Relocated elements not pruned when container is hidden
Categories
(Core :: Disability Access APIs, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr60 | --- | unaffected |
firefox-esr68 | --- | unaffected |
firefox68 | --- | unaffected |
firefox69 | --- | unaffected |
firefox70 | --- | fixed |
People
(Reporter: Jamie, Assigned: Jamie)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file)
Discovered this while trying to get aria-owns working properly on the address bar (bug 1567377).
STR:
- Open this test case:
data:text/html,<div role="combobox" aria-owns="listbox"></div><div id="container"><div id="listbox" role="listbox"></div></div><button onClick="container.hidden = true; listbox.innerHTML = `<div role='option'>1</div>`;">Break things</button><button onClick="container.hidden = false;">Break more things</button>
- Observe that in the accessibility tree, there is an editcombobox containing a combobox list. The combobox list does not have the invisible state.
- Press the "Break things" button.
- In the accessibility tree, examine the children of the editcombobox.
- Expected: There should be no children.
- Actual: The combobox list is still there. It has the invisible state.
- Press the "Break more things" button.
- In the accessibility tree, examine the children of the editcombobox.
- Observe: As expected, the combobox list is there and it does not have the invisible state.
- In the accessibility tree, examine the children of the combobox list.
- Expected: There should be a combobox option child.
- Actual: There is a text leaf child.
This is not fixed by the patch for bug 1571616 (I applied and tested locally).
In PruneOrInsertSubtree, when we remove something (e.g. because its accessible no longer has a frame), we call ContentRemoved(acc) and return early. That removes the accessible and its descendant accessibles. However, relocated accessibles aren't descendant accessibles, even though they're descendant DOM nodes. I think we need to remove Accessibles for descendant DOM nodes here.
Can we just call ContentRemoved on the node instead of the Accessible? That will iterate through descendant DOM nodes.
Comment 1•5 years ago
|
||
Note that in html, node.hidden = whatever
doesn't do anything.
Assignee | ||
Comment 2•5 years ago
|
||
It seems to, and MDN agrees:
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/hidden
Comment 3•5 years ago
|
||
Oh, hmm, even after reading that I'm not sure what it does. In XUL (this includes the urlbar) hidden is just a shortcut for style.display="none".
Assignee | ||
Comment 4•5 years ago
|
||
Removing an Accessible removes descendants in the a11y tree.
However, there may be DOM descendants which have been relocated elsewhere in the a11y tree.
Their DOM nodes are now hidden as well, so we need to remove those Accessibles too.
In addition to Accessibles remaining in the tree when they shouldn't, failing to remove relocated Accessibles caused problems later on when a relocated Accessible was shown with new descendants.
Comment 6•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Updated•5 years ago
|
Updated•3 years ago
|
Description
•