SIA-R16Elements with a role have required states and properties

Accessibility requirements

This rule tests conformance of the following accessibility requirements:

Description

This rule checks that elements that have a role also specify all required states and properties for that role.

Applicability

This rule applies to every element in the HTML or SVG namespace that has a semantic role.

Expectations

  1. The element specifies all required states and properties of its semantic role.

Assumptions

This rule makes no assumptions.

Accessibility support

This rule has no known accessibility support concerns.

Examples

Passed

This element with a role of checkbox has the required property aria-checked and therefore passes the rule:

<div role="checkbox" aria-checked="false"></div>

Failed

This element with a role of combobox is missing the required aria-controls property and therefore fails the rule:

<div role="combobox" aria-expanded="true"></div>

Inapplicable

This element has no role and is therefore inapplicable:

<div></div>