pour-engine 1.11.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/config/project.config.js
CHANGED
package/engine/COVERAGE.md
CHANGED
|
@@ -111,7 +111,7 @@ meaning that only a person can settle, even where a rule decides most real pages
|
|
|
111
111
|
|
|
112
112
|
| SC | Name | Level | Coverage | Rules |
|
|
113
113
|
|---|---|---|---|---|
|
|
114
|
-
| 4.1.2 | [Name, Role, Value](https://www.w3.org/WAI/WCAG22/Understanding/name-role-value.html) | A | Partially automated | input-image-alt, form-label, link-name, aria-attr-valid, aria-field-name, aria-hidden-focus, aria-valid-refs, button-name, dialog-name, frame-title, label-for-valid, nested-interactive, role-required-aria, valid-role |
|
|
114
|
+
| 4.1.2 | [Name, Role, Value](https://www.w3.org/WAI/WCAG22/Understanding/name-role-value.html) | A | Partially automated | input-image-alt, form-label, link-name, aria-allowed-attr, aria-attr-valid, aria-field-name, aria-hidden-focus, aria-valid-refs, button-name, dialog-name, frame-title, label-for-valid, nested-interactive, role-required-aria, valid-role |
|
|
115
115
|
| 4.1.3 | [Status Messages](https://www.w3.org/WAI/WCAG22/Understanding/status-messages.html) | AA | Manual review | — |
|
|
116
116
|
|
|
117
117
|
**Totals:** 30 partially automated · 56 manual — with 74 rules.
|
package/engine/rules/index.js
CHANGED
|
@@ -42,10 +42,13 @@ import audioControl from './wcag/1.4.2-audio-control.js';
|
|
|
42
42
|
import pauseStopHide from './wcag/2.2.2-pause-stop-hide.js';
|
|
43
43
|
import mediaCaptions from './wcag/1.2.2-media-captions.js';
|
|
44
44
|
import ariaAttrValid from './wcag/4.1.2-aria-attr-valid.js';
|
|
45
|
-
//
|
|
45
|
+
// Reviews rather than asserts: an unsupported ARIA attribute breaks an ARIA
|
|
46
46
|
// author MUST (1.2 §8.6) but is INERT, so name, role and value all survive
|
|
47
|
-
// and no success criterion fails
|
|
48
|
-
|
|
47
|
+
// and no success criterion provably fails. It sits in the WCAG scope anyway,
|
|
48
|
+
// because a real authoring error that a browser silently discards should not
|
|
49
|
+
// be invisible in a default audit, and it asks whether the state is real
|
|
50
|
+
// instead of claiming a failure (see the note in the rule file).
|
|
51
|
+
import ariaAllowedAttr from './wcag/4.1.2-aria-allowed-attr.js';
|
|
49
52
|
import ariaFieldName from './wcag/4.1.2-aria-field-name.js';
|
|
50
53
|
// Demoted to best-practice: prohibited-but-inert ARIA on a generic element
|
|
51
54
|
// fails no success criterion (see the note in the rule file).
|
|
@@ -3,19 +3,25 @@
|
|
|
3
3
|
// state or property". An unsupported attribute breaks that MUST, so this is a
|
|
4
4
|
// real, provable authoring error and the rule asserts it.
|
|
5
5
|
//
|
|
6
|
-
// It is
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
// is all 4.1.2 asks for.
|
|
6
|
+
// It is not, on its own, a WCAG failure. An unsupported attribute is INERT,
|
|
7
|
+
// measured in Chromium: aria-expanded on a button exposes expanded=true,
|
|
8
|
+
// while the same attribute on complementary, heading or list exposes no
|
|
9
|
+
// state at all. It is dropped, not misreported. So the role is still
|
|
10
|
+
// exposed, the name is still computed, and nothing is announced incorrectly.
|
|
11
|
+
// Name, role and value all survive, which is all 4.1.2 asks for.
|
|
13
12
|
//
|
|
14
13
|
// What CAN fail 4.1.2 is the thing underneath: if the element genuinely has
|
|
15
|
-
// the state the author reached for, that state is now invisible
|
|
16
|
-
// does is exactly what the DOM cannot establish
|
|
17
|
-
//
|
|
18
|
-
//
|
|
14
|
+
// the state the author reached for, that state is now invisible to a screen
|
|
15
|
+
// reader. Whether it does is exactly what the DOM cannot establish.
|
|
16
|
+
//
|
|
17
|
+
// So this sits in the WCAG scope and REVIEWS rather than asserts. It lived
|
|
18
|
+
// under best-practice before, which was defensible on the letter of 4.1.2
|
|
19
|
+
// and wrong in practice: teams act on what a tool marks as WCAG, so a real
|
|
20
|
+
// ARIA error that a browser silently discards went unseen in a default
|
|
21
|
+
// audit. Asserting a violation would state a criterion failure the browser
|
|
22
|
+
// does not actually cause; staying silent leaves a genuine authoring error
|
|
23
|
+
// unreported. Asking is the honest third option, and it is the one the
|
|
24
|
+
// engine is built around.
|
|
19
25
|
//
|
|
20
26
|
// Note "unsupported" is distinct from "prohibited" (§5.2.5), a separate
|
|
21
27
|
// category about naming that this rule does not cover.
|
|
@@ -34,9 +40,9 @@ const HANDLED_ELSEWHERE = new Set(['label', 'labelledby']);
|
|
|
34
40
|
export default {
|
|
35
41
|
id: 'aria-allowed-attr',
|
|
36
42
|
impact: 'moderate',
|
|
37
|
-
tags: ['
|
|
43
|
+
tags: ['wcag2a', 'wcag412'],
|
|
38
44
|
help: 'ARIA attributes must be supported by the element’s role',
|
|
39
|
-
helpUrl: 'https://www.w3.org/
|
|
45
|
+
helpUrl: 'https://www.w3.org/WAI/WCAG22/Understanding/name-role-value.html',
|
|
40
46
|
selector: '*',
|
|
41
47
|
visibleOnly: false,
|
|
42
48
|
evaluate(element) {
|
|
@@ -60,8 +66,8 @@ export default {
|
|
|
60
66
|
if (!disallowed.length) return { status: 'pass' };
|
|
61
67
|
const names = disallowed.map((n) => `aria-${n}`);
|
|
62
68
|
return {
|
|
63
|
-
status: '
|
|
64
|
-
message: `${names.join(', ')} is not supported on role "${role}", so the browser drops it and assistive technology never sees it. Nothing is announced wrongly, but nothing is announced at all.
|
|
69
|
+
status: 'incomplete',
|
|
70
|
+
message: `${names.join(', ')} is not supported on role "${role}", so the browser drops it and assistive technology never sees it. Nothing is announced wrongly, but nothing is announced at all. Does this element really have that state? If it does, it is invisible to a screen reader and this is a 4.1.2 failure. If it does not, the attribute is simply stray and no one is affected.`,
|
|
65
71
|
fix: `Move ${names.join('/')} to the element whose role supports it, usually the control that toggles this one, or remove it if the element has no such state. Adding a role to this element to make the attribute legal is rarely right: the host language restricts which roles each element may take.`,
|
|
66
72
|
};
|
|
67
73
|
},
|
package/package.json
CHANGED