This rule checks that each ARIA state or property has a valid value type.
Exception: For value types
ID Reference and
ID Reference List no ID referenced elements are required.
There are no assumptions.
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.
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.
- Understanding Success Criterion 4.1.2: Name, Role, Value
- ARIA5: Using WAI-ARIA state and property attributes to expose the state of a user interface component
- WAI-ARIA 1.2, Definitions of States and Properties
- WAI-ARIA 1.2, Characteristics of States and Properties, Value
- Uniform Resource Identifier (URI): Generic Syntax (RFC 3986)
Accessibility Requirements Mapping
- This rule is not required for conformance to WCAG 2.1 at any level.
This rule is related to the following accessibility requirements, but was not designed to test this requirements directly. These secondary requirements can either be stricter than the rule requires, or may be satisfied in ways not tested by the rule:
- 1.3.1 Info and Relationships (Level A): This success criterion is less strict than this rule. This is because the rule does not ignore irrelevant ARIA properties. Some of the failed examples satisfy this success criterion.
- 4.1.2 Name, Role, Value (Level A): This success criterion is less strict than this rule. This is because the rule does not ignore irrelevant ARIA properties. Some of the failed examples satisfy this success criterion.
The following aspects are required in using this rule.
Passed Example 1
<div role="textbox" aria-label="Family name"></div>
Passed Example 2
<div role="textbox" aria-required="true" aria-label="Family name"></div>
Passed Example 3
<div role="button" aria-expanded="undefined">A button</div>
Passed Example 4
<div role="button" aria-pressed="mixed">Partially pressed button</div>
Passed Example 5
<div role="textbox" aria-errormessage="my-error" aria-label="A textbox"></div>
Passed Example 6
<h1>Shopping list</h1> <div role="list" aria-owns="item1 item2"></div> <div id="item1">Apples</div> <div id="item2">Bananas</div>
Passed Example 7
<div role="gridcell" aria-rowindex="2">Fred</div>
Passed Example 8
<div role="spinbutton" aria-valuemin="1.0" aria-valuemax="2.0" aria-valuenow="1.5" aria-label="Select a value"></div>
Passed Example 9
<a href="/" aria-current="page">Home</a>
Passed Example 10
<div role="alert" aria-relevant="text removals"></div>
Failed Example 1
<div role="textbox" aria-required="undefined" aria-label="A required textbox"></div>
Failed Example 2
<div role="button" aria-expanded="collapsed">A button</div>
Failed Example 3
<div role="button" aria-pressed="horizontal">An other button</div>
Failed Example 4
<div role="gridcell" aria-rowindex="2.5">Fred</div>
Failed Example 5
<div role="spinbutton" aria-valuemin="one" aria-valuemax="three" aria-valuenow="two" aria-label="Choose a value"></div>
Failed Example 6
aria-live attribute value of
page is not a valid
page is not a token for
<div role="main" aria-live="page"></div>
Failed Example 7
aria-relevant attribute value has the two tokens
always token is not valid for the
token list. In order to be a valid value, all tokens must be valid.
<div role="alert" aria-relevant="text always"></div>
Inapplicable Example 1
Element does not have any ARIA states or properties
Inapplicable Example 2
Element has ARIA role, but no ARIA states or properties
<div role="button">Some Content</div>
Inapplicable Example 3
aria-live attribute does not have a value.
<div role="alert" aria-live>Remember to be awesome!</div>
Inapplicable Example 4
aria-hidden attribute is not on an HTML or SVG element.
The attribute value of a content attribute set on an HTML element is the value that the attribute gets after being parsed and computed according to specifications. It may differ from the value that is actually written in the HTML code due to trimming whitespace or non-digits characters, default values, or case-insensitivity.
Some notable case of attribute value, among others:
- For enumerated attributes, the attribute value is either the state of the attribute, or the keyword that maps to it; even for the default states. Thus
<input type="image" />has an attribute value of either
Image Button(the state) or
image(the keyword mapping to it), both formulations having the same meaning; similarly, “an input element with a
typeattribute value of
Text” can be either
<input type="text" />,
<input />(missing value default), or
<input type="invalid" />(invalid value default).
- For boolean attributes, the attribute value is
truewhen the attribute is present and
<button disabled="">all have a
disabledattribute value of
- For attributes whose value is used in a case-insensitive context, the attribute value is the lowercase version of the value written in the HTML code.
- For attributes that accept numbers, the attribute value is the result of parsing the value written in the HTML code according to the rules for parsing this kind of number.
- For attributes that accept sets of tokens, whether space separated or comma separated, the attribute value is the set of tokens obtained after parsing the set and, depending on the case, converting its items to lowercase (if the set is used in a case-insensitive context).
aria-*attributes, the attribute value is computed as indicated in the WAI-ARIA specification and the HTML Accessibility API Mappings.
This list is not exhaustive, and only serves as an illustration for some of the most common cases.
Namespaced elements are not limited to elements described in a specification. They also include custom elements. Elements such as
title have a different namespace depending on where they are used. For example a
title in an HTML page usually has the HTML namespace. When used in an
svg element, a
title element has the SVG namespace instead.
- Inapplicable: No part of the test subject matches the applicability
- Passed: A test target meets all expectations
- Failed: A test target does not meet all expectations
Note: A rule has one
failed outcome for every test target. When there are no test targets the rule has one
inapplicable outcome. This means that each test subject will have one or more outcomes.
Note: Implementations using the EARL10-Schema can express the outcome with the outcome property. In addition to
inapplicable, EARL 1.0 also defined an
incomplete outcome. While this cannot be the outcome of an ACT Rule when applied in its entirety, it often happens that rules are only partially evaluated. For example, when applicability was automated, but the expectations have to be evaluated manually. Such “interim” results can be expressed with the
This is the first version of this ACT rule.
This section is not part of the official rule. It is populated dynamically and not accounted for in the change history or the last modified date.