Skip to content

Commit 5ba46d9

Browse files
Update to rules format 1.1 (#2220)
* 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 <caduarte@edu.ulisboa.pt>
1 parent f9eace3 commit 5ba46d9

File tree

100 files changed

+812
-628
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+812
-628
lines changed

_rules/__tests__/headings.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ describeRule('headings', ruleData => {
5858
/**
5959
* Check for `required` `h2` headings
6060
*/
61-
const requiredH2 = [`Applicability`, `Assumptions`, `Accessibility Support`, `Background`, `Test Cases`]
61+
const requiredH2 = [`Applicability`, `Background`, `Test Cases`]
6262
const h2Headings = getHeadingOfDepth(headings, 2)
6363
test.each(requiredH2)('has required `h2` - `%s`', heading => {
6464
expect(h2Headings).toContain(heading)
@@ -67,9 +67,9 @@ describeRule('headings', ruleData => {
6767
/**
6868
* Check for `required` `h3` headings
6969
*/
70-
const requiredH3 = [`Passed`, `Failed`, `Inapplicable`]
70+
const requiredH3 = [`Assumptions`, `Accessibility Support`, `Passed`, `Failed`, `Inapplicable`]
7171
const h3Headings = getHeadingOfDepth(headings, 3)
72-
test.each(requiredH3)('has required `h2` - `%s`', heading => {
72+
test.each(requiredH3)('has required `h3` - `%s`', heading => {
7373
expect(h3Headings).toContain(heading)
7474
})
7575

_rules/aria-attr-defined-5f99a7.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
id: 5f99a7
33
name: ARIA attribute is defined in WAI-ARIA
4+
rules_format: 1.1
45
rule_type: atomic
56
description: |
67
This rule checks that each `aria-` attribute specified is defined in ARIA 1.2.
@@ -26,17 +27,17 @@ This rule applies to any attribute that starts with `aria-`.
2627

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

29-
## Assumptions
30+
## Background
3031

31-
There are no assumptions.
32+
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.
3233

33-
## Accessibility Support
34+
### Assumptions
3435

35-
There are no accessibility support issues known.
36+
There are no assumptions.
3637

37-
## Background
38+
### Accessibility Support
3839

39-
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.
40+
There are no accessibility support issues known.
4041

4142
### Bibliography
4243

_rules/aria-hidden-no-focusable-content-6cfa84.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
id: 6cfa84
33
name: Element with aria-hidden has no content in sequential focus navigation
4+
rules_format: 1.1
45
rule_type: atomic
56
description: |
67
This rule checks that elements with an `aria-hidden` attribute do not contain elements that are part of the sequential focus navigation and focusable.
@@ -34,14 +35,6 @@ This rule applies to any element with an `aria-hidden` [attribute value][] of `t
3435

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

37-
## Assumptions
38-
39-
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][].
40-
41-
## Accessibility Support
42-
43-
Some user agents treat the value of `aria-hidden` attribute as case-sensitive.
44-
4538
## Background
4639

4740
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.
@@ -52,6 +45,14 @@ An element with an `aria-hidden` attribute set to `true` that is also part of th
5245

5346
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.
5447

48+
### Assumptions
49+
50+
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][].
51+
52+
### Accessibility Support
53+
54+
Some user agents treat the value of `aria-hidden` attribute as case-sensitive.
55+
5556
### Related rules
5657

5758
- [Element with presentational children has no focusable content](https://www.w3.org/WAI/standards-guidelines/act/rules/307n5z/)

_rules/aria-required-context-role-ff89c9.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
id: ff89c9
33
name: ARIA required context role
4+
rules_format: 1.1
45
rule_type: atomic
56
description: |
67
This rule checks that an element with an explicit semantic role exists inside its required context.
@@ -33,16 +34,6 @@ This rule applies to any [HTML or SVG element][] that is [included in the access
3334

3435
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.
3536

36-
## Assumptions
37-
38-
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.
39-
40-
## Accessibility Support
41-
42-
- 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.
43-
- `aria-owns` has limited support in some user agents.
44-
- 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.
45-
4637
## Background
4738

4839
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.
@@ -57,6 +48,16 @@ This rule is restricted to direct parent-child relation in the [accessibility tr
5748

5849
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.
5950

51+
### Assumptions
52+
53+
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.
54+
55+
### Accessibility Support
56+
57+
- 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.
58+
- `aria-owns` has limited support in some user agents.
59+
- 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.
60+
6061
### Bibliography
6162

6263
- [Understanding Success Criterion 1.3.1: Info and Relationships](https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships.html)

_rules/aria-required-id-references-in6db8.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
id: in6db8
33
name: ARIA required ID references exist
4+
rules_format: 1.1
45
rule_type: atomic
56
description: |
67
This rule checks that every ID reference required by WAI-ARIA exists
@@ -34,17 +35,17 @@ This rule applies to any `aria-controls` attribute defined on an [HTML element][
3435

3536
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].
3637

37-
## Assumptions
38+
## Background
3839

39-
There are no assumptions.
40+
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.
4041

41-
## Accessibility Support
42+
### Assumptions
4243

43-
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.
44+
There are no assumptions.
4445

45-
## Background
46+
### Accessibility Support
4647

47-
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.
48+
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.
4849

4950
### Bibliography
5051

_rules/aria-required-owned-element-bc4a75.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
id: bc4a75
33
name: ARIA required owned elements
4+
rules_format: 1.1
45
rule_type: atomic
56
description: |
67
This rule checks that an element with an explicit semantic role has at least one of its required owned elements.
@@ -34,25 +35,25 @@ Each test target only [owns][] elements with a [semantic role][] from the [requi
3435

3536
**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.
3637

37-
## Assumptions
38+
## Background
39+
40+
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`.
41+
42+
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][].
43+
44+
**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`.
45+
46+
### Assumptions
3847

3948
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).
4049

41-
## Accessibility Support
50+
### Accessibility Support
4251

4352
- 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.
4453
- `aria-owns` has limited support in some user agents.
4554
- 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.
4655
- Some user agents treat the value of `aria-busy` as case-sensitive.
4756

48-
## Background
49-
50-
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`.
51-
52-
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][].
53-
54-
**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`.
55-
5657
### Bibliography
5758

5859
- [Understanding Success Criterion 1.3.1: Info and Relationships](https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships.html)

_rules/aria-state-or-property-permitted-5c01ea.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
id: 5c01ea
33
name: ARIA state or property is permitted
4+
rules_format: 1.1
45
rule_type: atomic
56
description: |
67
This rule checks that WAI-ARIA states or properties are allowed for the element they are specified on.
@@ -50,14 +51,6 @@ For each test target, one of the following is true:
5051

5152
No test target is [prohibited][] on the [semantic role][] of the element on which it is specified.
5253

53-
## Assumptions
54-
55-
There are no assumptions.
56-
57-
## Accessibility Support
58-
59-
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.
60-
6154
## Background
6255

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

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

62+
### Assumptions
63+
64+
There are no assumptions.
65+
66+
### Accessibility Support
67+
68+
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.
69+
6970
### Related rules
7071

7172
- [ARIA state or property has valid value](https://www.w3.org/WAI/standards-guidelines/act/rules/6a7281/)

_rules/aria-state-or-property-valid-value-6a7281.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
id: 6a7281
33
name: ARIA state or property has valid value
4+
rules_format: 1.1
45
rule_type: atomic
56
description: |
67
This rule checks that each ARIA state or property has a valid value type.
@@ -36,19 +37,19 @@ Each test target has an [attribute value][] that is valid according to its [WAI-
3637

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

39-
## Assumptions
40+
## Background
4041

41-
There are no assumptions.
42+
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.
4243

43-
## Accessibility Support
44+
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.
4445

45-
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.
46+
### Assumptions
4647

47-
## Background
48+
There are no assumptions.
4849

49-
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.
50+
### Accessibility Support
5051

51-
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.
52+
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.
5253

5354
### Related rules
5455

_rules/attr-not-duplicated-e6952f.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
id: e6952f
33
name: Attribute is not duplicated
4+
rules_format: 1.1
45
rule_type: atomic
56
description: |
67
This rule checks that HTML and SVG starting tags do not contain duplicated attributes.
@@ -43,16 +44,16 @@ This rule applies to any [starting tag](https://www.w3.org/TR/html5/syntax.html#
4344

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

46-
## Assumptions
47+
## Background
48+
49+
### Assumptions
4750

4851
There are no assumptions.
4952

50-
## Accessibility Support
53+
### Accessibility Support
5154

5255
There are no accessibility support issues known.
5356

54-
## Background
55-
5657
### Bibliography
5758

5859
- [H94: Ensuring that elements do not contain duplicate attributes](https://www.w3.org/WAI/WCAG22/Techniques/html/H94)

_rules/audio-as-media-alternative-afb423.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
id: afb423
33
name: Audio element content is media alternative for text
4+
rules_format: 1.1
45
rule_type: atomic
56
description: |
67
This rule checks that the `audio` element is a media alternative for text on the page.
@@ -35,16 +36,16 @@ The auditory information of each test target is available as text (directly or v
3536

3637
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][].
3738

38-
## Assumptions
39+
## Background
40+
41+
### Assumptions
3942

4043
There are no assumptions.
4144

42-
## Accessibility Support
45+
### Accessibility Support
4346

4447
There are no accessibility support issues known.
4548

46-
## Background
47-
4849
### Bibliography
4950

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

0 commit comments

Comments
 (0)