SVG image element with aria-label should not get role "nothing"
Categories
(Core :: Disability Access APIs, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox113 | --- | fixed |
People
(Reporter: peter, Assigned: longsonr)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/111.0
Steps to reproduce:
Add a non-empty aria-label to an image element within an svg element, e.g.,
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>svg image aria-label</title>
</head>
<body>
<h1>Image test</h1>
<svg>
<image width=100px height=100px aria-label="hello"></image>
</svg>
</body>
</html>
Actual results:
The accessibility inspector gives a role of "nothing" for the image element.
This prevents some assistive technologies (e.g., NVDA) from properly rendering the element (although others seem fine).
Expected results:
The role should be "img" (or alternatively "image") when a non-empty aria-label is present, see also https://w3c.github.io/svg-aam/#include_elements.
For comparison, Chromium sets a role "img", WebKit a role of "image".
| Assignee | ||
Comment 1•2 years ago
|
||
give the image a title or desc child
Comment 2•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Disability Access APIs' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 3•2 years ago
|
||
Note that the spec says the element should be included in the tree. Firefox is doing that and is thus complying with the spec. As far as I have found, the spec does not specify what role it should have.
Comment 4•2 years ago
|
||
I apologise. I see this now in the spec:
"img role mapping if the element meets the criteria for Including Elements in the Accessibility Tree; otherwise, no accessible object created "
Comment 5•2 years ago
|
||
We already have code to use the img role for image elements. Unfortunately, that code doesn't trigger because this example uses aria-label instead of <title>, which means we fall down to this code, which doesn't specify the role.
The simplest fix is probably to make MustSVGElementBeAccessible call MustBeAccessible at the bottom.
| Assignee | ||
Comment 6•2 years ago
|
||
Updated•2 years ago
|
| Assignee | ||
Comment 7•2 years ago
|
||
Comment 9•2 years ago
|
||
| bugherder | ||
Description
•