Skip to content

Commit a37cfd3

Browse files
Merge remote-tracking branch 'origin/develop' into rule-2ee8b8-may-2023
2 parents 2dcd941 + 09f668c commit a37cfd3

131 files changed

Lines changed: 2429 additions & 1443 deletions

File tree

Some content is hidden

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

.github/scripts/approve-rule.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ await updateRuleVersionsYaml(config, argv.ruleId);
2727
await approveTestCaseJson(config, argv.ruleId);
2828
await commitAndPush(config, `Set ${argv.ruleId} to approved`);
2929

30-
async function generateApprovedRulePages({ tmpDir, rulesDir, glossaryDir }, ruleId) {
30+
async function generateApprovedRulePages({ tmpDir, rulesDir, glossaryDir, testAssetsDir }, ruleId) {
3131
await $`node ./node_modules/act-tools/dist/cli/rule-transform.js \
3232
--rulesDir "${rulesDir}" \
3333
--glossaryDir "${glossaryDir}" \
34+
--testAssetsDir "${testAssetsDir}" \
3435
--outDir "${tmpDir}" \
3536
--ruleIds "${ruleId}"
3637
`;

.github/scripts/wai-build.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ await generateTestCases(config);
88
const commitMessage = (await $`git log -1 --pretty=%B`).stdout;
99
await commitAndPush(config, commitMessage);
1010

11-
async function generateProposedRulePages({ tmpDir, rulesDir, glossaryDir }) {
11+
async function generateProposedRulePages({ tmpDir, rulesDir, glossaryDir, testAssetsDir }) {
1212
await $`node ./node_modules/act-tools/dist/cli/rule-transform.js \
1313
--rulesDir "${rulesDir}" \
1414
--glossaryDir "${glossaryDir}" \
15+
--testAssetsDir "${testAssetsDir}" \
1516
--outDir "${tmpDir}" \
1617
--proposed
1718
`;

.github/workflows/approve-rule.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Sets a rule to "approved" in the wcag-act-rules repository in a given branch.
1+
# Sets a rule to "approved" in the wcag-act-rules repository in a given branch.
22
name: Set a rule to approved
33
on:
44
workflow_dispatch:
@@ -14,12 +14,11 @@ jobs:
1414
dispatch:
1515
runs-on: ubuntu-latest
1616
steps:
17+
- uses: actions/checkout@v3
1718
- name: Check user permission
1819
uses: 74th/workflow-permission-action@1.0.0
1920
with:
2021
listfile: .github/workflows/chair-accounts.md
21-
22-
- uses: actions/checkout@v3
2322
- uses: actions/setup-node@v3
2423
with:
2524
node-version: '16'
@@ -39,4 +38,4 @@ jobs:
3938
git config --global user.name "${{ secrets.WAI_GIT_NAME }}"
4039
git config --global user.email "${{ secrets.WAI_GIT_EMAIL }}"
4140
- name: Set rule to approved
42-
run: npx zx .github/scripts/wai-build.mjs --ruleId ${{ github.event.inputs.ruleId }}" --branch ${{ github.event.inputs.branch }}"
41+
run: npx zx .github/scripts/approve-rule.mjs --ruleId "${{ github.event.inputs.ruleId }}" --branch "${{ github.event.inputs.branch }}"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ For more information, see [ACT Overview - What is ACT](https://www.w3.org/WAI/GL
1212

1313
## Write rules, not tools
1414

15-
An ACT rule is a unambiguous description of what the results of accessibility test tools and methodologies be when running a conformance test for the [Web Content Accessibility Guidelines][wcag21]. The rules are written without a specific implementation in mind. The goal is not to create an accessibility test tool. Instead we aim to harmonize between existing tools, and improve their transparency and the overall quality of their results.
15+
An ACT rule is a unambiguous description of what the results of accessibility test tools and methodologies be when running a conformance test for the [Web Content Accessibility Guidelines][wcag22]. The rules are written without a specific implementation in mind. The goal is not to create an accessibility test tool. Instead we aim to harmonize between existing tools, and improve their transparency and the overall quality of their results.
1616

1717
If you want to know more about us, visit our website at: [www.w3.org/community/act-r][act-r].
1818

@@ -34,5 +34,5 @@ For info on how to use this GitHub repository, see the [ACT-Rules GitHub Guideli
3434

3535
This repository automatically pushes changes to rules to the [w3c/wcag-act-rules](https://github.com/w3c/wcag-act-rules/) repository. There is an "Approve rule" action available which can be triggered manually by an ACT Task Force facilitator, which will set a proposed rule to "approved".
3636

37-
[wcag21]: https://www.w3.org/TR/WCAG21/
37+
[wcag22]: https://www.w3.org/TR/WCAG22/
3838
[act-r]: https://www.w3.org/community/act-r/

__tests__/frontmatter.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,17 @@ 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()
100-
return
101-
}
102-
98+
expect(accReq).not.toBeNull()
99+
expect(typeof accReq).toBe('object')
103100
const keys = Object.keys(accReq).sort()
104-
expect(keys.length).toBeGreaterThanOrEqual(4)
105-
expect(keys).toIncludeAllMembers(['failed', 'forConformance', 'inapplicable', 'passed'])
101+
102+
if (keys.includes('secondary')) {
103+
expect(keys.length).toBe(1)
104+
expect(typeof accReq.secondary).toBe('string')
105+
} else {
106+
expect(keys.length).toBeGreaterThanOrEqual(4)
107+
expect(keys).toIncludeAllMembers(['failed', 'forConformance', 'inapplicable', 'passed'])
108+
}
106109
})
107110
}
108111
}

__tests__/link-is-outdated.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ const uniqueArray = require('../utils/unique-array')
1414
* Map of bad links vs their recommendations
1515
*/
1616
const badLinksAndRecommendations = {
17-
'://www.w3.org/TR/WCAG20/': 'Use WCAG 2.1 reference- https://www.w3.org/WAI/WCAG21/',
18-
'://www.w3.org/TR/UNDERSTANDING-WCAG20/': 'Use WCAG 2.1 reference - https://www.w3.org/WAI/WCAG21/Understanding/',
19-
'://www.w3.org/TR/WCAG20-TECHS/': 'Use WCAG 2.1 reference - https://www.w3.org/WAI/WCAG21/Techniques/',
20-
'://www.w3.org/TR/wai-aria-1.0/': 'Use ARIA 1.1 reference - https://www.w3.org/TR/wai-aria-1.1/',
17+
'://www.w3.org/TR/WCAG20/': 'Use WCAG 2.2 reference- https://www.w3.org/WAI/WCAG22/',
18+
'://www.w3.org/TR/WCAG21/': 'Use WCAG 2.2 reference- https://www.w3.org/WAI/WCAG22/',
19+
'://www.w3.org/TR/UNDERSTANDING-WCAG20/': 'Use WCAG 2.2 reference - https://www.w3.org/WAI/WCAG22/Understanding/',
20+
'://www.w3.org/WAI/WCAG21/Understanding/': 'Use WCAG 2.2 reference- ://www.w3.org/WAI/WCAG22/Understanding/',
21+
'://www.w3.org/TR/WCAG20-TECHS/': 'Use WCAG 2.2 reference - https://www.w3.org/WAI/WCAG22/Techniques/',
22+
'://www.w3.org/WAI/WCAG21/Techniques/': 'Use WCAG 2.2 reference - https://www.w3.org/WAI/WCAG22/Techniques/',
23+
'://www.w3.org/TR/wai-aria-1.0/': 'Use ARIA 1.2 reference - https://www.w3.org/TR/wai-aria-1.2/',
24+
'://www.w3.org/TR/wai-aria-1.1/': 'Use ARIA 1.2 reference - https://www.w3.org/TR/wai-aria-1.2/',
2125
'://www.w3.org/TR/dom41/': 'Use http://dom.spec.whatwg.org',
2226
'://www.w3.org/TR/html/': 'Use http://html.spec.whatwg.org',
2327
'://www.w3.org/TR/html52/': 'Use http://html.spec.whatwg.org',

__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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
- WCAG
2929
- WCAG2
3030
- WCAG21
31+
- WCAG22
3132
- CSS3
3233
- css # lowercase needed in reference list
3334
- UA
@@ -86,6 +87,7 @@
8687
- RFC
8788
- rfc
8889
- webauthn
90+
- customizable
8991

9092
# spell checker checks against strict casing & hence some repeated words here
9193
- Autocomplete
@@ -119,6 +121,7 @@
119121
- multipage
120122
- attr-input-type
121123
- wai-aria-1.1
124+
- wai-aria-1.2
122125

123126
# Notes and acronyms
124127
- TODO
@@ -207,6 +210,7 @@
207210
- reflow
208211
- Viewport
209212
- dom-meta-content
213+
- showModal
210214

211215
# Unsure why the dictionary does not have these words
212216
- programmatically
@@ -268,6 +272,8 @@
268272
- 2px
269273
- 3px
270274
- 4px
275+
- 10px
276+
- 15px
271277
- 16px
272278
- 20px
273279
- 24px

_rules/__tests__/unique-ids.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const getMarkdownData = require('../../utils/get-markdown-data')
2+
const rulesData = getMarkdownData(`./_rules`)
3+
4+
describe('Rule ids verification', () => {
5+
const duplicates = rulesData.filter(
6+
(ruleData, idx) => rulesData.findIndex(r => r.frontmatter.id === ruleData.frontmatter.id) !== idx
7+
)
8+
9+
test('Rule ids are unique', () => {
10+
expect(duplicates.length, `Duplicated rules: ${duplicates.map(ruleData => ruleData.filename).join(', ')}`).toBe(0)
11+
})
12+
})

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

Lines changed: 6 additions & 8 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,15 +36,15 @@ 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

4343
- [ARIA in HTML](https://www.w3.org/TR/html-aria/#index-aria-global)
4444
- [WAI ARIA Supported States and Properties](https://www.w3.org/TR/wai-aria-1.2/#supportedState)
45-
- [G108: Using markup features to expose the name and role](https://www.w3.org/WAI/WCAG21/Techniques/general/G108)
46-
- [Understanding Success Criterion 1.3.1: Info and Relationships](https://www.w3.org/WAI/WCAG21/Understanding/name-role-value)
47-
- [Understanding Success Criterion 4.1.2: Name, Role, Value](https://www.w3.org/WAI/WCAG21/Understanding/name-role-value)
45+
- [G108: Using markup features to expose the name and role](https://www.w3.org/WAI/WCAG22/Techniques/general/G108)
46+
- [Understanding Success Criterion 1.3.1: Info and Relationships](https://www.w3.org/WAI/WCAG22/Understanding/name-role-value)
47+
- [Understanding Success Criterion 4.1.2: Name, Role, Value](https://www.w3.org/WAI/WCAG22/Understanding/name-role-value)
4848
- [Semantics and ARIA](https://developers.google.com/web/fundamentals/accessibility/semantics-aria/)
4949

5050
## Test Cases
@@ -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

0 commit comments

Comments
 (0)