dequelabs / dequelabs/axe-core
False Positive: <li> inside <menu role="toolbar"> triggers "List item parent element has a role that is not role='list'"
Open
fix
info needed
- Dominant language
- JavaScript
- Stars
- 7.5k
- Forks
- 933
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 29
Description
### Product
axe Extension
### Product Version
4.126.2
### Latest Version
- [x] I have tested the issue with the latest version of the product
### Issue Description
#### Expectation
The `` elements is an HTML element defined as a semantic alternative to `
- ` for interactive items. According to the [W3C HTML Living Standard](https://html.spec.whatwg.org/multipage/grouping-content.html#the-menu-element) and [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/menu#specifications), a `` element validly accepts `
- ` elements as direct children.
I expected axe-core to recognize the `` element as a valid parent for `
- ` tags, even when the `` is assigned a functional ARIA role like `role="toolbar"`, without triggering structural integrity errors.
#### Actual
Axe-core flags a Serious impact error: ` - ` elements must be contained in a `
- ` or `
-
B
-
I
-
U
- `.
The tool specifically fails the audit because the parent element (``) has a role other than `role="list"`. This results in multiple false positives (22 errors in my specific case) for markup that is semantically and syntactically correct according to HTML specifications.#### How to Reproduce
Run an axe-core audit on the following HTML structure:```html
```
#### Additional context
This issue forces developers to either use non-semantic `` tags or ignore serious accessibility flags, which is counter-intuitive for accessibility-first development. -
Contributor guide
Assessment
This issue has not been assessed yet.