Read Thunderbird message text and preserve link announcements
Thunderbird HTML messages expose readable text on containers around embedded objects. The browse cursor previously considered only text leaves, and native document capture omitted heading/link character counts. This skipped message content, headings and link text. A caret event following Tab could also replace a complete link announcement with its first character. Capture owned hypertext child identities and native placeholder offsets on the GLib thread, releasing native interfaces before returning. Require every child to occupy one embedded-object character so providers exposing duplicate text through static descendants retain their ordinary traversal. Traverse native text ranges before and after embedded children without changing their offset domains. Preserve character, word, line and document-boundary navigation; normalize native caret and Braille routing positions at adjacent embedded links. Keep the Braille cursor on the correct fragment when a parent contributes text more than once to an assembled line. Ignore same-input link caret echoes after focus while retaining subsequent arrow and selection feedback. Add regression tests, extend the private Firefox fixture, and record behavior and remaining acceptance in the parity ledger. Validation: - Full Go test suite with count=1; focused app/atspi/review race checks. - go vet ./...; reader and brlapi helper builds. - Private Firefox baseline, mixed-parent offsets and tab navigation. - Private Chromium fragments, named links, document navigation and selection. - Parity ledger validation and whitespace checks. The existing Firefox tab test intermittently timed out on both an untouched HEAD copy and the changed tree; the final run passed. The unchanged TestRunReachesSoundStopAfterEarlierServiceStopError also failed once during startup cancellation and passed in subsequent full-suite and race runs. Both installed binaries were verified and the reader reloaded in its original desktop session. The maintainer confirmed readable message text and later working links after an earlier intermittent omission. That omission remains untraced; repeat live acceptance and physical Braille verification remain open.
This commit is contained in:
1 parent
8ef838e16e
commit
edd6c560b8
19 files changed
+538
-73
No files matched your search
@@ -33,7 +33,7 @@ func brailleDocumentFrame(result review.Result, options config.BrailleOptions, c
|
||||
start := utf8.RuneCountInString(frame.Text)
|
||||
frame.Text += raw
|
||||
length := utf8.RuneCountInString(raw)
|
||||
if source.ID() == snapshot.ID() {
|
||||
if source.ID() == snapshot.ID() && result.DocumentPosition.Offset >= sourceStart && result.DocumentPosition.Offset <= sourceStart+length {
|
||||
frame.Cursor = start + result.DocumentPosition.Offset - sourceStart
|
||||
}
|
||||
if source.ID().Valid() && source.Role != "password text" && length > 0 {
|
||||
|
||||
@@ -395,3 +395,19 @@ func TestTableNavigationUpdatesBrailleWithoutNativeCaretEvent(t *testing.T) {
|
||||
}
|
||||
wantFrame(t, frames, brailleFocusFrame(cell))
|
||||
}
|
||||
|
||||
func TestBrowseBrailleRepeatedParentKeepsNativeCursor(t *testing.T) {
|
||||
parent := atspi.NewSnapshot("/body", "", "paragraph", "", "")
|
||||
parent.BusName = ":1.1"
|
||||
child := atspi.NewSnapshot("/span", "", "section", "", "")
|
||||
child.BusName = ":1.1"
|
||||
result := review.Result{DocumentPosition: review.DocumentPosition{Snapshot: parent, Offset: 0}, DocumentCaretLine: &atspi.DocumentLine{Contents: []atspi.DocumentContent{
|
||||
{Snapshot: parent, Start: 0, End: 7, RawText: "Before "},
|
||||
{Snapshot: child, Start: 0, End: 9, RawText: "Read more"},
|
||||
{Snapshot: parent, Start: 8, End: 15, RawText: " after."},
|
||||
}}}
|
||||
frame := brailleDocumentFrame(result, config.DefaultSettings().Braille)
|
||||
if frame.Cursor != 0 {
|
||||
t.Fatalf("text=%q cursor=%d; expected cursor=0", frame.Text, frame.Cursor)
|
||||
}
|
||||
}
|
||||
@@ -164,7 +164,7 @@ func TestSettingsTreeSelectionSpeaksOnceAndIgnoresUnfocusedEdits(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestControlFocusCaretDoesNotInterruptButArrowCaretSpeaks(t *testing.T) {
|
||||
for _, role := range []string{"spin button", "button"} {
|
||||
for _, role := range []string{"spin button", "button", "link"} {
|
||||
t.Run(role, func(t *testing.T) {
|
||||
queue := &fakeSpeechQueue{spoken: make(chan string, 8)}
|
||||
adapter := &fakeAdapter{events: make(chan atspi.Event, 8)}
|
||||
|
||||
@@ -29,11 +29,11 @@ func (handler *accessibilityEventHandler) handleCaret(event atspi.Event, activit
|
||||
}
|
||||
}
|
||||
if (event.Source.Autocomplete || activity.Sequence != 0 &&
|
||||
(event.Source.Role == "spin button" || event.Source.Role == "button")) &&
|
||||
(event.Source.Role == "spin button" || event.Source.Role == "button" || event.Source.Role == "link")) &&
|
||||
event.Source.ID() == state.focusCaretID && activity.Sequence == state.focusCaretSequence &&
|
||||
!activity.Selecting &&
|
||||
(intent == input.NoIntent || intent == input.OtherIntent) {
|
||||
// Address bars, spin buttons, and Gecko buttons move their
|
||||
// Address bars, spin buttons, and Gecko buttons/links move their
|
||||
// text caret on focus. With the same input sequence and no
|
||||
// caret-navigation intent, this must not interrupt the label.
|
||||
logger.Debug("skipped control caret caused by focus", "role", event.Source.Role)
|
||||
|
||||
Reference in new issue
Block a user