Rule
Required ARIA parent
ARIA child roles must be inside their required container role.
- Rule
aria-required-parent- WCAG 2.2
- 1.3.1 Info and Relationships (opens in a new tab) (Level A)
- Severity
- Critical
What it checks
Some ARIA roles only make sense inside a particular container: a tab inside a tablist, an option inside a listbox, a listitem inside a list, a cell inside a row. The rule fails an element with one of these roles when no such container is above it, so assistive technology loses the structure.
Plain wrappers in between are fine: elements with no role, role="presentation" or role="none", and a group where the structure allows one. Any other role in between breaks the chain. A container that claims the element through aria-owns counts, and so does one across a shadow root boundary.
Example
Fails
<div class="tabs">
<button role="tab" aria-selected="true">Overview</button>
<button role="tab" aria-selected="false">Specifications</button>
</div>
Passes
<div class="tabs" role="tablist" aria-label="Product details">
<button role="tab" aria-selected="true">Overview</button>
<button role="tab" aria-selected="false">Specifications</button>
</div>
The engine is tested against both examples.
How to fix it
Put the role its container needs on the wrapping element, such as role="tablist" around tabs, or remove the role that interrupts the structure.
Check your own pages
This rule runs in every pour audit: the browser extension, the bookmarklet, the command line and the editor. Get pour, free.