dequelabs / dequelabs/axe-core
"Certain ARIA roles must contain particular children" reported for correct accessibility tree elements
- Dominant language
- JavaScript
- Stars
- 7.5k
- Forks
- 933
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 17
Description
### Product
axe-core
### Product Version
4.7.1
### Latest Version
- [X] I have tested the issue with the latest version of the product
### Issue Description
#### Expectation
Do not report "aria-required-children" violation for correctly built accessibility trees when relationship between certain elements is achieved through aria attributes (the accessibility tree differs from the DOM tree).
#### Actual
Reports "aria-required-children" error for elements that are "owned" by a table row element from a different table.
#### How to Reproduce
Please consider the following simplified example (run in separate window and run the developer tools AXE extension in Chrome):
https://stackblitz.com/edit/js-wbinbi?file=index.js,index.html
It triggers the same report:
But the accessibility tree is correct:
#### Additional context
We have a PivotGrid component, consisting of three separate tables (column headers, row headers, data), and an empty "cell" in the top-left corner between the row and column header tables:
Our problem is that AXE reports the following problem:
[Ensures elements with an ARIA role that require child roles contain them](https://dequeuniversity.com/rules/axe/4.7/aria-required-children?application=AxeChrome) because the Empty cell needs a "columnheader" role, but is a direct child (in the DOM) of the role="grid" element, and all data cells have role "gridcell", but are also considered direct children of the role="grid" wrapper (even though all mentioned cells are referred through aria-owns by the respective rows that they need to be part of.
The accessibility tree we build seems correct, and assistive technologies announce the relations as expected, but the AXE error is still reported.
Can you please check whether the AXE tool evaluates connections between elements, built with aria attributes like role="none/presentation", aria-owns, etc., correctly?
Contributor guide
Assessment
This issue has not been assessed yet.