Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 3.79 KB

File metadata and controls

40 lines (29 loc) · 3.79 KB
title ARIA state or property is set
key aria-attribute-set
unambiguous true
objective true
input_aspects
Accessibility tree
CSS styling
DOM tree

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-label is explicitly set on <button aria-label="Next page">Next</button>; and aria-checked is 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-checked is implicitly set both on <input type="checkbox" checked /> (through the presence of the HTML attribute checked) and <input type="checkbox" /> (through its absence). It is not set on <input type="text" /> given that the mapping for checked doesn't apply when the input element is not of type checkbox or radio.

  • 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-haspopup is set by default on <div role="combobox"></div> through the role of combobox.

Background

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.