Closed Bug 1967379 Opened 1 year ago Closed 1 year ago

Windows Text Cursor Indicator gets lost in contentEditable

Categories

(Core :: Disability Access APIs, defect)

Desktop
Windows
defect

Tracking

()

VERIFIED FIXED
141 Branch
Tracking Status
firefox-esr128 --- unaffected
firefox138 --- unaffected
firefox139 --- disabled
firefox140 --- disabled
firefox141 --- verified

People

(Reporter: Jamie, Assigned: Jamie)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression, Whiteboard: [uiaShipBlocker])

Attachments

(1 external file)

Spun off bug 1951833 comment 8.

STR:

  1. Turn on Windows Text Cursor Indicator.
  2. Open this:
    data:text/html,<div contenteditable role="textbox"><div>a</div><div><br></div><div><br></div><div>b</div></div>
  3. Focus the contentEditable.
    • Observe: The Text Cursor Indicator appears inside the editable area.
  4. Use the arrow keys to move around.
    • Expected: The Text Cursor Indicator should follow.
    • Actual: The Text Cursor Indicator disappears. Only the usual insertion cursor is shown.

This probably happens because Gecko fires caret events on the deepest container of the caret. In this case, that's the paragraphs. In contrast, UIA wants caret events on the contentEditable root, since it accesses text via the Text pattern queried from that root. The solution is (hopefully?) to route caret events up to the editable root for UIA only.

Set release status flags based on info from the regressing bug 1957314

Bizarrely, from what I've been able to determine, UIAutomationCore seems to bounce TextSelectionChanged events up from a paragraph to a contentEditable all by itself... but only if the contentEditable doesn't have role="textbox". Huh? Shouldn't that be the opposite? Either way, we should fire the events on the right element in the first place.

Gecko fires text caret, selection and change events on the deepest possible text container.
For example, in a contentEditable element, this might be a paragraph.
In contrast, UIA clients access text via the Text pattern provider on the editable control or document.
Therefore, we need to fire UIA Text pattern events on the Text pattern provider .
In the above example, when Gecko fires a text event on a paragraph in the contentEditable, we now fire the UIA Text pattern event on the contentEditable, not the paragraph.

Pushed by jteh@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7dcce761bb4f Fire UIA Text pattern events on the appropriate Text pattern provider. r=morgan
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 141 Branch

Morgan, would you mind verifying that this is fixed in latest Nightly? I meant to ask you to do this before I landed it, but my brain had an outage. :)

Flags: needinfo?(mreschenberg)

(In reply to James Teh [:Jamie] from comment #8)

Morgan, would you mind verifying that this is fixed in latest Nightly? I meant to ask you to do this before I landed it, but my brain had an outage. :)

Yep ! Verified fix in 141 :)

Flags: needinfo?(mreschenberg)
Status: RESOLVED → VERIFIED
Blocks: 1950748
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: