Closed Bug 1867170 Opened 1 year ago Closed 1 year ago

Update AccessibilityUtils to better handle shadow DOM

Categories

(Core :: Disability Access APIs, defect, P3)

defect

Tracking

()

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: ayeddi, Assigned: Jamie)

References

Details

Attachments

(1 file)

Example in the trunk and the log: the synthesizeMouseAtCenter event on the <slot>

It also would likely to need to walk the flat tree in findInteractiveAccessible

First, if a click is synthesised at the centre of a custom element containing a slot, the click might target a text node which is a child of the slot.
In that case, the composedTarget for the click event will be the slot, since click events on text nodes are retargeted to the parent node.
The slot itself isn't rendered, so we were returning early due to the 0 bounds check, hiding potential failures.
To fix this, walk to the slot's flattened tree parent.

Second, if a click occurs on a node which doesn't have an Accessible, we try to walk to the nearest Accessible ancestor.
If the node is in shadow DOM, the nearest Accessible might be outside of the shadow DOM.
Previously, we would stop at the shadow root.
Now, we walk flattened tree parents, which will walk us out of the shadow root.

Assignee: nobody → jteh
Status: NEW → ASSIGNED
Summary: Update AccessibilityUtils to better match tagnames → Update AccessibilityUtils to better handle shadow DOM
Blocks: 1867378
Pushed by jteh@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ce5a379c35be a11y checks: Check the correct node in some cases involving shadow DOM. r=ayeddi
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
See Also: → 1866598
Blocks: 1872285
Blocks: 1876146
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: