ARIA heading role: aria-level is required
Description
Changes the description of the ARIA heading role’s aria-level attribute to state that it is required, rather than stating that it defaults to 2.
Motivation
See the ARIA 1.3 specification for heading:
To ensure elements with a role of heading are organized into a logical outline, authors MUST use the aria-level attribute to indicate the proper nesting level.
Additional details
The MDN page on the aria-level role already states that the heading role is required.
I’m not sure where the “If no level is present, a value of 2 is the default” claim comes from.
Related issues and pull requests
None.
Preview URLs
External URLs (1)
URL: /en-US/docs/Web/Accessibility/ARIA/Reference/Roles/heading_role
Title: ARIA: heading role
- https://w3c.github.io/aria/ (1 time) (Note! This may be a new URL 👀)
(comment last updated: 2025-06-30 07:53:31)
I’m not sure where the “If no level is present, a value of 2 is the default” claim comes from.
defaulting to a level of 2 is how the role was previously spec'd, and it is what browsers are instructed to do to mitigate author error for not requiring a level.
see in section 9.2 States and Properties, the Fallback values for missing required attributes table. it's listed there that level 2 is the fallback value for an undefined aria-level on an element with a role of heading
Thanks for the explanation, @scottohara. I will update the pull request with an explanation that, if the required attribute is not specified, then a fallback value of 2 will be specified.