aria-required-attr
Roles with a required ARIA state/property must carry it
Checks that elements with an explicit role carry every unambiguous, context-independent required aria-* state/property for that role (e.g. role="checkbox" must have aria-checked).
Applies to. Applies to elements with an explicit, valid, non-abstract role that is also one of the small set of roles with a documented, context- independent required state/property (checkbox, combobox, heading, menuitemcheckbox, menuitemradio, meter, radio, scrollbar, separator, slider, switch) -- except when that explicit role is identical to the element's own native/implicit role (ACT 4e8ab6: e.g. <input type="checkbox" role="checkbox">, which is exempt because the native control's own state exposure already covers it; no aria-checked is required. helpers.aria.getNativeRoleForElement resolves this). A native <input type="checkbox"> or <input type="radio"> with another checkable role (switch, menuitemcheckbox, menuitemradio, or checkbox on a radio and the reverse) is in scope, but its aria-checked counts as supplied: the browser exposes the input's own checked state (HTML-AAM), so it passes without the attribute.
Expectation. Every required state/property for that role is present and non-empty. Graded by whether ARIA supplies a stand-in for the missing attribute:
- FAIL where it does not, so the state is simply not exposed (aria-checked on checkbox/radio/switch/menuitemcheckbox/menuitemradio, aria-valuenow on slider/scrollbar/meter and on a focusable separator).
- CANTTELL where ARIA defines an implicit value the role falls back to (aria-expanded on combobox, aria-level on heading), so the role still exposes a value and only the author knows whether it is the right one.
What a finding reports.
attr: the required attribute that is missing or empty.role: the element's role.implicitValue(the CANTTELL case): the value ARIA falls back to,falsefor aria-expanded on a combobox,2for aria-level on a heading.
These data.details fields help to read and reproduce a finding. Apart from reasonCode and the few fields Output schema names as stable, they are not a stable contract: a field may be renamed or dropped in a minor release, so don’t build on them.
Examples
<div role="checkbox" aria-checked="true"></div>
role="checkbox" requires aria-checked, and it's present.
<div role="checkbox"></div>
role="checkbox" requires aria-checked; it's missing entirely.
How to check
When this rule can’t decide, it reports cantTell and leaves the question to a person. Each question it can ask is listed here under its reason code, with the steps to answer it. A finding carries the same steps as howToCheck, in the scan’s language. See Output schema.
ARIA_ATTR_REQUIRED_MISSING_IMPLICIT
- Inspect the element the report names and note its role and the missing attribute (such as aria-expanded on a combobox, aria-level on a heading).
- For a combobox, open and close its popup with the keyboard (Alt+Down Arrow, Escape) and the mouse, and check whether aria-expanded is added and updated.
- For a heading, compare its place in the page outline with level 2, the default it gets, and check whether a different level is meant.
- With a screen reader, move to the element and listen for the state or level announced.
Pass. The default value matches reality: the combobox reports collapsed only when its popup is closed, or the heading really is level 2.
Fail. The announced value is wrong, such as a combobox announced collapsed while its list is open or a level 2 heading that should be another level, which fails WCAG 4.1.2 (or 1.3.1 for headings).
state_internals
- Inspect the custom element the report names and note its role and the missing state (such as checked or value).
- Open the Accessibility pane in the browser's developer tools and check whether that state shows for the element.
- Operate the element (click it, press Space or the arrow keys) and check whether the state shown in the pane changes.
- With a screen reader, move to the element and listen for the state.
Pass. The state is exposed and updates as the element is used, set through its internals.
Fail. The required state is missing from the accessibility tree or does not change when the element is used, which fails WCAG 4.1.2.