Last updated:

Created by:

Success Criterion:

Description

Elements that have an explicit role must also specify all required states and properties

Accessibility Requirements

This conformance rule relates to:

Test procedure

Applicability

Any HTML or SVG element that has an explicit semantic role, except if the element has an implicit semantic role that is identical to the explicit semantic role.

Expectation

For each test target, the WAI-ARIA required states and properties for the role are present, unless the state or property has a default value listed under WAI-ARIA implicit value for role.

Note: This rule does not test whether the required states and properties have correct values, only that the attributes are present and non-empty.

Assumptions

Accessibility Support

This rule relies on browsers and assistive technologies to support leaving out WAI-ARIA required states and properties when a WAI-ARIA implicit value for role is specified in WAI-ARIA 1.1.

Note: The required states and properties with implicit values can be found in the Core Accessibility API Mappings 1.1 Overview of default values for missing required attributes.

Background

Test Cases

Passed

Passed example 1

Element has required states (no properties required for this role)

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

Passed example 2

Implicit value for roles: ´option´ role has an implicit value (´false´) specified for the required state ´aria-selected´

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

Passed example 3

Implicit value for roles: ´option´ role has an implicit value (´false´) specified for the required state ´aria-selected´, here defined without value

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

Passed example 4

Implicit value for roles: ´option´ role has an implicit value (´false´) specified for the required state ´aria-selected´, here defined with only whitespace instead of a value

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

Passed example 5

Element has required properties, and required state aria-expanded has an implicit value

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

Passed example 6

Element has required properties, but with incorrect value since no element with with the given id(s) exists in the document

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

Failed

Failed example 1

Element does not list required states and properties (´aria-controls´ is required property for ´combobox´)

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

Failed example 2

Required states and properties does not have non-empty value

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

Inapplicable

Inapplicable example 1

Element does not have a semantic role

Code Snippet:
 <div>Some Content</div>
 
Example Output: Open in a new tab/ window

Inapplicable example 2

Element does not have an explicit semantic role

Code Snippet:
 <nav></nav>
 
Example Output: Open in a new tab/ window

Inapplicable example 3

Element has an implicit semantic role that is identical to the explicit semantic role

Code Snippet:
 <input type="checkbox" role="checkbox">
 
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.

Non-empty text string

A string of characters (text) is considered “non-empty” if it contains 1 or more characters that are contained within any of the following unicode categories:

  • Ll: Letter, Lowercase
  • Lu: Letter, Uppercase
  • Lt: Letter, Titlecase
  • Lo: Letter, Other
  • Lm: Letter, Modifier
  • Nd: Number, Decimal Digit

For more details on unicode categories, check out www.fileformat.info/info/unicode/category/

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!