aria-deprecated-role

role attribute should not use a deprecated or author-discouraged ARIA role

automaticWCAG 4.1.2 (A)confidence: highseverity: moderaterobust

Checks that an explicit role="" attribute does not use a role deprecated by the WAI-ARIA specification, or one reserved for user-agent-internal use (e.g. role="generic").

Applies to. Applies to any element whose role attribute's first (used) token is a valid, non-abstract ARIA role that authors should not explicitly declare, either because WAI-ARIA has deprecated it (e.g. "directory", superseded by role="list") or because it is reserved for user-agent- internal use (role="generic", which ARIA 1.2 §5.4 says authors SHOULD NOT use in content).

Expectation. The role in use is neither deprecated nor reserved. Graded by the strength of the rule ARIA states:

  • CANTTELL at SHOULD NOT, which leaves the usage conforming, so the author decides whether it matters: a deprecated role ("directory") or one reserved for user agents ("generic").
  • FAIL at MUST NOT. No ARIA 1.2 or 1.3 role carries an author MUST NOT outside the abstract roles, so this outcome is reserved for a later revision promoting a role to that strength.

Distinct, atomic decision from aria-roles-valid (existence/ abstractness): a role can be valid and non-abstract while still being discouraged in explicit author use.

Examples

pass
<ul role="list"><li>Item</li></ul>

`role="list"` is current, non-deprecated ARIA.

can't tell
<div role="directory"><a href="/a">Item</a></div>

`role="directory"` is deprecated in WAI-ARIA in favor of `role="list"`; still valid markup, but discouraged.

View source