ultra11y 5.47.0 → 5.48.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/.claude-plugin/marketplace.json +3 -3
- package/.claude-plugin/plugin.json +2 -2
- package/.codex-plugin/plugin.json +4 -4
- package/.opencode/plugins/ultra11y.js +1 -1
- package/README.md +28 -9
- package/dist/playwright.mjs +14 -4
- package/package.json +6 -2
- package/scripts/build-pack-rgaa.mjs +46 -2
- package/scripts/build-standards.mjs +1 -1
- package/scripts/record-rgaa-golden.mjs +70 -0
- package/scripts/ultra11y.mjs +1454 -509
- package/skills/review-a11y/SKILL.md +1 -1
- package/skills/review-a11y/scripts/ultra11y.mjs +1454 -509
- package/skills/ultra11y/SKILL.md +34 -16
- package/skills/ultra11y/references/act.md +5 -6
- package/skills/ultra11y/references/ci.md +6 -0
- package/skills/ultra11y/references/claude-code-report.md +40 -8
- package/skills/ultra11y/references/criteria.md +1 -1
- package/skills/ultra11y/references/judgment.md +42 -13
- package/skills/ultra11y/references/orchestrators.md +7 -2
- package/skills/ultra11y/references/rgaa-automation.md +20 -20
- package/skills/ultra11y/references/rgaa-review.md +127 -0
- package/skills/ultra11y/references/verify.md +8 -2
- package/skills/ultra11y/scripts/ultra11y.mjs +1454 -509
- package/skills/ultra11y/templates/gitlab-ci.yml +1 -1
- package/src/act.ts +1 -2
- package/src/adjudicate-subjects.ts +793 -74
- package/src/adjudicate.ts +60 -9
- package/src/audit.ts +51 -3
- package/src/axe-map.ts +1 -1
- package/src/cli.ts +76 -16
- package/src/data/standards/rgaa.json +133 -16
- package/src/data/wcag.json +1 -1
- package/src/name.ts +11 -0
- package/src/output.ts +35 -19
- package/src/probes.ts +14 -4
- package/src/refute.ts +29 -3
- package/src/rules/forms.ts +17 -0
- package/src/rules/headings.ts +11 -2
- package/src/rules/links.ts +21 -6
- package/src/rules/mandatory.ts +52 -6
- package/src/rules/presentation.ts +4 -0
- package/src/rules/rendered.ts +73 -2
- package/src/scan-local.ts +84 -13
- package/src/site-data.ts +72 -2
- package/src/types.ts +1 -1
- package/src/verify.ts +12 -1
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
"name": "maxgfr",
|
|
5
5
|
"url": "https://github.com/maxgfr"
|
|
6
6
|
},
|
|
7
|
-
"description": "Accessibility tooling for coding agents: WCAG 2.2 AA
|
|
7
|
+
"description": "Accessibility tooling for coding agents: RGAA 4.1.2, the French State's standard, on a WCAG 2.2 AA core — engine-decided where it can be, agent-adjudicated and counter-checked where it must be.",
|
|
8
8
|
"plugins": [
|
|
9
9
|
{
|
|
10
10
|
"name": "ultra11y",
|
|
11
11
|
"source": "./",
|
|
12
|
-
"description": "
|
|
13
|
-
"version": "5.
|
|
12
|
+
"description": "RGAA 4.1.2 accessibility audits on a WCAG 2.2 AA core: automatic review before commit, push and pull request, plus dated, evidenced Markdown, HTML and per-page conformance reports in Claude Code.",
|
|
13
|
+
"version": "5.48.0",
|
|
14
14
|
"author": { "name": "maxgfr" },
|
|
15
15
|
"homepage": "https://github.com/SocialGouv/ultra11y",
|
|
16
16
|
"repository": "https://github.com/SocialGouv/ultra11y",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ultra11y",
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "5.
|
|
3
|
+
"description": "RGAA 4.1.2 accessibility audits, the French State's standard, on a WCAG 2.2 AA core: automatic review before commit, push and pull request, plus dated, evidenced Markdown, HTML and per-page conformance reports. Never declares conforming what it has not verified.",
|
|
4
|
+
"version": "5.48.0",
|
|
5
5
|
"author": { "name": "maxgfr" },
|
|
6
6
|
"homepage": "https://github.com/SocialGouv/ultra11y",
|
|
7
7
|
"repository": "https://github.com/SocialGouv/ultra11y",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ultra11y",
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "5.
|
|
3
|
+
"description": "RGAA 4.1.2 accessibility audits, the French State's standard, on a WCAG 2.2 AA core: automatic review before commit, push and pull request, plus dated, evidenced Markdown, HTML and per-page conformance reports. Never declares conforming what it has not verified.",
|
|
4
|
+
"version": "5.48.0",
|
|
5
5
|
"author": { "name": "maxgfr", "url": "https://github.com/maxgfr" },
|
|
6
6
|
"homepage": "https://github.com/SocialGouv/ultra11y",
|
|
7
7
|
"repository": "https://github.com/SocialGouv/ultra11y",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"skills": "./skills/",
|
|
11
11
|
"interface": {
|
|
12
12
|
"displayName": "ultra11y",
|
|
13
|
-
"shortDescription": "WCAG 2.2 AA review before you commit, push or open a PR.",
|
|
14
|
-
"longDescription": "
|
|
13
|
+
"shortDescription": "RGAA 4.1.2 / WCAG 2.2 AA review before you commit, push or open a PR.",
|
|
14
|
+
"longDescription": "Accessibility audits against RGAA 4.1.2, the French State's standard, on a WCAG 2.2 AA core: a dated conformance report, the 106-criterion grid, a backlog and tickets, and a review of exactly the code under change. A zero-dependency static engine, scored against the W3C ACT corpus, plus a browser scan and the agent's judgment on what a static pass cannot decide, counter-checked by check/verify gates. It never declares conforming what it has not verified.",
|
|
15
15
|
"developerName": "maxgfr",
|
|
16
16
|
"category": "Productivity",
|
|
17
17
|
"capabilities": ["Read", "Write"],
|
|
@@ -27,7 +27,7 @@ import { fileURLToPath } from "node:url";
|
|
|
27
27
|
// Ownership marker: `ultra11y install --opencode` refuses to overwrite a plugin file that
|
|
28
28
|
// does not carry it, so a user's own ultra11y.js is never clobbered.
|
|
29
29
|
const ULTRA11Y_OPENCODE_PLUGIN = "ULTRA11Y_OPENCODE_PLUGIN";
|
|
30
|
-
const ULTRA11Y_PLUGIN_VERSION = "5.
|
|
30
|
+
const ULTRA11Y_PLUGIN_VERSION = "5.48.0";
|
|
31
31
|
|
|
32
32
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
33
33
|
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# ultra11y
|
|
1
|
+
# ultra11y — RGAA 4.1.2 accessibility audits, on a WCAG 2.2 AA core
|
|
2
2
|
|
|
3
3
|
[](https://github.com/SocialGouv/ultra11y/actions/workflows/ci.yml)
|
|
4
4
|
[](https://www.npmjs.com/package/ultra11y)
|
|
@@ -25,9 +25,9 @@ pull request — you never type the skill's name:
|
|
|
25
25
|
`npx ultra11y install --all`, and `npx ultra11y status` to check what is actually wired.
|
|
26
26
|
Full details, thresholds and off-switches under [Install](#install).</sub>
|
|
27
27
|
|
|
28
|
-
> Audit
|
|
28
|
+
> Audit a site against **RGAA 4.1.2**, the French State's accessibility standard (*référentiel général d'amélioration de l'accessibilité*), on its **WCAG 2.2 AA** core: a dated conformance report, the 106-criterion grid, a backlog and tickets — or author/review accessible markup without regressions. It never declares conforming what it has not verified. A [skills.sh](https://skills.sh) agent skill: a deterministic, zero-dependency static engine **plus** the agent's judgment, with `check`/`verify` gates against hallucinated non-conformities. **The central deliverable is the auditor conformance block** — theme, criterion + official wording, test(s), WCAG mapping + level, finding, expected state, verification, `file:line` occurrences — rendered identically by the `report` (compliance doc), the `prd` backlog and the GitHub issues, in the active standard's vocabulary and **in your language** (`--lang auto` follows the conversation/repo). **RGAA ships first; WCAG is the worldwide core it maps onto, and other country standards are pluggable in-repo packs.**
|
|
29
29
|
|
|
30
|
-
ultra11y is built around an honest **division of labour**. Automated tools only catch a fraction of accessibility problems, so the engine does the *mechanical* work —
|
|
30
|
+
ultra11y is built around an honest **division of labour**. Automated tools only catch a fraction of accessibility problems, so the engine does the *mechanical* work — 95 machine-detectable static checks tied to the WCAG 2.2 success criteria — and is explicit about everything it can't decide statically. What it can't, the **AI agent adjudicates** (statically, from the evidence, gated by `verify`/`check`) — not a deferral to a human:
|
|
31
31
|
|
|
32
32
|
- **Automatable (engine):** missing `alt`/`lang`/`title`, unlabeled fields, empty links/buttons, icon-only controls, iframes without title, tables without headers, heading-level skips, empty/dangling headings & labels, duplicate ids, invalid/broken ARIA, positive `tabindex`, autoplay/timed-refresh/`blink`/`marquee` media…
|
|
33
33
|
- **Agent judgment (gated):** alt-text relevance, link purpose in context, reading/tab order, caption accuracy — the agent rules on these via `verify --manual` → `--apply`, each verdict carrying a justification (or a groundable NC), never a silent "conforming".
|
|
@@ -318,19 +318,19 @@ a test). See [`CONTRIBUTING.md`](CONTRIBUTING.md) and `skills/ultra11y/reference
|
|
|
318
318
|
|
|
319
319
|
### What RGAA automation actually covers
|
|
320
320
|
|
|
321
|
-
The engine's
|
|
321
|
+
The engine's 95 rules are not 95 RGAA criteria: several rules can evidence the same official
|
|
322
322
|
test, and a rule can detect a useful symptom without exhausting the criterion's alternatives,
|
|
323
323
|
exceptions or relevance checks. The generated contract classifies all **258 official RGAA
|
|
324
324
|
tests**:
|
|
325
325
|
|
|
326
|
-
- **
|
|
326
|
+
- **28 `static` tests across 20 criteria:** `1.1`, `2.1`, `5.7`, `5.8`, `6.1`, `6.2`, `7.1`,
|
|
327
327
|
`8.2`, `8.3`, `8.4`, `8.5`, `8.10`, `9.3`, `10.1`, `10.12`, `11.1`, `11.5`,
|
|
328
328
|
`11.6`, `11.8`, `11.9`.
|
|
329
329
|
- **3 `rendered` tests across 3 criteria:** `1.1`, `8.1`, `10.7`.
|
|
330
|
-
- Those two tiers cover **
|
|
330
|
+
- Those two tiers cover **22 distinct criteria that can produce a deterministic `NC`**;
|
|
331
331
|
`1.1` belongs to both.
|
|
332
|
-
- **
|
|
333
|
-
|
|
332
|
+
- **51 criteria receive a normative engine signal:** 22 have at least one decisive rule and
|
|
333
|
+
42 receive candidate evidence, with overlap. One additional criterion receives only an
|
|
334
334
|
advisory signal. A candidate is forwarded to adjudication and never changes a verdict by
|
|
335
335
|
itself.
|
|
336
336
|
- Only **8.3 and 8.5** may earn `C` from a complete silent measurement. For the other
|
|
@@ -340,7 +340,7 @@ tests**:
|
|
|
340
340
|
glossary names five, and covers “presentation built out of spaces” with two heuristics —
|
|
341
341
|
every one of them a deliberate under-report, which is the safe direction for a finding and
|
|
342
342
|
the wrong one for a conformity.
|
|
343
|
-
- The remaining **
|
|
343
|
+
- The remaining **227 `judgment` tests across 92 criteria** all enter the AI worklist,
|
|
344
344
|
including an apparently absent subject whose `NA` still needs confirmation. Overall,
|
|
345
345
|
**104 of 106 criteria require adjudication to earn `C`**.
|
|
346
346
|
|
|
@@ -564,6 +564,25 @@ without changing a workflow. See `references/ci.md`.
|
|
|
564
564
|
|
|
565
565
|
The skill (`skills/ultra11y/SKILL.md` + `references/`) teaches the agent when and how to run these, how to complete the manual criteria, and the native-first authoring doctrine.
|
|
566
566
|
|
|
567
|
+
## Démo RGAA : le refuge
|
|
568
|
+
|
|
569
|
+
Le dépôt contient un [site de démonstration local](demos/refuge-rgaa/README.txt)
|
|
570
|
+
avec **59 scénarios volontairement non conformes et 59 témoins séparés**.
|
|
571
|
+
Il prolonge la démo Microsoft Edge, conservée avec sa licence et sa provenance
|
|
572
|
+
dans [`demos/microsoft-edge-a11y`](demos/microsoft-edge-a11y).
|
|
573
|
+
|
|
574
|
+
```sh
|
|
575
|
+
pnpm run demo:refuge # Python 3 ; http://127.0.0.1:8765/
|
|
576
|
+
pnpm run demo:refuge:check # ressources, liens, critères et séparation des témoins
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
Les pages et les médias sont fournis : aucune génération ni dépendance Python
|
|
580
|
+
supplémentaire n’est nécessaire pour visiter le site. Le
|
|
581
|
+
[guide de la démo](demos/refuge-rgaa/README.txt) décrit la reconstruction,
|
|
582
|
+
les tests navigateur et les commandes d’audit. Le catalogue et les verdicts
|
|
583
|
+
attendus restent hors du site audité ; ils ne constituent pas des détections
|
|
584
|
+
mesurées de l’outil. Cette démo ne prétend pas couvrir les 106 critères du RGAA.
|
|
585
|
+
|
|
567
586
|
## Development
|
|
568
587
|
|
|
569
588
|
```sh
|
package/dist/playwright.mjs
CHANGED
|
@@ -268,8 +268,16 @@ function focusSetupExpr(scope = "", maxFocusables = PROBE_DEFAULTS.maxFocusables
|
|
|
268
268
|
// the probe reports \xAB no visible change \xBB \u2014 a finding rather than a silent pass. That is the
|
|
269
269
|
// safe direction: this tool would rather name something a human can dismiss than clear
|
|
270
270
|
// something nobody will look at again.
|
|
271
|
-
|
|
272
|
-
|
|
271
|
+
// THE INDICATOR MAY NOT BE ON THE ELEMENT. RGAA 10.7.1 accepts \xAB un style du focus d\xE9fini par
|
|
272
|
+
// l'auteur [qui] est visible \xBB, and authors put it on the wrapper (:focus-within outlining a
|
|
273
|
+
// card), on the next sibling (input:focus + .label \u2014 the visually-hidden checkbox pattern), or
|
|
274
|
+
// in a property the first version did not read (transform, text-shadow, a side border). Each
|
|
275
|
+
// was a decisive \xAB focus not visible \xBB on a visible indicator. So the parent, the grandparent
|
|
276
|
+
// and the next sibling are compared too, and the property list is wider.
|
|
277
|
+
// (No backticks in this comment: it lives inside a template literal.)
|
|
278
|
+
const __style = (e, pseudo) => { const s = getComputedStyle(e, pseudo); if (s.animationName && s.animationName !== 'none') return 'animated'; return [s.outlineStyle, s.outlineWidth, s.outlineColor, s.boxShadow, s.borderColor, s.borderTopWidth, s.borderBottomWidth, s.borderLeftWidth, s.borderRightWidth, s.backgroundColor, s.backgroundImage, s.color, s.textDecorationLine, s.textShadow, s.transform, s.opacity, s.filter].join('|'); };
|
|
279
|
+
const __ctx = (e) => [e.parentElement, e.parentElement && e.parentElement.parentElement, e.nextElementSibling].map((x) => (x ? __style(x, null) : '-')).join('~');
|
|
280
|
+
const snap = (e) => [__style(e, null), __style(e, '::before'), __style(e, '::after')].join('#') + '@' + __ctx(e);
|
|
273
281
|
// Visually-hidden radio/checkbox \u2192 measure its visible label/proxy, not the input.
|
|
274
282
|
const proxyFor = (e) => {
|
|
275
283
|
const type = (e.getAttribute('type') || '').toLowerCase();
|
|
@@ -325,8 +333,10 @@ var FOCUS_CHECK_PROBE = `(() => {
|
|
|
325
333
|
// (No backticks in this comment: it lives inside a template literal.)
|
|
326
334
|
// Same three boxes, same animation exclusion as pass 1 -- an animating box contributes a
|
|
327
335
|
// constant on both sides, so it can never fabricate a difference (nor hide a real one).
|
|
328
|
-
const
|
|
329
|
-
const
|
|
336
|
+
const sty = (el, pseudo) => { const s = getComputedStyle(el, pseudo); if (s.animationName && s.animationName !== 'none') return 'animated'; return [s.outlineStyle, s.outlineWidth, s.outlineColor, s.boxShadow, s.borderColor, s.borderTopWidth, s.borderBottomWidth, s.borderLeftWidth, s.borderRightWidth, s.backgroundColor, s.backgroundImage, s.color, s.textDecorationLine, s.textShadow, s.transform, s.opacity, s.filter].join('|'); };
|
|
337
|
+
const st = (pseudo) => sty(proxy, pseudo);
|
|
338
|
+
const ctx = [proxy.parentElement, proxy.parentElement && proxy.parentElement.parentElement, proxy.nextElementSibling].map((x) => (x ? sty(x, null) : '-')).join('~');
|
|
339
|
+
const now = [st(null), st('::before'), st('::after')].join('#') + '@' + ctx;
|
|
330
340
|
return { key: key, changed: now !== rec.rest, selector: rec.sel, html: rec.html };
|
|
331
341
|
})()`;
|
|
332
342
|
var FOCUS_OBSCURED_PROBE = `(() => { ${PRELUDE}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ultra11y",
|
|
3
|
-
"version": "5.
|
|
4
|
-
"description": "Audit
|
|
3
|
+
"version": "5.48.0",
|
|
4
|
+
"description": "Audit d'accessibilité RGAA 4.1.2, le référentiel de l'État : rapport daté, grille des 106 critères, backlog et tickets. Moteur statique, navigateur et jugement IA contre-vérifié. Il ne déclare jamais conforme ce qu'il n'a pas vérifié. Socle WCAG 2.2 AA.",
|
|
5
5
|
"homepage": "https://socialgouv.github.io/ultra11y/",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"packageManager": "pnpm@10.33.0",
|
|
@@ -71,6 +71,10 @@
|
|
|
71
71
|
"build:site": "node scripts/build-site.mjs",
|
|
72
72
|
"check:site": "node scripts/build-site.mjs --check",
|
|
73
73
|
"demo": "node scripts/ultra11y.mjs audit tests/fixtures/non-conforming/bad.html --out /tmp/ultra11y-demo --json > /dev/null && node scripts/ultra11y.mjs report --in /tmp/ultra11y-demo/audit-latest.json --out /tmp/ultra11y-demo && node scripts/ultra11y.mjs check --report /tmp/ultra11y-demo/wcag-*.md && node scripts/ultra11y.mjs criteria --list",
|
|
74
|
+
"demo:refuge": "python3 demos/refuge-rgaa/serve.py",
|
|
75
|
+
"demo:refuge:build": "python3 demos/refuge-rgaa/build.py",
|
|
76
|
+
"demo:refuge:check": "python3 demos/refuge-rgaa/verify-files.py",
|
|
77
|
+
"demo:refuge:test": "node demos/refuge-rgaa/verify-browser.mjs",
|
|
74
78
|
"release": "semantic-release",
|
|
75
79
|
"build:icons": "node scripts/build-extension-icons.mjs"
|
|
76
80
|
},
|
|
@@ -150,6 +150,9 @@ const RULE_SC = {
|
|
|
150
150
|
"placeholder-as-label": ["4.1.2"], "positive-tabindex": ["2.4.3"], "redundant-aria": ["4.1.2"], "select-has-option": ["4.1.2"],
|
|
151
151
|
"skip-link-target-missing": ["2.4.1"], "bypass-blocks-missing": ["2.4.1"], "sortable-header-no-aria-sort": ["1.3.1"], "status-message-not-assertive": ["4.1.3"],
|
|
152
152
|
"table-caption-missing": ["1.3.1"], "table-empty-data-cell": ["1.3.1"], "title-missing-empty": ["2.4.2"],
|
|
153
|
+
"link-label-in-name-mismatch": ["2.5.3"],
|
|
154
|
+
"invalid-aria-attr": ["4.1.2"], "invalid-aria-value": ["4.1.2"], "aria-required-attr": ["4.1.2"], "aria-prohibited-attr": ["4.1.2"],
|
|
155
|
+
"dl-structure": ["1.3.1"], "on-input-context-change": ["3.2.2"],
|
|
153
156
|
};
|
|
154
157
|
|
|
155
158
|
// ---- Judgment criteria: RGAA wordings that ask MORE than their WCAG mapping ----
|
|
@@ -171,6 +174,11 @@ const JUDGMENT_CRITERIA = {
|
|
|
171
174
|
"4.10": "« contrôlable par l’utilisateur » — l’arrêt/le réglage du son se constate au rendu, 1.4.2 ne prouve que l’absence d’autoplay détectable.",
|
|
172
175
|
"8.4": "« le code de langue est-il pertinent ? » — 3.1.1 ne vérifie que la présence et la validité syntaxique de `lang`, pas sa cohérence avec la langue réelle du contenu.",
|
|
173
176
|
"8.6": "« ce titre est-il pertinent ? » — 2.4.2 ne vérifie que la présence d’un `<title>` non vide.",
|
|
177
|
+
// Its tests are « static » because list-structure can PROVE a malformed list — but what they
|
|
178
|
+
// ask about is « les informations regroupées VISUELLEMENT sous forme de liste », and the list
|
|
179
|
+
// that fails them is the one drawn with no list markup at all. An absence of <ul> is not an
|
|
180
|
+
// absence of lists, so a clean or empty pass must never close 9.3 on its own.
|
|
181
|
+
"9.3": "« les informations regroupées visuellement sous forme de liste » — un regroupement visuel se constate à la lecture ; l’absence de <ul>/<ol>/<dl> ne prouve pas l’absence de liste.",
|
|
174
182
|
"13.3": "« version accessible du document en téléchargement » — aucune règle moteur ne peut ouvrir le document ; les CS mappés ne portent que sur la page.",
|
|
175
183
|
"13.4": "« cette version offre-t-elle la même information ? » — comparaison de deux documents, hors de portée d’un audit de la page.",
|
|
176
184
|
};
|
|
@@ -216,6 +224,9 @@ const RULE_TO_CRITERIA = {
|
|
|
216
224
|
// Theme 6 — links (6.2 link label)
|
|
217
225
|
"link-empty-name": ["6.2"], "icon-only-control-unnamed": ["6.2", "11.9"], "cross-icon-only-unnamed": ["11.9"],
|
|
218
226
|
"axe:link-name": ["6.2"],
|
|
227
|
+
// 6.1.5 — « pour chaque lien ayant un intitulé visible, le nom accessible du lien contient-il au
|
|
228
|
+
// moins l'intitulé visible ? ». The link half of label-in-name, which used to land on 7.1.
|
|
229
|
+
"link-label-in-name-mismatch": ["6.1"],
|
|
219
230
|
// Theme 7 — scripts/ARIA (7.1 AT-compat, 7.3 keyboard, 7.5 status messages)
|
|
220
231
|
"invalid-aria-role": ["7.1"], "aria-ref-missing-id": ["7.1"], "aria-required-children": ["7.1"],
|
|
221
232
|
"aria-hidden-focusable": ["7.1"], "redundant-aria": ["7.1"], "nested-interactive": ["7.1"],
|
|
@@ -235,6 +246,18 @@ const RULE_TO_CRITERIA = {
|
|
|
235
246
|
"axe:aria-valid-attr": ["7.1"], "axe:aria-valid-attr-value": ["7.1"], "axe:nested-interactive": ["7.1"],
|
|
236
247
|
"axe:aria-hidden-focus": ["7.1"], "axe:presentation-role-conflict": ["7.1"],
|
|
237
248
|
"axe:button-name": ["7.1"], "axe:input-button-name": ["7.1"],
|
|
249
|
+
// These fired, raised a WCAG 4.1.2 non-conformity, and reached NO RGAA criterion: their axe
|
|
250
|
+
// twins were mapped, the static rules never were. An unknown `aria-*` attribute and a value
|
|
251
|
+
// outside an ARIA attribute's grammar are also invalid code under the doctype (8.2.1, what the
|
|
252
|
+
// W3C checker reports); a missing required state or a prohibited name is evidence for 7.1.
|
|
253
|
+
// (aria-required-parent reports under 1.3.1, which 7.1 does not map — listing it would be inert.)
|
|
254
|
+
"invalid-aria-attr": ["7.1", "8.2"], "invalid-aria-value": ["7.1", "8.2"],
|
|
255
|
+
"aria-required-attr": ["7.1"], "aria-prohibited-attr": ["7.1"],
|
|
256
|
+
"axe:aria-command-name": ["7.1"], "axe:aria-tooltip-name": ["7.1"], "axe:aria-dialog-name": ["7.1"],
|
|
257
|
+
"axe:aria-meter-name": ["7.1"], "axe:aria-progressbar-name": ["7.1"],
|
|
258
|
+
// 7.4.1 — a <select> whose change navigates or submits is the criterion's textbook case. A
|
|
259
|
+
// candidate: the user may be warned by a text before it, which the rule cannot see.
|
|
260
|
+
"on-input-context-change": ["7.4"],
|
|
238
261
|
// Theme 8 — document (8.2 valid code, 8.3 default lang, 8.4 lang relevant, 8.5 title, 8.7/8.8 lang changes)
|
|
239
262
|
"duplicate-id": ["8.2"], "axe:duplicate-id": ["8.2"], "axe:duplicate-id-aria": ["8.2"], "axe:duplicate-id-active": ["8.2"],
|
|
240
263
|
"html-lang-missing": ["8.3"], "axe:html-has-lang": ["8.3"],
|
|
@@ -248,6 +271,10 @@ const RULE_TO_CRITERIA = {
|
|
|
248
271
|
"missing-main-landmark": ["9.2", "12.6"], "multiple-main-landmark": ["9.2", "12.6"], "axe:landmark-one-main": ["12.6"],
|
|
249
272
|
"nav-landmark-missing": ["9.2", "12.6"], "nav-landmark-unnamed": ["12.6"],
|
|
250
273
|
"list-structure": ["9.3"], "axe:list": ["9.3"], "axe:listitem": ["9.3"], "axe:definition-list": ["9.3"], "axe:dlitem": ["9.3"],
|
|
274
|
+
// The static twin of axe definition-list/dlitem, which were mapped while it was not.
|
|
275
|
+
"dl-structure": ["9.3"],
|
|
276
|
+
// 10.6 — axe's own « link distinguishable from surrounding text » check.
|
|
277
|
+
"axe:link-in-text-block": ["10.6"],
|
|
251
278
|
// Theme 10 — presentation (10.2 CSS-off content, 10.4 zoom, 10.7 focus, 10.11 reflow, 10.12 text-spacing)
|
|
252
279
|
"css-generated-content-informative": ["10.2"],
|
|
253
280
|
"meta-viewport-zoom-block": ["10.4"], "axe:meta-viewport": ["10.4"], "axe:meta-viewport-large": ["10.4"],
|
|
@@ -264,7 +291,11 @@ const RULE_TO_CRITERIA = {
|
|
|
264
291
|
"autocomplete-token-invalid": ["11.13"], "form-label-in-name-mismatch": ["11.9"],
|
|
265
292
|
"error-not-associated": ["11.10"], "aria-invalid-no-description": ["11.10"],
|
|
266
293
|
"axe:label": ["11.1"], "axe:form-field-multiple-labels": ["11.1"], "axe:select-name": ["11.1"], "axe:label-title-only": ["11.1"],
|
|
267
|
-
|
|
294
|
+
// An ARIA field (role=textbox, combobox, checkbox, switch…) with no accessible name at all has
|
|
295
|
+
// none of the label mechanisms 11.1.1 lists either.
|
|
296
|
+
"axe:aria-input-field-name": ["11.1"], "axe:aria-toggle-field-name": ["11.1"],
|
|
297
|
+
// (axe-core has no `fieldset` rule — the entry that stood here was inert.)
|
|
298
|
+
"axe:autocomplete-valid": ["11.13"],
|
|
268
299
|
// Theme 12 — navigation (12.7 skip link, 12.8 tab order, 12.9 keyboard trap)
|
|
269
300
|
"skip-link-target-missing": ["12.7"], "axe:skip-link": ["12.7"], "axe:bypass": ["12.7"],
|
|
270
301
|
// A page whose <nav> precedes content with no landmark, heading, button or in-page link at
|
|
@@ -298,11 +329,18 @@ const DECISIVE_RULE_TESTS = {
|
|
|
298
329
|
"2.1|iframe-title-missing": ["1"],
|
|
299
330
|
"6.2|link-empty-name": ["1"],
|
|
300
331
|
"6.2|axe:link-name": ["1"],
|
|
332
|
+
// A link whose only content is an icon with no name has no intitulé between <a> and </a> — the
|
|
333
|
+
// same failure as an empty link, and its only difference is the icon. (On 6.2 the rule only
|
|
334
|
+
// ever projects its LINK findings: a button finding carries WCAG 4.1.2, which 6.2 does not map.)
|
|
335
|
+
"6.2|icon-only-control-unnamed": ["1"],
|
|
336
|
+
"6.1|link-label-in-name-mismatch": ["5"],
|
|
301
337
|
"8.2|duplicate-id": ["1"],
|
|
302
338
|
"8.2|axe:duplicate-id": ["1"],
|
|
303
339
|
"8.2|axe:duplicate-id-aria": ["1"],
|
|
304
340
|
"8.2|axe:duplicate-id-active": ["1"],
|
|
305
341
|
"8.2|duplicate-attribute": ["1"],
|
|
342
|
+
"8.2|invalid-aria-attr": ["1"],
|
|
343
|
+
"8.2|invalid-aria-value": ["1"],
|
|
306
344
|
"8.3|document-language-missing": ["1"],
|
|
307
345
|
"8.4|axe:html-lang-valid": ["1"],
|
|
308
346
|
"8.4|lang-invalid": ["1"],
|
|
@@ -321,7 +359,8 @@ const DECISIVE_RULE_TESTS = {
|
|
|
321
359
|
"11.1|axe:label": ["1"],
|
|
322
360
|
"11.1|axe:select-name": ["1"],
|
|
323
361
|
"11.1|control-label-missing": ["1"],
|
|
324
|
-
"11.
|
|
362
|
+
"11.1|axe:aria-input-field-name": ["1"],
|
|
363
|
+
"11.1|axe:aria-toggle-field-name": ["1"],
|
|
325
364
|
"11.6|fieldset-legend-missing": ["1"],
|
|
326
365
|
"11.9|form-button-empty-name": ["1"],
|
|
327
366
|
"11.9|form-label-in-name-mismatch": ["2"],
|
|
@@ -395,6 +434,11 @@ const CANDIDATE_RULE_TESTS = {
|
|
|
395
434
|
"12.7|skip-link-target-missing": ["2"],
|
|
396
435
|
"12.8|axe:tabindex": ["1"],
|
|
397
436
|
"12.8|positive-tabindex": ["1"],
|
|
437
|
+
"7.4|on-input-context-change": ["1"],
|
|
438
|
+
// Candidate, not decisive like its axe twins: in a component a <dt>/<dd> is routinely rendered
|
|
439
|
+
// into a parent component's <dl> that this file cannot see.
|
|
440
|
+
"9.3|dl-structure": ["3"],
|
|
441
|
+
"10.6|axe:link-in-text-block": ["1"],
|
|
398
442
|
"13.1|meta-refresh-redirect": ["2"],
|
|
399
443
|
"13.8|axe:blink": ["2"],
|
|
400
444
|
"13.8|axe:marquee": ["1"],
|
|
@@ -664,7 +664,7 @@ const RULE_SC_COVERAGE = {
|
|
|
664
664
|
"2.4.3": ["positive-tabindex"],
|
|
665
665
|
"2.4.7": ["rendered-focus-not-visible"],
|
|
666
666
|
"2.4.4": ["link-empty-name", "icon-only-control-unnamed"],
|
|
667
|
-
"2.5.3": ["label-in-name-mismatch", "form-label-in-name-mismatch"],
|
|
667
|
+
"2.5.3": ["label-in-name-mismatch", "form-label-in-name-mismatch", "link-label-in-name-mismatch"],
|
|
668
668
|
"3.2.2": ["on-input-context-change"],
|
|
669
669
|
"3.3.8": ["credential-entry-blocked"],
|
|
670
670
|
"3.1.1": ["html-lang-missing", "document-language-missing", "html-lang-xml-lang-mismatch", "lang-invalid"],
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Re-record the RENDERED captures of the RGAA golden pages (tests/fixtures/rgaa-golden).
|
|
3
|
+
//
|
|
4
|
+
// tests/rgaa-golden.test.ts audits each golden page three ways: as a source file, as a bare
|
|
5
|
+
// capture, and as the capture a real browser produced — computed styles, boxes, axe results and
|
|
6
|
+
// the live probes (focus walk, keyboard trap, reflow, text spacing…). That last one cannot be
|
|
7
|
+
// produced inside the test without a browser, so it is recorded here, once, and committed. The
|
|
8
|
+
// test refuses a recording whose source page has changed since (meta.notes carries its hash).
|
|
9
|
+
//
|
|
10
|
+
// node scripts/record-rgaa-golden.mjs (needs the local Playwright browser: `ultra11y status --browser`)
|
|
11
|
+
import { spawn } from "node:child_process";
|
|
12
|
+
import { createHash } from "node:crypto";
|
|
13
|
+
import { cpSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
14
|
+
import { createServer } from "node:http";
|
|
15
|
+
import { tmpdir } from "node:os";
|
|
16
|
+
import { dirname, extname, join } from "node:path";
|
|
17
|
+
import { fileURLToPath } from "node:url";
|
|
18
|
+
|
|
19
|
+
const repo = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
20
|
+
const dir = join(repo, "tests", "fixtures", "rgaa-golden");
|
|
21
|
+
const PAGES = ["non-conforme", "conforme"];
|
|
22
|
+
// The origin every recording is rewritten to, so a re-record does not churn on the port.
|
|
23
|
+
const ORIGIN = "http://villeneuve.test";
|
|
24
|
+
const TYPES = { ".html": "text/html; charset=utf-8", ".png": "image/png", ".mp4": "video/mp4", ".mp3": "audio/mpeg", ".vtt": "text/vtt" };
|
|
25
|
+
|
|
26
|
+
const server = createServer((req, res) => {
|
|
27
|
+
const path = join(dir, decodeURIComponent(new URL(req.url ?? "/", "http://x").pathname));
|
|
28
|
+
if (!path.startsWith(dir)) return res.writeHead(403).end();
|
|
29
|
+
try {
|
|
30
|
+
const body = readFileSync(path);
|
|
31
|
+
res.writeHead(200, { "content-type": TYPES[extname(path)] ?? "application/octet-stream" }).end(body);
|
|
32
|
+
} catch {
|
|
33
|
+
res.writeHead(404).end();
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
await new Promise((ok) => server.listen(0, "127.0.0.1", ok));
|
|
37
|
+
const origin = `http://127.0.0.1:${server.address().port}`;
|
|
38
|
+
const root = mkdtempSync(join(tmpdir(), "u11y-golden-rec-"));
|
|
39
|
+
try {
|
|
40
|
+
const code = await new Promise((ok) => {
|
|
41
|
+
const child = spawn(
|
|
42
|
+
process.execPath,
|
|
43
|
+
[join(repo, "scripts", "ultra11y.mjs"), "scan", ...PAGES.map((p) => `${origin}/${p}.html`), "--runtime", "local", "--root", root, "--out", join(root, "out")],
|
|
44
|
+
{ stdio: ["ignore", "ignore", "inherit"] },
|
|
45
|
+
);
|
|
46
|
+
child.on("exit", ok);
|
|
47
|
+
});
|
|
48
|
+
if (code !== 0) throw new Error(`scan exited ${code}`);
|
|
49
|
+
for (const page of PAGES) {
|
|
50
|
+
const id = `${page}-html`;
|
|
51
|
+
const from = join(root, ".ultra11y", "pages", id);
|
|
52
|
+
const to = join(dir, "rendered", ".ultra11y", "pages", id);
|
|
53
|
+
rmSync(to, { recursive: true, force: true });
|
|
54
|
+
cpSync(from, to, { recursive: true });
|
|
55
|
+
// The screenshot only feeds a pixel fallback for contrast; it is the bulk of the bytes and
|
|
56
|
+
// decides nothing the golden grid asserts.
|
|
57
|
+
rmSync(join(to, "screen.png"), { force: true });
|
|
58
|
+
for (const f of readdirSync(to)) {
|
|
59
|
+
const p = join(to, f);
|
|
60
|
+
writeFileSync(p, readFileSync(p, "utf8").replaceAll(origin, ORIGIN));
|
|
61
|
+
}
|
|
62
|
+
const meta = JSON.parse(readFileSync(join(to, "meta.json"), "utf8"));
|
|
63
|
+
meta.notes = `source sha256 ${createHash("sha256").update(readFileSync(join(dir, `${page}.html`))).digest("hex")}`;
|
|
64
|
+
writeFileSync(join(to, "meta.json"), `${JSON.stringify(meta, null, 2)}\n`);
|
|
65
|
+
console.log(`recorded ${id}`);
|
|
66
|
+
}
|
|
67
|
+
} finally {
|
|
68
|
+
server.close();
|
|
69
|
+
rmSync(root, { recursive: true, force: true });
|
|
70
|
+
}
|