aria-labelledby ignored when computing accessible name from content
Categories
(Core :: Disability Access APIs, defect, P3)
Tracking
()
People
(Reporter: wilcofiers, Unassigned)
References
(Blocks 1 open bug)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
Steps to reproduce:
- Open a page in Firefox with the following HTML:
<a href="#">
<img src="https://via.placeholder.com/100" aria-labelledby="outside" />
<svg role="img" aria-labelledby="circle" height="100">
<title id="circle">world</title>
<circle cx="50" cy="50" r="40" stroke="black" />
</svg>
</a>
<div id="outside">Hello</div>
- Open the accessibility inspector
Actual results:
The accessible name of the link should be "Hello world"
Expected results:
The link has an empty accessible name ("").
A similar issue seems to exist with buttons, which leads me to suspect Firefox does not correctly compute elements that are named from content (https://www.w3.org/TR/wai-aria/#namefromcontent). Specifically, step F.ii.b in the accessible name computation spec is where this is not going right: https://www.w3.org/TR/accname-1.1/#step2F.iii.b
Comment 1•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Comment 2•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Comment 3•4 years ago
|
||
I can confirm this. Since this seems to be new in Name Comp 1.1, or at least we've never been notified about such a case before AFAIK, setting this to a P3. Jamie, please adjust if you think this should be higher priority.
Comment 4•4 years ago
|
||
I think p3 is reasonable here. Certainly, I've not seen this in the wild. Note, however, that this works as expected in Chromium.
Simpler test case:
data:text/html,<button><span aria-labelledby="label"></button><div id="label">label
The button should get a name of "label", but it is instead empty.
Fixing this is going to be an interesting challenge, since aria-labelledby is currently handled in Accessible::ARIAName, not within nsTextEquivUtils. I also worry about the possibility of loops and I'm not sure how we're going to protect against that. Currently, we explicitly prevent recursion altogether to get around loops, but in this case, we need to recurse to get the right result.
Comment 5•4 years ago
|
||
This test case would result in infinite recursion if we didn't protect against that:
data:text/html,<button id="button"><span aria-labelledby="label"></span></button><div id="label">foo<span aria-labelledby="button"></span></div>
Description
•