diff --git a/_rules/aria-state-or-property-not-prohibited-yyw7k3.md b/_rules/aria-state-or-property-not-prohibited-yyw7k3.md new file mode 100644 index 0000000000..e0c3f87356 --- /dev/null +++ b/_rules/aria-state-or-property-not-prohibited-yyw7k3.md @@ -0,0 +1,161 @@ +--- +id: yyw7k3 +name: ARIA state or property is not prohibited +rule_type: atomic +description: | + This rule checks that WAI-ARIA states or properties are not prohibited for the element they are specified on. +accessibility_requirements: + wcag-technique:ARIA5: # Using WAI-ARIA state and property attributes to expose the state of a user interface component + forConformance: false + failed: not satisfied + passed: further testing needed + inapplicable: further testing needed + aria12:state_property_processing: + title: ARIA 1.2, 8.6 State and Property Attribute Processing + forConformance: true + failed: not satisfied + passed: satisfied + inapplicable: satisfied + wcag20:1.3.1: # Info and Relationships (A) + secondary: true + wcag20:4.1.2: # Name, Role, Value (A) + secondary: true +input_aspects: + - Accessibility Tree + - CSS styling + - DOM Tree +acknowledgments: + authors: + - Trevor Bostic + previous_authors: + - Anne Thyme Nørregaard + - Jean-Yves Moyen + funding: + - WAI-Tools + assets: + - 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 specified on an [HTML or SVG element][namespaced element] that is [included in the accessibility tree][]. + +## Expectation + +No test target is [prohibited](https://www.w3.org/TR/wai-aria-1.2/#prohibitedattributes) 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. This can cause issues under success criterion [1.3.1 Info and Relationships][sc131] or [4.1.2 Name, Rule Value][sc412]. + +Assessing the value of the attribute is out of scope for this rule. + +### Related rules + +- [Element marked as decorative is not exposed](https://www.w3.org/WAI/standards-guidelines/act/rules/46ca7f/) +- [ARIA state or property has valid value](https://www.w3.org/WAI/standards-guidelines/act/rules/6a7281/proposed/) +- [ARIA state or property is permitted](https://www.w3.org/WAI/standards-guidelines/act/rules/5c01ea/proposed/) + +### Bibliography + +- [Understanding Success Criterion 4.1.1: Parsing](https://www.w3.org/WAI/WCAG21/Understanding/parsing.html) +- [Understanding Success Criterion 4.1.2: Name, Role, Value](https://www.w3.org/WAI/WCAG21/Understanding/name-role-value.html) +- [WAI-ARIA 1.2, Supported States and Properties](https://www.w3.org/TR/wai-aria-1.2/#states_and_properties) +- [WAI-ARIA 1.2, Global States and Properties](https://www.w3.org/TR/wai-aria-1.2/#global_states) +- [ARIA5: Using WAI-ARIA state and property attributes to expose the state of a user interface component](https://www.w3.org/WAI/WCAG21/Techniques/aria/ARIA5) +- [Document conformance requirements for use of ARIA attributes in HTML](https://www.w3.org/TR/html-aria/#docconformance) + +## Test Cases + +### Passed + +#### Passed Example 1 + +The `aria-pressed` [state][] is [supported][] for the `button` role, which is the [implicit role][] for `button` elements. + +```html + +``` + +#### Passed Example 2 + +The `aria-pressed` [state][] is [supported][] for the `button` role, which is the [explicit role][] of this `div` element. + +```html +
My button
+``` + +#### Passed Example 3 + +The `aria-labelledby` [property][] is [supported][] for the `textbox` role, which is the [implicit role][] for and `input` element with `type="text"`. + +```html + + +``` + +### Failed + +#### Failed Example 1 + +The `aria-label` property is [prohibited](https://www.w3.org/TR/wai-aria-1.2/#prohibitedattributes) for an element with a generic role. + +```html +
+``` + +#### Failed Example 2 + +The `aria-labelledby` property is [prohibited](https://www.w3.org/TR/wai-aria-1.2/#prohibitedattributes) for an element with an emphasis role. + +```html + +

Bananas are a great fruit

+``` + +#### Failed Example 3 + +The `aria-roledescription` property is [prohibited](https://www.w3.org/TR/wai-aria-1.2/#prohibitedattributes) for an element with a generic role. + +```html +

Banana

+``` + +### Inapplicable + +#### Inapplicable Example 1 + +This `div` element has no [WAI-ARIA state or property][]. + +```html +
A region of content
+``` + +#### Inapplicable Example 2 + +This `div` element is not [included in the accessibility tree][], hence its [WAI-ARIA state or property][] is not checked. + +```html +
+``` + +[explicit role]: #explicit-role 'Definition of Explicit Role' +[implicit role]: #implicit-role 'Definition of Implicit Role' +[included in the accessibility tree]: #included-in-the-accessibility-tree 'Definition of Included in the Accessibility Tree' +[presentational roles conflict resolution]: https://www.w3.org/TR/wai-aria-1.2/#conflict_resolution_presentation_none 'Presentational Roles Conflict Resolution' +[property]: https://www.w3.org/TR/wai-aria-1.2/#dfn-property 'Definition of Property' +[semantic role]: #semantic-role 'Definition of Semantic Role' +[state]: https://www.w3.org/TR/wai-aria-1.2/#dfn-state 'Definition of ARIA State' +[supported]: https://www.w3.org/TR/wai-aria-1.2/#supportedState 'Definition of Supported ARIA States and Properties' +[wai-aria state or property]: https://www.w3.org/TR/wai-aria-1.2/#state_prop_def 'Definition of ARIA States and Properties' +[namespaced element]: #namespaced-element +[sc131]: https://www.w3.org/TR/WCAG21/#info-and-relationships +[sc412]: https://www.w3.org/TR/WCAG21/#name-role-value diff --git a/_rules/aria-state-or-property-permitted-5c01ea.md b/_rules/aria-state-or-property-permitted-5c01ea.md index 7236fe6e05..2234dabe32 100755 --- a/_rules/aria-state-or-property-permitted-5c01ea.md +++ b/_rules/aria-state-or-property-permitted-5c01ea.md @@ -28,6 +28,7 @@ acknowledgments: authors: - Anne Thyme Nørregaard - Jean-Yves Moyen + - Trevor Bostic funding: - WAI-Tools assets: @@ -38,7 +39,7 @@ acknowledgments: This rule applies to any [WAI-ARIA state or property][] that is specified on an [HTML or SVG element][namespaced element] that is [included in the accessibility tree][]. -## Expectation 1 +## Expectation For each test target, one of the following is true: @@ -46,10 +47,6 @@ For each test target, one of the following is true: - **semantic role**: the test target is an [inherited][], [supported][], or [required][] [state][] or [property][] of the [semantic role][] of the element on which the test target is specified; or - **language feature**: the test target is specified on an [HTML element][namespaced element] and is allowed on that element. Which ARIA states or properties may be used on which element is described in [ARIA in HTML](https://w3c.github.io/html-aria/). -## Expectation 2 - -No test target is [prohibited][] on the [semantic role][] of the element on which it is specified. - ## Assumptions There are no assumptions. @@ -60,8 +57,6 @@ Implementation of [Presentational Roles Conflict Resolution][] varies from one b ## 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. This can cause issues under [success criterion 1.3.1 Info and Relationships][sc131] or [4.1.2 Name, Rule Value][sc412]. - In HTML, there are language features that do not have corresponding implicit WAI-ARIA semantics. As per [ARIA in HTML](https://www.w3.org/TR/html-aria/), those elements can have [global states or properties][global]. Some of those elements can also have [inherited][], [supported][], or [required][] [states][state] or [properties][property] that correspond to a [WAI-ARIA role](https://www.w3.org/TR/wai-aria-1.2/#introroles). For example, the `audio` element has no corresponding ARIA semantics but it can have [inherited][], [supported][], or [required][] [states][state] or [properties][property] of the [`application` role](https://www.w3.org/TR/wai-aria-1.2/#application). Assessing the value of the attribute is out of scope for this rule. @@ -191,14 +186,6 @@ The `aria-orientation` property may not be used on `audio` element, nor can it b ``` -#### Failed Example 3 - -The `aria-label` property is [prohibited][] for an element with a `generic` role. - -```html -
-``` - ### Inapplicable #### Inapplicable Example 1 @@ -232,6 +219,3 @@ This `div` element is not [included in the accessibility tree][], hence its [WAI [supported]: https://www.w3.org/TR/wai-aria-1.2/#supportedState 'Definition of Supported ARIA States and Properties' [wai-aria state or property]: https://www.w3.org/TR/wai-aria-1.2/#state_prop_def 'Definition of ARIA States and Properties' [namespaced element]: #namespaced-element -[prohibited]: https://www.w3.org/TR/wai-aria-1.2/#prohibitedattributes 'WAI-ARIA 1.2 Definition of Prohibited States and Properties' -[sc131]: https://www.w3.org/TR/WCAG21/#info-and-relationships -[sc412]: https://www.w3.org/TR/WCAG21/#name-role-value diff --git a/package.json b/package.json index 663baf4c39..06566f309b 100644 --- a/package.json +++ b/package.json @@ -121,6 +121,10 @@ "url": "https://github.com/skotkjerra" }, { + "name": "Trevor Bostic", + "url": "https://github.com/tbostic32" + }, + { "name": "Tom Brunet", "url": "https://github.com/tombrunet" },