Skip to content

Commit

Permalink
Merge pull request #1686 from IBMa/dev-1680
Browse files Browse the repository at this point in the history
fix(engine): Remapping engine rules from 4.1.1 Parsing to HTML and ARIA
  • Loading branch information
ErickRenteria authored Oct 2, 2023
2 parents 41527d7 + 8b210ff commit e124556
Show file tree
Hide file tree
Showing 13 changed files with 71 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ <h3 id="ruleMessage"></h3>

* Replace deprecated roles and attributes with those preferred in the current version of the specification.

Note: The [4.1.1 Parsing](https://www.w3.org/WAI/WCAG21/Understanding/parsing.html) requirement was removed from WCAG.
However, the Checker will report an issue against another accessibility requirement when it detects it causes an accessibility issue.

</script></mark-down>
<!-- End main panel -->
<!-- This is where the rule id is injected -->
Expand All @@ -77,7 +80,7 @@ <h3 id="ruleMessage"></h3>

### About this requirement

* [IBM 4.1.1 Parsing](https://www.ibm.com/able/requirements/requirements/#4_1_1)
<!-- Replace 4.1.1 * [IBM 4.1.1 Parsing](https://www.ibm.com/able/requirements/requirements/#4_1_1) -->
* [ARIA 1.2 - Deprecated Requirements](https://www.w3.org/TR/wai-aria-1.2/#deprecated)

### Who does this affect?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ <h3 id="ruleMessage"></h3>

### What to do

Remove the redundant ARIA role from the element.
* Remove the redundant ARIA role from the element.

Note the redundant ARIA and HTML roles shown in the following examples.
Note the redundant ARIA and HTML roles shown in the following examples:

```
<button type="button" role="button">Save</button>
Expand All @@ -69,6 +69,9 @@ <h3 id="ruleMessage"></h3>
<input type="button" value="Save">
```

Note: The [4.1.1 Parsing](https://www.w3.org/WAI/WCAG21/Understanding/parsing.html) requirement was removed from WCAG.
However, the Checker will report an issue against another accessibility requirement when it detects it causes an accessibility issue.

</script></mark-down>
<!-- End main panel -->
<!-- This is where the rule id is injected -->
Expand All @@ -80,7 +83,7 @@ <h3 id="ruleMessage"></h3>

### About this requirement

* [IBM 4.1.2 Name, role, value](https://www.ibm.com/able/requirements/requirements/#4_1_2)
<!-- Remove 4.1.1 * [IBM 4.1.2 Name, role, value](https://www.ibm.com/able/requirements/requirements/#4_1_2) -->
* [ARIA in HTML - Avoid specifying redundant roles](https://www.w3.org/TR/html-aria/#avoid-specifying-redundant-roles)

### Who does this affect?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ <h3 id="ruleMessage"></h3>
### About this requirement

* [IBM 3.3.2 Labels and Instructions](https://www.ibm.com/able/requirements/requirements/#3_3_2)
* [WebAIM - The accesskey attribute](https://webaim.org/techniques/keyboard/accesskey#spec)
* [ARIA practices - Developing a Keyboard Interface](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/)

### Who does this affect?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ <h3 id="ruleMessage"></h3>
<button type="button" name="testButton1" id="button1" accesskey="a">Accept</button>
<button type="button" name="testButton2" id="button2" accesskey="r">Reject</button>
```
Note: The [4.1.1 Parsing](https://www.w3.org/WAI/WCAG21/Understanding/parsing.html) requirement was removed from WCAG.
However, the Checker will report an issue against another accessibility requirement when it detects it causes an accessibility issue.

</script></mark-down>
<!-- End main panel -->
Expand All @@ -71,7 +73,9 @@ <h3 id="ruleMessage"></h3>

### About this requirement

* [IBM 4.1.1 Parsing](https://www.ibm.com/able/requirements/requirements/#4_1_1)
<!-- * [IBM 4.1.1 Parsing](https://www.ibm.com/able/requirements/requirements/#4_1_1) -->
* [WebAIM - The accesskey attribute](https://webaim.org/techniques/keyboard/accesskey#spec)
* [ARIA practices - Developing a Keyboard Interface](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/)

### Who does this affect?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ <h3 id="ruleMessage"></h3>

### What to do

Replace deprecated elements and attributes with those preferred in the current version of the specification.
* Replace deprecated elements and attributes with those preferred in the current version of the specification.

Note: The [4.1.1 Parsing](https://www.w3.org/WAI/WCAG21/Understanding/parsing.html) requirement was removed from WCAG.
However, the Checker will report an issue against another accessibility requirement when it detects it causes an accessibility issue.

</script></mark-down>
<!-- End main panel -->
<!-- This is where the rule id is injected -->
Expand All @@ -77,7 +80,7 @@ <h3 id="ruleMessage"></h3>

### About this requirement

* [IBM 4.1.1 Parsing](https://www.ibm.com/able/requirements/requirements/#4_1_1)
<!-- * [IBM 4.1.1 Parsing](https://www.ibm.com/able/requirements/requirements/#4_1_1) -->
* [HTML 5 - Obsolete Features](https://dev.w3.org/html5/pf-summary/obsolete.html)

### Who does this affect?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h3 id="ruleMessage"></h3>

### What to do

* For each element with an `id` attribute, provide a unique, non-empty value.
* For each element with an `id` attribute, provide a unique, non-empty value.

For example:

Expand All @@ -64,6 +64,9 @@ <h1 id="news">Breaking news</h1>
</div>
```

Note: The [4.1.1 Parsing](https://www.w3.org/WAI/WCAG21/Understanding/parsing.html) requirement was removed from WCAG.
However, the Checker will report an issue against another accessibility requirement when it detects it causes an accessibility issue.

</script></mark-down>
<!-- End main panel -->
<!-- This is where the rule id is injected -->
Expand All @@ -75,13 +78,13 @@ <h1 id="news">Breaking news</h1>

### About this requirement

* [IBM 4.1.1 Parsing ](https://www.ibm.com/able/requirements/requirements/#4_1_1)
* [WCAG technique H93](https://www.w3.org/WAI/WCAG21/Techniques/html/H93)
* [WCAG technique F77](https://www.w3.org/WAI/WCAG21/Techniques/failures/F77)
<!-- Remove 4.1.1 * [IBM 4.1.1 Parsing ](https://www.ibm.com/able/requirements/requirements/#4_1_1) -->
* [WCAG technique H93 - Ensuring that ID attributes are unique on a Web page](https://www.w3.org/WAI/WCAG21/Techniques/html/H93)
* [WCAG technique F77 - Failure due to duplicate values of type ID](https://www.w3.org/WAI/WCAG21/Techniques/failures/F77)

### Who does this affect?

* People using a screen reader, including blind, low vision and neurodivergent people
* People using a screen reader, including blind, low vision, and neurodivergent people

</script></mark-down>
<!-- End side panel -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ export let aria_attribute_deprecated: Rule = {
}
},
rulesets: [{
"id": ["IBM_Accessibility", "WCAG_2_1", "WCAG_2_0"],
"num": ["4.1.1"],
"id": ["IBM_Accessibility"],
"num": ["ARIA"],
"level": eRulePolicy.RECOMMENDATION,
"toolkitLevel": eToolkitLevel.LEVEL_ONE
"toolkitLevel": eToolkitLevel.LEVEL_THREE
}],
act: [],
run: (context: RuleContext, options?: {}, contextHierarchies?: RuleContextHierarchy): RuleResult | RuleResult[] => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ export let aria_role_redundant: Rule = {
}
},
rulesets: [{
"id": ["IBM_Accessibility", "WCAG_2_1", "WCAG_2_0"],
"num": ["4.1.1"],
"id": ["IBM_Accessibility"],
"num": ["ARIA"],
"level": eRulePolicy.RECOMMENDATION,
"toolkitLevel": eToolkitLevel.LEVEL_FOUR
"toolkitLevel": eToolkitLevel.LEVEL_THREE
}],
act: [],
run: (context: RuleContext, options?: {}, contextHierarchies?: RuleContextHierarchy): RuleResult | RuleResult[] => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export let element_accesskey_unique: Rule = {
}
},
rulesets: [{
"id": ["IBM_Accessibility", "WCAG_2_1", "WCAG_2_0"],
"num": ["4.1.1"],
"id": ["IBM_Accessibility"],
"num": ["HTML"],
"level": eRulePolicy.VIOLATION,
"toolkitLevel": eToolkitLevel.LEVEL_THREE
}],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ export let element_attribute_deprecated: Rule = {
}
},
rulesets: [{
"id": ["IBM_Accessibility", "WCAG_2_1", "WCAG_2_0"],
"num": ["4.1.1"],
"id": ["IBM_Accessibility"],
"num": ["HTML"],
"level": eRulePolicy.RECOMMENDATION,
"toolkitLevel": eToolkitLevel.LEVEL_ONE
"toolkitLevel": eToolkitLevel.LEVEL_THREE
}],
act: [],
run: (context: RuleContext, options?: {}, contextHierarchies?: RuleContextHierarchy): RuleResult | RuleResult[] => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export let element_id_unique: Rule = {
}
},
rulesets: [{
"id": ["IBM_Accessibility", "WCAG_2_1", "WCAG_2_0"],
"num": ["4.1.1"],
"id": ["IBM_Accessibility"],
"num": ["HTML"],
"level": eRulePolicy.VIOLATION,
"toolkitLevel": eToolkitLevel.LEVEL_THREE
}],
Expand Down
7 changes: 4 additions & 3 deletions accessibility-checker-engine/src/v4/rulesets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@ const summaries = {
"3.3.2": "Labels or instructions are provided when content requires user input.",
"3.3.3": "If an input error is automatically detected and suggestions for correction are known, then the suggestions are provided to the user, unless it would jeopardize the security or purpose of the content.",
"3.3.4": "For content that cause legal commitments or financial transactions for the user to occur, that modify or delete user-controllable data in data storage systems, or that submit user test responses, the user can reverse, correct, or confirm the action.",
"4.1.1": "In content implemented using markup languages, elements have complete start and end tags, elements are nested according to their specifications, elements do not contain duplicate attributes, and any IDs are unique, except where the specifications allow these features.",
"4.1.2": "For all user interface components (including, but not limited to: form elements, links and components generated by scripts), the name and role can be programmatically determined; states, properties, and values that can be set by the user can be programmatically set; and notification of changes to these items is available to user agents, including assistive technologies.",
"4.1.3": "In content implemented using markup languages, status messages can be programmatically determined through role or properties such that they can be presented to the user by assistive technologies without receiving focus.",
}
"HTML": "The HTML specification issues that cause accessibility issues may be covered by other rules and will be reported under those accessibility requirements. However, some non-conforming HTML specification issues are reported.",
"ARIA": "The ARIA specification issues that cause accessibility issues may be covered by other rules and will be reported under those accessibility requirements. However, some non-conforming ARIA specification issues are reported.",
}

export let a11yRulesets: Guideline[] = [
// {
Expand Down Expand Up @@ -108,7 +109,7 @@ export let a11yRulesets: Guideline[] = [
description: "Rules for WCAG 2.1 AA plus additional IBM checklist supplemental requirements.",
// This ruleset has all 2.0 and 2.1 checkpoints that are A or AA
checkpoints: SCs
.filter(sc => (sc.level === "A" || sc.level === "AA") && (sc.wcagType === "2.0" || sc.wcagType === "2.1"))
.filter(sc => (sc.level === "A" || sc.level === "AA" || sc.level === "NA") && (sc.wcagType === "2.0" || sc.wcagType === "2.1" || sc.wcagType === "2.2" || sc.wcagType === "NA"))
.map(sc => ({
num: sc.num,
scId: sc.scId,
Expand Down
24 changes: 24 additions & 0 deletions accessibility-checker-engine/src/v4/sc-urls.json
Original file line number Diff line number Diff line change
Expand Up @@ -934,5 +934,29 @@
"handle": "Status Messages",
"level": "AA",
"wcagType": "2.1"
},
"HTML": {
"num": "HTML",
"url": "https://html.spec.whatwg.org/multipage/",
"scId": [],
"scAltId": [],
"test": "",
"howToMeetUrl": "https://html.spec.whatwg.org/multipage/",
"understandingUrl": "https://html.spec.whatwg.org/multipage/",
"handle": "HTML Messages",
"level": "NA",
"wcagType": "NA"
},
"ARIA": {
"num": "ARIA",
"url": "https://w3c.github.io/aria/",
"scId": [],
"scAltId": [],
"test": "",
"howToMeetUrl": "https://w3c.github.io/aria/",
"understandingUrl": "https://w3c.github.io/aria/",
"handle": "ARIA Messages",
"level": "NA",
"wcagType": "NA"
}
}

0 comments on commit e124556

Please sign in to comment.