ultra11y 5.55.0 → 5.55.2
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/package.json +1 -1
- package/scripts/ultra11y.mjs +51 -17
- package/scripts/vendor/wcag-2.2-techniques.json +6 -6
- package/skills/review-a11y/SKILL.md +1 -1
- package/skills/review-a11y/scripts/ultra11y.mjs +51 -17
- package/skills/ultra11y/SKILL.md +1 -1
- package/skills/ultra11y/scripts/ultra11y.mjs +51 -17
- package/skills/ultra11y/templates/gitlab-ci.yml +1 -1
- package/src/adjudicate-subjects.ts +2 -2
- package/src/cli.ts +6 -3
- package/src/data/guidance/wcag.json +3 -3
- package/src/name.ts +5 -1
- package/src/report.ts +44 -3
- package/src/rules/forms.ts +4 -1
- package/src/rules/headings.ts +11 -3
- package/src/rules/images.ts +3 -1
- package/src/rules/scripts-aria.ts +4 -2
- 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.55.
|
|
13
|
+
"version": "5.55.2",
|
|
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.55.
|
|
4
|
+
"version": "5.55.2",
|
|
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.55.
|
|
4
|
+
"version": "5.55.2",
|
|
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.55.
|
|
30
|
+
const ULTRA11Y_PLUGIN_VERSION = "5.55.2";
|
|
31
31
|
|
|
32
32
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
33
33
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ultra11y",
|
|
3
|
-
"version": "5.55.
|
|
3
|
+
"version": "5.55.2",
|
|
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",
|
package/scripts/ultra11y.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { join as join54, relative as relative6, resolve as resolve18, sep as sep
|
|
|
6
6
|
import { fileURLToPath as fileURLToPath6, pathToFileURL as pathToFileURL3 } from "url";
|
|
7
7
|
|
|
8
8
|
// src/types.ts
|
|
9
|
-
var VERSION = "5.55.
|
|
9
|
+
var VERSION = "5.55.2";
|
|
10
10
|
var SCHEMA_VERSION = 2;
|
|
11
11
|
function isAdjudicated(by) {
|
|
12
12
|
return by === "agent" || by === "human";
|
|
@@ -48646,12 +48646,12 @@ var PROBE_KEYS = {
|
|
|
48646
48646
|
"4.1.3": ["liveRegion"]
|
|
48647
48647
|
};
|
|
48648
48648
|
var MEASURED_SCS = ["1.3.4", "1.4.1", "1.4.3", "1.4.4", "1.4.10", "1.4.11", "1.4.12", "1.4.13", "2.1.2", "2.4.7", "2.4.11", "4.1.3"];
|
|
48649
|
-
var insideRoleImg = (e) => ancestors(e).some((a) => (
|
|
48649
|
+
var insideRoleImg = (e) => ancestors(e).some((a) => roleOf(a) === "img");
|
|
48650
48650
|
var SUBJECTS = {
|
|
48651
48651
|
// Every image-like element and the alternative it carries. Class = (alt, src): the same
|
|
48652
48652
|
// logo on 38 pages is one decision, not 38.
|
|
48653
48653
|
images: (docs) => docs.flatMap(
|
|
48654
|
-
(d) => elementsByTag(d, "img", "svg", "area", "object", "embed", "canvas").concat(elementsByTag(d, "input").filter((e) => (attr(e, "type") ?? "").trim().toLowerCase() === "image")).concat(d.elements.filter((e) =>
|
|
48654
|
+
(d) => elementsByTag(d, "img", "svg", "area", "object", "embed", "canvas").concat(elementsByTag(d, "input").filter((e) => (attr(e, "type") ?? "").trim().toLowerCase() === "image")).concat(d.elements.filter((e) => roleOf(e) === "img")).filter((e, i2, a) => a.indexOf(e) === i2 && !insideRoleImg(e)).map((e) => {
|
|
48655
48655
|
const extra = ["title", "aria-labelledby", "aria-hidden", "role", "aria-describedby", "longdesc"].filter((a) => attr(e, a) !== void 0).map((a) => ` ${a}="${(attr(e, a) ?? "").slice(0, 60)}"`).join("");
|
|
48656
48656
|
const figure = ancestors(e).some((a) => a.tag === "figure");
|
|
48657
48657
|
return h(
|
|
@@ -50070,8 +50070,10 @@ function visibleLabelText(el) {
|
|
|
50070
50070
|
return collapse(out2);
|
|
50071
50071
|
}
|
|
50072
50072
|
var NOT_INTITULE_CLASS = /(^|\s)(fr-hint-text|fr-sr-only|sr-only|visually-hidden|visuallyhidden|hint-text|help-text)(\s|$)/;
|
|
50073
|
+
var VISUALLY_HIDDEN_CLASS = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
|
|
50073
50074
|
var FIELD_DESCENDANT = /* @__PURE__ */ new Set(["input", "select", "textarea", "button", "datalist", "output"]);
|
|
50074
50075
|
function primaryLabelText(label) {
|
|
50076
|
+
if ([label, ...ancestors(label)].some((e) => VISUALLY_HIDDEN_CLASS.test(attr(e, "class") ?? ""))) return "";
|
|
50075
50077
|
let out2 = "";
|
|
50076
50078
|
const nonText = /* @__PURE__ */ new Set(["script", "style", "title", "desc", "noscript", "template", "canvas", "video", "img", "svg"]);
|
|
50077
50079
|
const walk3 = (n) => {
|
|
@@ -50340,7 +50342,7 @@ var figureCaptionUnassociated = {
|
|
|
50340
50342
|
for (const el of doc.elements) {
|
|
50341
50343
|
if (el.tag !== "figure" || isHidden(el) || hasDynamicSpread(el)) continue;
|
|
50342
50344
|
const desc = descendants(el);
|
|
50343
|
-
const caption = desc.find((d) => d.tag === "figcaption");
|
|
50345
|
+
const caption = desc.find((d) => d.tag === "figcaption" && ancestors(d).find((a) => a.tag === "figure") === el);
|
|
50344
50346
|
if (!caption || !desc.some((d) => d !== caption && isCaptionedImage(d) && !ancestors(d).includes(caption))) continue;
|
|
50345
50347
|
const captionText = collapseWs(textContent(caption));
|
|
50346
50348
|
if (!captionText || captionText.includes("{") || mayInjectContent(caption)) continue;
|
|
@@ -51017,7 +51019,9 @@ var menuitemEmptyName = {
|
|
|
51017
51019
|
criteria: ["4.1.2"],
|
|
51018
51020
|
severity: "bloquant",
|
|
51019
51021
|
run(doc) {
|
|
51020
|
-
return doc.elements.filter((el) => ["menuitem", "menuitemcheckbox", "menuitemradio"].includes((attr(el, "role") ?? "").trim().toLowerCase())).filter(
|
|
51022
|
+
return doc.elements.filter((el) => ["menuitem", "menuitemcheckbox", "menuitemradio"].includes((attr(el, "role") ?? "").trim().toLowerCase())).filter(
|
|
51023
|
+
(el) => !isHiddenFromAT(el) && !hasDynamicSpread(el) && !mayInjectContent(el) && !labelledbyIsDynamic(el) && accessibleName(el, doc).trim() === ""
|
|
51024
|
+
).map((el) => ({ criteriaId: "4.1.2", el, msgId: "menuitem-empty-name" }));
|
|
51021
51025
|
}
|
|
51022
51026
|
};
|
|
51023
51027
|
var nestedInteractive = {
|
|
@@ -51693,6 +51697,9 @@ var ALLOWED_IN_LIST = /* @__PURE__ */ new Set(["li", "script", "template", "slot
|
|
|
51693
51697
|
function rendersElsewhere(tag) {
|
|
51694
51698
|
return !isIntrinsic(tag) || tag.includes("-") || tag === "component";
|
|
51695
51699
|
}
|
|
51700
|
+
function listChildren(el) {
|
|
51701
|
+
return el.children.flatMap((c2) => c2.type !== "element" ? [] : c2.tag === "#fragment" ? listChildren(c2) : [c2]);
|
|
51702
|
+
}
|
|
51696
51703
|
var listStructure = {
|
|
51697
51704
|
id: "list-structure",
|
|
51698
51705
|
criteria: ["1.3.1"],
|
|
@@ -51701,8 +51708,8 @@ var listStructure = {
|
|
|
51701
51708
|
const out2 = [];
|
|
51702
51709
|
for (const el of doc.elements) {
|
|
51703
51710
|
if (el.tag === "ul" || el.tag === "ol") {
|
|
51704
|
-
const bad = el.
|
|
51705
|
-
if (bad
|
|
51711
|
+
const bad = listChildren(el).find((c2) => !rendersElsewhere(c2.tag) && !ALLOWED_IN_LIST.has(c2.tag));
|
|
51712
|
+
if (bad) {
|
|
51706
51713
|
out2.push({
|
|
51707
51714
|
criteriaId: "1.3.1",
|
|
51708
51715
|
el: bad,
|
|
@@ -51716,7 +51723,7 @@ var listStructure = {
|
|
|
51716
51723
|
if (parent.tag === "template" || ancestors(el).some((a) => a.tag === "template" || a.tag !== "#fragment" && rendersElsewhere(a.tag))) continue;
|
|
51717
51724
|
let host = parent;
|
|
51718
51725
|
while (host && host.tag === "#fragment") host = host.parent;
|
|
51719
|
-
if (!host) continue;
|
|
51726
|
+
if (!host || ["ul", "ol", "menu"].includes(host.tag)) continue;
|
|
51720
51727
|
out2.push({
|
|
51721
51728
|
criteriaId: "1.3.1",
|
|
51722
51729
|
el,
|
|
@@ -52450,7 +52457,8 @@ var controlLabelMissing = {
|
|
|
52450
52457
|
if (via === "title") continue;
|
|
52451
52458
|
if (hasDynamicSpread(el)) continue;
|
|
52452
52459
|
if (hasAttr(el, "placeholder")) continue;
|
|
52453
|
-
|
|
52460
|
+
const id = attr(el, "id");
|
|
52461
|
+
if (id === void 0 ? hasBoundAttr(el, "id") : id.includes("{")) continue;
|
|
52454
52462
|
out2.push({
|
|
52455
52463
|
criteriaId: "4.1.2",
|
|
52456
52464
|
el,
|
|
@@ -60599,9 +60607,13 @@ var wcag_default2 = {
|
|
|
60599
60607
|
examples: [
|
|
60600
60608
|
{
|
|
60601
60609
|
lang: "html",
|
|
60602
|
-
good:
|
|
60610
|
+
good: `<dialog aria-labelledby="alert-heading" id="date-alert" role="alertdialog">
|
|
60611
|
+
<h1 id="alert-heading">Error</h1>
|
|
60612
|
+
<p>Employee's Birth Date is after their hire date. Please verify the birth date and hire date.</p>
|
|
60613
|
+
<button command="close" commandfor="date-alert" type="button">Return to page and correct error</button>
|
|
60614
|
+
</dialog>`,
|
|
60603
60615
|
note: {
|
|
60604
|
-
en: "Good: Using aria-
|
|
60616
|
+
en: "Good: Using aria-alertdialog to Identify Errors (ARIA18)."
|
|
60605
60617
|
}
|
|
60606
60618
|
}
|
|
60607
60619
|
],
|
|
@@ -60714,7 +60726,7 @@ var wcag_default2 = {
|
|
|
60714
60726
|
fr: "Nom, r\xF4le et valeur"
|
|
60715
60727
|
},
|
|
60716
60728
|
summary: {
|
|
60717
|
-
en: "Give components
|
|
60729
|
+
en: "Give components appropriate names, roles, states, and values. People using assistive technology understand all components. Assistive technology only works well when code is done properly."
|
|
60718
60730
|
},
|
|
60719
60731
|
examples: [
|
|
60720
60732
|
{
|
|
@@ -63007,6 +63019,11 @@ var L5 = {
|
|
|
63007
63019
|
// Task 5 — partial-audit advisory (owner decision: scan stays opt-in but strongly advised).
|
|
63008
63020
|
// The list names ONLY the needs-rendering criteria still untested (real coverage).
|
|
63009
63021
|
partialAudit: (list) => `Audit partiel \u2014 les crit\xE8res \xAB \xE0 restituer \xBB (${list}) n'ont pas \xE9t\xE9 test\xE9s. Lancez \`ultra11y scan --sample\` (Playwright + axe + sondes) sur l'\xE9chantillon, puis fusionnez avec \`scan --merge\`.`,
|
|
63022
|
+
// #100 — a browser pass DID run: re-advising `scan --sample` sends the reader in a circle.
|
|
63023
|
+
partialAuditScanned: (list, notes) => `Audit partiel \u2014 un passage navigateur a eu lieu, mais les crit\xE8res \xAB \xE0 restituer \xBB (${list}) n'y ont pas \xE9t\xE9 mesur\xE9s. ${notes}`,
|
|
63024
|
+
partialAuditLive: "R\xE9gions live : elles ne se mesurent qu'avec les interactions actives, qu'un scan authentifi\xE9 (`--storage-state`) ou `--no-interact` coupe \u2014 enregistrez ces pages avec la fixture Playwright (`checkA11y` / `sweepSample`) ou relancez `scan` avec les interactions.",
|
|
63025
|
+
partialAuditRendered: "Couleur, contraste et focus se mesurent sur les captures : chacune doit porter une empreinte de styles (`styles.json`) accept\xE9e par le moteur ; une capture dont l'empreinte est absente ou refus\xE9e ne mesure rien \u2014 recapturez-la avec une version \xE0 jour.",
|
|
63026
|
+
partialAuditProbes: "Zoom, reflow, espacement, survol, pi\xE8ge clavier et focus masqu\xE9 se mesurent par les sondes : relancez `scan --sample` (ou la fixture avec `probes: true`) sur les pages qui n'ont pas \xE9t\xE9 sond\xE9es.",
|
|
63010
63027
|
// Task 5 — « Constats par page » (Ara-style per-sample-page synthesis).
|
|
63011
63028
|
perPageTitle: "Constats par page",
|
|
63012
63029
|
perPageNote: "Pour chaque page de l'\xE9chantillon : sa capture d'\xE9cran et les crit\xE8res non conformes relev\xE9s sur cette page.",
|
|
@@ -63206,6 +63223,10 @@ var L5 = {
|
|
|
63206
63223
|
// Task 5 — partial-audit advisory (owner decision: scan stays opt-in but strongly advised).
|
|
63207
63224
|
// The list names ONLY the needs-rendering criteria still untested (real coverage).
|
|
63208
63225
|
partialAudit: (list) => `Partial audit \u2014 the needs-rendering criteria (${list}) were not tested. Run \`ultra11y scan --sample\` (Playwright + axe + probes) on the sample, then merge with \`scan --merge\`.`,
|
|
63226
|
+
partialAuditScanned: (list, notes) => `Partial audit \u2014 a browser pass ran, but the needs-rendering criteria (${list}) were not measured by it. ${notes}`,
|
|
63227
|
+
partialAuditLive: "Live regions: they are only measured with interactions on, which an authenticated scan (`--storage-state`) or `--no-interact` turns off \u2014 record those pages with the Playwright fixture (`checkA11y` / `sweepSample`) or re-run `scan` with interactions.",
|
|
63228
|
+
partialAuditRendered: "Colour, contrast and focus are measured on the captures: each needs a style digest (`styles.json`) the engine accepts; a capture whose digest is missing or refused measures nothing \u2014 recapture it with an up-to-date version.",
|
|
63229
|
+
partialAuditProbes: "Zoom, reflow, spacing, hover, keyboard trap and focus obscured are measured by the probes: re-run `scan --sample` (or the fixture with `probes: true`) on the pages that were not probed.",
|
|
63209
63230
|
// Task 5 — « Findings per page » (Ara-style per-sample-page synthesis).
|
|
63210
63231
|
perPageTitle: "Findings per page",
|
|
63211
63232
|
perPageNote: "For each sample page: its screenshot and the criteria found non-conforming on that page.",
|
|
@@ -63350,10 +63371,23 @@ function establishedScs(derived) {
|
|
|
63350
63371
|
}
|
|
63351
63372
|
return out2;
|
|
63352
63373
|
}
|
|
63353
|
-
function partialAuditBanner(lang, untested = NEEDS_RENDERING.map((c2) => c2.sc)) {
|
|
63374
|
+
function partialAuditBanner(lang, untested = NEEDS_RENDERING.map((c2) => c2.sc), ctx = {}) {
|
|
63354
63375
|
const set = new Set(untested);
|
|
63355
63376
|
const labels = NEEDS_RENDERING.filter((c2) => set.has(c2.sc)).map((c2) => c2.label[lang]);
|
|
63356
|
-
return L5[lang].partialAudit(labels.join(", "));
|
|
63377
|
+
if (!ctx.scanned) return L5[lang].partialAudit(labels.join(", "));
|
|
63378
|
+
const notes = [
|
|
63379
|
+
set.has("4.1.3") ? L5[lang].partialAuditLive : "",
|
|
63380
|
+
untested.some((sc) => RENDERED_TIER_SCS.has(sc)) ? L5[lang].partialAuditRendered : "",
|
|
63381
|
+
untested.some((sc) => sc !== "4.1.3" && !RENDERED_TIER_SCS.has(sc)) ? L5[lang].partialAuditProbes : ""
|
|
63382
|
+
].filter(Boolean);
|
|
63383
|
+
return L5[lang].partialAuditScanned(labels.join(", "), notes.join(" "));
|
|
63384
|
+
}
|
|
63385
|
+
var RENDERED_TIER_SCS = /* @__PURE__ */ new Set(["1.3.4", "1.4.1", "1.4.3", "1.4.11", "2.4.7"]);
|
|
63386
|
+
function ranBrowser(r) {
|
|
63387
|
+
return (r.scope.scan?.testedScs?.length ?? 0) > 0 || (r.scope.captures?.files ?? 0) > 0 || (r.scope.pagesAudited?.length ?? 0) > 0;
|
|
63388
|
+
}
|
|
63389
|
+
function packPartialAudit(r, standard) {
|
|
63390
|
+
return untestedNeedsRendering(r, establishedScs(derivePackResults(r, standard)));
|
|
63357
63391
|
}
|
|
63358
63392
|
function tallyRows(rows) {
|
|
63359
63393
|
return {
|
|
@@ -64033,7 +64067,7 @@ function render(r, lang, opts) {
|
|
|
64033
64067
|
if (r.scope.dedup) ax.push(`- **${s.dedup}** : ${r.scope.dedup.canonicalFiles} ${s.canonical}, ${r.scope.dedup.duplicateFiles} ${s.duplicate}`);
|
|
64034
64068
|
ax.push("");
|
|
64035
64069
|
ax.push(`> \u26A0\uFE0F ${s.warn}`, "");
|
|
64036
|
-
if (opts.partialAudit?.length) ax.push(`> \u{1F6A8} ${partialAuditBanner(lang, opts.partialAudit)}`, "");
|
|
64070
|
+
if (opts.partialAudit?.length) ax.push(`> \u{1F6A8} ${partialAuditBanner(lang, opts.partialAudit, { scanned: ranBrowser(r) })}`, "");
|
|
64037
64071
|
if (!pageScope.length) ax.push(`> \u{1F9ED} ${s.noPagesNoteTech}`, "");
|
|
64038
64072
|
if (opts.derivedOf) ax.push(`> \u21AA\uFE0F ${s.derived(opts.derivedOf)}`, "");
|
|
64039
64073
|
if (r.scope.truncated) ax.push(`> \u2702\uFE0F ${s.truncated(r.scope.truncated.limit, r.scope.truncated.total, r.scope.truncated.skipped)}`, "");
|
|
@@ -79646,9 +79680,9 @@ async function cmdReport(p) {
|
|
|
79646
79680
|
if (p.flags.html === true) {
|
|
79647
79681
|
html = emitHtml(result, { outDir: out2, standard, lang, ...manifest ? { evidence: manifest } : {}, inlineBudget: budgetOf(p) });
|
|
79648
79682
|
}
|
|
79649
|
-
const untested = isCore(standard) ? [] :
|
|
79683
|
+
const untested = isCore(standard) ? [] : packPartialAudit(result, standard);
|
|
79650
79684
|
const partial = untested.length > 0;
|
|
79651
|
-
if (partial && !p.flags.json) console.error(`\u{1F6A8} ${partialAuditBanner(lang, untested)}`);
|
|
79685
|
+
if (partial && !p.flags.json) console.error(`\u{1F6A8} ${partialAuditBanner(lang, untested, { scanned: ranBrowser(result) })}`);
|
|
79652
79686
|
if (p.flags.json)
|
|
79653
79687
|
console.log(
|
|
79654
79688
|
JSON.stringify(
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"source": "https://github.com/w3c/wcag",
|
|
3
3
|
"understanding": "https://www.w3.org/WAI/WCAG22/Understanding/",
|
|
4
4
|
"license": "W3C Document License (code samples: W3C Software License)",
|
|
5
|
-
"fetchedAt": "2026-
|
|
5
|
+
"fetchedAt": "2026-11-02",
|
|
6
6
|
"criteria": {
|
|
7
7
|
"1.1.1": {
|
|
8
8
|
"slug": "non-text-content",
|
|
@@ -731,11 +731,11 @@
|
|
|
731
731
|
"whyitsimportant": "Flagging errors helps people with reduced sight and cognitive disabilities resolve them."
|
|
732
732
|
},
|
|
733
733
|
"good": {
|
|
734
|
-
"id": "
|
|
735
|
-
"title": "Using aria-
|
|
734
|
+
"id": "ARIA18",
|
|
735
|
+
"title": "Using aria-alertdialog to Identify Errors",
|
|
736
736
|
"lang": "html",
|
|
737
|
-
"code": "<
|
|
738
|
-
"note": "
|
|
737
|
+
"code": "<dialog aria-labelledby=\"alert-heading\" id=\"date-alert\" role=\"alertdialog\">\n <h1 id=\"alert-heading\">Error</h1>\n <p>Employee's Birth Date is after their hire date. Please verify the birth date and hire date.</p>\n <button command=\"close\" commandfor=\"date-alert\" type=\"button\">Return to page and correct error</button>\n</dialog>",
|
|
738
|
+
"note": "Alert dialog This example shows how a notification using role=\"alertdialog\" can be used to notify someone they have entered invalid information."
|
|
739
739
|
}
|
|
740
740
|
},
|
|
741
741
|
"3.3.2": {
|
|
@@ -803,7 +803,7 @@
|
|
|
803
803
|
"slug": "name-role-value",
|
|
804
804
|
"brief": {
|
|
805
805
|
"goal": "People using assistive technology understand all components.",
|
|
806
|
-
"whattodo": "Give components
|
|
806
|
+
"whattodo": "Give components appropriate names, roles, states, and values.",
|
|
807
807
|
"whyitsimportant": "Assistive technology only works well when code is done properly."
|
|
808
808
|
},
|
|
809
809
|
"good": {
|
|
@@ -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.55.
|
|
6
|
+
version: 5.55.2
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# review-a11y — accessibility review of changed code
|
|
@@ -6,7 +6,7 @@ import { join as join54, relative as relative6, resolve as resolve18, sep as sep
|
|
|
6
6
|
import { fileURLToPath as fileURLToPath6, pathToFileURL as pathToFileURL3 } from "url";
|
|
7
7
|
|
|
8
8
|
// src/types.ts
|
|
9
|
-
var VERSION = "5.55.
|
|
9
|
+
var VERSION = "5.55.2";
|
|
10
10
|
var SCHEMA_VERSION = 2;
|
|
11
11
|
function isAdjudicated(by) {
|
|
12
12
|
return by === "agent" || by === "human";
|
|
@@ -48646,12 +48646,12 @@ var PROBE_KEYS = {
|
|
|
48646
48646
|
"4.1.3": ["liveRegion"]
|
|
48647
48647
|
};
|
|
48648
48648
|
var MEASURED_SCS = ["1.3.4", "1.4.1", "1.4.3", "1.4.4", "1.4.10", "1.4.11", "1.4.12", "1.4.13", "2.1.2", "2.4.7", "2.4.11", "4.1.3"];
|
|
48649
|
-
var insideRoleImg = (e) => ancestors(e).some((a) => (
|
|
48649
|
+
var insideRoleImg = (e) => ancestors(e).some((a) => roleOf(a) === "img");
|
|
48650
48650
|
var SUBJECTS = {
|
|
48651
48651
|
// Every image-like element and the alternative it carries. Class = (alt, src): the same
|
|
48652
48652
|
// logo on 38 pages is one decision, not 38.
|
|
48653
48653
|
images: (docs) => docs.flatMap(
|
|
48654
|
-
(d) => elementsByTag(d, "img", "svg", "area", "object", "embed", "canvas").concat(elementsByTag(d, "input").filter((e) => (attr(e, "type") ?? "").trim().toLowerCase() === "image")).concat(d.elements.filter((e) =>
|
|
48654
|
+
(d) => elementsByTag(d, "img", "svg", "area", "object", "embed", "canvas").concat(elementsByTag(d, "input").filter((e) => (attr(e, "type") ?? "").trim().toLowerCase() === "image")).concat(d.elements.filter((e) => roleOf(e) === "img")).filter((e, i2, a) => a.indexOf(e) === i2 && !insideRoleImg(e)).map((e) => {
|
|
48655
48655
|
const extra = ["title", "aria-labelledby", "aria-hidden", "role", "aria-describedby", "longdesc"].filter((a) => attr(e, a) !== void 0).map((a) => ` ${a}="${(attr(e, a) ?? "").slice(0, 60)}"`).join("");
|
|
48656
48656
|
const figure = ancestors(e).some((a) => a.tag === "figure");
|
|
48657
48657
|
return h(
|
|
@@ -50070,8 +50070,10 @@ function visibleLabelText(el) {
|
|
|
50070
50070
|
return collapse(out2);
|
|
50071
50071
|
}
|
|
50072
50072
|
var NOT_INTITULE_CLASS = /(^|\s)(fr-hint-text|fr-sr-only|sr-only|visually-hidden|visuallyhidden|hint-text|help-text)(\s|$)/;
|
|
50073
|
+
var VISUALLY_HIDDEN_CLASS = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
|
|
50073
50074
|
var FIELD_DESCENDANT = /* @__PURE__ */ new Set(["input", "select", "textarea", "button", "datalist", "output"]);
|
|
50074
50075
|
function primaryLabelText(label) {
|
|
50076
|
+
if ([label, ...ancestors(label)].some((e) => VISUALLY_HIDDEN_CLASS.test(attr(e, "class") ?? ""))) return "";
|
|
50075
50077
|
let out2 = "";
|
|
50076
50078
|
const nonText = /* @__PURE__ */ new Set(["script", "style", "title", "desc", "noscript", "template", "canvas", "video", "img", "svg"]);
|
|
50077
50079
|
const walk3 = (n) => {
|
|
@@ -50340,7 +50342,7 @@ var figureCaptionUnassociated = {
|
|
|
50340
50342
|
for (const el of doc.elements) {
|
|
50341
50343
|
if (el.tag !== "figure" || isHidden(el) || hasDynamicSpread(el)) continue;
|
|
50342
50344
|
const desc = descendants(el);
|
|
50343
|
-
const caption = desc.find((d) => d.tag === "figcaption");
|
|
50345
|
+
const caption = desc.find((d) => d.tag === "figcaption" && ancestors(d).find((a) => a.tag === "figure") === el);
|
|
50344
50346
|
if (!caption || !desc.some((d) => d !== caption && isCaptionedImage(d) && !ancestors(d).includes(caption))) continue;
|
|
50345
50347
|
const captionText = collapseWs(textContent(caption));
|
|
50346
50348
|
if (!captionText || captionText.includes("{") || mayInjectContent(caption)) continue;
|
|
@@ -51017,7 +51019,9 @@ var menuitemEmptyName = {
|
|
|
51017
51019
|
criteria: ["4.1.2"],
|
|
51018
51020
|
severity: "bloquant",
|
|
51019
51021
|
run(doc) {
|
|
51020
|
-
return doc.elements.filter((el) => ["menuitem", "menuitemcheckbox", "menuitemradio"].includes((attr(el, "role") ?? "").trim().toLowerCase())).filter(
|
|
51022
|
+
return doc.elements.filter((el) => ["menuitem", "menuitemcheckbox", "menuitemradio"].includes((attr(el, "role") ?? "").trim().toLowerCase())).filter(
|
|
51023
|
+
(el) => !isHiddenFromAT(el) && !hasDynamicSpread(el) && !mayInjectContent(el) && !labelledbyIsDynamic(el) && accessibleName(el, doc).trim() === ""
|
|
51024
|
+
).map((el) => ({ criteriaId: "4.1.2", el, msgId: "menuitem-empty-name" }));
|
|
51021
51025
|
}
|
|
51022
51026
|
};
|
|
51023
51027
|
var nestedInteractive = {
|
|
@@ -51693,6 +51697,9 @@ var ALLOWED_IN_LIST = /* @__PURE__ */ new Set(["li", "script", "template", "slot
|
|
|
51693
51697
|
function rendersElsewhere(tag) {
|
|
51694
51698
|
return !isIntrinsic(tag) || tag.includes("-") || tag === "component";
|
|
51695
51699
|
}
|
|
51700
|
+
function listChildren(el) {
|
|
51701
|
+
return el.children.flatMap((c2) => c2.type !== "element" ? [] : c2.tag === "#fragment" ? listChildren(c2) : [c2]);
|
|
51702
|
+
}
|
|
51696
51703
|
var listStructure = {
|
|
51697
51704
|
id: "list-structure",
|
|
51698
51705
|
criteria: ["1.3.1"],
|
|
@@ -51701,8 +51708,8 @@ var listStructure = {
|
|
|
51701
51708
|
const out2 = [];
|
|
51702
51709
|
for (const el of doc.elements) {
|
|
51703
51710
|
if (el.tag === "ul" || el.tag === "ol") {
|
|
51704
|
-
const bad = el.
|
|
51705
|
-
if (bad
|
|
51711
|
+
const bad = listChildren(el).find((c2) => !rendersElsewhere(c2.tag) && !ALLOWED_IN_LIST.has(c2.tag));
|
|
51712
|
+
if (bad) {
|
|
51706
51713
|
out2.push({
|
|
51707
51714
|
criteriaId: "1.3.1",
|
|
51708
51715
|
el: bad,
|
|
@@ -51716,7 +51723,7 @@ var listStructure = {
|
|
|
51716
51723
|
if (parent.tag === "template" || ancestors(el).some((a) => a.tag === "template" || a.tag !== "#fragment" && rendersElsewhere(a.tag))) continue;
|
|
51717
51724
|
let host = parent;
|
|
51718
51725
|
while (host && host.tag === "#fragment") host = host.parent;
|
|
51719
|
-
if (!host) continue;
|
|
51726
|
+
if (!host || ["ul", "ol", "menu"].includes(host.tag)) continue;
|
|
51720
51727
|
out2.push({
|
|
51721
51728
|
criteriaId: "1.3.1",
|
|
51722
51729
|
el,
|
|
@@ -52450,7 +52457,8 @@ var controlLabelMissing = {
|
|
|
52450
52457
|
if (via === "title") continue;
|
|
52451
52458
|
if (hasDynamicSpread(el)) continue;
|
|
52452
52459
|
if (hasAttr(el, "placeholder")) continue;
|
|
52453
|
-
|
|
52460
|
+
const id = attr(el, "id");
|
|
52461
|
+
if (id === void 0 ? hasBoundAttr(el, "id") : id.includes("{")) continue;
|
|
52454
52462
|
out2.push({
|
|
52455
52463
|
criteriaId: "4.1.2",
|
|
52456
52464
|
el,
|
|
@@ -60599,9 +60607,13 @@ var wcag_default2 = {
|
|
|
60599
60607
|
examples: [
|
|
60600
60608
|
{
|
|
60601
60609
|
lang: "html",
|
|
60602
|
-
good:
|
|
60610
|
+
good: `<dialog aria-labelledby="alert-heading" id="date-alert" role="alertdialog">
|
|
60611
|
+
<h1 id="alert-heading">Error</h1>
|
|
60612
|
+
<p>Employee's Birth Date is after their hire date. Please verify the birth date and hire date.</p>
|
|
60613
|
+
<button command="close" commandfor="date-alert" type="button">Return to page and correct error</button>
|
|
60614
|
+
</dialog>`,
|
|
60603
60615
|
note: {
|
|
60604
|
-
en: "Good: Using aria-
|
|
60616
|
+
en: "Good: Using aria-alertdialog to Identify Errors (ARIA18)."
|
|
60605
60617
|
}
|
|
60606
60618
|
}
|
|
60607
60619
|
],
|
|
@@ -60714,7 +60726,7 @@ var wcag_default2 = {
|
|
|
60714
60726
|
fr: "Nom, r\xF4le et valeur"
|
|
60715
60727
|
},
|
|
60716
60728
|
summary: {
|
|
60717
|
-
en: "Give components
|
|
60729
|
+
en: "Give components appropriate names, roles, states, and values. People using assistive technology understand all components. Assistive technology only works well when code is done properly."
|
|
60718
60730
|
},
|
|
60719
60731
|
examples: [
|
|
60720
60732
|
{
|
|
@@ -63007,6 +63019,11 @@ var L5 = {
|
|
|
63007
63019
|
// Task 5 — partial-audit advisory (owner decision: scan stays opt-in but strongly advised).
|
|
63008
63020
|
// The list names ONLY the needs-rendering criteria still untested (real coverage).
|
|
63009
63021
|
partialAudit: (list) => `Audit partiel \u2014 les crit\xE8res \xAB \xE0 restituer \xBB (${list}) n'ont pas \xE9t\xE9 test\xE9s. Lancez \`ultra11y scan --sample\` (Playwright + axe + sondes) sur l'\xE9chantillon, puis fusionnez avec \`scan --merge\`.`,
|
|
63022
|
+
// #100 — a browser pass DID run: re-advising `scan --sample` sends the reader in a circle.
|
|
63023
|
+
partialAuditScanned: (list, notes) => `Audit partiel \u2014 un passage navigateur a eu lieu, mais les crit\xE8res \xAB \xE0 restituer \xBB (${list}) n'y ont pas \xE9t\xE9 mesur\xE9s. ${notes}`,
|
|
63024
|
+
partialAuditLive: "R\xE9gions live : elles ne se mesurent qu'avec les interactions actives, qu'un scan authentifi\xE9 (`--storage-state`) ou `--no-interact` coupe \u2014 enregistrez ces pages avec la fixture Playwright (`checkA11y` / `sweepSample`) ou relancez `scan` avec les interactions.",
|
|
63025
|
+
partialAuditRendered: "Couleur, contraste et focus se mesurent sur les captures : chacune doit porter une empreinte de styles (`styles.json`) accept\xE9e par le moteur ; une capture dont l'empreinte est absente ou refus\xE9e ne mesure rien \u2014 recapturez-la avec une version \xE0 jour.",
|
|
63026
|
+
partialAuditProbes: "Zoom, reflow, espacement, survol, pi\xE8ge clavier et focus masqu\xE9 se mesurent par les sondes : relancez `scan --sample` (ou la fixture avec `probes: true`) sur les pages qui n'ont pas \xE9t\xE9 sond\xE9es.",
|
|
63010
63027
|
// Task 5 — « Constats par page » (Ara-style per-sample-page synthesis).
|
|
63011
63028
|
perPageTitle: "Constats par page",
|
|
63012
63029
|
perPageNote: "Pour chaque page de l'\xE9chantillon : sa capture d'\xE9cran et les crit\xE8res non conformes relev\xE9s sur cette page.",
|
|
@@ -63206,6 +63223,10 @@ var L5 = {
|
|
|
63206
63223
|
// Task 5 — partial-audit advisory (owner decision: scan stays opt-in but strongly advised).
|
|
63207
63224
|
// The list names ONLY the needs-rendering criteria still untested (real coverage).
|
|
63208
63225
|
partialAudit: (list) => `Partial audit \u2014 the needs-rendering criteria (${list}) were not tested. Run \`ultra11y scan --sample\` (Playwright + axe + probes) on the sample, then merge with \`scan --merge\`.`,
|
|
63226
|
+
partialAuditScanned: (list, notes) => `Partial audit \u2014 a browser pass ran, but the needs-rendering criteria (${list}) were not measured by it. ${notes}`,
|
|
63227
|
+
partialAuditLive: "Live regions: they are only measured with interactions on, which an authenticated scan (`--storage-state`) or `--no-interact` turns off \u2014 record those pages with the Playwright fixture (`checkA11y` / `sweepSample`) or re-run `scan` with interactions.",
|
|
63228
|
+
partialAuditRendered: "Colour, contrast and focus are measured on the captures: each needs a style digest (`styles.json`) the engine accepts; a capture whose digest is missing or refused measures nothing \u2014 recapture it with an up-to-date version.",
|
|
63229
|
+
partialAuditProbes: "Zoom, reflow, spacing, hover, keyboard trap and focus obscured are measured by the probes: re-run `scan --sample` (or the fixture with `probes: true`) on the pages that were not probed.",
|
|
63209
63230
|
// Task 5 — « Findings per page » (Ara-style per-sample-page synthesis).
|
|
63210
63231
|
perPageTitle: "Findings per page",
|
|
63211
63232
|
perPageNote: "For each sample page: its screenshot and the criteria found non-conforming on that page.",
|
|
@@ -63350,10 +63371,23 @@ function establishedScs(derived) {
|
|
|
63350
63371
|
}
|
|
63351
63372
|
return out2;
|
|
63352
63373
|
}
|
|
63353
|
-
function partialAuditBanner(lang, untested = NEEDS_RENDERING.map((c2) => c2.sc)) {
|
|
63374
|
+
function partialAuditBanner(lang, untested = NEEDS_RENDERING.map((c2) => c2.sc), ctx = {}) {
|
|
63354
63375
|
const set = new Set(untested);
|
|
63355
63376
|
const labels = NEEDS_RENDERING.filter((c2) => set.has(c2.sc)).map((c2) => c2.label[lang]);
|
|
63356
|
-
return L5[lang].partialAudit(labels.join(", "));
|
|
63377
|
+
if (!ctx.scanned) return L5[lang].partialAudit(labels.join(", "));
|
|
63378
|
+
const notes = [
|
|
63379
|
+
set.has("4.1.3") ? L5[lang].partialAuditLive : "",
|
|
63380
|
+
untested.some((sc) => RENDERED_TIER_SCS.has(sc)) ? L5[lang].partialAuditRendered : "",
|
|
63381
|
+
untested.some((sc) => sc !== "4.1.3" && !RENDERED_TIER_SCS.has(sc)) ? L5[lang].partialAuditProbes : ""
|
|
63382
|
+
].filter(Boolean);
|
|
63383
|
+
return L5[lang].partialAuditScanned(labels.join(", "), notes.join(" "));
|
|
63384
|
+
}
|
|
63385
|
+
var RENDERED_TIER_SCS = /* @__PURE__ */ new Set(["1.3.4", "1.4.1", "1.4.3", "1.4.11", "2.4.7"]);
|
|
63386
|
+
function ranBrowser(r) {
|
|
63387
|
+
return (r.scope.scan?.testedScs?.length ?? 0) > 0 || (r.scope.captures?.files ?? 0) > 0 || (r.scope.pagesAudited?.length ?? 0) > 0;
|
|
63388
|
+
}
|
|
63389
|
+
function packPartialAudit(r, standard) {
|
|
63390
|
+
return untestedNeedsRendering(r, establishedScs(derivePackResults(r, standard)));
|
|
63357
63391
|
}
|
|
63358
63392
|
function tallyRows(rows) {
|
|
63359
63393
|
return {
|
|
@@ -64033,7 +64067,7 @@ function render(r, lang, opts) {
|
|
|
64033
64067
|
if (r.scope.dedup) ax.push(`- **${s.dedup}** : ${r.scope.dedup.canonicalFiles} ${s.canonical}, ${r.scope.dedup.duplicateFiles} ${s.duplicate}`);
|
|
64034
64068
|
ax.push("");
|
|
64035
64069
|
ax.push(`> \u26A0\uFE0F ${s.warn}`, "");
|
|
64036
|
-
if (opts.partialAudit?.length) ax.push(`> \u{1F6A8} ${partialAuditBanner(lang, opts.partialAudit)}`, "");
|
|
64070
|
+
if (opts.partialAudit?.length) ax.push(`> \u{1F6A8} ${partialAuditBanner(lang, opts.partialAudit, { scanned: ranBrowser(r) })}`, "");
|
|
64037
64071
|
if (!pageScope.length) ax.push(`> \u{1F9ED} ${s.noPagesNoteTech}`, "");
|
|
64038
64072
|
if (opts.derivedOf) ax.push(`> \u21AA\uFE0F ${s.derived(opts.derivedOf)}`, "");
|
|
64039
64073
|
if (r.scope.truncated) ax.push(`> \u2702\uFE0F ${s.truncated(r.scope.truncated.limit, r.scope.truncated.total, r.scope.truncated.skipped)}`, "");
|
|
@@ -79646,9 +79680,9 @@ async function cmdReport(p) {
|
|
|
79646
79680
|
if (p.flags.html === true) {
|
|
79647
79681
|
html = emitHtml(result, { outDir: out2, standard, lang, ...manifest ? { evidence: manifest } : {}, inlineBudget: budgetOf(p) });
|
|
79648
79682
|
}
|
|
79649
|
-
const untested = isCore(standard) ? [] :
|
|
79683
|
+
const untested = isCore(standard) ? [] : packPartialAudit(result, standard);
|
|
79650
79684
|
const partial = untested.length > 0;
|
|
79651
|
-
if (partial && !p.flags.json) console.error(`\u{1F6A8} ${partialAuditBanner(lang, untested)}`);
|
|
79685
|
+
if (partial && !p.flags.json) console.error(`\u{1F6A8} ${partialAuditBanner(lang, untested, { scanned: ranBrowser(result) })}`);
|
|
79652
79686
|
if (p.flags.json)
|
|
79653
79687
|
console.log(
|
|
79654
79688
|
JSON.stringify(
|
package/skills/ultra11y/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: ultra11y
|
|
|
3
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 102 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.55.
|
|
6
|
+
version: 5.55.2
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# ultra11y — audit WCAG 2.2 AA and write accessible markup
|
|
@@ -6,7 +6,7 @@ import { join as join54, relative as relative6, resolve as resolve18, sep as sep
|
|
|
6
6
|
import { fileURLToPath as fileURLToPath6, pathToFileURL as pathToFileURL3 } from "url";
|
|
7
7
|
|
|
8
8
|
// src/types.ts
|
|
9
|
-
var VERSION = "5.55.
|
|
9
|
+
var VERSION = "5.55.2";
|
|
10
10
|
var SCHEMA_VERSION = 2;
|
|
11
11
|
function isAdjudicated(by) {
|
|
12
12
|
return by === "agent" || by === "human";
|
|
@@ -48646,12 +48646,12 @@ var PROBE_KEYS = {
|
|
|
48646
48646
|
"4.1.3": ["liveRegion"]
|
|
48647
48647
|
};
|
|
48648
48648
|
var MEASURED_SCS = ["1.3.4", "1.4.1", "1.4.3", "1.4.4", "1.4.10", "1.4.11", "1.4.12", "1.4.13", "2.1.2", "2.4.7", "2.4.11", "4.1.3"];
|
|
48649
|
-
var insideRoleImg = (e) => ancestors(e).some((a) => (
|
|
48649
|
+
var insideRoleImg = (e) => ancestors(e).some((a) => roleOf(a) === "img");
|
|
48650
48650
|
var SUBJECTS = {
|
|
48651
48651
|
// Every image-like element and the alternative it carries. Class = (alt, src): the same
|
|
48652
48652
|
// logo on 38 pages is one decision, not 38.
|
|
48653
48653
|
images: (docs) => docs.flatMap(
|
|
48654
|
-
(d) => elementsByTag(d, "img", "svg", "area", "object", "embed", "canvas").concat(elementsByTag(d, "input").filter((e) => (attr(e, "type") ?? "").trim().toLowerCase() === "image")).concat(d.elements.filter((e) =>
|
|
48654
|
+
(d) => elementsByTag(d, "img", "svg", "area", "object", "embed", "canvas").concat(elementsByTag(d, "input").filter((e) => (attr(e, "type") ?? "").trim().toLowerCase() === "image")).concat(d.elements.filter((e) => roleOf(e) === "img")).filter((e, i2, a) => a.indexOf(e) === i2 && !insideRoleImg(e)).map((e) => {
|
|
48655
48655
|
const extra = ["title", "aria-labelledby", "aria-hidden", "role", "aria-describedby", "longdesc"].filter((a) => attr(e, a) !== void 0).map((a) => ` ${a}="${(attr(e, a) ?? "").slice(0, 60)}"`).join("");
|
|
48656
48656
|
const figure = ancestors(e).some((a) => a.tag === "figure");
|
|
48657
48657
|
return h(
|
|
@@ -50070,8 +50070,10 @@ function visibleLabelText(el) {
|
|
|
50070
50070
|
return collapse(out2);
|
|
50071
50071
|
}
|
|
50072
50072
|
var NOT_INTITULE_CLASS = /(^|\s)(fr-hint-text|fr-sr-only|sr-only|visually-hidden|visuallyhidden|hint-text|help-text)(\s|$)/;
|
|
50073
|
+
var VISUALLY_HIDDEN_CLASS = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
|
|
50073
50074
|
var FIELD_DESCENDANT = /* @__PURE__ */ new Set(["input", "select", "textarea", "button", "datalist", "output"]);
|
|
50074
50075
|
function primaryLabelText(label) {
|
|
50076
|
+
if ([label, ...ancestors(label)].some((e) => VISUALLY_HIDDEN_CLASS.test(attr(e, "class") ?? ""))) return "";
|
|
50075
50077
|
let out2 = "";
|
|
50076
50078
|
const nonText = /* @__PURE__ */ new Set(["script", "style", "title", "desc", "noscript", "template", "canvas", "video", "img", "svg"]);
|
|
50077
50079
|
const walk3 = (n) => {
|
|
@@ -50340,7 +50342,7 @@ var figureCaptionUnassociated = {
|
|
|
50340
50342
|
for (const el of doc.elements) {
|
|
50341
50343
|
if (el.tag !== "figure" || isHidden(el) || hasDynamicSpread(el)) continue;
|
|
50342
50344
|
const desc = descendants(el);
|
|
50343
|
-
const caption = desc.find((d) => d.tag === "figcaption");
|
|
50345
|
+
const caption = desc.find((d) => d.tag === "figcaption" && ancestors(d).find((a) => a.tag === "figure") === el);
|
|
50344
50346
|
if (!caption || !desc.some((d) => d !== caption && isCaptionedImage(d) && !ancestors(d).includes(caption))) continue;
|
|
50345
50347
|
const captionText = collapseWs(textContent(caption));
|
|
50346
50348
|
if (!captionText || captionText.includes("{") || mayInjectContent(caption)) continue;
|
|
@@ -51017,7 +51019,9 @@ var menuitemEmptyName = {
|
|
|
51017
51019
|
criteria: ["4.1.2"],
|
|
51018
51020
|
severity: "bloquant",
|
|
51019
51021
|
run(doc) {
|
|
51020
|
-
return doc.elements.filter((el) => ["menuitem", "menuitemcheckbox", "menuitemradio"].includes((attr(el, "role") ?? "").trim().toLowerCase())).filter(
|
|
51022
|
+
return doc.elements.filter((el) => ["menuitem", "menuitemcheckbox", "menuitemradio"].includes((attr(el, "role") ?? "").trim().toLowerCase())).filter(
|
|
51023
|
+
(el) => !isHiddenFromAT(el) && !hasDynamicSpread(el) && !mayInjectContent(el) && !labelledbyIsDynamic(el) && accessibleName(el, doc).trim() === ""
|
|
51024
|
+
).map((el) => ({ criteriaId: "4.1.2", el, msgId: "menuitem-empty-name" }));
|
|
51021
51025
|
}
|
|
51022
51026
|
};
|
|
51023
51027
|
var nestedInteractive = {
|
|
@@ -51693,6 +51697,9 @@ var ALLOWED_IN_LIST = /* @__PURE__ */ new Set(["li", "script", "template", "slot
|
|
|
51693
51697
|
function rendersElsewhere(tag) {
|
|
51694
51698
|
return !isIntrinsic(tag) || tag.includes("-") || tag === "component";
|
|
51695
51699
|
}
|
|
51700
|
+
function listChildren(el) {
|
|
51701
|
+
return el.children.flatMap((c2) => c2.type !== "element" ? [] : c2.tag === "#fragment" ? listChildren(c2) : [c2]);
|
|
51702
|
+
}
|
|
51696
51703
|
var listStructure = {
|
|
51697
51704
|
id: "list-structure",
|
|
51698
51705
|
criteria: ["1.3.1"],
|
|
@@ -51701,8 +51708,8 @@ var listStructure = {
|
|
|
51701
51708
|
const out2 = [];
|
|
51702
51709
|
for (const el of doc.elements) {
|
|
51703
51710
|
if (el.tag === "ul" || el.tag === "ol") {
|
|
51704
|
-
const bad = el.
|
|
51705
|
-
if (bad
|
|
51711
|
+
const bad = listChildren(el).find((c2) => !rendersElsewhere(c2.tag) && !ALLOWED_IN_LIST.has(c2.tag));
|
|
51712
|
+
if (bad) {
|
|
51706
51713
|
out2.push({
|
|
51707
51714
|
criteriaId: "1.3.1",
|
|
51708
51715
|
el: bad,
|
|
@@ -51716,7 +51723,7 @@ var listStructure = {
|
|
|
51716
51723
|
if (parent.tag === "template" || ancestors(el).some((a) => a.tag === "template" || a.tag !== "#fragment" && rendersElsewhere(a.tag))) continue;
|
|
51717
51724
|
let host = parent;
|
|
51718
51725
|
while (host && host.tag === "#fragment") host = host.parent;
|
|
51719
|
-
if (!host) continue;
|
|
51726
|
+
if (!host || ["ul", "ol", "menu"].includes(host.tag)) continue;
|
|
51720
51727
|
out2.push({
|
|
51721
51728
|
criteriaId: "1.3.1",
|
|
51722
51729
|
el,
|
|
@@ -52450,7 +52457,8 @@ var controlLabelMissing = {
|
|
|
52450
52457
|
if (via === "title") continue;
|
|
52451
52458
|
if (hasDynamicSpread(el)) continue;
|
|
52452
52459
|
if (hasAttr(el, "placeholder")) continue;
|
|
52453
|
-
|
|
52460
|
+
const id = attr(el, "id");
|
|
52461
|
+
if (id === void 0 ? hasBoundAttr(el, "id") : id.includes("{")) continue;
|
|
52454
52462
|
out2.push({
|
|
52455
52463
|
criteriaId: "4.1.2",
|
|
52456
52464
|
el,
|
|
@@ -60599,9 +60607,13 @@ var wcag_default2 = {
|
|
|
60599
60607
|
examples: [
|
|
60600
60608
|
{
|
|
60601
60609
|
lang: "html",
|
|
60602
|
-
good:
|
|
60610
|
+
good: `<dialog aria-labelledby="alert-heading" id="date-alert" role="alertdialog">
|
|
60611
|
+
<h1 id="alert-heading">Error</h1>
|
|
60612
|
+
<p>Employee's Birth Date is after their hire date. Please verify the birth date and hire date.</p>
|
|
60613
|
+
<button command="close" commandfor="date-alert" type="button">Return to page and correct error</button>
|
|
60614
|
+
</dialog>`,
|
|
60603
60615
|
note: {
|
|
60604
|
-
en: "Good: Using aria-
|
|
60616
|
+
en: "Good: Using aria-alertdialog to Identify Errors (ARIA18)."
|
|
60605
60617
|
}
|
|
60606
60618
|
}
|
|
60607
60619
|
],
|
|
@@ -60714,7 +60726,7 @@ var wcag_default2 = {
|
|
|
60714
60726
|
fr: "Nom, r\xF4le et valeur"
|
|
60715
60727
|
},
|
|
60716
60728
|
summary: {
|
|
60717
|
-
en: "Give components
|
|
60729
|
+
en: "Give components appropriate names, roles, states, and values. People using assistive technology understand all components. Assistive technology only works well when code is done properly."
|
|
60718
60730
|
},
|
|
60719
60731
|
examples: [
|
|
60720
60732
|
{
|
|
@@ -63007,6 +63019,11 @@ var L5 = {
|
|
|
63007
63019
|
// Task 5 — partial-audit advisory (owner decision: scan stays opt-in but strongly advised).
|
|
63008
63020
|
// The list names ONLY the needs-rendering criteria still untested (real coverage).
|
|
63009
63021
|
partialAudit: (list) => `Audit partiel \u2014 les crit\xE8res \xAB \xE0 restituer \xBB (${list}) n'ont pas \xE9t\xE9 test\xE9s. Lancez \`ultra11y scan --sample\` (Playwright + axe + sondes) sur l'\xE9chantillon, puis fusionnez avec \`scan --merge\`.`,
|
|
63022
|
+
// #100 — a browser pass DID run: re-advising `scan --sample` sends the reader in a circle.
|
|
63023
|
+
partialAuditScanned: (list, notes) => `Audit partiel \u2014 un passage navigateur a eu lieu, mais les crit\xE8res \xAB \xE0 restituer \xBB (${list}) n'y ont pas \xE9t\xE9 mesur\xE9s. ${notes}`,
|
|
63024
|
+
partialAuditLive: "R\xE9gions live : elles ne se mesurent qu'avec les interactions actives, qu'un scan authentifi\xE9 (`--storage-state`) ou `--no-interact` coupe \u2014 enregistrez ces pages avec la fixture Playwright (`checkA11y` / `sweepSample`) ou relancez `scan` avec les interactions.",
|
|
63025
|
+
partialAuditRendered: "Couleur, contraste et focus se mesurent sur les captures : chacune doit porter une empreinte de styles (`styles.json`) accept\xE9e par le moteur ; une capture dont l'empreinte est absente ou refus\xE9e ne mesure rien \u2014 recapturez-la avec une version \xE0 jour.",
|
|
63026
|
+
partialAuditProbes: "Zoom, reflow, espacement, survol, pi\xE8ge clavier et focus masqu\xE9 se mesurent par les sondes : relancez `scan --sample` (ou la fixture avec `probes: true`) sur les pages qui n'ont pas \xE9t\xE9 sond\xE9es.",
|
|
63010
63027
|
// Task 5 — « Constats par page » (Ara-style per-sample-page synthesis).
|
|
63011
63028
|
perPageTitle: "Constats par page",
|
|
63012
63029
|
perPageNote: "Pour chaque page de l'\xE9chantillon : sa capture d'\xE9cran et les crit\xE8res non conformes relev\xE9s sur cette page.",
|
|
@@ -63206,6 +63223,10 @@ var L5 = {
|
|
|
63206
63223
|
// Task 5 — partial-audit advisory (owner decision: scan stays opt-in but strongly advised).
|
|
63207
63224
|
// The list names ONLY the needs-rendering criteria still untested (real coverage).
|
|
63208
63225
|
partialAudit: (list) => `Partial audit \u2014 the needs-rendering criteria (${list}) were not tested. Run \`ultra11y scan --sample\` (Playwright + axe + probes) on the sample, then merge with \`scan --merge\`.`,
|
|
63226
|
+
partialAuditScanned: (list, notes) => `Partial audit \u2014 a browser pass ran, but the needs-rendering criteria (${list}) were not measured by it. ${notes}`,
|
|
63227
|
+
partialAuditLive: "Live regions: they are only measured with interactions on, which an authenticated scan (`--storage-state`) or `--no-interact` turns off \u2014 record those pages with the Playwright fixture (`checkA11y` / `sweepSample`) or re-run `scan` with interactions.",
|
|
63228
|
+
partialAuditRendered: "Colour, contrast and focus are measured on the captures: each needs a style digest (`styles.json`) the engine accepts; a capture whose digest is missing or refused measures nothing \u2014 recapture it with an up-to-date version.",
|
|
63229
|
+
partialAuditProbes: "Zoom, reflow, spacing, hover, keyboard trap and focus obscured are measured by the probes: re-run `scan --sample` (or the fixture with `probes: true`) on the pages that were not probed.",
|
|
63209
63230
|
// Task 5 — « Findings per page » (Ara-style per-sample-page synthesis).
|
|
63210
63231
|
perPageTitle: "Findings per page",
|
|
63211
63232
|
perPageNote: "For each sample page: its screenshot and the criteria found non-conforming on that page.",
|
|
@@ -63350,10 +63371,23 @@ function establishedScs(derived) {
|
|
|
63350
63371
|
}
|
|
63351
63372
|
return out2;
|
|
63352
63373
|
}
|
|
63353
|
-
function partialAuditBanner(lang, untested = NEEDS_RENDERING.map((c2) => c2.sc)) {
|
|
63374
|
+
function partialAuditBanner(lang, untested = NEEDS_RENDERING.map((c2) => c2.sc), ctx = {}) {
|
|
63354
63375
|
const set = new Set(untested);
|
|
63355
63376
|
const labels = NEEDS_RENDERING.filter((c2) => set.has(c2.sc)).map((c2) => c2.label[lang]);
|
|
63356
|
-
return L5[lang].partialAudit(labels.join(", "));
|
|
63377
|
+
if (!ctx.scanned) return L5[lang].partialAudit(labels.join(", "));
|
|
63378
|
+
const notes = [
|
|
63379
|
+
set.has("4.1.3") ? L5[lang].partialAuditLive : "",
|
|
63380
|
+
untested.some((sc) => RENDERED_TIER_SCS.has(sc)) ? L5[lang].partialAuditRendered : "",
|
|
63381
|
+
untested.some((sc) => sc !== "4.1.3" && !RENDERED_TIER_SCS.has(sc)) ? L5[lang].partialAuditProbes : ""
|
|
63382
|
+
].filter(Boolean);
|
|
63383
|
+
return L5[lang].partialAuditScanned(labels.join(", "), notes.join(" "));
|
|
63384
|
+
}
|
|
63385
|
+
var RENDERED_TIER_SCS = /* @__PURE__ */ new Set(["1.3.4", "1.4.1", "1.4.3", "1.4.11", "2.4.7"]);
|
|
63386
|
+
function ranBrowser(r) {
|
|
63387
|
+
return (r.scope.scan?.testedScs?.length ?? 0) > 0 || (r.scope.captures?.files ?? 0) > 0 || (r.scope.pagesAudited?.length ?? 0) > 0;
|
|
63388
|
+
}
|
|
63389
|
+
function packPartialAudit(r, standard) {
|
|
63390
|
+
return untestedNeedsRendering(r, establishedScs(derivePackResults(r, standard)));
|
|
63357
63391
|
}
|
|
63358
63392
|
function tallyRows(rows) {
|
|
63359
63393
|
return {
|
|
@@ -64033,7 +64067,7 @@ function render(r, lang, opts) {
|
|
|
64033
64067
|
if (r.scope.dedup) ax.push(`- **${s.dedup}** : ${r.scope.dedup.canonicalFiles} ${s.canonical}, ${r.scope.dedup.duplicateFiles} ${s.duplicate}`);
|
|
64034
64068
|
ax.push("");
|
|
64035
64069
|
ax.push(`> \u26A0\uFE0F ${s.warn}`, "");
|
|
64036
|
-
if (opts.partialAudit?.length) ax.push(`> \u{1F6A8} ${partialAuditBanner(lang, opts.partialAudit)}`, "");
|
|
64070
|
+
if (opts.partialAudit?.length) ax.push(`> \u{1F6A8} ${partialAuditBanner(lang, opts.partialAudit, { scanned: ranBrowser(r) })}`, "");
|
|
64037
64071
|
if (!pageScope.length) ax.push(`> \u{1F9ED} ${s.noPagesNoteTech}`, "");
|
|
64038
64072
|
if (opts.derivedOf) ax.push(`> \u21AA\uFE0F ${s.derived(opts.derivedOf)}`, "");
|
|
64039
64073
|
if (r.scope.truncated) ax.push(`> \u2702\uFE0F ${s.truncated(r.scope.truncated.limit, r.scope.truncated.total, r.scope.truncated.skipped)}`, "");
|
|
@@ -79646,9 +79680,9 @@ async function cmdReport(p) {
|
|
|
79646
79680
|
if (p.flags.html === true) {
|
|
79647
79681
|
html = emitHtml(result, { outDir: out2, standard, lang, ...manifest ? { evidence: manifest } : {}, inlineBudget: budgetOf(p) });
|
|
79648
79682
|
}
|
|
79649
|
-
const untested = isCore(standard) ? [] :
|
|
79683
|
+
const untested = isCore(standard) ? [] : packPartialAudit(result, standard);
|
|
79650
79684
|
const partial = untested.length > 0;
|
|
79651
|
-
if (partial && !p.flags.json) console.error(`\u{1F6A8} ${partialAuditBanner(lang, untested)}`);
|
|
79685
|
+
if (partial && !p.flags.json) console.error(`\u{1F6A8} ${partialAuditBanner(lang, untested, { scanned: ranBrowser(result) })}`);
|
|
79652
79686
|
if (p.flags.json)
|
|
79653
79687
|
console.log(
|
|
79654
79688
|
JSON.stringify(
|
|
@@ -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.55.
|
|
30
|
+
ULTRA11Y_VERSION: '5.55.2'
|
|
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
|
|
@@ -512,7 +512,7 @@ const MEASURED_SCS = ["1.3.4", "1.4.1", "1.4.3", "1.4.4", "1.4.10", "1.4.11", "1
|
|
|
512
512
|
* nothing below it — no alt, no aria-label, no text — is in the accessibility tree. The
|
|
513
513
|
* container IS the image. Only `img`: the children of a `button` or a `tab` still give their
|
|
514
514
|
* text, and an image's alt, to the accessible name (#108). */
|
|
515
|
-
const insideRoleImg = (e: El): boolean => ancestors(e).some((a) => (
|
|
515
|
+
const insideRoleImg = (e: El): boolean => ancestors(e).some((a) => roleOf(a) === "img");
|
|
516
516
|
|
|
517
517
|
export const SUBJECTS: Record<string, Subject> = {
|
|
518
518
|
// Every image-like element and the alternative it carries. Class = (alt, src): the same
|
|
@@ -522,7 +522,7 @@ export const SUBJECTS: Record<string, Subject> = {
|
|
|
522
522
|
elementsByTag(d, "img", "svg", "area", "object", "embed", "canvas")
|
|
523
523
|
// RGAA 1.1.3 is about nothing else: an image button is an image.
|
|
524
524
|
.concat(elementsByTag(d, "input").filter((e) => (attr(e, "type") ?? "").trim().toLowerCase() === "image"))
|
|
525
|
-
.concat(d.elements.filter((e) =>
|
|
525
|
+
.concat(d.elements.filter((e) => roleOf(e) === "img"))
|
|
526
526
|
.filter((e, i, a) => a.indexOf(e) === i && !insideRoleImg(e))
|
|
527
527
|
.map((e) => {
|
|
528
528
|
// The other mechanisms the RGAA tests name, when present — an image's verdict turns
|
package/src/cli.ts
CHANGED
|
@@ -22,8 +22,9 @@ import {
|
|
|
22
22
|
averageRateLine,
|
|
23
23
|
pageConformanceCell,
|
|
24
24
|
writeReportFiles,
|
|
25
|
-
|
|
25
|
+
packPartialAudit,
|
|
26
26
|
partialAuditBanner,
|
|
27
|
+
ranBrowser,
|
|
27
28
|
withReportAnnexes,
|
|
28
29
|
} from "./report.js";
|
|
29
30
|
import { writePrd, prdUnits, type PrdFormat } from "./prd.js";
|
|
@@ -2228,9 +2229,11 @@ async function cmdReport(p: ParsedArgs): Promise<number> {
|
|
|
2228
2229
|
// leaves needs-rendering criteria untested — warn prominently on the CLI, naming exactly
|
|
2229
2230
|
// which criteria lack a dynamic verdict (the report itself carries the matching banner).
|
|
2230
2231
|
// Scan stays opt-in but strongly advised.
|
|
2231
|
-
|
|
2232
|
+
// The SAME list the document prints (#100): before, the CLI ignored the verdicts the pack grid
|
|
2233
|
+
// rules on and contradicted the report it had just written.
|
|
2234
|
+
const untested = isCore(standard) ? [] : packPartialAudit(result, standard);
|
|
2232
2235
|
const partial = untested.length > 0;
|
|
2233
|
-
if (partial && !p.flags.json) console.error(`🚨 ${partialAuditBanner(lang, untested)}`);
|
|
2236
|
+
if (partial && !p.flags.json) console.error(`🚨 ${partialAuditBanner(lang, untested, { scanned: ranBrowser(result) })}`);
|
|
2234
2237
|
if (p.flags.json)
|
|
2235
2238
|
console.log(
|
|
2236
2239
|
JSON.stringify(
|
|
@@ -975,9 +975,9 @@
|
|
|
975
975
|
"examples": [
|
|
976
976
|
{
|
|
977
977
|
"lang": "html",
|
|
978
|
-
"good": "<
|
|
978
|
+
"good": "<dialog aria-labelledby=\"alert-heading\" id=\"date-alert\" role=\"alertdialog\">\n <h1 id=\"alert-heading\">Error</h1>\n <p>Employee's Birth Date is after their hire date. Please verify the birth date and hire date.</p>\n <button command=\"close\" commandfor=\"date-alert\" type=\"button\">Return to page and correct error</button>\n</dialog>",
|
|
979
979
|
"note": {
|
|
980
|
-
"en": "Good: Using aria-
|
|
980
|
+
"en": "Good: Using aria-alertdialog to Identify Errors (ARIA18)."
|
|
981
981
|
}
|
|
982
982
|
}
|
|
983
983
|
],
|
|
@@ -1086,7 +1086,7 @@
|
|
|
1086
1086
|
"fr": "Nom, rôle et valeur"
|
|
1087
1087
|
},
|
|
1088
1088
|
"summary": {
|
|
1089
|
-
"en": "Give components
|
|
1089
|
+
"en": "Give components appropriate names, roles, states, and values. People using assistive technology understand all components. Assistive technology only works well when code is done properly."
|
|
1090
1090
|
},
|
|
1091
1091
|
"examples": [
|
|
1092
1092
|
{
|
package/src/name.ts
CHANGED
|
@@ -200,13 +200,17 @@ export function visibleLabelText(el: El): string {
|
|
|
200
200
|
// span is not visible at all. Comparing an aria-label against them would demand that the name
|
|
201
201
|
// repeat help text, which neither RGAA 11.2.5 nor WCAG 2.5.3 asks.
|
|
202
202
|
const NOT_INTITULE_CLASS = /(^|\s)(fr-hint-text|fr-sr-only|sr-only|visually-hidden|visuallyhidden|hint-text|help-text)(\s|$)/;
|
|
203
|
+
// The visually hidden classes alone: a <label> (or a wrapper of it) that carries one is no
|
|
204
|
+
// visible label at all, so there is no intitulé for the name to contain (#115).
|
|
205
|
+
const VISUALLY_HIDDEN_CLASS = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
|
|
203
206
|
const FIELD_DESCENDANT = new Set(["input", "select", "textarea", "button", "datalist", "output"]);
|
|
204
207
|
|
|
205
208
|
/** The PRIMARY visible text of a `<label>` — its intitulé — for the label-in-name comparison of
|
|
206
209
|
* a form field: hidden subtrees, aria-hidden decoration, hint/sr-only spans and the nested
|
|
207
210
|
* field itself (a wrapping label contains the <select> whose options are not label text) are
|
|
208
|
-
* left out. Literal text only; a caller must still refuse an interpolated result. */
|
|
211
|
+
* left out, and a visually hidden label (sr-only on itself or a wrapper) has none. Literal text only; a caller must still refuse an interpolated result. */
|
|
209
212
|
export function primaryLabelText(label: El): string {
|
|
213
|
+
if ([label, ...ancestors(label)].some((e) => VISUALLY_HIDDEN_CLASS.test(attr(e, "class") ?? ""))) return "";
|
|
210
214
|
let out = "";
|
|
211
215
|
const nonText = new Set(["script", "style", "title", "desc", "noscript", "template", "canvas", "video", "img", "svg"]);
|
|
212
216
|
const walk = (n: HNode): void => {
|
package/src/report.ts
CHANGED
|
@@ -178,6 +178,15 @@ const L = {
|
|
|
178
178
|
// The list names ONLY the needs-rendering criteria still untested (real coverage).
|
|
179
179
|
partialAudit: (list: string) =>
|
|
180
180
|
`Audit partiel — les critères « à restituer » (${list}) n'ont pas été testés. Lancez \`ultra11y scan --sample\` (Playwright + axe + sondes) sur l'échantillon, puis fusionnez avec \`scan --merge\`.`,
|
|
181
|
+
// #100 — a browser pass DID run: re-advising `scan --sample` sends the reader in a circle.
|
|
182
|
+
partialAuditScanned: (list: string, notes: string) =>
|
|
183
|
+
`Audit partiel — un passage navigateur a eu lieu, mais les critères « à restituer » (${list}) n'y ont pas été mesurés. ${notes}`,
|
|
184
|
+
partialAuditLive:
|
|
185
|
+
"Régions live : elles ne se mesurent qu'avec les interactions actives, qu'un scan authentifié (`--storage-state`) ou `--no-interact` coupe — enregistrez ces pages avec la fixture Playwright (`checkA11y` / `sweepSample`) ou relancez `scan` avec les interactions.",
|
|
186
|
+
partialAuditRendered:
|
|
187
|
+
"Couleur, contraste et focus se mesurent sur les captures : chacune doit porter une empreinte de styles (`styles.json`) acceptée par le moteur ; une capture dont l'empreinte est absente ou refusée ne mesure rien — recapturez-la avec une version à jour.",
|
|
188
|
+
partialAuditProbes:
|
|
189
|
+
"Zoom, reflow, espacement, survol, piège clavier et focus masqué se mesurent par les sondes : relancez `scan --sample` (ou la fixture avec `probes: true`) sur les pages qui n'ont pas été sondées.",
|
|
181
190
|
// Task 5 — « Constats par page » (Ara-style per-sample-page synthesis).
|
|
182
191
|
perPageTitle: "Constats par page",
|
|
183
192
|
perPageNote: "Pour chaque page de l'échantillon : sa capture d'écran et les critères non conformes relevés sur cette page.",
|
|
@@ -409,6 +418,14 @@ const L = {
|
|
|
409
418
|
// The list names ONLY the needs-rendering criteria still untested (real coverage).
|
|
410
419
|
partialAudit: (list: string) =>
|
|
411
420
|
`Partial audit — the needs-rendering criteria (${list}) were not tested. Run \`ultra11y scan --sample\` (Playwright + axe + probes) on the sample, then merge with \`scan --merge\`.`,
|
|
421
|
+
partialAuditScanned: (list: string, notes: string) =>
|
|
422
|
+
`Partial audit — a browser pass ran, but the needs-rendering criteria (${list}) were not measured by it. ${notes}`,
|
|
423
|
+
partialAuditLive:
|
|
424
|
+
"Live regions: they are only measured with interactions on, which an authenticated scan (`--storage-state`) or `--no-interact` turns off — record those pages with the Playwright fixture (`checkA11y` / `sweepSample`) or re-run `scan` with interactions.",
|
|
425
|
+
partialAuditRendered:
|
|
426
|
+
"Colour, contrast and focus are measured on the captures: each needs a style digest (`styles.json`) the engine accepts; a capture whose digest is missing or refused measures nothing — recapture it with an up-to-date version.",
|
|
427
|
+
partialAuditProbes:
|
|
428
|
+
"Zoom, reflow, spacing, hover, keyboard trap and focus obscured are measured by the probes: re-run `scan --sample` (or the fixture with `probes: true`) on the pages that were not probed.",
|
|
412
429
|
// Task 5 — « Findings per page » (Ara-style per-sample-page synthesis).
|
|
413
430
|
perPageTitle: "Findings per page",
|
|
414
431
|
perPageNote: "For each sample page: its screenshot and the criteria found non-conforming on that page.",
|
|
@@ -620,10 +637,34 @@ export function establishedScs(derived: readonly PackCriterionResult[]): Set<str
|
|
|
620
637
|
/** The partial-audit advisory text (no leading `> `) — shared by the report banner and the
|
|
621
638
|
* CLI warning (src/cli.ts cmdReport) so the two can never drift. Names ONLY the criteria
|
|
622
639
|
* in `untested` (default: all of them — the no-scan-at-all case). */
|
|
623
|
-
export function partialAuditBanner(lang: Lang, untested: string[] = NEEDS_RENDERING.map((c) => c.sc)): string {
|
|
640
|
+
export function partialAuditBanner(lang: Lang, untested: string[] = NEEDS_RENDERING.map((c) => c.sc), ctx: { scanned?: boolean } = {}): string {
|
|
624
641
|
const set = new Set(untested);
|
|
625
642
|
const labels = NEEDS_RENDERING.filter((c) => set.has(c.sc)).map((c) => c.label[lang]);
|
|
626
|
-
return L[lang].partialAudit(labels.join(", "));
|
|
643
|
+
if (!ctx.scanned) return L[lang].partialAudit(labels.join(", "));
|
|
644
|
+
// A browser pass ran and still left these: name what closes each kind, not « scan again ».
|
|
645
|
+
const notes = [
|
|
646
|
+
set.has("4.1.3") ? L[lang].partialAuditLive : "",
|
|
647
|
+
untested.some((sc) => RENDERED_TIER_SCS.has(sc)) ? L[lang].partialAuditRendered : "",
|
|
648
|
+
untested.some((sc) => sc !== "4.1.3" && !RENDERED_TIER_SCS.has(sc)) ? L[lang].partialAuditProbes : "",
|
|
649
|
+
].filter(Boolean);
|
|
650
|
+
return L[lang].partialAuditScanned(labels.join(", "), notes.join(" "));
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
// The needs-rendering SCs the RENDERED tier measures from a capture's style/stylesheet digest
|
|
654
|
+
// (src/rules/rendered.ts): text contrast, link colour, non-text contrast, orientation lock,
|
|
655
|
+
// focus visibility. The others come from the live probes, and 4.1.3 from the interactions.
|
|
656
|
+
const RENDERED_TIER_SCS = new Set(["1.3.4", "1.4.1", "1.4.3", "1.4.11", "2.4.7"]);
|
|
657
|
+
|
|
658
|
+
/** Did any browser pass contribute to this audit — a scan stamp, or audited captures? */
|
|
659
|
+
export function ranBrowser(r: AuditResult): boolean {
|
|
660
|
+
return (r.scope.scan?.testedScs?.length ?? 0) > 0 || (r.scope.captures?.files ?? 0) > 0 || (r.scope.pagesAudited?.length ?? 0) > 0;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
/** THE pack report's partial-audit list — one definition for the document, the CLI warning and
|
|
664
|
+
* `report --json`, so they can never disagree again (#100): the needs-rendering SCs nothing
|
|
665
|
+
* measured AND the pack grid does not rule on. */
|
|
666
|
+
export function packPartialAudit(r: AuditResult, standard: string): string[] {
|
|
667
|
+
return untestedNeedsRendering(r, establishedScs(derivePackResults(r, standard)));
|
|
627
668
|
}
|
|
628
669
|
|
|
629
670
|
// A normalized row the renderer is agnostic about: one labelled criterion + its status/findings.
|
|
@@ -1812,7 +1853,7 @@ function render(r: AuditResult, lang: Lang, opts: RenderOpts): ReportDocuments {
|
|
|
1812
1853
|
ax.push(`> ⚠️ ${s.warn}`, "");
|
|
1813
1854
|
// Partial-audit advisory (owner decision): names EXACTLY the untested criteria, with the
|
|
1814
1855
|
// command that tests them. Labels only — no criterion-shaped token, so `check` accepts it.
|
|
1815
|
-
if (opts.partialAudit?.length) ax.push(`> 🚨 ${partialAuditBanner(lang, opts.partialAudit)}`, "");
|
|
1856
|
+
if (opts.partialAudit?.length) ax.push(`> 🚨 ${partialAuditBanner(lang, opts.partialAudit, { scanned: ranBrowser(r) })}`, "");
|
|
1816
1857
|
if (!pageScope.length) ax.push(`> 🧭 ${s.noPagesNoteTech}`, "");
|
|
1817
1858
|
if (opts.derivedOf) ax.push(`> ↪️ ${s.derived(opts.derivedOf)}`, "");
|
|
1818
1859
|
if (r.scope.truncated) ax.push(`> ✂️ ${s.truncated(r.scope.truncated.limit, r.scope.truncated.total, r.scope.truncated.skipped)}`, "");
|
package/src/rules/forms.ts
CHANGED
|
@@ -66,7 +66,10 @@ const controlLabelMissing: Rule = {
|
|
|
66
66
|
// caller renders: the shared-component pattern. Nothing in this document can prove the
|
|
67
67
|
// field unlabelled, and a blocking NC on it is a guess (#94). The rendered tier, where
|
|
68
68
|
// ids are resolved, decides — `axe:label` and this very rule on the page snapshots.
|
|
69
|
-
|
|
69
|
+
// Same for a framework-bound id (Vue `:id="inputId"`, `v-bind:id`), where the literal
|
|
70
|
+
// attribute is absent (#115).
|
|
71
|
+
const id = attr(el, "id");
|
|
72
|
+
if (id === undefined ? hasBoundAttr(el, "id") : id.includes("{")) continue;
|
|
70
73
|
out.push({
|
|
71
74
|
criteriaId: "4.1.2",
|
|
72
75
|
el,
|
package/src/rules/headings.ts
CHANGED
|
@@ -143,6 +143,12 @@ function rendersElsewhere(tag: string): boolean {
|
|
|
143
143
|
return !isIntrinsic(tag) || tag.includes("-") || tag === "component";
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
+
/** The element children a list renders: a `#fragment` is transparent, its own children stand
|
|
147
|
+
* in its place (#115). */
|
|
148
|
+
function listChildren(el: El): El[] {
|
|
149
|
+
return el.children.flatMap((c) => (c.type !== "element" ? [] : c.tag === "#fragment" ? listChildren(c) : [c]));
|
|
150
|
+
}
|
|
151
|
+
|
|
146
152
|
const listStructure: Rule = {
|
|
147
153
|
id: "list-structure",
|
|
148
154
|
criteria: ["1.3.1"],
|
|
@@ -154,8 +160,10 @@ const listStructure: Rule = {
|
|
|
154
160
|
// Only intrinsic (HTML) children are a definite violation; a PascalCase
|
|
155
161
|
// component child may itself render an <li>, so it is left to the cross-file
|
|
156
162
|
// graph / human, never asserted here.
|
|
157
|
-
|
|
158
|
-
|
|
163
|
+
// A fragment (`{open && (<><li/></>)}`) renders its children in its place: it is
|
|
164
|
+
// transparent, so the list's real children are those it carries (#115).
|
|
165
|
+
const bad = listChildren(el).find((c) => !rendersElsewhere(c.tag) && !ALLOWED_IN_LIST.has(c.tag));
|
|
166
|
+
if (bad) {
|
|
159
167
|
out.push({
|
|
160
168
|
criteriaId: "1.3.1",
|
|
161
169
|
el: bad,
|
|
@@ -175,7 +183,7 @@ const listStructure: Rule = {
|
|
|
175
183
|
// Only a fragment nested inside a known element still has a provable parent.
|
|
176
184
|
let host: typeof parent | null = parent;
|
|
177
185
|
while (host && host.tag === "#fragment") host = host.parent;
|
|
178
|
-
if (!host) continue;
|
|
186
|
+
if (!host || ["ul", "ol", "menu"].includes(host.tag)) continue;
|
|
179
187
|
out.push({
|
|
180
188
|
criteriaId: "1.3.1",
|
|
181
189
|
el,
|
package/src/rules/images.ts
CHANGED
|
@@ -234,7 +234,9 @@ const figureCaptionUnassociated: Rule = {
|
|
|
234
234
|
for (const el of doc.elements) {
|
|
235
235
|
if (el.tag !== "figure" || isHidden(el) || hasDynamicSpread(el)) continue;
|
|
236
236
|
const desc = descendants(el);
|
|
237
|
-
|
|
237
|
+
// Only this figure's own caption: a nested figure's <figcaption> belongs to that figure
|
|
238
|
+
// (its nearest figure ancestor), never to the outer one (#115).
|
|
239
|
+
const caption = desc.find((d) => d.tag === "figcaption" && ancestors(d).find((a) => a.tag === "figure") === el);
|
|
238
240
|
if (!caption || !desc.some((d) => d !== caption && isCaptionedImage(d) && !ancestors(d).includes(caption))) continue;
|
|
239
241
|
const captionText = collapseWs(textContent(caption));
|
|
240
242
|
if (!captionText || captionText.includes("{") || mayInjectContent(caption)) continue;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { Doc, El } from "../parse/html.js";
|
|
3
3
|
import { attr, hasAttr, hasBoundAttr, hasDynamicSpread, descendants, ancestors } from "../parse/html.js";
|
|
4
4
|
import { isIntrinsic } from "../parse/jsx-bridge.js";
|
|
5
|
-
import { accessibleName, mayInjectContent, isHiddenFromAT, isDisplayHidden, isPresentational } from "../name.js";
|
|
5
|
+
import { accessibleName, mayInjectContent, isHiddenFromAT, isDisplayHidden, isPresentational, labelledbyIsDynamic } from "../name.js";
|
|
6
6
|
import { ARIA_ATTRS, ARIA_REQUIRED_ATTRS, ARIA_REQUIRED_PARENT, IMPLICIT_CONTAINER_ROLE, NAME_PROHIBITED_ROLES, isValidAriaValue } from "../aria.js";
|
|
7
7
|
import type { Rule, RuleFinding } from "./rule.js";
|
|
8
8
|
|
|
@@ -507,7 +507,9 @@ const menuitemEmptyName: Rule = {
|
|
|
507
507
|
run(doc: Doc): RuleFinding[] {
|
|
508
508
|
return doc.elements
|
|
509
509
|
.filter((el) => ["menuitem", "menuitemcheckbox", "menuitemradio"].includes((attr(el, "role") ?? "").trim().toLowerCase()))
|
|
510
|
-
.filter(
|
|
510
|
+
.filter(
|
|
511
|
+
(el) => !isHiddenFromAT(el) && !hasDynamicSpread(el) && !mayInjectContent(el) && !labelledbyIsDynamic(el) && accessibleName(el, doc).trim() === "",
|
|
512
|
+
)
|
|
511
513
|
.map((el) => ({ criteriaId: "4.1.2", el, msgId: "menuitem-empty-name" }));
|
|
512
514
|
},
|
|
513
515
|
};
|
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.55.
|
|
3
|
+
export const VERSION = "5.55.2";
|
|
4
4
|
export const SCHEMA_VERSION = 2;
|
|
5
5
|
|
|
6
6
|
// Lang = the UI FRAME's language — the `L` localization tables each module (report,
|