Closed Bug 1825718 Opened 2 years ago Closed 2 years ago

SVG image element with aria-label should not get role "nothing"

Categories

(Core :: Disability Access APIs, defect)

Firefox 111
defect

Tracking

()

RESOLVED FIXED
113 Branch
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".

give the image a title or desc child

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.

Component: Untriaged → Disability Access APIs
Product: Firefox → Core

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.

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 "

Blocks: svga11y
Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true

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: nobody → longsonr
Status: NEW → ASSIGNED
Pushed by longsonr@gmail.com: https://hg.mozilla.org/integration/autoland/rev/6f6936c59a94 map SVG elements to a role if they have an aria-label attribute r=Jamie
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: