Closed Bug 1487312 Opened 7 years ago Closed 7 years ago

No accessibility semantics for mutations inside shadow DOM

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: Jamie, Assigned: emilio)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

STR: 1. Open this test case: data:text/html,<div id="host"></div><script>shadow = host.attachShadow({mode: 'open'}); setTimeout(function () { shadow.innerHTML = `<button>Go</button>`; }, 1000);</script> 2. Wait 1 second. 3. Look for the button in the Accessibility Inspector. Expected: There should be a button with name "Go". Actual: There is no button, only a text leaf. It seems that the initial shadow tree gets populated correctly, but mutations do not.
Similar problems in the past have been fixes of this kind: GetParent() -> GetFlattenedTreeParent() IsInUnComposedDoc() -> IsInComposedDoc() etc. For this particular issue: https://searchfox.org/mozilla-central/rev/94e37e71ffbfd39e6ad73ebcda5d77cce8d341ae/accessible/generic/DocAccessible.cpp#1365 Looks wrong. aContainerNode is the ShadowRoot when we insert the <button>, you really want the host, which is aStartChildNode->GetFlattenedTreeParent(). Note that that code needs to deal with the flattened parent of the child nodes potentially being different (for example, for two different slots). Also, looks like we don't create accessible stuff for display: contents, so you probably want to jump over those or something. Should be easy to test with a <slot>.
I can take a look at this, as long as somebody helps writing the tests :)
Assignee: nobody → emilio
The issue was specific to content insertion directly under a shadow root, the rest should work (see bug 1427825 for the fix for other similar occurrences). The removal of the aContainer argument follows the same pattern as bug 1442207.
See Also: → 1487065
Alex, review ping? I've added a test and such, I don't know if this fell off the radar or what not.
Flags: needinfo?(surkov.alexander)
(In reply to Emilio Cobos Álvarez (:emilio) from comment #4) > Alex, review ping? I've added a test and such, I don't know if this fell off > the radar or what not. done, sorry for delay
Flags: needinfo?(surkov.alexander)
Blocks: 1500416
Pushed by emilio@crisal.io: https://hg.mozilla.org/integration/mozilla-inbound/rev/011cfa1666cb Fix content insertion accessibility notifications in Shadow DOM. r=Jamie,surkov
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: