Skip to content

Commit 352e7a8

Browse files
Merge branch 'develop' into giacomo-petri-patch-svg-acc-supp-note-23a2a8
2 parents 9ce7aec + 7c50fae commit 352e7a8

8 files changed

Lines changed: 91 additions & 10 deletions

.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+
}

.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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@
239239
- unitless
240240
- luminance
241241
- disambiguated
242+
- superclass
242243
- grey
243244

244245
# Parts of Unicode

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

Lines changed: 33 additions & 2 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>
@@ -150,7 +150,7 @@ The `aria-controls` [property][] is [required][] for the [semantic][semantic rol
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,6 +223,14 @@ 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

_rules/element-marked-decorative-is-not-exposed-46ca7f.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ rule_type: atomic
66
description: |
77
This rule checks that elements marked as decorative either are not included in the accessibility tree, or have a presentational role.
88
accessibility_requirements:
9+
wcag20:1.1.1: # Non-text content (A)
10+
secondary: This success criterion is **less strict** than this rule. Only when this rule is applied to decorative content does a failure of 1.1.1 occur.
911
input_aspects:
1012
- Accessibility tree
1113
- CSS styling
@@ -35,7 +37,7 @@ Elements are normally [marked as decorative][] to convey the intention of the au
3537

3638
Whenever such a conflict occurs, this indicates at the very least mismatching intentions. Such a conflict should be avoided.
3739

38-
When these conflicts arise on [decorative][] [non-text content][], this is also a failure of [Success Criterion 1.1.1: Non-text Content][sc111] because [decorative][] [non-text content][] must be implemented in a way that allows assistive technologies to ignore it. When these conflicts arise on text content, or on content which is not [decorative][], this is not a failure of WCAG. Therefore this rule is not mapping to any specific WCAG Success Criterion, and is not an accessibility requirement for WCAG.
40+
When these conflicts arise on [decorative][] [non-text content][], this is also a failure of [Success Criterion 1.1.1: Non-text Content][sc111] because [decorative][] [non-text content][] must be implemented in a way that allows assistive technologies to ignore it. When these conflicts arise on text content, or on content which is not [decorative][], this is not a failure of WCAG. Therefore this rule maps to Non-text Content as a secondary requirement.
3941

4042
### Assumptions
4143

_rules/meta-refresh-no-delay-bc659a.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ This page will not refresh because it lacks a `http-equiv` attribute.
198198

199199
#### Inapplicable Example 3
200200

201-
This 'meta' element contains an invalid `content` attribute and will not refresh the page.
201+
This `meta` element contains an invalid `content` attribute and will not refresh the page.
202202

203203
```html
204204
<head>
@@ -211,7 +211,7 @@ This 'meta' element contains an invalid `content` attribute and will not refresh
211211

212212
#### Inapplicable Example 4
213213

214-
This 'meta' element contains an invalid `content` attribute and will not refresh the page.
214+
This `meta` element contains an invalid `content` attribute and will not refresh the page.
215215

216216
```html
217217
<head>
@@ -224,7 +224,7 @@ This 'meta' element contains an invalid `content` attribute and will not refresh
224224

225225
#### Inapplicable Example 5
226226

227-
This 'meta' element contains an invalid `content` attribute and will not refresh the page.
227+
This `meta` element contains an invalid `content` attribute and will not refresh the page.
228228

229229
```html
230230
<head>
@@ -237,7 +237,7 @@ This 'meta' element contains an invalid `content` attribute and will not refresh
237237

238238
#### Inapplicable Example 6
239239

240-
This 'meta' element contains an invalid `content` attribute and will not refresh the page.
240+
This `meta` element contains an invalid `content` attribute and will not refresh the page.
241241

242242
```html
243243
<head>
@@ -250,7 +250,7 @@ This 'meta' element contains an invalid `content` attribute and will not refresh
250250

251251
#### Inapplicable Example 7
252252

253-
This 'meta' element contains an invalid `content` attribute and will not refresh the page.
253+
This `meta` element contains an invalid `content` attribute and will not refresh the page.
254254

255255
```html
256256
<head>
@@ -263,7 +263,7 @@ This 'meta' element contains an invalid `content` attribute and will not refresh
263263

264264
#### Inapplicable Example 8
265265

266-
This 'meta' element contains an invalid `content` attribute and will not refresh the page.
266+
This `meta` element contains an invalid `content` attribute and will not refresh the page.
267267

268268
```html
269269
<head>

netlify.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[build]
2+
command = "npm run pr:preview && cd wcag-act-rules-tmp && git submodule update --init --remote && bundle install && bundle exec jekyll build --config '_config.yml,_config_staging.yml'"
3+
# base = "wcag-act-rules-tmp"
4+
publish = "wcag-act-rules-tmp/_site"
5+
6+
[build.environment]
7+
RUBY_VERSION = "3.3.3"
8+
9+
[[redirects]]
10+
from = "/"
11+
to = "/standards-guidelines/act/rules/"
12+
13+
[[redirects]]
14+
from = "/standards-guidelines/act/rules/*"
15+
to = "/standards-guidelines/at/rules/:splat/proposed"

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@
177177
"formatRulesDir": "prettier --write './_rules/**/*.md'",
178178
"format": "prettier --write *.{json,md,js,html,css,yml} './{__tests__,_rules,.github,pages,test-assets,test-utils,utils}/**/*.{json,md,js,html,css,yml}'",
179179
"test": "jest --coverage",
180-
"build:wai": "zx .github/scripts/wai-build.mjs"
180+
"build:wai": "zx .github/scripts/wai-build.mjs",
181+
"pr:preview": "zx .github/scripts/pr-preview.mjs"
181182
},
182183
"homepage": "https://github.com/act-rules/act-rules.github.io",
183184
"repository": {

0 commit comments

Comments
 (0)