Dieser Inhalt ist derzeit nur auf Englisch verfügbar
Audit aria-required-attr
Ensure elements with ARIA roles have all required ARIA attributes
Impact:
Critical
WCAG-Konformität:
A
WCAG 4.1.2
Issue type:
failure
Element with role attribute has required states and properties
This rule checks that elements that have an explicit role also specify all required states and properties.
Content loading...
Autoren: Anne Thyme Nørregaard, Tom Brunet
Finanzierung: WAI-Tools
Applicability
This rule applies to any HTML or SVG element that is included in the accessibility tree and has an explicit semantic role, except if the element has an implicit semantic role that is identical to the explicit semantic role.
Omitting WAI-ARIA required states and properties is often the result of a developer error. When required properties are missing and a default value is not specified by WAI-ARIA Specifications, the behavior is not defined. For WAI-ARIA 1.2, the only explicit semantic roles with a required property with a default value are the option and tabs roles for the aria-selected property.
This rule is testing author built components that specify explicit semantic roles and not components that keep their implicit semantic role. For components that keep their implicit semantic role, all native HTML and SVG elements have native attributes that are mapped to all of the WAI-ARIA required states and properties. Most of these mappings are defined in the HTML Accessibility API Mappings, Attribute State and Property Mappings.
This heading does not have the required aria-level property. Prior to WAI-ARIA 1.2 the heading role had an implicit default aria-level value of 2. As of WAI-ARIA 1.2 this property must be explicitly set.
<divrole="heading">
My First Heading
</div>
Failed Example 2
This switch does not have the required aria-checked property. Prior to WAI-ARIA 1.2 the switch role had an implicit default aria-checked value of false. As of WAI-ARIA 1.2 this property must be explicitly set.
<divrole="switch">
Toggle me
</div>
Failed Example 3
This checkbox does not have the required property aria-checked. Prior to WAI-ARIA 1.2 the checkbox had an implicit default aria-checked value of false. As of WAI-ARIA 1.2 this property must be explicitly set.
This separator does not have the required aria-valuenow property. This is required because the separator is focusable, which makes it a widget.
<p>My first HTML</p><divrole="separator"tabindex="0"></div><p>My last HTML</p>
Failed Example 5
This combobox does not have the required aria-expanded property. Prior to WAI-ARIA 1.2 the combobox had an implicit default aria-expanded value of false. As of WAI-ARIA 1.2 this property must be explicitly set.