aria-allowed-attr

aria-* attributes must be permitted for the element’s role

automaticWCAG 4.1.2 (A)confidence: mediumseverity: moderaterobust

Checks that every recognized aria-* attribute present on an element with an explicit role is either globally supported or supported by that role.

Applies to. Applies to elements carrying at least one recognized, non-global aria-* attribute, judged against the role they actually have: an explicit valid role, else the implicit role of their tag, else, for the elements HTML-AAM maps to no role at all, nothing.

Expectation. Every recognized aria-* attribute present is either: (a) globally supported on any element (the "global" ARIA states/properties, e.g. aria-label/aria-hidden/aria-describedby), or (b) explicitly listed as a required or supported state/property for the element's role. An attribute ARIA deprecated (rather than prohibited) on the role is still allowed: it is reported as CANTTELL (see helpers.aria.isDeprecatedAttr) so the author decides, not as a not-allowed FAIL.

Examples

pass
<div role="checkbox" aria-checked="true"></div>

`aria-checked` is one of the states role="checkbox" supports.

fail
<div role="checkbox" aria-valuenow="1"></div>

`aria-valuenow` belongs to range widgets, not role="checkbox".

View source