ultra11y 5.55.2 → 5.55.3
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 +19 -7
- package/skills/review-a11y/SKILL.md +1 -1
- package/skills/review-a11y/scripts/ultra11y.mjs +19 -7
- package/skills/ultra11y/SKILL.md +1 -1
- package/skills/ultra11y/scripts/ultra11y.mjs +19 -7
- package/skills/ultra11y/templates/gitlab-ci.yml +1 -1
- package/src/audit.ts +2 -3
- package/src/axe-map.ts +21 -0
- package/src/rules/rendered.ts +13 -0
- package/src/scan.ts +5 -5
- 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.3",
|
|
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.3",
|
|
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.3",
|
|
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.3";
|
|
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.3",
|
|
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.3";
|
|
10
10
|
var SCHEMA_VERSION = 2;
|
|
11
11
|
function isAdjudicated(by) {
|
|
12
12
|
return by === "agent" || by === "human";
|
|
@@ -40598,6 +40598,7 @@ function borderColours(css) {
|
|
|
40598
40598
|
}
|
|
40599
40599
|
return out2;
|
|
40600
40600
|
}
|
|
40601
|
+
var VISUALLY_HIDDEN_CLASS = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
|
|
40601
40602
|
var renderedNonTextContrast = {
|
|
40602
40603
|
id: "rendered-nontext-contrast",
|
|
40603
40604
|
criteria: ["1.4.11"],
|
|
@@ -40614,6 +40615,9 @@ var renderedNonTextContrast = {
|
|
|
40614
40615
|
if (el.tag === "input" && ["button", "submit", "reset"].includes(type) && WORD.test(el.attribs.value ?? "")) continue;
|
|
40615
40616
|
const css = styleAt(doc, i2)?.css;
|
|
40616
40617
|
if (!css || invisible(css)) continue;
|
|
40618
|
+
if (VISUALLY_HIDDEN_CLASS.test(el.attribs.class ?? "")) continue;
|
|
40619
|
+
const box = doc.signals?.boxes?.get(i2);
|
|
40620
|
+
if (box && box.w <= 1 && box.h <= 1) continue;
|
|
40617
40621
|
if (css.boxShadow && css.boxShadow !== "none") continue;
|
|
40618
40622
|
if ((css.outlineStyle ?? "none") !== "none" && Number.parseFloat(css.outlineWidth ?? "0") > 0) continue;
|
|
40619
40623
|
const surrounding = el.parent ? backdropOf(doc, index, el.parent) : void 0;
|
|
@@ -40621,6 +40625,9 @@ var renderedNonTextContrast = {
|
|
|
40621
40625
|
const own = parseColor(css.backgroundColor ?? "");
|
|
40622
40626
|
const fill = own && own.a >= 1 ? own : surrounding.color;
|
|
40623
40627
|
if (contrastRatio(fill, surrounding.color) >= 3) continue;
|
|
40628
|
+
const isButton3 = el.tag === "button" || el.tag === "input" && ["button", "submit", "reset"].includes(type);
|
|
40629
|
+
const glyph = parseColor(css.color ?? "");
|
|
40630
|
+
if (isButton3 && glyph && glyph.a >= 1 && contrastRatio(glyph, surrounding.color) >= 3) continue;
|
|
40624
40631
|
const borders = borderColours(css);
|
|
40625
40632
|
if (borders.some((b) => contrastRatio(b, surrounding.color) >= 3 || contrastRatio(b, fill) >= 3)) continue;
|
|
40626
40633
|
out2.push({
|
|
@@ -40974,6 +40981,13 @@ function axeAdvisory(tags) {
|
|
|
40974
40981
|
function isAxeAdvisory(ruleId, tags) {
|
|
40975
40982
|
return AXE_ADVISORY_EXCEPTIONS[ruleId] ?? axeAdvisory(tags);
|
|
40976
40983
|
}
|
|
40984
|
+
function axeNodeTreatment(ruleId, tags, impact, nodeHtml) {
|
|
40985
|
+
if (ruleId === "label-title-only") {
|
|
40986
|
+
const labelledby = /\saria-labelledby\s*=\s*["'][^"']*\S[^"']*["']/i.test(nodeHtml ?? "");
|
|
40987
|
+
return { severity: "mineur", advisory: labelledby || isAxeAdvisory(ruleId, tags) };
|
|
40988
|
+
}
|
|
40989
|
+
return { severity: severityFromImpact(impact), advisory: isAxeAdvisory(ruleId, tags) };
|
|
40990
|
+
}
|
|
40977
40991
|
function scForAxe(ruleId, tags) {
|
|
40978
40992
|
return AXE_WCAG[ruleId] ?? scFromWcagTags(tags) ?? FALLBACK_SC;
|
|
40979
40993
|
}
|
|
@@ -50070,10 +50084,10 @@ function visibleLabelText(el) {
|
|
|
50070
50084
|
return collapse(out2);
|
|
50071
50085
|
}
|
|
50072
50086
|
var NOT_INTITULE_CLASS = /(^|\s)(fr-hint-text|fr-sr-only|sr-only|visually-hidden|visuallyhidden|hint-text|help-text)(\s|$)/;
|
|
50073
|
-
var
|
|
50087
|
+
var VISUALLY_HIDDEN_CLASS2 = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
|
|
50074
50088
|
var FIELD_DESCENDANT = /* @__PURE__ */ new Set(["input", "select", "textarea", "button", "datalist", "output"]);
|
|
50075
50089
|
function primaryLabelText(label) {
|
|
50076
|
-
if ([label, ...ancestors(label)].some((e) =>
|
|
50090
|
+
if ([label, ...ancestors(label)].some((e) => VISUALLY_HIDDEN_CLASS2.test(attr(e, "class") ?? ""))) return "";
|
|
50077
50091
|
let out2 = "";
|
|
50078
50092
|
const nonText = /* @__PURE__ */ new Set(["script", "style", "title", "desc", "noscript", "template", "canvas", "video", "img", "svg"]);
|
|
50079
50093
|
const walk3 = (n) => {
|
|
@@ -56349,10 +56363,9 @@ function axeFindings(violations, file, page) {
|
|
|
56349
56363
|
for (const v of violations) {
|
|
56350
56364
|
if (!v?.id) continue;
|
|
56351
56365
|
const criteriaId = scForAxe(v.id, v.tags);
|
|
56352
|
-
const severity = severityFromImpact(v.impact);
|
|
56353
|
-
const advisory = isAxeAdvisory(v.id, v.tags);
|
|
56354
56366
|
const nodes = v.nodes?.length ? v.nodes : [{ target: [], html: "" }];
|
|
56355
56367
|
for (const n of nodes) {
|
|
56368
|
+
const { severity, advisory } = axeNodeTreatment(v.id, v.tags, v.impact, n.html);
|
|
56356
56369
|
out2.push({
|
|
56357
56370
|
ruleId: `axe:${v.id}`,
|
|
56358
56371
|
criteriaId,
|
|
@@ -69953,9 +69966,8 @@ function toDynamicResult(out2, target, lang = "en", engine = "axe-core@playwrigh
|
|
|
69953
69966
|
const findings = [];
|
|
69954
69967
|
for (const v of out2.violations) {
|
|
69955
69968
|
const criteriaId = scForAxe(v.id, v.tags);
|
|
69956
|
-
const severity = severityFromImpact(v.impact);
|
|
69957
|
-
const advisory = isAxeAdvisory(v.id, v.tags);
|
|
69958
69969
|
for (const n of v.nodes.length ? v.nodes : [{ target: [], html: "" }]) {
|
|
69970
|
+
const { severity, advisory } = axeNodeTreatment(v.id, v.tags, v.impact, n.html);
|
|
69959
69971
|
findings.push({
|
|
69960
69972
|
criteriaId,
|
|
69961
69973
|
axeRule: v.id,
|
|
@@ -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.3
|
|
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.3";
|
|
10
10
|
var SCHEMA_VERSION = 2;
|
|
11
11
|
function isAdjudicated(by) {
|
|
12
12
|
return by === "agent" || by === "human";
|
|
@@ -40598,6 +40598,7 @@ function borderColours(css) {
|
|
|
40598
40598
|
}
|
|
40599
40599
|
return out2;
|
|
40600
40600
|
}
|
|
40601
|
+
var VISUALLY_HIDDEN_CLASS = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
|
|
40601
40602
|
var renderedNonTextContrast = {
|
|
40602
40603
|
id: "rendered-nontext-contrast",
|
|
40603
40604
|
criteria: ["1.4.11"],
|
|
@@ -40614,6 +40615,9 @@ var renderedNonTextContrast = {
|
|
|
40614
40615
|
if (el.tag === "input" && ["button", "submit", "reset"].includes(type) && WORD.test(el.attribs.value ?? "")) continue;
|
|
40615
40616
|
const css = styleAt(doc, i2)?.css;
|
|
40616
40617
|
if (!css || invisible(css)) continue;
|
|
40618
|
+
if (VISUALLY_HIDDEN_CLASS.test(el.attribs.class ?? "")) continue;
|
|
40619
|
+
const box = doc.signals?.boxes?.get(i2);
|
|
40620
|
+
if (box && box.w <= 1 && box.h <= 1) continue;
|
|
40617
40621
|
if (css.boxShadow && css.boxShadow !== "none") continue;
|
|
40618
40622
|
if ((css.outlineStyle ?? "none") !== "none" && Number.parseFloat(css.outlineWidth ?? "0") > 0) continue;
|
|
40619
40623
|
const surrounding = el.parent ? backdropOf(doc, index, el.parent) : void 0;
|
|
@@ -40621,6 +40625,9 @@ var renderedNonTextContrast = {
|
|
|
40621
40625
|
const own = parseColor(css.backgroundColor ?? "");
|
|
40622
40626
|
const fill = own && own.a >= 1 ? own : surrounding.color;
|
|
40623
40627
|
if (contrastRatio(fill, surrounding.color) >= 3) continue;
|
|
40628
|
+
const isButton3 = el.tag === "button" || el.tag === "input" && ["button", "submit", "reset"].includes(type);
|
|
40629
|
+
const glyph = parseColor(css.color ?? "");
|
|
40630
|
+
if (isButton3 && glyph && glyph.a >= 1 && contrastRatio(glyph, surrounding.color) >= 3) continue;
|
|
40624
40631
|
const borders = borderColours(css);
|
|
40625
40632
|
if (borders.some((b) => contrastRatio(b, surrounding.color) >= 3 || contrastRatio(b, fill) >= 3)) continue;
|
|
40626
40633
|
out2.push({
|
|
@@ -40974,6 +40981,13 @@ function axeAdvisory(tags) {
|
|
|
40974
40981
|
function isAxeAdvisory(ruleId, tags) {
|
|
40975
40982
|
return AXE_ADVISORY_EXCEPTIONS[ruleId] ?? axeAdvisory(tags);
|
|
40976
40983
|
}
|
|
40984
|
+
function axeNodeTreatment(ruleId, tags, impact, nodeHtml) {
|
|
40985
|
+
if (ruleId === "label-title-only") {
|
|
40986
|
+
const labelledby = /\saria-labelledby\s*=\s*["'][^"']*\S[^"']*["']/i.test(nodeHtml ?? "");
|
|
40987
|
+
return { severity: "mineur", advisory: labelledby || isAxeAdvisory(ruleId, tags) };
|
|
40988
|
+
}
|
|
40989
|
+
return { severity: severityFromImpact(impact), advisory: isAxeAdvisory(ruleId, tags) };
|
|
40990
|
+
}
|
|
40977
40991
|
function scForAxe(ruleId, tags) {
|
|
40978
40992
|
return AXE_WCAG[ruleId] ?? scFromWcagTags(tags) ?? FALLBACK_SC;
|
|
40979
40993
|
}
|
|
@@ -50070,10 +50084,10 @@ function visibleLabelText(el) {
|
|
|
50070
50084
|
return collapse(out2);
|
|
50071
50085
|
}
|
|
50072
50086
|
var NOT_INTITULE_CLASS = /(^|\s)(fr-hint-text|fr-sr-only|sr-only|visually-hidden|visuallyhidden|hint-text|help-text)(\s|$)/;
|
|
50073
|
-
var
|
|
50087
|
+
var VISUALLY_HIDDEN_CLASS2 = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
|
|
50074
50088
|
var FIELD_DESCENDANT = /* @__PURE__ */ new Set(["input", "select", "textarea", "button", "datalist", "output"]);
|
|
50075
50089
|
function primaryLabelText(label) {
|
|
50076
|
-
if ([label, ...ancestors(label)].some((e) =>
|
|
50090
|
+
if ([label, ...ancestors(label)].some((e) => VISUALLY_HIDDEN_CLASS2.test(attr(e, "class") ?? ""))) return "";
|
|
50077
50091
|
let out2 = "";
|
|
50078
50092
|
const nonText = /* @__PURE__ */ new Set(["script", "style", "title", "desc", "noscript", "template", "canvas", "video", "img", "svg"]);
|
|
50079
50093
|
const walk3 = (n) => {
|
|
@@ -56349,10 +56363,9 @@ function axeFindings(violations, file, page) {
|
|
|
56349
56363
|
for (const v of violations) {
|
|
56350
56364
|
if (!v?.id) continue;
|
|
56351
56365
|
const criteriaId = scForAxe(v.id, v.tags);
|
|
56352
|
-
const severity = severityFromImpact(v.impact);
|
|
56353
|
-
const advisory = isAxeAdvisory(v.id, v.tags);
|
|
56354
56366
|
const nodes = v.nodes?.length ? v.nodes : [{ target: [], html: "" }];
|
|
56355
56367
|
for (const n of nodes) {
|
|
56368
|
+
const { severity, advisory } = axeNodeTreatment(v.id, v.tags, v.impact, n.html);
|
|
56356
56369
|
out2.push({
|
|
56357
56370
|
ruleId: `axe:${v.id}`,
|
|
56358
56371
|
criteriaId,
|
|
@@ -69953,9 +69966,8 @@ function toDynamicResult(out2, target, lang = "en", engine = "axe-core@playwrigh
|
|
|
69953
69966
|
const findings = [];
|
|
69954
69967
|
for (const v of out2.violations) {
|
|
69955
69968
|
const criteriaId = scForAxe(v.id, v.tags);
|
|
69956
|
-
const severity = severityFromImpact(v.impact);
|
|
69957
|
-
const advisory = isAxeAdvisory(v.id, v.tags);
|
|
69958
69969
|
for (const n of v.nodes.length ? v.nodes : [{ target: [], html: "" }]) {
|
|
69970
|
+
const { severity, advisory } = axeNodeTreatment(v.id, v.tags, v.impact, n.html);
|
|
69959
69971
|
findings.push({
|
|
69960
69972
|
criteriaId,
|
|
69961
69973
|
axeRule: v.id,
|
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.3
|
|
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.3";
|
|
10
10
|
var SCHEMA_VERSION = 2;
|
|
11
11
|
function isAdjudicated(by) {
|
|
12
12
|
return by === "agent" || by === "human";
|
|
@@ -40598,6 +40598,7 @@ function borderColours(css) {
|
|
|
40598
40598
|
}
|
|
40599
40599
|
return out2;
|
|
40600
40600
|
}
|
|
40601
|
+
var VISUALLY_HIDDEN_CLASS = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
|
|
40601
40602
|
var renderedNonTextContrast = {
|
|
40602
40603
|
id: "rendered-nontext-contrast",
|
|
40603
40604
|
criteria: ["1.4.11"],
|
|
@@ -40614,6 +40615,9 @@ var renderedNonTextContrast = {
|
|
|
40614
40615
|
if (el.tag === "input" && ["button", "submit", "reset"].includes(type) && WORD.test(el.attribs.value ?? "")) continue;
|
|
40615
40616
|
const css = styleAt(doc, i2)?.css;
|
|
40616
40617
|
if (!css || invisible(css)) continue;
|
|
40618
|
+
if (VISUALLY_HIDDEN_CLASS.test(el.attribs.class ?? "")) continue;
|
|
40619
|
+
const box = doc.signals?.boxes?.get(i2);
|
|
40620
|
+
if (box && box.w <= 1 && box.h <= 1) continue;
|
|
40617
40621
|
if (css.boxShadow && css.boxShadow !== "none") continue;
|
|
40618
40622
|
if ((css.outlineStyle ?? "none") !== "none" && Number.parseFloat(css.outlineWidth ?? "0") > 0) continue;
|
|
40619
40623
|
const surrounding = el.parent ? backdropOf(doc, index, el.parent) : void 0;
|
|
@@ -40621,6 +40625,9 @@ var renderedNonTextContrast = {
|
|
|
40621
40625
|
const own = parseColor(css.backgroundColor ?? "");
|
|
40622
40626
|
const fill = own && own.a >= 1 ? own : surrounding.color;
|
|
40623
40627
|
if (contrastRatio(fill, surrounding.color) >= 3) continue;
|
|
40628
|
+
const isButton3 = el.tag === "button" || el.tag === "input" && ["button", "submit", "reset"].includes(type);
|
|
40629
|
+
const glyph = parseColor(css.color ?? "");
|
|
40630
|
+
if (isButton3 && glyph && glyph.a >= 1 && contrastRatio(glyph, surrounding.color) >= 3) continue;
|
|
40624
40631
|
const borders = borderColours(css);
|
|
40625
40632
|
if (borders.some((b) => contrastRatio(b, surrounding.color) >= 3 || contrastRatio(b, fill) >= 3)) continue;
|
|
40626
40633
|
out2.push({
|
|
@@ -40974,6 +40981,13 @@ function axeAdvisory(tags) {
|
|
|
40974
40981
|
function isAxeAdvisory(ruleId, tags) {
|
|
40975
40982
|
return AXE_ADVISORY_EXCEPTIONS[ruleId] ?? axeAdvisory(tags);
|
|
40976
40983
|
}
|
|
40984
|
+
function axeNodeTreatment(ruleId, tags, impact, nodeHtml) {
|
|
40985
|
+
if (ruleId === "label-title-only") {
|
|
40986
|
+
const labelledby = /\saria-labelledby\s*=\s*["'][^"']*\S[^"']*["']/i.test(nodeHtml ?? "");
|
|
40987
|
+
return { severity: "mineur", advisory: labelledby || isAxeAdvisory(ruleId, tags) };
|
|
40988
|
+
}
|
|
40989
|
+
return { severity: severityFromImpact(impact), advisory: isAxeAdvisory(ruleId, tags) };
|
|
40990
|
+
}
|
|
40977
40991
|
function scForAxe(ruleId, tags) {
|
|
40978
40992
|
return AXE_WCAG[ruleId] ?? scFromWcagTags(tags) ?? FALLBACK_SC;
|
|
40979
40993
|
}
|
|
@@ -50070,10 +50084,10 @@ function visibleLabelText(el) {
|
|
|
50070
50084
|
return collapse(out2);
|
|
50071
50085
|
}
|
|
50072
50086
|
var NOT_INTITULE_CLASS = /(^|\s)(fr-hint-text|fr-sr-only|sr-only|visually-hidden|visuallyhidden|hint-text|help-text)(\s|$)/;
|
|
50073
|
-
var
|
|
50087
|
+
var VISUALLY_HIDDEN_CLASS2 = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
|
|
50074
50088
|
var FIELD_DESCENDANT = /* @__PURE__ */ new Set(["input", "select", "textarea", "button", "datalist", "output"]);
|
|
50075
50089
|
function primaryLabelText(label) {
|
|
50076
|
-
if ([label, ...ancestors(label)].some((e) =>
|
|
50090
|
+
if ([label, ...ancestors(label)].some((e) => VISUALLY_HIDDEN_CLASS2.test(attr(e, "class") ?? ""))) return "";
|
|
50077
50091
|
let out2 = "";
|
|
50078
50092
|
const nonText = /* @__PURE__ */ new Set(["script", "style", "title", "desc", "noscript", "template", "canvas", "video", "img", "svg"]);
|
|
50079
50093
|
const walk3 = (n) => {
|
|
@@ -56349,10 +56363,9 @@ function axeFindings(violations, file, page) {
|
|
|
56349
56363
|
for (const v of violations) {
|
|
56350
56364
|
if (!v?.id) continue;
|
|
56351
56365
|
const criteriaId = scForAxe(v.id, v.tags);
|
|
56352
|
-
const severity = severityFromImpact(v.impact);
|
|
56353
|
-
const advisory = isAxeAdvisory(v.id, v.tags);
|
|
56354
56366
|
const nodes = v.nodes?.length ? v.nodes : [{ target: [], html: "" }];
|
|
56355
56367
|
for (const n of nodes) {
|
|
56368
|
+
const { severity, advisory } = axeNodeTreatment(v.id, v.tags, v.impact, n.html);
|
|
56356
56369
|
out2.push({
|
|
56357
56370
|
ruleId: `axe:${v.id}`,
|
|
56358
56371
|
criteriaId,
|
|
@@ -69953,9 +69966,8 @@ function toDynamicResult(out2, target, lang = "en", engine = "axe-core@playwrigh
|
|
|
69953
69966
|
const findings = [];
|
|
69954
69967
|
for (const v of out2.violations) {
|
|
69955
69968
|
const criteriaId = scForAxe(v.id, v.tags);
|
|
69956
|
-
const severity = severityFromImpact(v.impact);
|
|
69957
|
-
const advisory = isAxeAdvisory(v.id, v.tags);
|
|
69958
69969
|
for (const n of v.nodes.length ? v.nodes : [{ target: [], html: "" }]) {
|
|
69970
|
+
const { severity, advisory } = axeNodeTreatment(v.id, v.tags, v.impact, n.html);
|
|
69959
69971
|
findings.push({
|
|
69960
69972
|
criteriaId,
|
|
69961
69973
|
axeRule: v.id,
|
|
@@ -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.3'
|
|
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
|
package/src/audit.ts
CHANGED
|
@@ -28,7 +28,7 @@ import { CAPTURES_DIR, computeCaptureCoverage, enrichCaptureOrigins, isUnderDir,
|
|
|
28
28
|
import { isFullDocument } from "./rules/rule.js";
|
|
29
29
|
import { renderedRulesFor, renderedRulesRan, renderedTestedScs } from "./rules/rendered.js";
|
|
30
30
|
import { renderedProvesOn } from "./coverage.js";
|
|
31
|
-
import { AXE_DECIDES, PROBE_SEVERITY, PROBE_WCAG,
|
|
31
|
+
import { AXE_DECIDES, PROBE_SEVERITY, PROBE_WCAG, axeNodeTreatment, scForAxe } from "./axe-map.js";
|
|
32
32
|
import { subjectsAbsent, subjectsForSc, subjectsPresentIn } from "./adjudicate-subjects.js";
|
|
33
33
|
import { runRules } from "./rules/registry.js";
|
|
34
34
|
import { runCrossRules } from "./rules/cross-registry.js";
|
|
@@ -917,10 +917,9 @@ function axeFindings(violations: NonNullable<NonNullable<RenderSignals["axe"]>["
|
|
|
917
917
|
for (const v of violations) {
|
|
918
918
|
if (!v?.id) continue;
|
|
919
919
|
const criteriaId = scForAxe(v.id, v.tags);
|
|
920
|
-
const severity = severityFromImpact(v.impact);
|
|
921
|
-
const advisory = isAxeAdvisory(v.id, v.tags);
|
|
922
920
|
const nodes = v.nodes?.length ? v.nodes : [{ target: [] as string[], html: "" }];
|
|
923
921
|
for (const n of nodes) {
|
|
922
|
+
const { severity, advisory } = axeNodeTreatment(v.id, v.tags, v.impact, n.html);
|
|
924
923
|
out.push({
|
|
925
924
|
ruleId: `axe:${v.id}`,
|
|
926
925
|
criteriaId,
|
package/src/axe-map.ts
CHANGED
|
@@ -325,6 +325,27 @@ export function isAxeAdvisory(ruleId: string, tags: string[] | undefined): boole
|
|
|
325
325
|
return AXE_ADVISORY_EXCEPTIONS[ruleId] ?? axeAdvisory(tags);
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
+
/** How ONE axe node merges: its severity and whether it is advisory. The rule-level decision
|
|
329
|
+
* (`severityFromImpact`, `isAxeAdvisory`) with the node-level corrections a rule needs.
|
|
330
|
+
*
|
|
331
|
+
* `label-title-only` (#117) is pinned normative for parity with the static twin
|
|
332
|
+
* `control-name-title-only`, whose defect is a field named by `title` ALONE — a weak name,
|
|
333
|
+
* « mineur », never a missing one. axe also fires it on a field named by a visually hidden
|
|
334
|
+
* `aria-labelledby` target: that field has a programmatic name and fails no criterion, so the
|
|
335
|
+
* node is advisory. Neither case is ever a blocking 4.1.2 failure. */
|
|
336
|
+
export function axeNodeTreatment(
|
|
337
|
+
ruleId: string,
|
|
338
|
+
tags: string[] | undefined,
|
|
339
|
+
impact: string | null | undefined,
|
|
340
|
+
nodeHtml: string | undefined,
|
|
341
|
+
): { severity: Severity; advisory: boolean } {
|
|
342
|
+
if (ruleId === "label-title-only") {
|
|
343
|
+
const labelledby = /\saria-labelledby\s*=\s*["'][^"']*\S[^"']*["']/i.test(nodeHtml ?? "");
|
|
344
|
+
return { severity: "mineur", advisory: labelledby || isAxeAdvisory(ruleId, tags) };
|
|
345
|
+
}
|
|
346
|
+
return { severity: severityFromImpact(impact), advisory: isAxeAdvisory(ruleId, tags) };
|
|
347
|
+
}
|
|
348
|
+
|
|
328
349
|
/** Resolve an axe rule to a WCAG SC: the curated map first (deliberate, e.g.
|
|
329
350
|
* color-contrast → 1.4.3), then axe's own wcag tags, then the 4.1.2 fallback. */
|
|
330
351
|
export function scForAxe(ruleId: string, tags?: string[]): string {
|
package/src/rules/rendered.ts
CHANGED
|
@@ -296,6 +296,8 @@ function borderColours(css: Record<string, string>): RGBA[] {
|
|
|
296
296
|
// itself. Three independent ways to pass — deliberately generous, because a false
|
|
297
297
|
// "non-conforming" here is far more costly than a missed one, and the remaining failures (a
|
|
298
298
|
// borderless input on a same-coloured background) are unambiguous.
|
|
299
|
+
const VISUALLY_HIDDEN_CLASS = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
|
|
300
|
+
|
|
299
301
|
const renderedNonTextContrast: Rule = {
|
|
300
302
|
id: "rendered-nontext-contrast",
|
|
301
303
|
criteria: ["1.4.11"],
|
|
@@ -315,6 +317,11 @@ const renderedNonTextContrast: Rule = {
|
|
|
315
317
|
if (el.tag === "input" && ["button", "submit", "reset"].includes(type) && WORD.test(el.attribs.value ?? "")) continue;
|
|
316
318
|
const css = styleAt(doc, i)?.css;
|
|
317
319
|
if (!css || invisible(css)) continue;
|
|
320
|
+
// A visually hidden control (sr-only class, or a box of at most 1×1 px) has nothing visible
|
|
321
|
+
// to delimit: the control a sighted user operates is another element (#118).
|
|
322
|
+
if (VISUALLY_HIDDEN_CLASS.test(el.attribs.class ?? "")) continue;
|
|
323
|
+
const box = doc.signals?.boxes?.get(i);
|
|
324
|
+
if (box && box.w <= 1 && box.h <= 1) continue;
|
|
318
325
|
// A shadow or an outline can BE the boundary, and neither is a colour we can compare
|
|
319
326
|
// simply. Decline rather than guess.
|
|
320
327
|
if (css.boxShadow && css.boxShadow !== "none") continue;
|
|
@@ -326,6 +333,12 @@ const renderedNonTextContrast: Rule = {
|
|
|
326
333
|
// A transparent control is filled by whatever is behind it: the surroundings.
|
|
327
334
|
const fill = own && own.a >= 1 ? own : surrounding.color;
|
|
328
335
|
if (contrastRatio(fill, surrounding.color) >= 3) continue; // the fill draws the boundary
|
|
336
|
+
// An icon-only BUTTON is identified by its glyph, which icon fonts and DSFR masks paint in
|
|
337
|
+
// `currentColor`: 1.4.11 then asks 3:1 for that glyph, not a boundary (#118). Fields
|
|
338
|
+
// still need one — a borderless input has no glyph to stand in for it.
|
|
339
|
+
const isButton = el.tag === "button" || (el.tag === "input" && ["button", "submit", "reset"].includes(type));
|
|
340
|
+
const glyph = parseColor(css.color ?? "");
|
|
341
|
+
if (isButton && glyph && glyph.a >= 1 && contrastRatio(glyph, surrounding.color) >= 3) continue;
|
|
329
342
|
const borders = borderColours(css);
|
|
330
343
|
if (borders.some((b) => contrastRatio(b, surrounding.color) >= 3 || contrastRatio(b, fill) >= 3)) continue;
|
|
331
344
|
// No fill contrast and no contrasting border: nothing marks where the control is.
|
package/src/scan.ts
CHANGED
|
@@ -14,7 +14,7 @@ import type { AuditResult, DynamicEngine, DynamicFinding, DynamicResult, Finding
|
|
|
14
14
|
import { isAdjudicated } from "./types.js";
|
|
15
15
|
import { lineStartsOf, lineColAt } from "./parse/html.js";
|
|
16
16
|
import { allGuidelines } from "./wcag.js";
|
|
17
|
-
import { PROBE_SEVERITY, PROBE_WCAG,
|
|
17
|
+
import { PROBE_SEVERITY, PROBE_WCAG, axeNodeTreatment, scForAxe } from "./axe-map.js";
|
|
18
18
|
import { parseSitemapUrls, crawlUrls, crawlBound, nameFromUrl } from "./crawl.js";
|
|
19
19
|
import { sampleScope } from "./sample.js";
|
|
20
20
|
import {
|
|
@@ -462,11 +462,11 @@ export function toDynamicResult(out: RunnerOutput, target: string, lang: Lang =
|
|
|
462
462
|
const findings: DynamicFinding[] = [];
|
|
463
463
|
for (const v of out.violations) {
|
|
464
464
|
const criteriaId = scForAxe(v.id, v.tags);
|
|
465
|
-
const severity: Severity = severityFromImpact(v.impact);
|
|
466
|
-
// A best-practice-only axe violation (no `wcag<digits>` tag) evidences no testable SC
|
|
467
|
-
// → fold as an advisory recommendation, never a criterion NC (e.g. empty-table-header).
|
|
468
|
-
const advisory = isAxeAdvisory(v.id, v.tags);
|
|
469
465
|
for (const n of v.nodes.length ? v.nodes : [{ target: [], html: "" }]) {
|
|
466
|
+
// A best-practice-only axe violation (no `wcag<digits>` tag) evidences no testable SC
|
|
467
|
+
// → fold as an advisory recommendation, never a criterion NC (e.g. empty-table-header).
|
|
468
|
+
// Decided per NODE: some rules need the element to tell a weak name from no name (#117).
|
|
469
|
+
const { severity, advisory } = axeNodeTreatment(v.id, v.tags, v.impact, n.html);
|
|
470
470
|
findings.push({
|
|
471
471
|
criteriaId,
|
|
472
472
|
axeRule: v.id,
|
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.3";
|
|
4
4
|
export const SCHEMA_VERSION = 2;
|
|
5
5
|
|
|
6
6
|
// Lang = the UI FRAME's language — the `L` localization tables each module (report,
|