| title | ARIA state or property is set | |||
|---|---|---|---|---|
| key | aria-attribute-set | |||
| unambiguous | true | |||
| objective | true | |||
| input_aspects |
|
An ARIA state or property is set on an HTML element when it has a value. This may happen in three ways:
-
It is explicitly set if there is a corresponding
aria-*HTML attribute on the element. If the value as written in the HTML code is not valid for this ARIA state or property and then the attribute is set but does not have an attribute value.For example,
aria-labelis explicitly set on<button aria-label="Next page">Next</button>; andaria-checkedis explicitly set on<input type="checkbox" aria-checked="yes" />, even though it does not have an attribute value. -
It is implicitly set if there is no corresponding
aria-*HTML attribute on the element, but the element or one of its HTML attribute has an ARIA attribute mapping setting this ARIA attribute.For example,
aria-checkedis implicitly set both on<input type="checkbox" checked />(through the presence of the HTML attributechecked) and<input type="checkbox" />(through its absence). It is not set on<input type="text" />given that the mapping forcheckeddoesn't apply when theinputelement is not of typecheckboxorradio. -
It is set by default if there is no corresponding
aria-*HTML attribute on the element, and either the element has an semantic role that has a default value for this ARIA state or property or the attribute itself has a default value.For example,
aria-haspopupis set by default on<div role="combobox"></div>through the role ofcombobox.
For explicitly set attributes, this definition only looks at the value written in the HTML code, without considering its validity. Attributes that are explicitly set with an invalid value are author errors that are detected by the rule Role attribute has valid value, and authors should not rely on invalid value to have forbidden attributes discarded from roles not allowing it.
For attributes set by default, this definition doesn't consider whether the attribute is allowed on the element (or role). Thus, aria-expanded (whose default value is false) is considered as set by default on <input /> even though it is not allowed on the textbox role. While authors can (and should) rely on attributes to be set by default, they also have no direct control on them and therefore whether they are allowed on an element never causes an author error.