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

+7 -5
View File
@@ -115,10 +115,7 @@ func (worker *Worker) readAll(ctx context.Context, cursor *DocumentCursor) Resul
movement.Position.Snapshot.Misspelled = movement.Misspelled
line := atspi.DocumentLine{Document: movement.Position.Document, Contents: []atspi.DocumentContent{{Snapshot: movement.Position.Snapshot, Text: movement.Text, RawText: movement.RawText}}}
if movement.Line != nil {
// Presentation deliberately flattens a visual line into one spoken
// string. Keep every contributing source for independent privacy
// checks, including sources outside the caret object's ancestry.
line.SourceContexts = movement.Line.SourceContexts
line = *movement.Line
}
owner, err := cursor.tree.DocumentContext(movement.Position.Object)
if err != nil {
@@ -136,7 +133,12 @@ func (worker *Worker) readAll(ctx context.Context, cursor *DocumentCursor) Resul
} else {
line.Context = owner.Ancestors
roles := map[string]bool{movement.Position.Snapshot.Role: true}
for _, ancestor := range owner.Ancestors {
ancestors := owner.Ancestors
if movement.Line != nil {
// Assembled lines carry each fragment's semantic ancestry.
ancestors = nil
}
for _, ancestor := range ancestors {
if (ancestor.Role == "link" || ancestor.Role == "heading") && !roles[ancestor.Role] {
roles[ancestor.Role] = true
ancestor.Name = ""