Ensure child roles are contained within required parent roles

ARIA roles and attributes help screen readers provide missing information about an element. For these roles and attributes to make sense, each ARIA role supports a specific subset of aria-* attributes (see ARIA roles definitions). Some ARIA child roles must be contained by specific parent roles to properly perform their intended accessibility functions. Lighthouse reports missing parenrts for these child roles:

Lighthouse audit showing ARIA role missing required parent role
ARIA role missing required parent role.

Key Term: ARIA attributes let you modify the way HTML elements are represented to assitive technologies like screen readers. Learn more in this Introduction to ARIA.

How Lighthouse finds missing parent roles

Lighthouse uses the WAI ARIA specification - Definition of roles to check for required parent roles. Any role that contains "required context role", is considered a child role to the parent(s).

Lighthouse fails this audit, when it finds a child role that's missing its parent. In the example Lighthouse audit above, the listitem role requires a parent group or list. Since there's no parent role defined, the audit fails. This makes sense, as it would be confusing to have a listitem without grouping into a list.

How this audit impacts overall Lighthouse score

Lighthouse flags this as a low severity issue. It is important to fix, and probably indicates a mistaken assumption in your code. In the example above, the element would be announced as plain text content and its listitem role would be discarded.

How to check for required parent roles

To check for required parent roles refer to the WAI ARIA Definition of roles. ARIA explicitly defines required parent roles. Link to the child role from the specification, and check the "required context role". Make sure to include a parent role for that child role.

For more information on this audit, see Certain ARIA roles must be contained by particular parent elements.

More information

Last updated: Improve article