Skip to content

Commit 94a8083

Browse files
Merge branch 'develop' into HelenBurge-patch-2
2 parents e8fdf97 + 32fe6af commit 94a8083

28 files changed

+230
-107
lines changed

.github/scripts/pr-preview.mjs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env zx
2+
import 'zx/globals';
3+
import { config, cloneWcagActRules, commitAndPush } from './commons.mjs'
4+
5+
await cloneWcagActRules(config);
6+
await generateProposedRulePages(config);
7+
await generateTestCases(config);
8+
// const commitMessage = (await $`git log -1 --pretty=%B`).stdout;
9+
// await commitAndPush(config, commitMessage);
10+
11+
async function generateProposedRulePages({ tmpDir, rulesDir, glossaryDir, testAssetsDir }) {
12+
await $`node ./node_modules/act-tools/dist/cli/rule-transform.js \
13+
--rulesDir "${rulesDir}" \
14+
--glossaryDir "${glossaryDir}" \
15+
--testAssetsDir "${testAssetsDir}" \
16+
--outDir "${tmpDir}" \
17+
--proposed
18+
`;
19+
}
20+
21+
async function generateTestCases({ tmpDir, rulesDir, testAssetsDir }) {
22+
await $`node ./node_modules/act-tools/dist/cli/build-examples.js \
23+
--rulesDir "${rulesDir}" \
24+
--testAssetsDir "${testAssetsDir}" \
25+
--outDir "${tmpDir}" \
26+
--proposed
27+
`;
28+
}

.github/workflows/wai-deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
- run: git config --global url."https://github.com/".insteadOf ssh://[email protected]/
2424
- name: Install dependencies
2525
run: npm ci
26+
# Since we control this we can safely just always use the latest
27+
- name: Install act-tools latest
28+
run: npm install github:act-rules/act-tools#main
2629
- name: Configure git
2730
run: |
2831
git config --global url."https://${{ secrets.WAI_GIT_NAME }}:${{ secrets.WAI_GIT_ACCESS_TOKEN }}@github.com".insteadOf "https://github.com"

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,6 @@ yarn.lock
7272

7373
# Tmp build directory
7474
wcag-act-rules-tmp/
75+
76+
# Local Netlify folder
77+
.netlify

__tests__/spelling-ignore.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@
240240
- unitless
241241
- luminance
242242
- disambiguated
243+
- superclass
243244
- grey
244245

245246
# Parts of Unicode
@@ -295,3 +296,6 @@
295296
- A-lum-min
296297
- B-lum-max
297298
- B-lum-min
299+
300+
#Browsers Internal Roles
301+
- SvgRoot

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ This `article` element has an `aria-atomic` attribute which is defined in [WAI-A
6565
This `div` element with a role of `dialog` has an `aria-modal` attribute which is defined in [WAI-ARIA Specifications][].
6666

6767
```html
68-
<div role="dialog" aria-modal="true">Contains modal content...</div>
68+
<div role="dialog" aria-modal="true" aria-label="Modal title">Contains modal content...</div>
6969
```
7070

7171
#### Passed Example 3

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ The `aria-controls` [attribute value][] of this `scrollbar` matches the `id` of
7878
The `aria-controls` [attribute value][] of this expanded `combobox` matches the `id` of the `ul` element in the same document.
7979

8080
```html
81-
<label for="tag_combo">Tag</label>
81+
<label for="tag_combo" id="tag_label">Tag</label>
8282
<input
8383
type="text"
8484
id="tag_combo"
@@ -87,7 +87,7 @@ The `aria-controls` [attribute value][] of this expanded `combobox` matches the
8787
aria-controls="popup_listbox"
8888
aria-activedescendant="selected_option"
8989
/>
90-
<ul role="listbox" id="popup_listbox">
90+
<ul role="listbox" id="popup_listbox" aria-labelledby="tag_label">
9191
<li role="option">Zebra</li>
9292
<li role="option" id="selected_option">Zoom</li>
9393
</ul>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: ARIA required owned elements
44
rules_format: 1.1
55
rule_type: atomic
66
description: |
7-
This rule checks that an element with an explicit semantic role has at least one of its required owned elements.
7+
This rule checks that an element with an explicit role that restricts which elements it can own only owns such elements.
88
accessibility_requirements:
99
wcag20:1.3.1: # Info and Relationships (A)
1010
forConformance: true
@@ -80,7 +80,7 @@ This element with the `list` role only owns elements with the `listitem` role. T
8080
This element with the `grid` role only owns elements with the `row` role, and the element with the `row` role only owns elements with the `gridcell` role. The `row` role is one of the [required owned elements][] for `grid`, and `gridcell` is one of the [required owned elements][] for `row`.
8181

8282
```html
83-
<table role="grid">
83+
<table role="grid" aria-label="grid name">
8484
<tr role="row">
8585
<td role="gridcell">Item 1</td>
8686
</tr>
@@ -250,7 +250,7 @@ This `ul` element does not have an [explicit semantic role][].
250250
This element with the `progressbar` role does not need [required owned elements][].
251251

252252
```html
253-
<div role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">20 %</div>
253+
<div role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" aria-label="Completion">20 %</div>
254254
```
255255

256256
#### Inapplicable Example 4

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

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ The `aria-busy` [state][] is a [global][] [state][] that is [supported][] by all
110110

111111
#### Passed Example 4
112112

113-
The `aria-label` [property][] is a [global][] [property][]. It is allowed on any [semantic role][].
113+
The `aria-label` [property][] is a [global][] [property][]. It is allowed on any [semantic role][], except where specifically prohibited.
114114

115115
```html
116116
<div role="button" aria-label="OK">✓</div>
@@ -129,28 +129,28 @@ The `aria-checked` [state][] is [required][] for the [semantic][semantic role] `
129129
The `aria-controls` [property][] is [required][] for the [semantic][semantic role] `combobox`.
130130

131131
```html
132-
<div role="combobox" aria-controls="id1" aria-expanded="false">My combobox</div>
132+
<div role="combobox" aria-controls="id1" aria-expanded="false" aria-label="My combobox">My combobox</div>
133133
```
134134

135135
#### Passed Example 7
136136

137137
The `aria-controls` [property][] is [required][] for the [semantic][semantic role] `combobox`. [WAI-ARIA states and properties][wai-aria state or property] with empty value are still applicable to this rule.
138138

139139
```html
140-
<div role="combobox" aria-expanded="false" aria-controls>My combobox</div>
140+
<div role="combobox" aria-expanded="false" aria-controls aria-label="My combobox">My combobox</div>
141141
```
142142

143143
#### Passed Example 8
144144

145145
The `aria-controls` [property][] is [required][] for the [semantic][semantic role] `combobox`. [WAI-ARIA states and properties][wai-aria state or property] with empty value (specified as an empty string) are still applicable to this rule.
146146

147147
```html
148-
<div role="combobox" aria-expanded="false" aria-controls="">My combobox</div>
148+
<div role="combobox" aria-expanded="false" aria-controls="" aria-label="My combobox">My combobox</div>
149149
```
150150

151151
#### Passed Example 9
152152

153-
The `aria-label` [property][] is [global][]. It is allowed on any [semantic role][], including roles from the [WAI-ARIA Graphics Module](https://www.w3.org/TR/graphics-aria-1.0). This rule is applicable to SVG elements.
153+
The `aria-label` [property][] is [global][]. It is allowed on any [semantic role][], except where specifically prohibited, including roles from the [WAI-ARIA Graphics Module](https://www.w3.org/TR/graphics-aria-1.0). This rule is applicable to SVG elements.
154154

155155
```html
156156
<svg xmlns="http://www.w3.org/2000/svg" role="graphics-object" width="100" height="100" aria-label="yellow circle">
@@ -174,6 +174,29 @@ This `input` element does not have an [explicit role][] of `textbox`, but the `a
174174
<label>Password<input type="password" aria-required="true"/></label>
175175
```
176176

177+
#### Passed Example 12
178+
179+
This `div` element has an [explicit role][] of `switch`; the `aria-required` [property][] is [inherited][] from the `checkbox` [superclass role](https://www.w3.org/TR/wai-aria-1.2/#superclassrole).
180+
181+
```html
182+
<div role="switch" aria-checked="false" tabindex="0" aria-required="true">
183+
<span class="label">Notifications</span>
184+
<span class="switch" style="position: relative; display: inline-block; top: 6px; border: 2px solid black; border-radius: 12px; height: 20px; width: 40px;">
185+
<span style="position: absolute; top: 2px; left: 2px; display: inline-block; border: 2px solid black; border-radius: 8px; height: 12px; width: 12px; background: black;"></span>
186+
</span>
187+
<span class="on" aria-hidden="true" style="display: none;">On</span>
188+
<span class="off" aria-hidden="true">Off</span>
189+
</div>
190+
```
191+
192+
#### Passed Example 13
193+
194+
This `div` element has an [explicit role][] of `separator`. The `aria-valuemin`, `aria-valuemax` and `aria-valuenow` [properties][property] are [supported][] for the `separator` role when the element is [focusable][].
195+
196+
```html
197+
<div role="separator" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" tabindex="0">My separator</div>
198+
```
199+
177200
### Failed
178201

179202
#### Failed Example 1
@@ -200,14 +223,22 @@ The `aria-label` property is [prohibited][] for an element with a `generic` role
200223
<div aria-label="Bananas"></div>
201224
```
202225

226+
#### Failed Example 4
227+
228+
The `aria-label` property is [prohibited][] for an element with a `paragraph` role.
229+
230+
```html
231+
<div role="paragraph" aria-label="Bananas"></div>
232+
```
233+
203234
### Inapplicable
204235

205236
#### Inapplicable Example 1
206237

207238
This `div` element has no [WAI-ARIA state or property][].
208239

209240
```html
210-
<div role="region">A region of content</div>
241+
<div role="group">A group of content</div>
211242
```
212243

213244
#### Inapplicable Example 2

_rules/autocomplete-valid-value-73f2c2.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ The purpose of a control is programmatically identifiable even when its `autocom
6969

7070
- While `autocomplete` is a promising technique for supporting personalization in HTML, support for this in assistive technologies is fairly limited.
7171
- 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 fail this rule with some technology but users of other technologies would not experience any accessibility issue.
72-
- In some user agents, querying the value of the `autocomplete` property returns an empty string ("") even when the attribute was set according to the rule's expectations. It affects assistive technologies which rely on this property to personalize input fields collecting information about the user.
7372
- Authors may assign inappropriate `autocomplete` attribute values. Moreover, HTML specifications restrict certain `autocomplete` attribute values to specific form controls. Mismatches between `autocomplete` attribute values and form control types may or may not lead to a failure of [success criterion 1.3.5 Identify Input Purpose](https://www.w3.org/TR/WCAG22/#identify-input-purpose). However, this rule focuses exclusively on validating valid `autocomplete` attribute values, disregarding their contextual appropriateness.
7473

7574
### Bibliography

_rules/block-collapsible-3e12e1.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,14 @@ For each [block of repeated content][] in each test target, which is before (in
3939

4040
### Assumptions
4141

42-
There are no assumptions.
42+
Usually the same [instrument][] removes both [visibility][visible] and [inclusion in the accessibility tree][included in the accessibility tree] of a [block of repeated content][]. That [instrument][] may remove all [blocks of repeated content][block of repeated content]. If there is no [block of repeated content][] before the non-repeated content the rule passes.
43+
44+
[Technique SCR28: Using an expandable and collapsible menu to bypass block of content][tech scr28] does not have any requirements concerning the location of the [instruments][instrument] in relation to the [block of repeated content][] they control, hence this rule doesn't. It is likely a good idea to either keep each [instrument][] close to the start of the [block of repeated content][] it controls; or to group them all in one place near the start of the document. Notably, [instruments][instrument] located after (in reading order) the block they collapse are likely not satisfying [Success Criterion 2.4.1 Bypass blocks][sc241], which this rule is designed for. Thus, it is possible to pass this rule without satisfying [Success Criterion 2.4.1 Bypass blocks][sc241].
4345

4446
### Accessibility Support
4547

4648
There are no accessibility support issues known.
4749

48-
Usually the same [instrument][] removes both [visibility][visible] and [inclusion in the accessibility tree][included in the accessibility tree] of a [block of repeated content][]. That [instrument][] may remove all [blocks of repeated content][block of repeated content]. If there is no [block of repeated content][] before the non-repeated content the rule passes.
49-
50-
[Technique SCR28: Using an expandable and collapsible menu to bypass block of content][tech scr28] does not have any requirements concerning the location of the [instruments][instrument] in relation to the [block of repeated content][] they control, hence this rule doesn't. It is likely a good idea to either keep each [instrument][] close to the start of the [block of repeated content][] it controls; or to group them all in one place near the start of the document. Notably, [instruments][instrument] located after (in reading order) the block they collapse are likely not satisfying [Success Criterion 2.4.1 Bypass blocks][sc241], which this rule is designed for. Thus, it is possible to pass this rule without satisfying [Success Criterion 2.4.1 Bypass blocks][sc241].
51-
5250
### Bibliography
5351

5452
- [Technique SCR28: Using an expandable and collapsible menu to bypass block of content][tech scr28]

0 commit comments

Comments
 (0)