Closed Bug 1946552 Opened 6 months ago Closed 5 months ago

Windows Narrator draws bounds one character too far into next unit

Categories

(Core :: Disability Access APIs, defect)

Unspecified
Windows
defect

Tracking

()

RESOLVED FIXED
138 Branch
Tracking Status
firefox137 --- disabled
firefox138 --- fixed

People

(Reporter: nlapre, Assigned: Jamie)

References

(Blocks 3 open bugs)

Details

(Whiteboard: [uiaShipBlocker])

Attachments

(1 file)

STR:

  1. Turn on UIA support in about:config; set accessibility.uia.enable to true.
  2. Launch Windows Narrator
  3. Open test page data:text/html,abc def ghi
  4. Navigate by character or word and observe the bounds that Narrator draws on-screen

Expected: The bounds will tightly bound the spoken range, as it does in Edge.
Actual: The bounds tightly bound the spoken range on the left hand side (assuming LTR text), but extend one character/word/etc. past on the right hand side.

The utterances are not incorrect, they just don't match the bounded text. I suspect that the "too far to the right" behavior occurs due to some particularity in our implementation of UIA TextUnits combined with how we render bounds to UIA, since it's one character or one word too far (corresponding to TextUnits), based on the way you navigate with Narrator.

In certain conditions, WalkLineRects uses the incorrect endpoint for
calculating rects for a given TextLeafRange. This revision fixes the problem by
properly walking the endpoint back by one character, if possible.

Pushed by nlapre@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0a39b47ae3c2 Fix WalkLineRects endpoint calculation, r=Jamie

Seems I've largely broken getting the bounds of non-LTR text here. Looking into a fix.

Flags: needinfo?(nlapre)

The specific test that this change breaks is this one. There are others also broken, but I think they're fixed by the patch for Bug 1947331. :Jamie intends to pick up this work once I'm gone.

Whiteboard: [uiaShipBlocker]
Assignee: nlapre → jteh
Duplicate of this bug: 1947331

I'm merging bug 1947331 into this, as the changes in these two bugs are somewhat intertwined and I need to make significant changes to how these bounds functions behave. STR from that bug:

  1. Turn on UIA support in about:config; set accessibility.uia.enable to true.
  2. Launch Windows Narrator
  3. Open site data:text/html,This is the first sentence<br/>This is the second sentence, which is longer than the first
  4. Navigate by word (Narrator + l) through the first sentence until you hit the last word, "sentence."
  5. Observe the bounds wrapping the word.

Expected: The drawn bounds wrap the word "sentence" exactly, as they do in Edge.
Actual: The drawn bounds don't bound the word "sentence." They seem to extend from the top of the first line to the bottom of the second line vertically, but don't properly bound the word "sentence" horizontally on either side of the word.

Attachment #9464515 - Attachment description: Bug 1946552: Fix WalkLineRects endpoint calculation, r?jamie → Bug 1946552: Fix problems and inconsistencies in the calculation of text bounds for a range.
Pushed by jteh@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f99db37efb0a Fix problems and inconsistencies in the calculation of text bounds for a range. r=morgan
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 138 Branch

The patch landed in nightly and beta is affected.
:Jamie, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox137 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(jteh)
Flags: needinfo?(jteh)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: