Dieser Inhalt ist derzeit nur auf Englisch verfügbar
Audit aria-deprecated-role
Ensure elements do not use deprecated roles
Impact:
Minor
WCAG-Konformität:
A
WCAG 4.1.2
Issue type:
failure
Role attribute has valid value
This rule checks that each `role` attribute has a valid value.
Content loading...
Autoren: Jey Nandakumar
Finanzierung: WAI-Tools
Applicability
This rule applies to any role attribute for which all the following are true:
the attribute has a value that is neither empty ("") nor only ASCII whitespace; and
the attribute is specified on an HTML or SVG element which is not programmatically hidden.
Expectation
Each test target has at least one token which is a valid value corresponding to a non-abstract role from WAI-ARIA Specifications.
Background
Using an invalid role is often the result of a typo or other developer error. Unknown roles are ignored by browsers and assistive technologies, and the element's implicit role is used. This often means that a role that should exist is missing.
The role attribute is a set of space separated tokens. Having a whitespace separated list of more than one token in the value of the role attribute is used for what is known as fallback roles. If the first token is not accessibility supported (or valid), the next one will be used for determining the semantic role of the element, and so forth. The rule applies to attributes containing at least one non-ASCII whitespace character so that there is at least one token in the set.
Not every role can be used on every element. Which ARIA roles may be used on which HTML elements is defined in ARIA in HTML. Testing this is not part of this rule.