Dieser Inhalt ist derzeit nur auf Englisch verfügbar
Audit aria-valid-attr-value
Ensure all ARIA attributes have valid values
Impact:
Critical
WCAG-Konformität:
A
WCAG 4.1.2
Issue types:
failure, needs review
ARIA state or property has valid value
This rule checks that each ARIA state or property has a valid value type.
Content loading...
Autoren: Anne Thyme Nørregaard, Wilco Fiers
Finanzierung: WAI-Tools
Applicability
This rule applies to any WAI-ARIA state or property that has a non-empty ("") attribute value, and that is specified on an HTML or SVG element.
Expectation
Each test target has an attribute value that is valid according to its WAI-ARIA value type.
Exception: For value types ID Reference and ID Reference List no ID referenced elements are required.
Background
Using invalid ARIA attribute values is often the result of a typo or other developer error. These attributes are then either ignored, or a default value is assumed by browsers and assistive technologies. This often means that a state or property which should exist is missing or has an unexpected value. If the default value for invalid attribute values happens to match the author's intention for the value, there will not be an accessibility issue.
This rule does not require the target of an ID Reference to exist. This is because referencing an element that does not exist, and not having the reference at all has the same end result. A common use case for using ID Reference for a non-existing ID is to use a static aria-errormessage on an input element, and to only insert the element with the error message if there is an actual error. There are some cases in which ID references are required. These are tested in a separate rule.
Assumptions
There are no assumptions.
Accessibility Support
Some user agents treat the value of aria-* attribute as case-sensitive (even when these are not ID) while some treat them as case-insensitive.
The aria-pressedattribute value of horizontal is not valid for a tristatevalue type.
<divrole="button"aria-pressed="horizontal">An other button</div>
Failed Example 4
The aria-rowindexattribute value of 2.5 is not valid for an integervalue type because it is a decimal number.
<divrole="gridcell"aria-rowindex="2.5">Fred</div>
Failed Example 5
The aria-valuemin, aria-valuemax and aria-valuenowattribute values are strings. These should all be of the numbervalue type instead.
<divrole="spinbutton"aria-valuemin="one"aria-valuemax="three"aria-valuenow="two"aria-label="Choose a value"></div>
Failed Example 6
The aria-liveattribute value of page is not a valid token, because page is not a token for aria-live.
<divrole="main"aria-live="page"></div>
Failed Example 7
The aria-relevantattribute value has the two tokens text and always. The always token is not valid for the aria-relevanttoken list. In order to be a valid value, all tokens must be valid.