aria-activedescendant fails with simultaneous insertion and relocation
Categories
(Core :: Disability Access APIs, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: Jamie, Assigned: Jamie)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file)
Spun off bug 1567377 comment 14.
STR:
- Open this test case:
data:text/html,<div tabindex="0" role="combobox" aria-owns="listbox" onkeydown="listbox.hidden = false; this.setAttribute('aria-activedescendant', 'option');"></div><div id="listbox" hidden role="listbox"><div id="option" role="option">option</div></div>
- Tab to the combo box and press down arrow.
- Expected: You should get a focus event for the option. (A screen reader should report "option")
- Actual: You don't. (A screen reader reports nothing.)
I think what's happening is this:
- The listbox is hidden and thus not in the a11y tree. If you press down arrow at this point, it will simultaneously create the listbox and focus the first item.
- We see the aria-activedescendant change and schedule DocAccessible::ARIAActiveDescendantChanged.
- WillRefresh is called.
- We process insertions. Because aria-owns is present, we don't create the subtree for the listbox. DocAccessible::RelocateARIAOwnedIfNeeded schedules a relocation and returns false when called here: https://searchfox.org/mozilla-central/rev/29cce9a2684ef64c4f1f996087da8b7545d31f65/accessible/base/TreeWalker.cpp#340
- We process generic notifications, including ARIAActiveDescendantChanged. The subtree for the listbox still doesn't exist, so we fail to get an accessible for the active descendant.
- Finally, we process relocations. The subtree for the list gets created.. too late!
Moving invalidations/relocations before generic notifications fixes this, but I don't understand this well and I'm concerned it might break other things. All a11y mochitests and browser-chrome tests pass with this change; see try run.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
Previously, if a hidden, aria-owned subtree was shown and aria-activedescendant was simultaneously targeted inside it, aria-activedescendant would fail.
This occurred because when we processed insertions, the presence of aria-owns meant we didn't create the subtree.
This meant that when we processed aria-activedescendant (which occurred before relocations), the active descendant didn't exist yet.
To fix this, we now process generic notifications (including aria-activedescendant) after relocations.
Pushed by jteh@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d3b29691bdc6 Process generic notifications after relocations to fix aria-activedescendant with simultaneous insertion and relocation. r=eeejay
Comment 3•5 years ago
|
||
bugherder |
Description
•