ultra11y 5.54.0 → 5.54.1
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 +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.opencode/plugins/ultra11y.js +1 -1
- package/README.md +6 -6
- package/package.json +1 -1
- package/scripts/build-pack-rgaa.mjs +7 -1
- package/scripts/build-standards.mjs +1 -1
- package/scripts/ultra11y.mjs +83 -6
- package/skills/review-a11y/SKILL.md +1 -1
- package/skills/review-a11y/scripts/ultra11y.mjs +83 -6
- package/skills/ultra11y/SKILL.md +3 -3
- package/skills/ultra11y/references/criteria.md +1 -1
- package/skills/ultra11y/references/rgaa-automation.md +2 -2
- package/skills/ultra11y/scripts/ultra11y.mjs +83 -6
- package/skills/ultra11y/templates/gitlab-ci.yml +1 -1
- package/src/data/standards/rgaa.json +14 -3
- package/src/data/wcag.json +2 -1
- package/src/messages.ts +26 -0
- package/src/rules/images.ts +53 -1
- package/src/types.ts +1 -1
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"name": "ultra11y",
|
|
11
11
|
"source": "./",
|
|
12
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.54.
|
|
13
|
+
"version": "5.54.1",
|
|
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
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.54.
|
|
4
|
+
"version": "5.54.1",
|
|
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
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.54.
|
|
4
|
+
"version": "5.54.1",
|
|
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",
|
|
@@ -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.54.
|
|
30
|
+
const ULTRA11Y_PLUGIN_VERSION = "5.54.1";
|
|
31
31
|
|
|
32
32
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
33
33
|
|
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ Full details, thresholds and off-switches under [Install](#install).</sub>
|
|
|
27
27
|
|
|
28
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 — 97 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".
|
|
@@ -320,18 +320,18 @@ a test). See [`CONTRIBUTING.md`](CONTRIBUTING.md) and `skills/ultra11y/reference
|
|
|
320
320
|
|
|
321
321
|
### What RGAA automation actually covers
|
|
322
322
|
|
|
323
|
-
The engine's
|
|
323
|
+
The engine's 97 rules are not 97 RGAA criteria: several rules can evidence the same official
|
|
324
324
|
test, and a rule can detect a useful symptom without exhausting the criterion's alternatives,
|
|
325
325
|
exceptions or relevance checks. The generated contract classifies all **258 official RGAA
|
|
326
326
|
tests**:
|
|
327
327
|
|
|
328
|
-
- **
|
|
328
|
+
- **30 `static` tests across 22 criteria:** `1.1`, `1.9`, `2.1`, `5.7`, `5.8`, `6.1`, `6.2`, `7.1`,
|
|
329
329
|
`8.2`, `8.3`, `8.4`, `8.5`, `8.10`, `9.3`, `10.1`, `10.12`, `11.1`, `11.2`, `11.5`,
|
|
330
330
|
`11.6`, `11.8`, `11.9`.
|
|
331
331
|
- **3 `rendered` tests across 3 criteria:** `1.1`, `8.1`, `10.7`.
|
|
332
|
-
- Those two tiers cover **
|
|
332
|
+
- Those two tiers cover **24 distinct criteria that can produce a deterministic `NC`**;
|
|
333
333
|
`1.1` belongs to both.
|
|
334
|
-
- **
|
|
334
|
+
- **53 criteria receive a normative engine signal:** 24 have at least one decisive rule and
|
|
335
335
|
42 receive candidate evidence, with overlap. One additional criterion receives only an
|
|
336
336
|
advisory signal. A candidate is forwarded to adjudication and never changes a verdict by
|
|
337
337
|
itself.
|
|
@@ -342,7 +342,7 @@ tests**:
|
|
|
342
342
|
glossary names five, and covers “presentation built out of spaces” with two heuristics —
|
|
343
343
|
every one of them a deliberate under-report, which is the safe direction for a finding and
|
|
344
344
|
the wrong one for a conformity.
|
|
345
|
-
- The remaining **
|
|
345
|
+
- The remaining **225 `judgment` tests across 92 criteria** all enter the AI worklist,
|
|
346
346
|
including an apparently absent subject whose `NA` still needs confirmation. Overall,
|
|
347
347
|
**104 of 106 criteria require adjudication to earn `C`**.
|
|
348
348
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ultra11y",
|
|
3
|
-
"version": "5.54.
|
|
3
|
+
"version": "5.54.1",
|
|
4
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",
|
|
@@ -126,7 +126,7 @@ const bareSc = (w) => String(w).trim().split(/\s+/)[0];
|
|
|
126
126
|
const RULE_SC = {
|
|
127
127
|
"aria-hidden-focusable": ["4.1.2"], "aria-invalid-no-description": ["3.3.1"], "aria-ref-missing-id": ["4.1.2"],
|
|
128
128
|
"aria-required-children": ["4.1.2"], "autoplay-media": ["1.4.2", "2.2.2"], "blink-marquee": ["2.2.2"],
|
|
129
|
-
"button-empty-name": ["4.1.2"], "canvas-fallback-missing": ["1.1.1"], "chart-no-accessible-name": ["1.1.1"],
|
|
129
|
+
"button-empty-name": ["4.1.2"], "canvas-fallback-missing": ["1.1.1"], "chart-no-accessible-name": ["1.1.1"], "figure-caption-unassociated": ["1.1.1"],
|
|
130
130
|
"clickable-noninteractive": ["4.1.2", "2.1.1"], "contrast-literal": ["1.4.3"], "control-label-missing": ["4.1.2"],
|
|
131
131
|
"rendered-contrast": ["1.4.3"], "rendered-contrast-pixel": ["1.4.3"], "rendered-link-colour-only": ["1.4.1"],
|
|
132
132
|
"rendered-nontext-contrast": ["1.4.11"], "rendered-focus-not-visible": ["2.4.7"], "rendered-orientation-lock": ["1.3.4"],
|
|
@@ -195,6 +195,9 @@ const RULE_TO_CRITERIA = {
|
|
|
195
195
|
// Theme 1 — images (1.1 informative alt, 1.2 decorative)
|
|
196
196
|
"img-alt-missing": ["1.1"], "input-image-alt-missing": ["1.1"], "object-embed-no-name": ["1.1"],
|
|
197
197
|
"chart-no-accessible-name": ["1.1"], "canvas-fallback-missing": ["1.1"], "axe:image-alt": ["1.1"],
|
|
198
|
+
// RGAA 1.9.1: a captioned <figure> carries role="figure"|"group" and an aria-label identical to
|
|
199
|
+
// its <figcaption> (#97). Advisory in the WCAG core, re-normativized by `overrides` below.
|
|
200
|
+
"figure-caption-unassociated": ["1.9"],
|
|
198
201
|
"axe:input-image-alt": ["1.1"], "axe:area-alt": ["1.1"], "axe:role-img-alt": ["1.1"], "axe:svg-img-alt": ["1.1"],
|
|
199
202
|
"axe:object-alt": ["1.1"], "decorative-alt-misuse": ["1.2"], "axe:image-redundant-alt": ["1.2"],
|
|
200
203
|
"decorative-marked-exposed": ["1.2"],
|
|
@@ -329,6 +332,7 @@ const RULE_TO_CRITERIA = {
|
|
|
329
332
|
// `candidate` below. This deliberately small table contains only failures whose observation
|
|
330
333
|
// itself exhausts the cited numbered test.
|
|
331
334
|
const DECISIVE_RULE_TESTS = {
|
|
335
|
+
"1.9|figure-caption-unassociated": ["1"],
|
|
332
336
|
"1.1|axe:area-alt": ["2"],
|
|
333
337
|
"1.1|axe:input-image-alt": ["3"],
|
|
334
338
|
"1.1|input-image-alt-missing": ["3"],
|
|
@@ -690,6 +694,8 @@ const DOWNLOAD_EXT = "pdf|docx?|pptx?|xlsx?|odt|ods|odp|rtf|csv|zip|rar|7z|gz|ep
|
|
|
690
694
|
if (!presentational) throw new Error("build-pack-rgaa: RGAA 10.1 is missing from the referential");
|
|
691
695
|
presentational.appliesTo = { ruleIds: [...new Set([...presentational.appliesTo.ruleIds, ...PRESENTATIONAL_RULE_IDS])].sort() };
|
|
692
696
|
const overrides = Object.fromEntries(PRESENTATIONAL_RULE_IDS.map((id) => [id, { advisory: false, severity: "majeur" }]));
|
|
697
|
+
// Same reason, second use: WCAG never asks a <figure> for role + aria-label, RGAA 1.9.1 does.
|
|
698
|
+
overrides["figure-caption-unassociated"] = { advisory: false, severity: "majeur" };
|
|
693
699
|
|
|
694
700
|
// ---- Test-level automation matrix -------------------------------------------------
|
|
695
701
|
// Start fail-closed: every one of DINUM's 258 tests is a judgment until a rule is
|
|
@@ -639,7 +639,7 @@ const NEEDS_RENDERING = new Set([
|
|
|
639
639
|
// icon-only-control-unnamed) appear under BOTH their SCs so registry's bidirectional
|
|
640
640
|
// rule↔dataset cross-check holds.
|
|
641
641
|
const RULE_SC_COVERAGE = {
|
|
642
|
-
"1.1.1": ["img-alt-missing", "canvas-fallback-missing", "decorative-alt-misuse", "decorative-marked-exposed", "input-image-alt-missing", "object-embed-no-name", "chart-no-accessible-name"],
|
|
642
|
+
"1.1.1": ["img-alt-missing", "canvas-fallback-missing", "decorative-alt-misuse", "decorative-marked-exposed", "input-image-alt-missing", "object-embed-no-name", "chart-no-accessible-name", "figure-caption-unassociated"],
|
|
643
643
|
"1.2.2": ["media-no-track"],
|
|
644
644
|
"1.3.1": [
|
|
645
645
|
"fieldset-legend-missing", "data-table-no-headers", "table-caption-missing",
|
package/scripts/ultra11y.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { join as join53, relative as relative6, resolve as resolve18, sep as sep
|
|
|
6
6
|
import { fileURLToPath as fileURLToPath5, pathToFileURL as pathToFileURL3 } from "url";
|
|
7
7
|
|
|
8
8
|
// src/types.ts
|
|
9
|
-
var VERSION = "5.54.
|
|
9
|
+
var VERSION = "5.54.1";
|
|
10
10
|
var SCHEMA_VERSION = 2;
|
|
11
11
|
function isAdjudicated(by) {
|
|
12
12
|
return by === "agent" || by === "human";
|
|
@@ -131,7 +131,8 @@ var wcag_default = {
|
|
|
131
131
|
"decorative-marked-exposed",
|
|
132
132
|
"input-image-alt-missing",
|
|
133
133
|
"object-embed-no-name",
|
|
134
|
-
"chart-no-accessible-name"
|
|
134
|
+
"chart-no-accessible-name",
|
|
135
|
+
"figure-caption-unassociated"
|
|
135
136
|
],
|
|
136
137
|
understanding: "https://www.w3.org/WAI/WCAG22/Understanding/non-text-content.html",
|
|
137
138
|
techniques: [
|
|
@@ -39039,6 +39040,32 @@ var MSG_CATALOG = {
|
|
|
39039
39040
|
en: () => `Add aria-label/title describing the content (and text fallback content inside <object>\u2026</object>), or aria-hidden="true" if decorative.`
|
|
39040
39041
|
}
|
|
39041
39042
|
},
|
|
39043
|
+
"figure-caption-unassociated": {
|
|
39044
|
+
message: {
|
|
39045
|
+
fr: (p) => {
|
|
39046
|
+
const m = String(p.missing).split(",");
|
|
39047
|
+
const parts2 = [
|
|
39048
|
+
m.includes("role") ? `pas de role="figure" ou "group"` : "",
|
|
39049
|
+
m.includes("aria-label") ? "pas d'aria-label" : "",
|
|
39050
|
+
m.includes("aria-label-mismatch") ? "un aria-label diff\xE9rent de la l\xE9gende" : ""
|
|
39051
|
+
].filter(Boolean);
|
|
39052
|
+
return `<figure> l\xE9gend\xE9e (\xAB ${p.caption} \xBB) : ${parts2.join(", ")} \u2014 la l\xE9gende n'est pas reli\xE9e \xE0 l'image (test RGAA 1.9.1).`;
|
|
39053
|
+
},
|
|
39054
|
+
en: (p) => {
|
|
39055
|
+
const m = String(p.missing).split(",");
|
|
39056
|
+
const parts2 = [
|
|
39057
|
+
m.includes("role") ? `no role="figure" or "group"` : "",
|
|
39058
|
+
m.includes("aria-label") ? "no aria-label" : "",
|
|
39059
|
+
m.includes("aria-label-mismatch") ? "an aria-label that differs from the caption" : ""
|
|
39060
|
+
].filter(Boolean);
|
|
39061
|
+
return `Captioned <figure> ("${p.caption}"): ${parts2.join(", ")} \u2014 the caption is not tied to the image.`;
|
|
39062
|
+
}
|
|
39063
|
+
},
|
|
39064
|
+
remediation: {
|
|
39065
|
+
fr: (p) => `Ajoutez role="figure" et aria-label="${p.caption}" sur la balise <figure>, identique au contenu du <figcaption>.`,
|
|
39066
|
+
en: (p) => `Add role="figure" and aria-label="${p.caption}" to the <figure>, identical to the <figcaption> content.`
|
|
39067
|
+
}
|
|
39068
|
+
},
|
|
39042
39069
|
"chart-no-accessible-name": {
|
|
39043
39070
|
message: {
|
|
39044
39071
|
fr: (p) => `Graphique (<${p.tag}> ${p.cls}) sans nom accessible \u2014 alternative textuelle manquante.`,
|
|
@@ -41082,6 +41109,10 @@ var rgaa_default = {
|
|
|
41082
41109
|
"presentational-spacing": {
|
|
41083
41110
|
advisory: false,
|
|
41084
41111
|
severity: "majeur"
|
|
41112
|
+
},
|
|
41113
|
+
"figure-caption-unassociated": {
|
|
41114
|
+
advisory: false,
|
|
41115
|
+
severity: "majeur"
|
|
41085
41116
|
}
|
|
41086
41117
|
},
|
|
41087
41118
|
themes: [
|
|
@@ -41960,17 +41991,24 @@ var rgaa_default = {
|
|
|
41960
41991
|
],
|
|
41961
41992
|
wcag: ["1.1.1", "4.1.2"],
|
|
41962
41993
|
appliesTo: {
|
|
41963
|
-
ruleIds: []
|
|
41994
|
+
ruleIds: ["figure-caption-unassociated"]
|
|
41964
41995
|
},
|
|
41965
41996
|
automation: {
|
|
41966
41997
|
tests: {
|
|
41967
|
-
"1": "
|
|
41998
|
+
"1": "static",
|
|
41968
41999
|
"2": "judgment",
|
|
41969
42000
|
"3": "judgment",
|
|
41970
42001
|
"4": "judgment",
|
|
41971
42002
|
"5": "judgment"
|
|
41972
42003
|
},
|
|
41973
|
-
rules: [
|
|
42004
|
+
rules: [
|
|
42005
|
+
{
|
|
42006
|
+
id: "figure-caption-unassociated",
|
|
42007
|
+
tests: ["1"],
|
|
42008
|
+
effect: "decisive-nc",
|
|
42009
|
+
rationale: "The observed failure exhausts the cited RGAA test."
|
|
42010
|
+
}
|
|
42011
|
+
]
|
|
41974
42012
|
}
|
|
41975
42013
|
},
|
|
41976
42014
|
{
|
|
@@ -50101,7 +50139,46 @@ var chartNoAccessibleName = {
|
|
|
50101
50139
|
return out2;
|
|
50102
50140
|
}
|
|
50103
50141
|
};
|
|
50104
|
-
var
|
|
50142
|
+
var FIGURE_ROLES = /* @__PURE__ */ new Set(["figure", "group"]);
|
|
50143
|
+
var collapseWs = (s) => s.replace(/\s+/g, " ").trim();
|
|
50144
|
+
var frameworkBound = (el, name2) => [":", "v-bind:", "x-bind:", "bind:"].some((p) => `${p}${name2}` in el.attribs);
|
|
50145
|
+
var isCaptionedImage = (d) => d.tag === "img" || d.tag === "input" && (attr(d, "type") ?? "").trim().toLowerCase() === "image" || (attr(d, "role") ?? "").trim().toLowerCase() === "img";
|
|
50146
|
+
var figureCaptionUnassociated = {
|
|
50147
|
+
id: "figure-caption-unassociated",
|
|
50148
|
+
criteria: ["1.1.1"],
|
|
50149
|
+
severity: "majeur",
|
|
50150
|
+
advisory: true,
|
|
50151
|
+
run(doc) {
|
|
50152
|
+
const out2 = [];
|
|
50153
|
+
for (const el of doc.elements) {
|
|
50154
|
+
if (el.tag !== "figure" || isHidden(el) || hasDynamicSpread(el)) continue;
|
|
50155
|
+
const desc = descendants(el);
|
|
50156
|
+
const caption = desc.find((d) => d.tag === "figcaption");
|
|
50157
|
+
if (!caption || !desc.some((d) => d !== caption && isCaptionedImage(d) && !ancestors(d).includes(caption))) continue;
|
|
50158
|
+
const captionText = collapseWs(textContent(caption));
|
|
50159
|
+
if (!captionText || captionText.includes("{") || mayInjectContent(caption)) continue;
|
|
50160
|
+
const role = attr(el, "role");
|
|
50161
|
+
const label = attr(el, "aria-label");
|
|
50162
|
+
if ((role ?? "").includes("{") || (label ?? "").includes("{") || frameworkBound(el, "role") || frameworkBound(el, "aria-label")) continue;
|
|
50163
|
+
const missing = [];
|
|
50164
|
+
if (!FIGURE_ROLES.has((role ?? "").trim().toLowerCase())) missing.push("role");
|
|
50165
|
+
if (label === void 0 || !label.trim()) missing.push("aria-label");
|
|
50166
|
+
else if (collapseWs(label) !== captionText) missing.push("aria-label-mismatch");
|
|
50167
|
+
if (!missing.length) continue;
|
|
50168
|
+
out2.push({ criteriaId: "1.1.1", el, msgId: "figure-caption-unassociated", params: { caption: captionText, missing: missing.join(",") } });
|
|
50169
|
+
}
|
|
50170
|
+
return out2;
|
|
50171
|
+
}
|
|
50172
|
+
};
|
|
50173
|
+
var imagesRules = [
|
|
50174
|
+
figureCaptionUnassociated,
|
|
50175
|
+
imgAltMissing,
|
|
50176
|
+
decorativeAltMisuse,
|
|
50177
|
+
canvasFallbackMissing,
|
|
50178
|
+
inputImageAltMissing,
|
|
50179
|
+
objectEmbedNoName,
|
|
50180
|
+
chartNoAccessibleName
|
|
50181
|
+
];
|
|
50105
50182
|
|
|
50106
50183
|
// src/rules/frames.ts
|
|
50107
50184
|
var iframeTitleMissing = {
|
|
@@ -3,7 +3,7 @@ name: review-a11y
|
|
|
3
3
|
description: "Use to REVIEW changed frontend code for accessibility: staged files, a working diff, branch, or PR; prompts such as 'review a11y', 'is this accessible?', or 'anything to fix before merge?'; and hook or CI findings on a change. Run the bundled install-free engine with cross-file JSX/TSX analysis, then adjudicate candidates and return a severity-ranked WCAG 2.2 AA review with file:line fixes, residual rendering risks, and a verdict. Use `ultra11y` instead for whole-repo audits, dated conformance reports, country standards, PRD backlogs, or authoring accessible markup."
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: 5.54.
|
|
6
|
+
version: 5.54.1
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# review-a11y — accessibility review of changed code
|
|
@@ -6,7 +6,7 @@ import { join as join53, relative as relative6, resolve as resolve18, sep as sep
|
|
|
6
6
|
import { fileURLToPath as fileURLToPath5, pathToFileURL as pathToFileURL3 } from "url";
|
|
7
7
|
|
|
8
8
|
// src/types.ts
|
|
9
|
-
var VERSION = "5.54.
|
|
9
|
+
var VERSION = "5.54.1";
|
|
10
10
|
var SCHEMA_VERSION = 2;
|
|
11
11
|
function isAdjudicated(by) {
|
|
12
12
|
return by === "agent" || by === "human";
|
|
@@ -131,7 +131,8 @@ var wcag_default = {
|
|
|
131
131
|
"decorative-marked-exposed",
|
|
132
132
|
"input-image-alt-missing",
|
|
133
133
|
"object-embed-no-name",
|
|
134
|
-
"chart-no-accessible-name"
|
|
134
|
+
"chart-no-accessible-name",
|
|
135
|
+
"figure-caption-unassociated"
|
|
135
136
|
],
|
|
136
137
|
understanding: "https://www.w3.org/WAI/WCAG22/Understanding/non-text-content.html",
|
|
137
138
|
techniques: [
|
|
@@ -39039,6 +39040,32 @@ var MSG_CATALOG = {
|
|
|
39039
39040
|
en: () => `Add aria-label/title describing the content (and text fallback content inside <object>\u2026</object>), or aria-hidden="true" if decorative.`
|
|
39040
39041
|
}
|
|
39041
39042
|
},
|
|
39043
|
+
"figure-caption-unassociated": {
|
|
39044
|
+
message: {
|
|
39045
|
+
fr: (p) => {
|
|
39046
|
+
const m = String(p.missing).split(",");
|
|
39047
|
+
const parts2 = [
|
|
39048
|
+
m.includes("role") ? `pas de role="figure" ou "group"` : "",
|
|
39049
|
+
m.includes("aria-label") ? "pas d'aria-label" : "",
|
|
39050
|
+
m.includes("aria-label-mismatch") ? "un aria-label diff\xE9rent de la l\xE9gende" : ""
|
|
39051
|
+
].filter(Boolean);
|
|
39052
|
+
return `<figure> l\xE9gend\xE9e (\xAB ${p.caption} \xBB) : ${parts2.join(", ")} \u2014 la l\xE9gende n'est pas reli\xE9e \xE0 l'image (test RGAA 1.9.1).`;
|
|
39053
|
+
},
|
|
39054
|
+
en: (p) => {
|
|
39055
|
+
const m = String(p.missing).split(",");
|
|
39056
|
+
const parts2 = [
|
|
39057
|
+
m.includes("role") ? `no role="figure" or "group"` : "",
|
|
39058
|
+
m.includes("aria-label") ? "no aria-label" : "",
|
|
39059
|
+
m.includes("aria-label-mismatch") ? "an aria-label that differs from the caption" : ""
|
|
39060
|
+
].filter(Boolean);
|
|
39061
|
+
return `Captioned <figure> ("${p.caption}"): ${parts2.join(", ")} \u2014 the caption is not tied to the image.`;
|
|
39062
|
+
}
|
|
39063
|
+
},
|
|
39064
|
+
remediation: {
|
|
39065
|
+
fr: (p) => `Ajoutez role="figure" et aria-label="${p.caption}" sur la balise <figure>, identique au contenu du <figcaption>.`,
|
|
39066
|
+
en: (p) => `Add role="figure" and aria-label="${p.caption}" to the <figure>, identical to the <figcaption> content.`
|
|
39067
|
+
}
|
|
39068
|
+
},
|
|
39042
39069
|
"chart-no-accessible-name": {
|
|
39043
39070
|
message: {
|
|
39044
39071
|
fr: (p) => `Graphique (<${p.tag}> ${p.cls}) sans nom accessible \u2014 alternative textuelle manquante.`,
|
|
@@ -41082,6 +41109,10 @@ var rgaa_default = {
|
|
|
41082
41109
|
"presentational-spacing": {
|
|
41083
41110
|
advisory: false,
|
|
41084
41111
|
severity: "majeur"
|
|
41112
|
+
},
|
|
41113
|
+
"figure-caption-unassociated": {
|
|
41114
|
+
advisory: false,
|
|
41115
|
+
severity: "majeur"
|
|
41085
41116
|
}
|
|
41086
41117
|
},
|
|
41087
41118
|
themes: [
|
|
@@ -41960,17 +41991,24 @@ var rgaa_default = {
|
|
|
41960
41991
|
],
|
|
41961
41992
|
wcag: ["1.1.1", "4.1.2"],
|
|
41962
41993
|
appliesTo: {
|
|
41963
|
-
ruleIds: []
|
|
41994
|
+
ruleIds: ["figure-caption-unassociated"]
|
|
41964
41995
|
},
|
|
41965
41996
|
automation: {
|
|
41966
41997
|
tests: {
|
|
41967
|
-
"1": "
|
|
41998
|
+
"1": "static",
|
|
41968
41999
|
"2": "judgment",
|
|
41969
42000
|
"3": "judgment",
|
|
41970
42001
|
"4": "judgment",
|
|
41971
42002
|
"5": "judgment"
|
|
41972
42003
|
},
|
|
41973
|
-
rules: [
|
|
42004
|
+
rules: [
|
|
42005
|
+
{
|
|
42006
|
+
id: "figure-caption-unassociated",
|
|
42007
|
+
tests: ["1"],
|
|
42008
|
+
effect: "decisive-nc",
|
|
42009
|
+
rationale: "The observed failure exhausts the cited RGAA test."
|
|
42010
|
+
}
|
|
42011
|
+
]
|
|
41974
42012
|
}
|
|
41975
42013
|
},
|
|
41976
42014
|
{
|
|
@@ -50101,7 +50139,46 @@ var chartNoAccessibleName = {
|
|
|
50101
50139
|
return out2;
|
|
50102
50140
|
}
|
|
50103
50141
|
};
|
|
50104
|
-
var
|
|
50142
|
+
var FIGURE_ROLES = /* @__PURE__ */ new Set(["figure", "group"]);
|
|
50143
|
+
var collapseWs = (s) => s.replace(/\s+/g, " ").trim();
|
|
50144
|
+
var frameworkBound = (el, name2) => [":", "v-bind:", "x-bind:", "bind:"].some((p) => `${p}${name2}` in el.attribs);
|
|
50145
|
+
var isCaptionedImage = (d) => d.tag === "img" || d.tag === "input" && (attr(d, "type") ?? "").trim().toLowerCase() === "image" || (attr(d, "role") ?? "").trim().toLowerCase() === "img";
|
|
50146
|
+
var figureCaptionUnassociated = {
|
|
50147
|
+
id: "figure-caption-unassociated",
|
|
50148
|
+
criteria: ["1.1.1"],
|
|
50149
|
+
severity: "majeur",
|
|
50150
|
+
advisory: true,
|
|
50151
|
+
run(doc) {
|
|
50152
|
+
const out2 = [];
|
|
50153
|
+
for (const el of doc.elements) {
|
|
50154
|
+
if (el.tag !== "figure" || isHidden(el) || hasDynamicSpread(el)) continue;
|
|
50155
|
+
const desc = descendants(el);
|
|
50156
|
+
const caption = desc.find((d) => d.tag === "figcaption");
|
|
50157
|
+
if (!caption || !desc.some((d) => d !== caption && isCaptionedImage(d) && !ancestors(d).includes(caption))) continue;
|
|
50158
|
+
const captionText = collapseWs(textContent(caption));
|
|
50159
|
+
if (!captionText || captionText.includes("{") || mayInjectContent(caption)) continue;
|
|
50160
|
+
const role = attr(el, "role");
|
|
50161
|
+
const label = attr(el, "aria-label");
|
|
50162
|
+
if ((role ?? "").includes("{") || (label ?? "").includes("{") || frameworkBound(el, "role") || frameworkBound(el, "aria-label")) continue;
|
|
50163
|
+
const missing = [];
|
|
50164
|
+
if (!FIGURE_ROLES.has((role ?? "").trim().toLowerCase())) missing.push("role");
|
|
50165
|
+
if (label === void 0 || !label.trim()) missing.push("aria-label");
|
|
50166
|
+
else if (collapseWs(label) !== captionText) missing.push("aria-label-mismatch");
|
|
50167
|
+
if (!missing.length) continue;
|
|
50168
|
+
out2.push({ criteriaId: "1.1.1", el, msgId: "figure-caption-unassociated", params: { caption: captionText, missing: missing.join(",") } });
|
|
50169
|
+
}
|
|
50170
|
+
return out2;
|
|
50171
|
+
}
|
|
50172
|
+
};
|
|
50173
|
+
var imagesRules = [
|
|
50174
|
+
figureCaptionUnassociated,
|
|
50175
|
+
imgAltMissing,
|
|
50176
|
+
decorativeAltMisuse,
|
|
50177
|
+
canvasFallbackMissing,
|
|
50178
|
+
inputImageAltMissing,
|
|
50179
|
+
objectEmbedNoName,
|
|
50180
|
+
chartNoAccessibleName
|
|
50181
|
+
];
|
|
50105
50182
|
|
|
50106
50183
|
// src/rules/frames.ts
|
|
50107
50184
|
var iframeTitleMissing = {
|
package/skills/ultra11y/SKILL.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ultra11y
|
|
3
|
-
description: "Use to AUDIT a site, repository, or page against RGAA 4.1.2, the French State's accessibility standard (référentiel de l'État), on a WCAG 2.2 AA core (other country standards as packs); produce a dated conformance report, criterion grid, PRD backlog, or tickets; AUTHOR accessible markup; fix accessibility; or wire a repo gate and rendered-DOM capture pipeline. The bundled install-free engine runs
|
|
3
|
+
description: "Use to AUDIT a site, repository, or page against RGAA 4.1.2, the French State's accessibility standard (référentiel de l'État), on a WCAG 2.2 AA core (other country standards as packs); produce a dated conformance report, criterion grid, PRD backlog, or tickets; AUTHOR accessible markup; fix accessibility; or wire a repo gate and rendered-DOM capture pipeline. The bundled install-free engine runs 97 static checks tied to success criteria, while the agent adjudicates judgment criteria and routes rendering criteria to browser scans; check/verify reject invented non-conformities and never declare conforming what was not verified. Use `review-a11y` instead for a review scoped only to a diff, branch, or PR."
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
|
-
version: 5.54.
|
|
6
|
+
version: 5.54.1
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# ultra11y — audit WCAG 2.2 AA and write accessible markup
|
|
@@ -20,7 +20,7 @@ criteria (computed contrast, visible focus, zoom/reflow, content-on-hover) fall
|
|
|
20
20
|
tier (axe-core in a real browser); a human is at most optional oversight. Gates stop any
|
|
21
21
|
hallucinated non-conformity from surviving, and nothing is ever silently "conforming".
|
|
22
22
|
|
|
23
|
-
**Do not confuse rules with criteria.** The bundle ships
|
|
23
|
+
**Do not confuse rules with criteria.** The bundle ships 97 static checks, WCAG AA has 55
|
|
24
24
|
success criteria, and RGAA has 106 criteria. Several rules may evidence one criterion, one
|
|
25
25
|
rule may contribute to several pack criteria, and most criteria remain open until a scan or
|
|
26
26
|
an adjudication. The only honest run-level coverage is the grid's live provenance tally
|
|
@@ -12,7 +12,7 @@ criteria that map to it. SC ids, titles and levels are derived from the W3C sour
|
|
|
12
12
|
|
|
13
13
|
| SC | Title | Level | Automatability | Rules | RGAA |
|
|
14
14
|
|---|---|---|---|---|---|
|
|
15
|
-
| 1.1.1 | Non-text Content | A | judgment | img-alt-missing, canvas-fallback-missing, decorative-alt-misuse, decorative-marked-exposed, input-image-alt-missing, object-embed-no-name, chart-no-accessible-name | 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.9, 4.7, 4.8, 4.9, 6.1, 6.2, 7.2, 10.2, 13.3, 13.4, 13.5, 13.6 |
|
|
15
|
+
| 1.1.1 | Non-text Content | A | judgment | img-alt-missing, canvas-fallback-missing, decorative-alt-misuse, decorative-marked-exposed, input-image-alt-missing, object-embed-no-name, chart-no-accessible-name, figure-caption-unassociated | 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.9, 4.7, 4.8, 4.9, 6.1, 6.2, 7.2, 10.2, 13.3, 13.4, 13.5, 13.6 |
|
|
16
16
|
|
|
17
17
|
## 1.2 Time-based Media
|
|
18
18
|
|
|
@@ -18,7 +18,7 @@ The 106 criterion rows below are the one-by-one routing review. “AI + signals
|
|
|
18
18
|
| 1.6 | 0 / 0 / 10 | 0 / 0 / 0 | no | AI |
|
|
19
19
|
| 1.7 | 0 / 0 / 6 | 0 / 0 / 0 | no | AI |
|
|
20
20
|
| 1.8 | 0 / 0 / 6 | 0 / 0 / 0 | no | AI |
|
|
21
|
-
| 1.9 |
|
|
21
|
+
| 1.9 | 1 / 0 / 4 | 1 / 0 / 0 | no | deterministic NC + AI residual |
|
|
22
22
|
| 2.1 | 1 / 0 / 0 | 2 / 1 / 0 | no | deterministic NC + AI residual |
|
|
23
23
|
| 2.2 | 0 / 0 / 1 | 0 / 0 / 0 | no | AI |
|
|
24
24
|
| 3.1 | 0 / 0 / 6 | 0 / 0 / 0 | no | AI |
|
|
@@ -175,7 +175,7 @@ The 106 criterion rows below are the one-by-one routing review. “AI + signals
|
|
|
175
175
|
| 1.8.4 | judgment | — | — |
|
|
176
176
|
| 1.8.5 | judgment | — | — |
|
|
177
177
|
| 1.8.6 | judgment | — | — |
|
|
178
|
-
| 1.9.1 |
|
|
178
|
+
| 1.9.1 | static | `figure-caption-unassociated` | — |
|
|
179
179
|
| 1.9.2 | judgment | — | — |
|
|
180
180
|
| 1.9.3 | judgment | — | — |
|
|
181
181
|
| 1.9.4 | judgment | — | — |
|
|
@@ -6,7 +6,7 @@ import { join as join53, relative as relative6, resolve as resolve18, sep as sep
|
|
|
6
6
|
import { fileURLToPath as fileURLToPath5, pathToFileURL as pathToFileURL3 } from "url";
|
|
7
7
|
|
|
8
8
|
// src/types.ts
|
|
9
|
-
var VERSION = "5.54.
|
|
9
|
+
var VERSION = "5.54.1";
|
|
10
10
|
var SCHEMA_VERSION = 2;
|
|
11
11
|
function isAdjudicated(by) {
|
|
12
12
|
return by === "agent" || by === "human";
|
|
@@ -131,7 +131,8 @@ var wcag_default = {
|
|
|
131
131
|
"decorative-marked-exposed",
|
|
132
132
|
"input-image-alt-missing",
|
|
133
133
|
"object-embed-no-name",
|
|
134
|
-
"chart-no-accessible-name"
|
|
134
|
+
"chart-no-accessible-name",
|
|
135
|
+
"figure-caption-unassociated"
|
|
135
136
|
],
|
|
136
137
|
understanding: "https://www.w3.org/WAI/WCAG22/Understanding/non-text-content.html",
|
|
137
138
|
techniques: [
|
|
@@ -39039,6 +39040,32 @@ var MSG_CATALOG = {
|
|
|
39039
39040
|
en: () => `Add aria-label/title describing the content (and text fallback content inside <object>\u2026</object>), or aria-hidden="true" if decorative.`
|
|
39040
39041
|
}
|
|
39041
39042
|
},
|
|
39043
|
+
"figure-caption-unassociated": {
|
|
39044
|
+
message: {
|
|
39045
|
+
fr: (p) => {
|
|
39046
|
+
const m = String(p.missing).split(",");
|
|
39047
|
+
const parts2 = [
|
|
39048
|
+
m.includes("role") ? `pas de role="figure" ou "group"` : "",
|
|
39049
|
+
m.includes("aria-label") ? "pas d'aria-label" : "",
|
|
39050
|
+
m.includes("aria-label-mismatch") ? "un aria-label diff\xE9rent de la l\xE9gende" : ""
|
|
39051
|
+
].filter(Boolean);
|
|
39052
|
+
return `<figure> l\xE9gend\xE9e (\xAB ${p.caption} \xBB) : ${parts2.join(", ")} \u2014 la l\xE9gende n'est pas reli\xE9e \xE0 l'image (test RGAA 1.9.1).`;
|
|
39053
|
+
},
|
|
39054
|
+
en: (p) => {
|
|
39055
|
+
const m = String(p.missing).split(",");
|
|
39056
|
+
const parts2 = [
|
|
39057
|
+
m.includes("role") ? `no role="figure" or "group"` : "",
|
|
39058
|
+
m.includes("aria-label") ? "no aria-label" : "",
|
|
39059
|
+
m.includes("aria-label-mismatch") ? "an aria-label that differs from the caption" : ""
|
|
39060
|
+
].filter(Boolean);
|
|
39061
|
+
return `Captioned <figure> ("${p.caption}"): ${parts2.join(", ")} \u2014 the caption is not tied to the image.`;
|
|
39062
|
+
}
|
|
39063
|
+
},
|
|
39064
|
+
remediation: {
|
|
39065
|
+
fr: (p) => `Ajoutez role="figure" et aria-label="${p.caption}" sur la balise <figure>, identique au contenu du <figcaption>.`,
|
|
39066
|
+
en: (p) => `Add role="figure" and aria-label="${p.caption}" to the <figure>, identical to the <figcaption> content.`
|
|
39067
|
+
}
|
|
39068
|
+
},
|
|
39042
39069
|
"chart-no-accessible-name": {
|
|
39043
39070
|
message: {
|
|
39044
39071
|
fr: (p) => `Graphique (<${p.tag}> ${p.cls}) sans nom accessible \u2014 alternative textuelle manquante.`,
|
|
@@ -41082,6 +41109,10 @@ var rgaa_default = {
|
|
|
41082
41109
|
"presentational-spacing": {
|
|
41083
41110
|
advisory: false,
|
|
41084
41111
|
severity: "majeur"
|
|
41112
|
+
},
|
|
41113
|
+
"figure-caption-unassociated": {
|
|
41114
|
+
advisory: false,
|
|
41115
|
+
severity: "majeur"
|
|
41085
41116
|
}
|
|
41086
41117
|
},
|
|
41087
41118
|
themes: [
|
|
@@ -41960,17 +41991,24 @@ var rgaa_default = {
|
|
|
41960
41991
|
],
|
|
41961
41992
|
wcag: ["1.1.1", "4.1.2"],
|
|
41962
41993
|
appliesTo: {
|
|
41963
|
-
ruleIds: []
|
|
41994
|
+
ruleIds: ["figure-caption-unassociated"]
|
|
41964
41995
|
},
|
|
41965
41996
|
automation: {
|
|
41966
41997
|
tests: {
|
|
41967
|
-
"1": "
|
|
41998
|
+
"1": "static",
|
|
41968
41999
|
"2": "judgment",
|
|
41969
42000
|
"3": "judgment",
|
|
41970
42001
|
"4": "judgment",
|
|
41971
42002
|
"5": "judgment"
|
|
41972
42003
|
},
|
|
41973
|
-
rules: [
|
|
42004
|
+
rules: [
|
|
42005
|
+
{
|
|
42006
|
+
id: "figure-caption-unassociated",
|
|
42007
|
+
tests: ["1"],
|
|
42008
|
+
effect: "decisive-nc",
|
|
42009
|
+
rationale: "The observed failure exhausts the cited RGAA test."
|
|
42010
|
+
}
|
|
42011
|
+
]
|
|
41974
42012
|
}
|
|
41975
42013
|
},
|
|
41976
42014
|
{
|
|
@@ -50101,7 +50139,46 @@ var chartNoAccessibleName = {
|
|
|
50101
50139
|
return out2;
|
|
50102
50140
|
}
|
|
50103
50141
|
};
|
|
50104
|
-
var
|
|
50142
|
+
var FIGURE_ROLES = /* @__PURE__ */ new Set(["figure", "group"]);
|
|
50143
|
+
var collapseWs = (s) => s.replace(/\s+/g, " ").trim();
|
|
50144
|
+
var frameworkBound = (el, name2) => [":", "v-bind:", "x-bind:", "bind:"].some((p) => `${p}${name2}` in el.attribs);
|
|
50145
|
+
var isCaptionedImage = (d) => d.tag === "img" || d.tag === "input" && (attr(d, "type") ?? "").trim().toLowerCase() === "image" || (attr(d, "role") ?? "").trim().toLowerCase() === "img";
|
|
50146
|
+
var figureCaptionUnassociated = {
|
|
50147
|
+
id: "figure-caption-unassociated",
|
|
50148
|
+
criteria: ["1.1.1"],
|
|
50149
|
+
severity: "majeur",
|
|
50150
|
+
advisory: true,
|
|
50151
|
+
run(doc) {
|
|
50152
|
+
const out2 = [];
|
|
50153
|
+
for (const el of doc.elements) {
|
|
50154
|
+
if (el.tag !== "figure" || isHidden(el) || hasDynamicSpread(el)) continue;
|
|
50155
|
+
const desc = descendants(el);
|
|
50156
|
+
const caption = desc.find((d) => d.tag === "figcaption");
|
|
50157
|
+
if (!caption || !desc.some((d) => d !== caption && isCaptionedImage(d) && !ancestors(d).includes(caption))) continue;
|
|
50158
|
+
const captionText = collapseWs(textContent(caption));
|
|
50159
|
+
if (!captionText || captionText.includes("{") || mayInjectContent(caption)) continue;
|
|
50160
|
+
const role = attr(el, "role");
|
|
50161
|
+
const label = attr(el, "aria-label");
|
|
50162
|
+
if ((role ?? "").includes("{") || (label ?? "").includes("{") || frameworkBound(el, "role") || frameworkBound(el, "aria-label")) continue;
|
|
50163
|
+
const missing = [];
|
|
50164
|
+
if (!FIGURE_ROLES.has((role ?? "").trim().toLowerCase())) missing.push("role");
|
|
50165
|
+
if (label === void 0 || !label.trim()) missing.push("aria-label");
|
|
50166
|
+
else if (collapseWs(label) !== captionText) missing.push("aria-label-mismatch");
|
|
50167
|
+
if (!missing.length) continue;
|
|
50168
|
+
out2.push({ criteriaId: "1.1.1", el, msgId: "figure-caption-unassociated", params: { caption: captionText, missing: missing.join(",") } });
|
|
50169
|
+
}
|
|
50170
|
+
return out2;
|
|
50171
|
+
}
|
|
50172
|
+
};
|
|
50173
|
+
var imagesRules = [
|
|
50174
|
+
figureCaptionUnassociated,
|
|
50175
|
+
imgAltMissing,
|
|
50176
|
+
decorativeAltMisuse,
|
|
50177
|
+
canvasFallbackMissing,
|
|
50178
|
+
inputImageAltMissing,
|
|
50179
|
+
objectEmbedNoName,
|
|
50180
|
+
chartNoAccessibleName
|
|
50181
|
+
];
|
|
50105
50182
|
|
|
50106
50183
|
// src/rules/frames.ts
|
|
50107
50184
|
var iframeTitleMissing = {
|
|
@@ -27,7 +27,7 @@ variables:
|
|
|
27
27
|
ULTRA11Y_LANG: en
|
|
28
28
|
# Exact by default: a CI report must say which engine produced it. The release script keeps
|
|
29
29
|
# this pin aligned with the package version; override only for a deliberate upgrade test.
|
|
30
|
-
ULTRA11Y_VERSION: '5.54.
|
|
30
|
+
ULTRA11Y_VERSION: '5.54.1'
|
|
31
31
|
# Batches of 8 amortise the prompt; each accepted verdict is checkpointed before the next
|
|
32
32
|
# batch, and later passes receive only the residue.
|
|
33
33
|
ULTRA11Y_GRAIN: batch
|
|
@@ -248,6 +248,10 @@
|
|
|
248
248
|
"presentational-spacing": {
|
|
249
249
|
"advisory": false,
|
|
250
250
|
"severity": "majeur"
|
|
251
|
+
},
|
|
252
|
+
"figure-caption-unassociated": {
|
|
253
|
+
"advisory": false,
|
|
254
|
+
"severity": "majeur"
|
|
251
255
|
}
|
|
252
256
|
},
|
|
253
257
|
"themes": [
|
|
@@ -1126,17 +1130,24 @@
|
|
|
1126
1130
|
],
|
|
1127
1131
|
"wcag": ["1.1.1", "4.1.2"],
|
|
1128
1132
|
"appliesTo": {
|
|
1129
|
-
"ruleIds": []
|
|
1133
|
+
"ruleIds": ["figure-caption-unassociated"]
|
|
1130
1134
|
},
|
|
1131
1135
|
"automation": {
|
|
1132
1136
|
"tests": {
|
|
1133
|
-
"1": "
|
|
1137
|
+
"1": "static",
|
|
1134
1138
|
"2": "judgment",
|
|
1135
1139
|
"3": "judgment",
|
|
1136
1140
|
"4": "judgment",
|
|
1137
1141
|
"5": "judgment"
|
|
1138
1142
|
},
|
|
1139
|
-
"rules": [
|
|
1143
|
+
"rules": [
|
|
1144
|
+
{
|
|
1145
|
+
"id": "figure-caption-unassociated",
|
|
1146
|
+
"tests": ["1"],
|
|
1147
|
+
"effect": "decisive-nc",
|
|
1148
|
+
"rationale": "The observed failure exhausts the cited RGAA test."
|
|
1149
|
+
}
|
|
1150
|
+
]
|
|
1140
1151
|
}
|
|
1141
1152
|
},
|
|
1142
1153
|
{
|
package/src/data/wcag.json
CHANGED
|
@@ -110,7 +110,8 @@
|
|
|
110
110
|
"decorative-marked-exposed",
|
|
111
111
|
"input-image-alt-missing",
|
|
112
112
|
"object-embed-no-name",
|
|
113
|
-
"chart-no-accessible-name"
|
|
113
|
+
"chart-no-accessible-name",
|
|
114
|
+
"figure-caption-unassociated"
|
|
114
115
|
],
|
|
115
116
|
"understanding": "https://www.w3.org/WAI/WCAG22/Understanding/non-text-content.html",
|
|
116
117
|
"techniques": [
|
package/src/messages.ts
CHANGED
|
@@ -345,6 +345,32 @@ export const MSG_CATALOG: Record<string, MsgEntry> = {
|
|
|
345
345
|
en: () => `Add aria-label/title describing the content (and text fallback content inside <object>…</object>), or aria-hidden="true" if decorative.`,
|
|
346
346
|
},
|
|
347
347
|
},
|
|
348
|
+
"figure-caption-unassociated": {
|
|
349
|
+
message: {
|
|
350
|
+
fr: (p) => {
|
|
351
|
+
const m = String(p.missing).split(",");
|
|
352
|
+
const parts = [
|
|
353
|
+
m.includes("role") ? `pas de role="figure" ou "group"` : "",
|
|
354
|
+
m.includes("aria-label") ? "pas d'aria-label" : "",
|
|
355
|
+
m.includes("aria-label-mismatch") ? "un aria-label différent de la légende" : "",
|
|
356
|
+
].filter(Boolean);
|
|
357
|
+
return `<figure> légendée (« ${p.caption} ») : ${parts.join(", ")} — la légende n'est pas reliée à l'image (test RGAA 1.9.1).`;
|
|
358
|
+
},
|
|
359
|
+
en: (p) => {
|
|
360
|
+
const m = String(p.missing).split(",");
|
|
361
|
+
const parts = [
|
|
362
|
+
m.includes("role") ? `no role="figure" or "group"` : "",
|
|
363
|
+
m.includes("aria-label") ? "no aria-label" : "",
|
|
364
|
+
m.includes("aria-label-mismatch") ? "an aria-label that differs from the caption" : "",
|
|
365
|
+
].filter(Boolean);
|
|
366
|
+
return `Captioned <figure> ("${p.caption}"): ${parts.join(", ")} — the caption is not tied to the image.`;
|
|
367
|
+
},
|
|
368
|
+
},
|
|
369
|
+
remediation: {
|
|
370
|
+
fr: (p) => `Ajoutez role="figure" et aria-label="${p.caption}" sur la balise <figure>, identique au contenu du <figcaption>.`,
|
|
371
|
+
en: (p) => `Add role="figure" and aria-label="${p.caption}" to the <figure>, identical to the <figcaption> content.`,
|
|
372
|
+
},
|
|
373
|
+
},
|
|
348
374
|
"chart-no-accessible-name": {
|
|
349
375
|
message: {
|
|
350
376
|
fr: (p) => `Graphique (<${p.tag}> ${p.cls}) sans nom accessible — alternative textuelle manquante.`,
|
package/src/rules/images.ts
CHANGED
|
@@ -209,4 +209,56 @@ const chartNoAccessibleName: Rule = {
|
|
|
209
209
|
},
|
|
210
210
|
};
|
|
211
211
|
|
|
212
|
-
|
|
212
|
+
// RGAA 1.9.1 — an image with a caption (`<img>`, `<input type="image">`, `role="img"`) sits in a
|
|
213
|
+
// `<figure>` that carries `role="figure"` or `role="group"` AND an `aria-label` identical to its
|
|
214
|
+
// `<figcaption>` (the criterion's technical note: assistive technologies still support
|
|
215
|
+
// <figure> poorly, so the association must be explicit). WCAG asks none of this, so the rule
|
|
216
|
+
// ships ADVISORY and the RGAA pack re-normativizes it through `overrides` — the
|
|
217
|
+
// presentational-* pattern. egapro#4921 shipped three charts in a bare <figure>.
|
|
218
|
+
// Conservative: literal role, label and caption only; a spread may carry both attributes.
|
|
219
|
+
const FIGURE_ROLES = new Set(["figure", "group"]);
|
|
220
|
+
const collapseWs = (s: string): string => s.replace(/\s+/g, " ").trim();
|
|
221
|
+
// `:role` / `v-bind:aria-label`… — a framework binding, as opposed to the literal attribute
|
|
222
|
+
// (`boundAttr` matches both, its prefix list starts with "").
|
|
223
|
+
const frameworkBound = (el: El, name: string): boolean => [":", "v-bind:", "x-bind:", "bind:"].some((p) => `${p}${name}` in el.attribs);
|
|
224
|
+
const isCaptionedImage = (d: El): boolean =>
|
|
225
|
+
d.tag === "img" || (d.tag === "input" && (attr(d, "type") ?? "").trim().toLowerCase() === "image") || (attr(d, "role") ?? "").trim().toLowerCase() === "img";
|
|
226
|
+
|
|
227
|
+
const figureCaptionUnassociated: Rule = {
|
|
228
|
+
id: "figure-caption-unassociated",
|
|
229
|
+
criteria: ["1.1.1"],
|
|
230
|
+
severity: "majeur",
|
|
231
|
+
advisory: true,
|
|
232
|
+
run(doc: Doc): RuleFinding[] {
|
|
233
|
+
const out: RuleFinding[] = [];
|
|
234
|
+
for (const el of doc.elements) {
|
|
235
|
+
if (el.tag !== "figure" || isHidden(el) || hasDynamicSpread(el)) continue;
|
|
236
|
+
const desc = descendants(el);
|
|
237
|
+
const caption = desc.find((d) => d.tag === "figcaption");
|
|
238
|
+
if (!caption || !desc.some((d) => d !== caption && isCaptionedImage(d) && !ancestors(d).includes(caption))) continue;
|
|
239
|
+
const captionText = collapseWs(textContent(caption));
|
|
240
|
+
if (!captionText || captionText.includes("{") || mayInjectContent(caption)) continue;
|
|
241
|
+
const role = attr(el, "role");
|
|
242
|
+
const label = attr(el, "aria-label");
|
|
243
|
+
// A bound value we cannot read proves nothing either way.
|
|
244
|
+
if ((role ?? "").includes("{") || (label ?? "").includes("{") || frameworkBound(el, "role") || frameworkBound(el, "aria-label")) continue;
|
|
245
|
+
const missing: string[] = [];
|
|
246
|
+
if (!FIGURE_ROLES.has((role ?? "").trim().toLowerCase())) missing.push("role");
|
|
247
|
+
if (label === undefined || !label.trim()) missing.push("aria-label");
|
|
248
|
+
else if (collapseWs(label) !== captionText) missing.push("aria-label-mismatch");
|
|
249
|
+
if (!missing.length) continue;
|
|
250
|
+
out.push({ criteriaId: "1.1.1", el, msgId: "figure-caption-unassociated", params: { caption: captionText, missing: missing.join(",") } });
|
|
251
|
+
}
|
|
252
|
+
return out;
|
|
253
|
+
},
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
export const imagesRules: Rule[] = [
|
|
257
|
+
figureCaptionUnassociated,
|
|
258
|
+
imgAltMissing,
|
|
259
|
+
decorativeAltMisuse,
|
|
260
|
+
canvasFallbackMissing,
|
|
261
|
+
inputImageAltMissing,
|
|
262
|
+
objectEmbedNoName,
|
|
263
|
+
chartNoAccessibleName,
|
|
264
|
+
];
|
package/src/types.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Single source of truth for shared types + the embedded version. sync-version.mjs
|
|
2
2
|
// rewrites VERSION at release time (kept in lockstep with package.json + SKILL.md).
|
|
3
|
-
export const VERSION = "5.54.
|
|
3
|
+
export const VERSION = "5.54.1";
|
|
4
4
|
export const SCHEMA_VERSION = 2;
|
|
5
5
|
|
|
6
6
|
// Lang = the UI FRAME's language — the `L` localization tables each module (report,
|