Skip to content

Commit a97a8bd

Browse files
WilcoFierstbostic32kengdojJym77
authored
Move secondary requirement texts out of the background (#2060)
* Move secondary requirement texts out of the background * Apply suggestions from code review * fix test * Fix failing test * Secondary reqs on ARIA rules * Update all secondary requirements * Typos * Fix failing tests * Update _rules/link-non-empty-accessible-name-c487ae.md Co-authored-by: Trevor R. Bostic <32486143+tbostic32@users.noreply.github.com> * Tweaked the language some more * Update rule design info for secondary requirements * Fix tests * Apply suggestions from code review Co-authored-by: Kathy Eng <kengdoj@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Jean-Yves Moyen <jym@siteimprove.com> --------- Co-authored-by: Trevor R. Bostic <32486143+tbostic32@users.noreply.github.com> Co-authored-by: Kathy Eng <kengdoj@users.noreply.github.com> Co-authored-by: Jean-Yves Moyen <jym@siteimprove.com>
1 parent ebc87aa commit a97a8bd

25 files changed

Lines changed: 69 additions & 103 deletions

__tests__/frontmatter.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,11 @@ function validateRuleFrontmatter({ frontmatter }, metaData) {
9595
*/
9696
const accRequirementValues = Object.values(accessibility_requirements)
9797
test.each(accRequirementValues)('has expected keys for accessibility requirement: `%p`', accReq => {
98-
if (accReq.secondary) {
99-
expect(accReq.secondary).toBeTrue()
98+
if (!accReq) {
99+
return
100+
} else if (accReq.secondary) {
101+
// Note; empty strings & false won't get here, and so aren't allowed
102+
expect(['string', 'boolean']).toContain(typeof accReq.secondary)
100103
return
101104
}
102105

__tests__/link-to-glossary-term-valid.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const whitelist = [
1414
/^#expectation(-[1-9][0-9]*)?$/,
1515
/^#assumptions$/,
1616
/^#accessibility-support$/,
17+
/^#accessibility-requirements-mapping$/,
1718
/^#background$/,
1819
/^#test-cases$/,
1920
/^#passed(-example-[1-9][0-9]*)?$/,

__tests__/spelling-ignore.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
- RFC
8787
- rfc
8888
- webauthn
89+
- customizable
8990

9091
# spell checker checks against strict casing & hence some repeated words here
9192
- Autocomplete

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ description: |
66
This rule checks that each `aria-` attribute specified is defined in ARIA 1.2.
77
accessibility_requirements:
88
wcag20:1.3.1: # Info and Relationships (A)
9-
secondary: true
9+
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.
1010
wcag20:4.1.2: # Name, Role, Value (A)
11-
secondary: true
11+
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.
1212
input_aspects:
1313
- DOM Tree
1414
acknowledgments:
@@ -36,7 +36,7 @@ There are no accessibility support issues known.
3636

3737
## Background
3838

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. This can cause issues under [success criterion 1.3.1 Info and Relationships][sc131] or [4.1.2 Name, Rule Value][sc412].
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.
4040

4141
### Bibliography
4242

@@ -122,5 +122,3 @@ This `canvas` element does not have an `aria-` attribute specified.
122122
```
123123

124124
[wai-aria specifications]: #wai-aria-specifications 'Definition of WAI-ARIA specifications'
125-
[sc131]: https://www.w3.org/TR/WCAG21/#info-and-relationships
126-
[sc412]: https://www.w3.org/TR/WCAG21/#name-role-value

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ accessibility_requirements:
1717
passed: satisfied
1818
inapplicable: satisfied
1919
wcag20:1.3.1: # Info and Relationships (A)
20-
secondary: true
20+
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.
2121
wcag20:4.1.2: # Name, Role, Value (A)
22-
secondary: true
22+
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.
2323
input_aspects:
2424
- Accessibility Tree
2525
- CSS styling
@@ -60,7 +60,7 @@ Implementation of [Presentational Roles Conflict Resolution][] varies from one b
6060

6161
## Background
6262

63-
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].
63+
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.
6464

6565
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).
6666

@@ -233,5 +233,3 @@ This `div` element is not [included in the accessibility tree][], hence its [WAI
233233
[wai-aria state or property]: https://www.w3.org/TR/wai-aria-1.2/#state_prop_def 'Definition of ARIA States and Properties'
234234
[namespaced element]: #namespaced-element
235235
[prohibited]: https://www.w3.org/TR/wai-aria-1.2/#prohibitedattributes 'WAI-ARIA 1.2 Definition of Prohibited States and Properties'
236-
[sc131]: https://www.w3.org/TR/WCAG21/#info-and-relationships
237-
[sc412]: https://www.w3.org/TR/WCAG21/#name-role-value

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ accessibility_requirements:
1212
passed: satisfied
1313
inapplicable: satisfied
1414
wcag20:1.3.1: # Info and Relationships (A)
15-
secondary: true
15+
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.
1616
wcag20:4.1.2: # Name, Role, Value (A)
17-
secondary: true
17+
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.
1818
input_aspects:
1919
- DOM Tree
2020
- CSS Styling
@@ -46,7 +46,7 @@ Some user agents treat the value of `aria-*` attribute as case-sensitive (even w
4646

4747
## Background
4848

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. This can cause issues under [success criterion 1.3.1 Info and Relationships][sc131] or [4.1.2 Name, Rule Value][sc412]. 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.
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.
5050

5151
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.
5252

@@ -242,7 +242,5 @@ The `aria-hidden` attribute is not on an [HTML or SVG element][].
242242
```
243243

244244
[html or svg element]: #namespaced-element
245-
[sc131]: https://www.w3.org/TR/WCAG21/#info-and-relationships
246-
[sc412]: https://www.w3.org/TR/WCAG21/#name-role-value
247245
[value type]: https://www.w3.org/TR/wai-aria-1.2/#propcharacteristic_value
248246
[wai-aria state or property]: https://www.w3.org/TR/wai-aria-1.2/#state_prop_def

_rules/image-no-text-0va7u6.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ accessibility_requirements:
1212
inapplicable: further testing needed
1313
wcag20:1.4.9: # Images of Text (No Exception) (AAA)
1414
forConformance: true
15-
secondary: true
1615
failed: not satisfied
1716
passed: further testing needed
1817
inapplicable: further testing needed
@@ -56,7 +55,7 @@ There are no accessibility support issues known.
5655

5756
## Background
5857

59-
This rule is designed specifically for [SC 1.4.5 Images of Text][sc1.4.5] which includes exceptions to the images it applies to that are not part of [SC 1.4.9 Images of Text (No Exception)][sc1.4.9]. Therefore, some images that are inapplicable for this rule can be applicable to [SC 1.4.9 Images of Text (No Exception)][sc1.4.9].
58+
This rule is designed specifically for [SC 1.4.5 Images of Text][sc1.4.5]. There are however only minimal differences between this criterion and [SC 1.4.9 Images of Text (No Exception)][sc1.4.9]. The two differences are that customizable images of text are allowed, and that images of text are allowed when the presentation cannot otherwise be achieved. These scenarios are so rare the rule ignores them as part of the assumptions, and so the [accessibility requirements mapping](#accessibility-requirements-mapping) of these two criteria is the same.
6059

6160
### Bibliography
6261

@@ -210,10 +209,13 @@ This image resource referenced by the `img` element contains text that provides
210209
This `img` element loads an SVG with text as an image resource. Because the SVG is loaded as an image resource, instead of being embedded in HTML the text cannot be selected or customized.
211210

212211
```html
213-
<img alt="WCAG Rocks" src="data:image/svg+xml;utf8,
212+
<img
213+
alt="WCAG Rocks"
214+
src="data:image/svg+xml;utf8,
214215
<svg xmlns='http://www.w3.org/2000/svg' height='20px' width='80px'>
215216
<text x='0' y='15'>WCAG Rocks</text>
216-
</svg>" />
217+
</svg>"
218+
/>
217219
```
218220

219221
### Inapplicable

_rules/link-in-context-descriptive-5effbb.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ accessibility_requirements:
1111
passed: further testing needed
1212
inapplicable: further testing needed
1313
wcag20:2.4.9: # Link Purpose (Link Only) (AAA)
14-
forConformance: true
15-
secondary: true
16-
failed: not satisfied
17-
passed: further testing needed
18-
inapplicable: further testing needed
14+
secondary: This success criterion is **more strict** than this rule. This is because the rule also considers the context of the link, in addition to the link text. Some of the passed examples do not satisfy this success criterion.
1915
input_aspects:
2016
- Accessibility Tree
2117
- DOM Tree
@@ -53,8 +49,6 @@ The [accessible name][] of each target element together with its [programmatical
5349

5450
## Background
5551

56-
This rule is designed specifically for [2.4.4 Link Purpose (In Context)][sc244], which requires the purpose to be clear within the context of a link. Because links that do not have this, also are not clear without that context, this rule maps to [2.4.9 Link Purpose (Link only)][sc249] as well. In order to adequately test the [expectation](#expectation), some of the passed examples do not satisfy [2.4.9 Link Purpose (Link only)][sc249].
57-
5852
### Related rules
5953

6054
- [Link has non-empty accessible name](https://www.w3.org/WAI/standards-guidelines/act/rules/c487ae/)

_rules/link-non-empty-accessible-name-c487ae.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ accessibility_requirements:
1717
inapplicable: further testing needed
1818
wcag20:2.4.9: # Link Purpose (Link Only) (AAA)
1919
forConformance: true
20-
secondary: true
2120
failed: not satisfied
2221
passed: further testing needed
2322
inapplicable: further testing needed
@@ -27,7 +26,7 @@ accessibility_requirements:
2726
passed: further testing needed
2827
inapplicable: further testing needed
2928
wcag20:1.1.1: # Non-text content (A)
30-
secondary: true
29+
secondary: This success criterion is **related** to this rule. This is because HTML `area` elements are both links and non-text content. Most failed examples satisfy this success criterion.
3130
input_aspects:
3231
- Accessibility Tree
3332
- DOM Tree
@@ -66,8 +65,6 @@ The rule assumes that all links are [user interface components](https://www.w3.o
6665

6766
## Background
6867

69-
The HTML `area` element is both a link and non-text content. When this rule fails on `area` elements [success criterion 1.1.1 Non-text content][sc111] is not satisfied.
70-
7168
### Related rules
7269

7370
- [Link in context is descriptive](https://www.w3.org/WAI/standards-guidelines/act/rules/5effbb/proposed/)
@@ -365,4 +362,3 @@ This `a` element does not have the role of link because it does not have an `hre
365362
[semantic role]: #semantic-role 'Definition of Semantic Role'
366363
[attribute value]: #attribute-value 'Definition of Attribute value'
367364
[html element]: #namespaced-element
368-
[sc111]: https://www.w3.org/TR/WCAG21/#non-text-content

_rules/links-identical-name-equivalent-purpose-b20e66.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ accessibility_requirements:
1111
passed: further testing needed
1212
inapplicable: further testing needed
1313
wcag20:2.4.4: # Link Purpose (In Context) (A)
14-
secondary: true
14+
secondary: This success criterion is **less strict** than this rule. This is because the rule does not consider the context of the link. Some of the failed examples satisfy this success criterion.
1515
input_aspects:
1616
- Accessibility Tree
1717
- DOM Tree
@@ -57,8 +57,6 @@ When followed, the links in each set of target elements resolve to the [same res
5757

5858
## Background
5959

60-
This rule is closely related to [success criterion 2.4.4 Link Purpose (In Context)][sc244]. Because this rule is stricter, links that pass this rule satisfy 2.4.4 Link Purpose (In Context).
61-
6260
### Bibliography
6361

6462
- [CSS Scoping Module Level 1 (editor's draft)](https://drafts.csswg.org/css-scoping/)
@@ -389,7 +387,6 @@ These `span` elements do not have a [semantic role][] of `link`. They are not va
389387
[presentational roles conflict resolution]: https://www.w3.org/TR/wai-aria-1.1/#conflict_resolution_presentation_none 'Presentational Roles Conflict Resolution'
390388
[same resource]: #same-resource 'Definition of same resource'
391389
[sc249]: https://www.w3.org/TR/WCAG21/#link-purpose-link-only 'Success Criterion 2.4.9: Link Purpose (Link Only)'
392-
[sc244]: https://www.w3.org/TR/WCAG21/#link-purpose-in-context 'Success Criterion 2.4.4: Link Purpose (In Context)'
393390
[semantic role]: #semantic-role 'Definition of semantic role'
394391
[shadow tree]: https://dom.spec.whatwg.org/#shadow-tree 'Definition of shadow tree'
395392
[web page (html)]: #web-page-html 'Definition of web page (HTML)'

0 commit comments

Comments
 (0)