Group inline links and list items into browse lines

This commit is contained in:
ak47 committed 2026-11-07 20:31:50 -05:00
1 parent 3dbd7f2554
commit d01965c00d
16 files changed
+309 -15

No files matched your search

+9 -3
View File
@@ -116,17 +116,23 @@ func move_caret_line(ctx context.Context, source DocumentCaretReader, tree *atsp
}
// Retain semantic boundaries even if unrelated blocks have matching y values.
// Inline spans/emphasis do not introduce boundaries. Links remain independent
// stops with their existing activation, voice, state and sound presentation.
// Links and same-row list items inherit their surrounding block. Headings,
// paragraphs and table cells remain separate; grid items retain their boundaries.
func visual_line_owners(nodes []atspi.DocumentNode) map[int]atspi.ObjectID {
owners := make(map[int]atspi.ObjectID, len(nodes))
byID := make(map[atspi.ObjectID]atspi.ObjectID, len(nodes))
displays := make(map[atspi.ObjectID]string, len(nodes))
for index, node := range nodes {
owner := byID[node.Parent]
snapshot := node.Snapshot
displays[node.Reference.ID()] = snapshot.Display
switch snapshot.Role {
case "paragraph", "heading", "list item", "table cell", "row header", "column header", "link", "document web", "document frame", "embedded":
case "paragraph", "heading", "list", "table cell", "row header", "column header", "document web", "document frame", "embedded":
owner = node.Reference.ID()
case "list item":
if strings.Contains(displays[node.Parent], "grid") {
owner = node.Reference.ID()
}
case "section":
if snapshot.HTMLTag != "span" {
owner = node.Reference.ID()