Last updated:

Created by:

Success Criterion:

Description

This rule checks that WAI-ARIA states or properties are allowed for the element they are specified on.

Accessibility Requirements

This conformance rule relates to:

Test procedure

Applicability

Any WAI-ARIA state or property that is specified on an HTML or SVG element.

Expectation

The attribute is either an inherited, supported, or required state or property of the semantic role of the element on which the attribute is specified. If the element has no semantic role, the attribute must be a global state or property.

Note: Assessing the value of the attribute is out of scope for this rule.

Assumptions

There are currently no assumptions

Accessibility support

There are no major accessibility support issues known for this rule.

Background

Test Cases

Passed

Passed example 1

aria-pressed state is supported for role button.

Code Snippet:
 <div role="button" aria-pressed="false"></div>
 
Example Output: Open in a new tab/ window

Passed example 2

aria-pressed state is supported for role=button that is the implicit role for button element.

Code Snippet:
 <button aria-pressed="false"></button>
 
Example Output: Open in a new tab/ window

Passed example 3

Global state that is supported by all base markup elements.

Code Snippet:
 <div aria-hidden="true"></div>
 
Example Output: Open in a new tab/ window

Passed example 4

aria-label state is inherited for role button

Code Snippet:
 <div role="button" aria-label="OK"></div>
 
Example Output: Open in a new tab/ window

Passed example 5

aria-checked state is required for role aria-checkbox

Code Snippet:
 <div role="checkbox" aria-checked="false"></div>
 
Example Output: Open in a new tab/ window

Passed example 6

aria-controls property is supported for role combobox

Code Snippet:
 <div role="combobox" aria-controls="id1"></div>
 
Example Output: Open in a new tab/ window

Passed example 7

WAI-ARIA states and properties with empty value are also applicable to this rule

Code Snippet:
 <div role="combobox" aria-controls></div>
 
Example Output: Open in a new tab/ window

Passed example 8

WAI-ARIA states and properties with empty value, specified as an empty string, are also applicable to this rule

Code Snippet:
 <div role="combobox" aria-controls=""></div>
 
Example Output: Open in a new tab/ window

Failed

Failed example 1

aria-sort property is neither inherited, supported, nor required for role button.

Code Snippet:
 <div role="button" aria-sort=""></div>
 
Example Output: Open in a new tab/ window

Failed example 2

aria-sort attribute is neither inherited, supported, nor required for role=button that is the implicit role for button element.

Code Snippet:
 <button aria-sort=""></button>
 
Example Output: Open in a new tab/ window

Inapplicable

Inapplicable example 1

No WAI-ARIA state or property.

Code Snippet:
 <div role="region"></div>
 
Example Output: Open in a new tab/ window

Glossary

Semantic Role

A semantic role is a semantic association that indicates an object’s type. This allows tools to present and support interaction with the object in a manner that is consistent with user expectations about other objects of that type.

Roles can be implicit through the element type or explicit through the role attribute.

The role attribute takes a list of tokens. The semantic role is the first valid role in this list. If none of the tokens are valid, the implicit role will be used instead.

Non-abstract roles defined in the following specifications are considered valid:

Other roles may be added as they become available. Not all roles will be supported in all assistive technologies. Testers are encouraged to adjust which roles are allowed according to the accessibility support base line. For the purposes of executing test cases in all rules, it should be assumed that all roles are supported by assistive technologies so that none of the roles fail due to lack of accessibility support.

Note: For HTML elements the implicit roles are documented in ARIA in HTML.

Test Aspects

Test aspects are defined as part of the ACT Rules format 1.0.
  • DOM Tree

Contribute






GitHub

Contributing is open to anyone. We welcome any new issues or pull requests for changes. Auto WCAG Rules has conference calls every 4 weeks. If you are interested in becoming an active contributor or reviewer, we ask that you join the Auto WCAG Rules community group through the W3C Website. This requires setting up a W3C account, may require approval by the organization you work for if they are a W3C member.

Learn more about contributing to Auto WCAG Rules Join the Auto WCAG Rules community group now!