Fire name/description change event when text in hidden aria-labelled/describedby subtree changes
Categories
(Core :: Disability Access APIs, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox103 | --- | fixed |
People
(Reporter: Jamie, Assigned: Jamie)
References
(Blocks 3 open bugs)
Details
(Whiteboard: [ctw-m2])
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
After bug 493683, changes in aria-labelled/describedby subtrees fire name/description change events on the element being labelled/described. However, this only works if the change occurs in a visible subtree of the aria-labelled/describedby target. If the target is hidden, events aren't fired.
STR (with the NVDA screen reader, though you should get similar results with any other screen reader):
- Open this test case:
data:text/html,<button aria-labelledby="label" onclick="label.textContent = 'After change';"></button><div id="label" style="display: none;">Press to change</div>
- Tab to the button.
- Press space to activate it.
- Expected: NVDA should say "After change"
- Actual: NVDA says nothing.
Impact: This means that the updated label isn't announced by screen readers when selecting a message in a Gmail message list.
I guess we're going to have to watch for DOM changes to handle this, since this isn't handled by layout (since it's invisible) and thus layout doesn't fire a11y notifications.
Assignee | ||
Comment 1•3 years ago
|
||
Without this, the cached name isn't updated when the selection state of an item in a Gmail message list changes.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
We already handled this for visible aria-labelledby/describedby subtrees based on a11y events.
However, when a subtree is hidden (whether via CSS or aria-hidden), it is completely removed from the a11y tree, so we can't use a11y events.
Instead, when a node is added to the DOM, we walk its ancestors looking for an aria-labelledby/describedby target.
We stop if the node or an ancestor has an Accessible, since that means it will be handled elsewhere.
This also limits the number of ancestors we walk for each inserted node, thus decreasing the performance impact of this change.
This doesn't catch all possible mutations in a hidden subtree (e.g. removals or direct text node changes), but this at least fixes a case in Gmail.
Given performance risks, I think it makes sense to address specific cases as they arise.
Comment 4•2 years ago
|
||
bugherder |
Description
•