Skip to content

Commit

Permalink
Update to rules format 1.1 (#2220)
Browse files Browse the repository at this point in the history
* Update to rules format 1.1

* Update mention to rules format from 1.0 to 1.1 in rule design

* Update pages/design/rule-design.md

---------

Co-authored-by: Carlos Duarte <[email protected]>
  • Loading branch information
WilcoFiers and carlosapaduarte authored Nov 21, 2024
1 parent f9eace3 commit 5ba46d9
Show file tree
Hide file tree
Showing 100 changed files with 812 additions and 628 deletions.
6 changes: 3 additions & 3 deletions _rules/__tests__/headings.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describeRule('headings', ruleData => {
/**
* Check for `required` `h2` headings
*/
const requiredH2 = [`Applicability`, `Assumptions`, `Accessibility Support`, `Background`, `Test Cases`]
const requiredH2 = [`Applicability`, `Background`, `Test Cases`]
const h2Headings = getHeadingOfDepth(headings, 2)
test.each(requiredH2)('has required `h2` - `%s`', heading => {
expect(h2Headings).toContain(heading)
Expand All @@ -67,9 +67,9 @@ describeRule('headings', ruleData => {
/**
* Check for `required` `h3` headings
*/
const requiredH3 = [`Passed`, `Failed`, `Inapplicable`]
const requiredH3 = [`Assumptions`, `Accessibility Support`, `Passed`, `Failed`, `Inapplicable`]
const h3Headings = getHeadingOfDepth(headings, 3)
test.each(requiredH3)('has required `h2` - `%s`', heading => {
test.each(requiredH3)('has required `h3` - `%s`', heading => {
expect(h3Headings).toContain(heading)
})

Expand Down
13 changes: 7 additions & 6 deletions _rules/aria-attr-defined-5f99a7.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
id: 5f99a7
name: ARIA attribute is defined in WAI-ARIA
rules_format: 1.1
rule_type: atomic
description: |
This rule checks that each `aria-` attribute specified is defined in ARIA 1.2.
Expand All @@ -26,17 +27,17 @@ This rule applies to any attribute that starts with `aria-`.

Each target attribute is defined in [WAI-ARIA Specifications][].

## Assumptions
## Background

There are no assumptions.
The presence of unknown ARIA attributes is often the result of a typo or other developer error. These attributes are ignored by browsers and other assistive technologies. This often means that a state or property which should exist is missing.

## Accessibility Support
### Assumptions

There are no accessibility support issues known.
There are no assumptions.

## Background
### Accessibility Support

The presence of unknown ARIA attributes is often the result of a typo or other developer error. These attributes are ignored by browsers and other assistive technologies. This often means that a state or property which should exist is missing.
There are no accessibility support issues known.

### Bibliography

Expand Down
17 changes: 9 additions & 8 deletions _rules/aria-hidden-no-focusable-content-6cfa84.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
id: 6cfa84
name: Element with aria-hidden has no content in sequential focus navigation
rules_format: 1.1
rule_type: atomic
description: |
This rule checks that elements with an `aria-hidden` attribute do not contain elements that are part of the sequential focus navigation and focusable.
Expand Down Expand Up @@ -34,14 +35,6 @@ This rule applies to any element with an `aria-hidden` [attribute value][] of `t

None of the target elements has an [inclusive descendant][] in the [flat tree][] that are [focusable][] and part of the [sequential focus navigation][].

## Assumptions

Interacting with the page does not result in changing the `aria-hidden` [attribute value][] of target elements. An example of such a situation would be when closing a modal dialog makes previously hidden elements that were not [focusable][] or part of the [sequential focus navigation][] become [focusable][] and part of the [sequential focus navigation][].

## Accessibility Support

Some user agents treat the value of `aria-hidden` attribute as case-sensitive.

## Background

Using `aria-hidden="false"` on a descendant of an element with `aria-hidden="true"` [**does not** expose that element](https://www.w3.org/TR/wai-aria-1.2/#aria-hidden). `aria-hidden="true"` hides itself and all its content from assistive technologies.
Expand All @@ -52,6 +45,14 @@ An element with an `aria-hidden` attribute set to `true` that is also part of th

The 1 second time span introduced in the exception of the definition of [focusable][] is an arbitrary limit which is not included in WCAG. Given that scripts can manage the focus state of elements, testing the focused state of an element consistently would be impractical without a time limit.

### Assumptions

Interacting with the page does not result in changing the `aria-hidden` [attribute value][] of target elements. An example of such a situation would be when closing a modal dialog makes previously hidden elements that were not [focusable][] or part of the [sequential focus navigation][] become [focusable][] and part of the [sequential focus navigation][].

### Accessibility Support

Some user agents treat the value of `aria-hidden` attribute as case-sensitive.

### Related rules

- [Element with presentational children has no focusable content](https://www.w3.org/WAI/standards-guidelines/act/rules/307n5z/)
Expand Down
21 changes: 11 additions & 10 deletions _rules/aria-required-context-role-ff89c9.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
id: ff89c9
name: ARIA required context role
rules_format: 1.1
rule_type: atomic
description: |
This rule checks that an element with an explicit semantic role exists inside its required context.
Expand Down Expand Up @@ -33,16 +34,6 @@ This rule applies to any [HTML or SVG element][] that is [included in the access

Each test target is the child in the [accessibility tree][] of an element that has a [semantic role][] that is one of the [required context roles][] of the target element.

## Assumptions

The rule assumes that the [explicit role][] of the applicable elements is appropriate for their element. I.e. A heading incorrectly marked up with `role="cell"` does not fail [success criterion 1.3.1 Info and Relationships][sc131] for not being in the context of a `row`. Having an inappropriate role is itself an issue under 1.3.1 Info and Relationships, so in either scenario a failure of this rule means this success criterion is not satisfied.

## Accessibility Support

- User agents do not all have the same accessibility tree. This can lead to different results for this rule, depending on which accessibility tree is used as input.
- `aria-owns` has limited support in some user agents.
- There exist some combination of popular browsers and assistive technologies who do not announce correctly relationships based on a mix of [implicit][implicit role] and [explicit][explicit role] roles.

## Background

The applicability of this rule is limited to the [WAI-ARIA 1.2 Recommendation][aria 1.2] roles. The [WAI-ARIA Graphics Module][] does not include any [required context roles][]. The [Digital Publishing WAI-ARIA Module (DPUB ARIA) 1.0][dpub 1.0] only has two roles with [required context roles][] (`doc-biblioentry` and `doc-endnote`); both of them have issues with their use of role inheritance, and both of them are deprecated in the [Digital Publishing WAI-ARIA Module (DPUB ARIA) 1.1][dpub 1.1] editor's draft.
Expand All @@ -57,6 +48,16 @@ This rule is restricted to direct parent-child relation in the [accessibility tr

Some user agents try to correct missing [required context roles][] or incorrect [content model][]. This often results, for example, in an isolated list item being presented as part of a one-item list containing only itself. Therefore, most test cases contain several targets to try and circumvent these corrections in order to better demonstrate the issue.

### Assumptions

The rule assumes that the [explicit role][] of the applicable elements is appropriate for their element. I.e. A heading incorrectly marked up with `role="cell"` does not fail [success criterion 1.3.1 Info and Relationships][sc131] for not being in the context of a `row`. Having an inappropriate role is itself an issue under 1.3.1 Info and Relationships, so in either scenario a failure of this rule means this success criterion is not satisfied.

### Accessibility Support

- User agents do not all have the same accessibility tree. This can lead to different results for this rule, depending on which accessibility tree is used as input.
- `aria-owns` has limited support in some user agents.
- There exist some combination of popular browsers and assistive technologies who do not announce correctly relationships based on a mix of [implicit][implicit role] and [explicit][explicit role] roles.

### Bibliography

- [Understanding Success Criterion 1.3.1: Info and Relationships](https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships.html)
Expand Down
13 changes: 7 additions & 6 deletions _rules/aria-required-id-references-in6db8.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
id: in6db8
name: ARIA required ID references exist
rules_format: 1.1
rule_type: atomic
description: |
This rule checks that every ID reference required by WAI-ARIA exists
Expand Down Expand Up @@ -34,17 +35,17 @@ This rule applies to any `aria-controls` attribute defined on an [HTML element][

Each test target's [attribute value][] is a space-separated list of one or more IDs. At least one of those IDs must match an `id` [attribute value][] in the same [shadow tree][] or, if not within a [shadow tree][], within the same [document][document tree].

## Assumptions
## Background

There are no assumptions.
This rule is written specifically for `aria-controls`, because it is the only [ID Reference List][] property that is [required by WAI-ARIA][]. The `aria-controls` property is only required by the `scrollbar` role and by an expanded `combobox`. There are no [ID Reference][] properties that are required by WAI-ARIA for any role.

## Accessibility Support
### Assumptions

Some user agents treat the value of `aria-*` attribute as case-sensitive (even when these are not IDs) while some treat them as case-insensitive.
There are no assumptions.

## Background
### Accessibility Support

This rule is written specifically for `aria-controls`, because it is the only [ID Reference List][] property that is [required by WAI-ARIA][]. The `aria-controls` property is only required by the `scrollbar` role and by an expanded `combobox`. There are no [ID Reference][] properties that are required by WAI-ARIA for any role.
Some user agents treat the value of `aria-*` attribute as case-sensitive (even when these are not IDs) while some treat them as case-insensitive.

### Bibliography

Expand Down
21 changes: 11 additions & 10 deletions _rules/aria-required-owned-element-bc4a75.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
id: bc4a75
name: ARIA required owned elements
rules_format: 1.1
rule_type: atomic
description: |
This rule checks that an element with an explicit semantic role has at least one of its required owned elements.
Expand Down Expand Up @@ -34,25 +35,25 @@ Each test target only [owns][] elements with a [semantic role][] from the [requi

**Note:** The definition of [owned by][] used in this rule is different than the definition of ["owned element" in WAI-ARIA](https://www.w3.org/TR/wai-aria-1.2/#dfn-owned-element). See more in the [owned by][] definition.

## Assumptions
## Background

Some [required owned elements][] are only valid if they themselves [own][owns] (or "contain") elements with a given [semantic role][]. This is denoted by an arrow (meaning "containing") in the role description. For example, the role `menu` has `group → menuitemradio` as one of its [required owned elements][], meaning that elements with a role of `menu` may only [own][owns] elements with a role of `group` who themselves only [own][owns] elements with a role of `menuitemradio`.

The applicability of this rule is limited to the [WAI-ARIA 1.2 Recommendation][wai-aria 1.2] roles. The [WAI-ARIA Graphics Module][] and [Digital Publishing WAI-ARIA Module (DPUB ARIA) 1.1 (Editors draft)][dpub 1.1] do not include any [required owned elements][].

**Note:** [Subclass roles](https://www.w3.org/TR/wai-aria-1.2/#subclassroles) of [required owned elements][] are not automatically included as possible [required owned elements][]. For example, the `treeitem` role is not a [required owned elements][] for [`list`](https://www.w3.org/TR/wai-aria-1.2/#list), even though `treeitem` is a [subclass role](https://www.w3.org/TR/wai-aria-1.2/#subclassroles) of `listitem`.

### Assumptions

If the [explicit semantic role][] on the target element is incorrectly used, and any relationships between elements are already programmatically determinable, failing this rule may not result in accessibility issues for users of assistive technologies, and it should then not be considered a failure under [WCAG success criterion 1.3.1 Info and Relationships](https://www.w3.org/TR/WCAG22/#info-and-relationships).

## Accessibility Support
### Accessibility Support

- User agents do not all have the same accessibility tree. Particularly the method of deriving which element owns which other elements varies between browsers. This can lead to different results for this rule, depending on which accessibility tree is used as input.
- `aria-owns` has limited support in some user agents.
- Assistive technologies are not consistent in how they handle situations where a [required owned element][] has a missing or incorrect role. This can lead to situations where inaccurate owned elements behave as expected in one assistive technology, but not in another.
- Some user agents treat the value of `aria-busy` as case-sensitive.

## Background

Some [required owned elements][] are only valid if they themselves [own][owns] (or "contain") elements with a given [semantic role][]. This is denoted by an arrow (meaning "containing") in the role description. For example, the role `menu` has `group → menuitemradio` as one of its [required owned elements][], meaning that elements with a role of `menu` may only [own][owns] elements with a role of `group` who themselves only [own][owns] elements with a role of `menuitemradio`.

The applicability of this rule is limited to the [WAI-ARIA 1.2 Recommendation][wai-aria 1.2] roles. The [WAI-ARIA Graphics Module][] and [Digital Publishing WAI-ARIA Module (DPUB ARIA) 1.1 (Editors draft)][dpub 1.1] do not include any [required owned elements][].

**Note:** [Subclass roles](https://www.w3.org/TR/wai-aria-1.2/#subclassroles) of [required owned elements][] are not automatically included as possible [required owned elements][]. For example, the `treeitem` role is not a [required owned elements][] for [`list`](https://www.w3.org/TR/wai-aria-1.2/#list), even though `treeitem` is a [subclass role](https://www.w3.org/TR/wai-aria-1.2/#subclassroles) of `listitem`.

### Bibliography

- [Understanding Success Criterion 1.3.1: Info and Relationships](https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships.html)
Expand Down
17 changes: 9 additions & 8 deletions _rules/aria-state-or-property-permitted-5c01ea.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
id: 5c01ea
name: ARIA state or property is permitted
rules_format: 1.1
rule_type: atomic
description: |
This rule checks that WAI-ARIA states or properties are allowed for the element they are specified on.
Expand Down Expand Up @@ -50,14 +51,6 @@ For each test target, one of the following is true:

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.
Expand All @@ -66,6 +59,14 @@ In HTML, there are language features that do not have corresponding implicit WAI

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

### 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.

### Related rules

- [ARIA state or property has valid value](https://www.w3.org/WAI/standards-guidelines/act/rules/6a7281/)
Expand Down
15 changes: 8 additions & 7 deletions _rules/aria-state-or-property-valid-value-6a7281.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
id: 6a7281
name: ARIA state or property has valid value
rules_format: 1.1
rule_type: atomic
description: |
This rule checks that each ARIA state or property has a valid value type.
Expand Down Expand Up @@ -36,19 +37,19 @@ Each test target has an [attribute value][] that is valid according to its [WAI-

**Exception**: For value types `ID Reference` and `ID Reference List` no ID referenced elements are required.

## Assumptions
## Background

There are no assumptions.
Using invalid ARIA attribute values is often the result of a typo or other developer error. These attributes are then either ignored, or a default value is assumed by browsers and assistive technologies. This often means that a state or property which should exist is missing or has an unexpected value. If the default value for invalid attribute values happens to match the author's intention for the value, there will not be an accessibility issue.

## Accessibility Support
This rule does not require the target of an `ID Reference` to exist. This is because referencing an element that does not exist, and not having the reference at all has the same end result. A common use case for using `ID Reference` for a non-existing ID is to use a static `aria-errormessage` on an `input` element, and to only insert the element with the error message if there is an actual error. There are some cases in which ID references are required. These are tested in a separate rule.

Some user agents treat the value of `aria-*` attribute as case-sensitive (even when these are not ID) while some treat them as case-insensitive.
### Assumptions

## Background
There are no assumptions.

Using invalid ARIA attribute values is often the result of a typo or other developer error. These attributes are then either ignored, or a default value is assumed by browsers and assistive technologies. This often means that a state or property which should exist is missing or has an unexpected value. If the default value for invalid attribute values happens to match the author's intention for the value, there will not be an accessibility issue.
### Accessibility Support

This rule does not require the target of an `ID Reference` to exist. This is because referencing an element that does not exist, and not having the reference at all has the same end result. A common use case for using `ID Reference` for a non-existing ID is to use a static `aria-errormessage` on an `input` element, and to only insert the element with the error message if there is an actual error. There are some cases in which ID references are required. These are tested in a separate rule.
Some user agents treat the value of `aria-*` attribute as case-sensitive (even when these are not ID) while some treat them as case-insensitive.

### Related rules

Expand Down
9 changes: 5 additions & 4 deletions _rules/attr-not-duplicated-e6952f.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
id: e6952f
name: Attribute is not duplicated
rules_format: 1.1
rule_type: atomic
description: |
This rule checks that HTML and SVG starting tags do not contain duplicated attributes.
Expand Down Expand Up @@ -43,16 +44,16 @@ This rule applies to any [starting tag](https://www.w3.org/TR/html5/syntax.html#

For each test target, there are no duplicated [attributes](https://www.w3.org/TR/html5/syntax.html#elements-attributes).

## Assumptions
## Background

### Assumptions

There are no assumptions.

## Accessibility Support
### Accessibility Support

There are no accessibility support issues known.

## Background

### Bibliography

- [H94: Ensuring that elements do not contain duplicate attributes](https://www.w3.org/WAI/WCAG22/Techniques/html/H94)
Expand Down
9 changes: 5 additions & 4 deletions _rules/audio-as-media-alternative-afb423.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
id: afb423
name: Audio element content is media alternative for text
rules_format: 1.1
rule_type: atomic
description: |
This rule checks that the `audio` element is a media alternative for text on the page.
Expand Down Expand Up @@ -35,16 +36,16 @@ The auditory information of each test target is available as text (directly or v

Each target element is labeled as an audio alternative for text on the page by content that is [visible][] and [included in the accessibility tree][].

## Assumptions
## Background

### Assumptions

There are no assumptions.

## Accessibility Support
### Accessibility Support

There are no accessibility support issues known.

## Background

### Bibliography

- [Understanding SC 1.2.1: Audio-only and Video-only (Prerecorded)](https://www.w3.org/WAI/WCAG22/Understanding/audio-only-and-video-only-prerecorded)
Expand Down
Loading

0 comments on commit 5ba46d9

Please sign in to comment.