Skip to content

Latest commit

 

History

History
executable file
·
248 lines (172 loc) · 11.1 KB

File metadata and controls

executable file
·
248 lines (172 loc) · 11.1 KB
id 5c01ea
name ARIA state or property is permitted
rule_type atomic
description This rule checks that WAI-ARIA states or properties are allowed for the element they are specified on.
accessibility_requirements
wcag-technique:ARIA5 aria12:state_property_processing wcag20:1.3.1 wcag20:4.1.2
forConformance failed passed inapplicable
false
not satisfied
further testing needed
further testing needed
title forConformance failed passed inapplicable
ARIA 1.2, 8.6 State and Property Attribute Processing
true
not satisfied
satisfied
satisfied
secondary
This success criterion is **less strict** than this rule. This is because the rule does not ignore irrelevant ARIA properties. Some of the failed examples satisfy this success criterion.
secondary
This success criterion is **less strict** than this rule. This is because the rule does not ignore irrelevant ARIA properties. Some of the failed examples satisfy this success criterion.
input_aspects
Accessibility Tree
CSS styling
DOM Tree
acknowledgments
authors funding assets
Anne Thyme Nørregaard
Jean-Yves Moyen
WAI-Tools
JFK's "We Choose the Moon" speech excerpt is courtesy of NASA.

Applicability

This rule applies to any WAI-ARIA state or property that is explicitly set on an HTML or SVG element that is included in the accessibility tree.

Expectation 1

For each test target, one of the following is true:

Expectation 2

No test target is prohibited on the semantic role of the element on which it is specified.

Assumptions

There are no assumptions.

Accessibility Support

Implementation of Presentational Roles Conflict Resolution varies from one browser or assistive technology to another. Depending on this, some elements can have a semantic role of none and their attributes fail this rule with some technologies but users of other technology would not experience any accessibility issue.

Background

The presence of prohibited ARIA attributes is often the result of a developer using an incorrect role, or a misunderstanding of the attribute. These attributes are ignored by browsers and other assistive technologies. This often means that a state or property which should exist is missing.

In HTML, there are language features that do not have corresponding implicit WAI-ARIA semantics. As per ARIA in HTML, those elements can have global states or properties. Some of those elements can also have inherited, supported, or required states or properties that correspond to a WAI-ARIA role. For example, the audio element has no corresponding ARIA semantics but it can have inherited, supported, or required states or properties of the application role.

This rule only applies to explicitly set attributes since these have been provided by authors and using the wrong one is therefore an author issue. If an implicitly set attribute is incorrect, this is not necessarily an author error, e.g., it can be the result of re-purposing an existing element.

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

Related rules

Bibliography

Test Cases

Passed

Passed Example 1

The aria-pressed state is supported with button, which is the implicit role for button elements.

<button aria-pressed="false">My button</button>

Passed Example 2

The aria-pressed state is supported with button, which is the explicit role of this div element.

<div role="button" aria-pressed="false">My button</div>

Passed Example 3

The aria-busy state is a global state that is supported by all elements, even without any semantic role.

<div aria-busy="true">My busy div</div>

Passed Example 4

The aria-label property is a global property. It is allowed on any semantic role.

<div role="button" aria-label="OK"></div>

Passed Example 5

The aria-checked state is required for the semantic checkbox.

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

Passed Example 6

The aria-controls property is required for the semantic combobox.

<div role="combobox" aria-controls="id1" aria-expanded="false">My combobox</div>

Passed Example 7

The aria-controls property is required for the semantic combobox. WAI-ARIA states and properties with empty value are still applicable to this rule.

<div role="combobox" aria-expanded="false" aria-controls>My combobox</div>

Passed Example 8

The aria-controls property is required for the semantic combobox. WAI-ARIA states and properties with empty value (specified as an empty string) are still applicable to this rule.

<div role="combobox" aria-expanded="false" aria-controls="">My combobox</div>

Passed Example 9

The aria-label property is global. It is allowed on any semantic role, including roles from the WAI-ARIA Graphics Module. This rule is applicable to SVG elements.

<svg xmlns="http://www.w3.org/2000/svg" role="graphics-object" width="100" height="100" aria-label="yellow circle">
	<circle cx="50" cy="50" r="40" fill="yellow"></circle>
</svg>

Passed Example 10

This button element has an explicit role of none. However, because it is focusable (by default), it has a semantic role of button due to Presentational Roles Conflict Resolution. The aria-pressed state is supported for the button role.

<button role="none" aria-pressed="false">ACT rules are cool!</button>

Passed Example 11

This input element does not have an explicit role of textbox, but the aria-required property may be used on an input element with a type attribute value of password.

<label>Password<input type="password" aria-required="true"/></label>

Failed

Failed Example 1

The aria-sort property may not be used on a semantic button.

<button aria-sort="">Sort by year</button>

Failed Example 2

The aria-orientation property may not be used on audio element, nor can it be used on application (the semantic role for which inherited, supported, or required states or properties are also applicable to audio element).

<audio src="/test-assets/moon-audio/moon-speech.mp3" controls aria-orientation="horizontal"></audio>

Failed Example 3

The aria-label property is prohibited for an element with a generic role.

<div aria-label="Bananas"></div>

Inapplicable

Inapplicable Example 1

This div element has no WAI-ARIA state or property.

<div role="region">A region of content</div>

Inapplicable Example 2

This div element is not included in the accessibility tree, hence its WAI-ARIA state or property is not checked.

<div role="button" aria-sort="" style="display:none;"></div>

Inapplicable Example 3

This button does not have any explicitly set ARIA attribute. It has an implicitly set aria-checked state, due to the absence of a checked attribute on the input element with a type attribute value of checkbox.

<input type="checkbox" role="button" />