dequelabs / dequelabs/axe-core

aria-label on svg image element

Open
#3,969 7 comments 0 reactions 0 assignees View on GitHub
rule metadata rules
Dominant language
JavaScript
Stars
7.5k
Forks
933
Avg merge
2d 23h
Merged PRs (30d)
17

Description

### Product

axe Extension

### Product Version

axe DevTools for Firefox, 4.49.0

### Latest Version

- [X] I have tested the issue with the latest version of the product

### Issue Description

#### Expectation

An aria-label attribute on an svg image element should not trigger an error.

#### Actual

axe dev tools reports a error (of level "serious") with the message: "aria-label attribute cannot be used on a image with no valid role attribute."

#### How to Reproduce

```html


axe svg image aria-label

Image test

```

#### Additional context

From a quick test, chromium and webkit appear to follow the svg-aam and expose svg image elements correctly with role `img` and `image` respectively when an aria-label is present.

While Firefox seems to expose the image element with a strange role of "nothing", the label seems to be exposed -- orca, jaws and narrator voice it even if NVDA fails. (For completeness, Narrator fails to voice the label on Chrome.)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.