dequelabs / dequelabs/axe-core

Elements must only use allowed ARIA attributes for SVG g element with aria-label

Open
#3,389 4 comments 1 reaction 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
7.5k
Forks
933
Avg merge
2d 23h
Merged PRs (30d)
17

Description

Product: axe Extension

Sorry for the divergence from the template. It's actually more a question than a bug report.

I have an SVG with a group that renders text as paths and [animation library](https://github.com/airbnb/lottie-web) producing this SVG adds `aria-label` with this text to the group.
```

```
Axe (and lighthouse) gives an error "Elements must only use allowed ARIA attributes". I've read a spec and your latest issue about prohibiting `aria-label` for some roles. The question is does `g` element has a `generic` or a `group` role. I've searched spec for information about `g` element, found [this one](https://www.w3.org/TR/2018/WD-svg-aam-1.0-20180510/) (it's old but the latest one). It says that `g` maps to a group role if I read it right and `group` role is allowed to have `aria-label`
![Screenshot from 2022-02-08 18-04-38](https://user-images.githubusercontent.com/15820496/153014585-6600d5c6-92e2-469f-8b58-cc5dc1830dde.png)

I think that in this case `title` should be used instead of `aria-label` and will ask the maintainers about that.
Though I'm still interested in the reason (partially as the argument to animation library not to use `aria-label`), whether it's something I don't see in specs or just some empiric rule that no screen readers will handle this the right way.



axe-core version: v4.3.5
extension version: v4.22.1

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.