ultra11y 5.55.1 → 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 +40 -16
- 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 +40 -16
- package/skills/ultra11y/SKILL.md +1 -1
- package/skills/ultra11y/scripts/ultra11y.mjs +40 -16
- package/skills/ultra11y/templates/gitlab-ci.yml +1 -1
- package/src/adjudicate-subjects.ts +2 -2
- package/src/audit.ts +2 -3
- package/src/axe-map.ts +21 -0
- package/src/data/guidance/wcag.json +3 -3
- package/src/name.ts +5 -1
- package/src/rules/forms.ts +4 -1
- package/src/rules/headings.ts +11 -3
- package/src/rules/images.ts +3 -1
- package/src/rules/rendered.ts +13 -0
- package/src/rules/scripts-aria.ts +4 -2
- 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
|
}
|
|
@@ -48646,12 +48660,12 @@ var PROBE_KEYS = {
|
|
|
48646
48660
|
"4.1.3": ["liveRegion"]
|
|
48647
48661
|
};
|
|
48648
48662
|
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) => (
|
|
48663
|
+
var insideRoleImg = (e) => ancestors(e).some((a) => roleOf(a) === "img");
|
|
48650
48664
|
var SUBJECTS = {
|
|
48651
48665
|
// Every image-like element and the alternative it carries. Class = (alt, src): the same
|
|
48652
48666
|
// logo on 38 pages is one decision, not 38.
|
|
48653
48667
|
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) =>
|
|
48668
|
+
(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
48669
|
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
48670
|
const figure = ancestors(e).some((a) => a.tag === "figure");
|
|
48657
48671
|
return h(
|
|
@@ -50070,8 +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|$)/;
|
|
50087
|
+
var VISUALLY_HIDDEN_CLASS2 = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
|
|
50073
50088
|
var FIELD_DESCENDANT = /* @__PURE__ */ new Set(["input", "select", "textarea", "button", "datalist", "output"]);
|
|
50074
50089
|
function primaryLabelText(label) {
|
|
50090
|
+
if ([label, ...ancestors(label)].some((e) => VISUALLY_HIDDEN_CLASS2.test(attr(e, "class") ?? ""))) return "";
|
|
50075
50091
|
let out2 = "";
|
|
50076
50092
|
const nonText = /* @__PURE__ */ new Set(["script", "style", "title", "desc", "noscript", "template", "canvas", "video", "img", "svg"]);
|
|
50077
50093
|
const walk3 = (n) => {
|
|
@@ -50340,7 +50356,7 @@ var figureCaptionUnassociated = {
|
|
|
50340
50356
|
for (const el of doc.elements) {
|
|
50341
50357
|
if (el.tag !== "figure" || isHidden(el) || hasDynamicSpread(el)) continue;
|
|
50342
50358
|
const desc = descendants(el);
|
|
50343
|
-
const caption = desc.find((d) => d.tag === "figcaption");
|
|
50359
|
+
const caption = desc.find((d) => d.tag === "figcaption" && ancestors(d).find((a) => a.tag === "figure") === el);
|
|
50344
50360
|
if (!caption || !desc.some((d) => d !== caption && isCaptionedImage(d) && !ancestors(d).includes(caption))) continue;
|
|
50345
50361
|
const captionText = collapseWs(textContent(caption));
|
|
50346
50362
|
if (!captionText || captionText.includes("{") || mayInjectContent(caption)) continue;
|
|
@@ -51017,7 +51033,9 @@ var menuitemEmptyName = {
|
|
|
51017
51033
|
criteria: ["4.1.2"],
|
|
51018
51034
|
severity: "bloquant",
|
|
51019
51035
|
run(doc) {
|
|
51020
|
-
return doc.elements.filter((el) => ["menuitem", "menuitemcheckbox", "menuitemradio"].includes((attr(el, "role") ?? "").trim().toLowerCase())).filter(
|
|
51036
|
+
return doc.elements.filter((el) => ["menuitem", "menuitemcheckbox", "menuitemradio"].includes((attr(el, "role") ?? "").trim().toLowerCase())).filter(
|
|
51037
|
+
(el) => !isHiddenFromAT(el) && !hasDynamicSpread(el) && !mayInjectContent(el) && !labelledbyIsDynamic(el) && accessibleName(el, doc).trim() === ""
|
|
51038
|
+
).map((el) => ({ criteriaId: "4.1.2", el, msgId: "menuitem-empty-name" }));
|
|
51021
51039
|
}
|
|
51022
51040
|
};
|
|
51023
51041
|
var nestedInteractive = {
|
|
@@ -51693,6 +51711,9 @@ var ALLOWED_IN_LIST = /* @__PURE__ */ new Set(["li", "script", "template", "slot
|
|
|
51693
51711
|
function rendersElsewhere(tag) {
|
|
51694
51712
|
return !isIntrinsic(tag) || tag.includes("-") || tag === "component";
|
|
51695
51713
|
}
|
|
51714
|
+
function listChildren(el) {
|
|
51715
|
+
return el.children.flatMap((c2) => c2.type !== "element" ? [] : c2.tag === "#fragment" ? listChildren(c2) : [c2]);
|
|
51716
|
+
}
|
|
51696
51717
|
var listStructure = {
|
|
51697
51718
|
id: "list-structure",
|
|
51698
51719
|
criteria: ["1.3.1"],
|
|
@@ -51701,8 +51722,8 @@ var listStructure = {
|
|
|
51701
51722
|
const out2 = [];
|
|
51702
51723
|
for (const el of doc.elements) {
|
|
51703
51724
|
if (el.tag === "ul" || el.tag === "ol") {
|
|
51704
|
-
const bad = el.
|
|
51705
|
-
if (bad
|
|
51725
|
+
const bad = listChildren(el).find((c2) => !rendersElsewhere(c2.tag) && !ALLOWED_IN_LIST.has(c2.tag));
|
|
51726
|
+
if (bad) {
|
|
51706
51727
|
out2.push({
|
|
51707
51728
|
criteriaId: "1.3.1",
|
|
51708
51729
|
el: bad,
|
|
@@ -51716,7 +51737,7 @@ var listStructure = {
|
|
|
51716
51737
|
if (parent.tag === "template" || ancestors(el).some((a) => a.tag === "template" || a.tag !== "#fragment" && rendersElsewhere(a.tag))) continue;
|
|
51717
51738
|
let host = parent;
|
|
51718
51739
|
while (host && host.tag === "#fragment") host = host.parent;
|
|
51719
|
-
if (!host) continue;
|
|
51740
|
+
if (!host || ["ul", "ol", "menu"].includes(host.tag)) continue;
|
|
51720
51741
|
out2.push({
|
|
51721
51742
|
criteriaId: "1.3.1",
|
|
51722
51743
|
el,
|
|
@@ -52450,7 +52471,8 @@ var controlLabelMissing = {
|
|
|
52450
52471
|
if (via === "title") continue;
|
|
52451
52472
|
if (hasDynamicSpread(el)) continue;
|
|
52452
52473
|
if (hasAttr(el, "placeholder")) continue;
|
|
52453
|
-
|
|
52474
|
+
const id = attr(el, "id");
|
|
52475
|
+
if (id === void 0 ? hasBoundAttr(el, "id") : id.includes("{")) continue;
|
|
52454
52476
|
out2.push({
|
|
52455
52477
|
criteriaId: "4.1.2",
|
|
52456
52478
|
el,
|
|
@@ -56341,10 +56363,9 @@ function axeFindings(violations, file, page) {
|
|
|
56341
56363
|
for (const v of violations) {
|
|
56342
56364
|
if (!v?.id) continue;
|
|
56343
56365
|
const criteriaId = scForAxe(v.id, v.tags);
|
|
56344
|
-
const severity = severityFromImpact(v.impact);
|
|
56345
|
-
const advisory = isAxeAdvisory(v.id, v.tags);
|
|
56346
56366
|
const nodes = v.nodes?.length ? v.nodes : [{ target: [], html: "" }];
|
|
56347
56367
|
for (const n of nodes) {
|
|
56368
|
+
const { severity, advisory } = axeNodeTreatment(v.id, v.tags, v.impact, n.html);
|
|
56348
56369
|
out2.push({
|
|
56349
56370
|
ruleId: `axe:${v.id}`,
|
|
56350
56371
|
criteriaId,
|
|
@@ -60599,9 +60620,13 @@ var wcag_default2 = {
|
|
|
60599
60620
|
examples: [
|
|
60600
60621
|
{
|
|
60601
60622
|
lang: "html",
|
|
60602
|
-
good:
|
|
60623
|
+
good: `<dialog aria-labelledby="alert-heading" id="date-alert" role="alertdialog">
|
|
60624
|
+
<h1 id="alert-heading">Error</h1>
|
|
60625
|
+
<p>Employee's Birth Date is after their hire date. Please verify the birth date and hire date.</p>
|
|
60626
|
+
<button command="close" commandfor="date-alert" type="button">Return to page and correct error</button>
|
|
60627
|
+
</dialog>`,
|
|
60603
60628
|
note: {
|
|
60604
|
-
en: "Good: Using aria-
|
|
60629
|
+
en: "Good: Using aria-alertdialog to Identify Errors (ARIA18)."
|
|
60605
60630
|
}
|
|
60606
60631
|
}
|
|
60607
60632
|
],
|
|
@@ -60714,7 +60739,7 @@ var wcag_default2 = {
|
|
|
60714
60739
|
fr: "Nom, r\xF4le et valeur"
|
|
60715
60740
|
},
|
|
60716
60741
|
summary: {
|
|
60717
|
-
en: "Give components
|
|
60742
|
+
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
60743
|
},
|
|
60719
60744
|
examples: [
|
|
60720
60745
|
{
|
|
@@ -69941,9 +69966,8 @@ function toDynamicResult(out2, target, lang = "en", engine = "axe-core@playwrigh
|
|
|
69941
69966
|
const findings = [];
|
|
69942
69967
|
for (const v of out2.violations) {
|
|
69943
69968
|
const criteriaId = scForAxe(v.id, v.tags);
|
|
69944
|
-
const severity = severityFromImpact(v.impact);
|
|
69945
|
-
const advisory = isAxeAdvisory(v.id, v.tags);
|
|
69946
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);
|
|
69947
69971
|
findings.push({
|
|
69948
69972
|
criteriaId,
|
|
69949
69973
|
axeRule: v.id,
|
|
@@ -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.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
|
}
|
|
@@ -48646,12 +48660,12 @@ var PROBE_KEYS = {
|
|
|
48646
48660
|
"4.1.3": ["liveRegion"]
|
|
48647
48661
|
};
|
|
48648
48662
|
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) => (
|
|
48663
|
+
var insideRoleImg = (e) => ancestors(e).some((a) => roleOf(a) === "img");
|
|
48650
48664
|
var SUBJECTS = {
|
|
48651
48665
|
// Every image-like element and the alternative it carries. Class = (alt, src): the same
|
|
48652
48666
|
// logo on 38 pages is one decision, not 38.
|
|
48653
48667
|
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) =>
|
|
48668
|
+
(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
48669
|
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
48670
|
const figure = ancestors(e).some((a) => a.tag === "figure");
|
|
48657
48671
|
return h(
|
|
@@ -50070,8 +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|$)/;
|
|
50087
|
+
var VISUALLY_HIDDEN_CLASS2 = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
|
|
50073
50088
|
var FIELD_DESCENDANT = /* @__PURE__ */ new Set(["input", "select", "textarea", "button", "datalist", "output"]);
|
|
50074
50089
|
function primaryLabelText(label) {
|
|
50090
|
+
if ([label, ...ancestors(label)].some((e) => VISUALLY_HIDDEN_CLASS2.test(attr(e, "class") ?? ""))) return "";
|
|
50075
50091
|
let out2 = "";
|
|
50076
50092
|
const nonText = /* @__PURE__ */ new Set(["script", "style", "title", "desc", "noscript", "template", "canvas", "video", "img", "svg"]);
|
|
50077
50093
|
const walk3 = (n) => {
|
|
@@ -50340,7 +50356,7 @@ var figureCaptionUnassociated = {
|
|
|
50340
50356
|
for (const el of doc.elements) {
|
|
50341
50357
|
if (el.tag !== "figure" || isHidden(el) || hasDynamicSpread(el)) continue;
|
|
50342
50358
|
const desc = descendants(el);
|
|
50343
|
-
const caption = desc.find((d) => d.tag === "figcaption");
|
|
50359
|
+
const caption = desc.find((d) => d.tag === "figcaption" && ancestors(d).find((a) => a.tag === "figure") === el);
|
|
50344
50360
|
if (!caption || !desc.some((d) => d !== caption && isCaptionedImage(d) && !ancestors(d).includes(caption))) continue;
|
|
50345
50361
|
const captionText = collapseWs(textContent(caption));
|
|
50346
50362
|
if (!captionText || captionText.includes("{") || mayInjectContent(caption)) continue;
|
|
@@ -51017,7 +51033,9 @@ var menuitemEmptyName = {
|
|
|
51017
51033
|
criteria: ["4.1.2"],
|
|
51018
51034
|
severity: "bloquant",
|
|
51019
51035
|
run(doc) {
|
|
51020
|
-
return doc.elements.filter((el) => ["menuitem", "menuitemcheckbox", "menuitemradio"].includes((attr(el, "role") ?? "").trim().toLowerCase())).filter(
|
|
51036
|
+
return doc.elements.filter((el) => ["menuitem", "menuitemcheckbox", "menuitemradio"].includes((attr(el, "role") ?? "").trim().toLowerCase())).filter(
|
|
51037
|
+
(el) => !isHiddenFromAT(el) && !hasDynamicSpread(el) && !mayInjectContent(el) && !labelledbyIsDynamic(el) && accessibleName(el, doc).trim() === ""
|
|
51038
|
+
).map((el) => ({ criteriaId: "4.1.2", el, msgId: "menuitem-empty-name" }));
|
|
51021
51039
|
}
|
|
51022
51040
|
};
|
|
51023
51041
|
var nestedInteractive = {
|
|
@@ -51693,6 +51711,9 @@ var ALLOWED_IN_LIST = /* @__PURE__ */ new Set(["li", "script", "template", "slot
|
|
|
51693
51711
|
function rendersElsewhere(tag) {
|
|
51694
51712
|
return !isIntrinsic(tag) || tag.includes("-") || tag === "component";
|
|
51695
51713
|
}
|
|
51714
|
+
function listChildren(el) {
|
|
51715
|
+
return el.children.flatMap((c2) => c2.type !== "element" ? [] : c2.tag === "#fragment" ? listChildren(c2) : [c2]);
|
|
51716
|
+
}
|
|
51696
51717
|
var listStructure = {
|
|
51697
51718
|
id: "list-structure",
|
|
51698
51719
|
criteria: ["1.3.1"],
|
|
@@ -51701,8 +51722,8 @@ var listStructure = {
|
|
|
51701
51722
|
const out2 = [];
|
|
51702
51723
|
for (const el of doc.elements) {
|
|
51703
51724
|
if (el.tag === "ul" || el.tag === "ol") {
|
|
51704
|
-
const bad = el.
|
|
51705
|
-
if (bad
|
|
51725
|
+
const bad = listChildren(el).find((c2) => !rendersElsewhere(c2.tag) && !ALLOWED_IN_LIST.has(c2.tag));
|
|
51726
|
+
if (bad) {
|
|
51706
51727
|
out2.push({
|
|
51707
51728
|
criteriaId: "1.3.1",
|
|
51708
51729
|
el: bad,
|
|
@@ -51716,7 +51737,7 @@ var listStructure = {
|
|
|
51716
51737
|
if (parent.tag === "template" || ancestors(el).some((a) => a.tag === "template" || a.tag !== "#fragment" && rendersElsewhere(a.tag))) continue;
|
|
51717
51738
|
let host = parent;
|
|
51718
51739
|
while (host && host.tag === "#fragment") host = host.parent;
|
|
51719
|
-
if (!host) continue;
|
|
51740
|
+
if (!host || ["ul", "ol", "menu"].includes(host.tag)) continue;
|
|
51720
51741
|
out2.push({
|
|
51721
51742
|
criteriaId: "1.3.1",
|
|
51722
51743
|
el,
|
|
@@ -52450,7 +52471,8 @@ var controlLabelMissing = {
|
|
|
52450
52471
|
if (via === "title") continue;
|
|
52451
52472
|
if (hasDynamicSpread(el)) continue;
|
|
52452
52473
|
if (hasAttr(el, "placeholder")) continue;
|
|
52453
|
-
|
|
52474
|
+
const id = attr(el, "id");
|
|
52475
|
+
if (id === void 0 ? hasBoundAttr(el, "id") : id.includes("{")) continue;
|
|
52454
52476
|
out2.push({
|
|
52455
52477
|
criteriaId: "4.1.2",
|
|
52456
52478
|
el,
|
|
@@ -56341,10 +56363,9 @@ function axeFindings(violations, file, page) {
|
|
|
56341
56363
|
for (const v of violations) {
|
|
56342
56364
|
if (!v?.id) continue;
|
|
56343
56365
|
const criteriaId = scForAxe(v.id, v.tags);
|
|
56344
|
-
const severity = severityFromImpact(v.impact);
|
|
56345
|
-
const advisory = isAxeAdvisory(v.id, v.tags);
|
|
56346
56366
|
const nodes = v.nodes?.length ? v.nodes : [{ target: [], html: "" }];
|
|
56347
56367
|
for (const n of nodes) {
|
|
56368
|
+
const { severity, advisory } = axeNodeTreatment(v.id, v.tags, v.impact, n.html);
|
|
56348
56369
|
out2.push({
|
|
56349
56370
|
ruleId: `axe:${v.id}`,
|
|
56350
56371
|
criteriaId,
|
|
@@ -60599,9 +60620,13 @@ var wcag_default2 = {
|
|
|
60599
60620
|
examples: [
|
|
60600
60621
|
{
|
|
60601
60622
|
lang: "html",
|
|
60602
|
-
good:
|
|
60623
|
+
good: `<dialog aria-labelledby="alert-heading" id="date-alert" role="alertdialog">
|
|
60624
|
+
<h1 id="alert-heading">Error</h1>
|
|
60625
|
+
<p>Employee's Birth Date is after their hire date. Please verify the birth date and hire date.</p>
|
|
60626
|
+
<button command="close" commandfor="date-alert" type="button">Return to page and correct error</button>
|
|
60627
|
+
</dialog>`,
|
|
60603
60628
|
note: {
|
|
60604
|
-
en: "Good: Using aria-
|
|
60629
|
+
en: "Good: Using aria-alertdialog to Identify Errors (ARIA18)."
|
|
60605
60630
|
}
|
|
60606
60631
|
}
|
|
60607
60632
|
],
|
|
@@ -60714,7 +60739,7 @@ var wcag_default2 = {
|
|
|
60714
60739
|
fr: "Nom, r\xF4le et valeur"
|
|
60715
60740
|
},
|
|
60716
60741
|
summary: {
|
|
60717
|
-
en: "Give components
|
|
60742
|
+
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
60743
|
},
|
|
60719
60744
|
examples: [
|
|
60720
60745
|
{
|
|
@@ -69941,9 +69966,8 @@ function toDynamicResult(out2, target, lang = "en", engine = "axe-core@playwrigh
|
|
|
69941
69966
|
const findings = [];
|
|
69942
69967
|
for (const v of out2.violations) {
|
|
69943
69968
|
const criteriaId = scForAxe(v.id, v.tags);
|
|
69944
|
-
const severity = severityFromImpact(v.impact);
|
|
69945
|
-
const advisory = isAxeAdvisory(v.id, v.tags);
|
|
69946
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);
|
|
69947
69971
|
findings.push({
|
|
69948
69972
|
criteriaId,
|
|
69949
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
|
}
|
|
@@ -48646,12 +48660,12 @@ var PROBE_KEYS = {
|
|
|
48646
48660
|
"4.1.3": ["liveRegion"]
|
|
48647
48661
|
};
|
|
48648
48662
|
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) => (
|
|
48663
|
+
var insideRoleImg = (e) => ancestors(e).some((a) => roleOf(a) === "img");
|
|
48650
48664
|
var SUBJECTS = {
|
|
48651
48665
|
// Every image-like element and the alternative it carries. Class = (alt, src): the same
|
|
48652
48666
|
// logo on 38 pages is one decision, not 38.
|
|
48653
48667
|
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) =>
|
|
48668
|
+
(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
48669
|
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
48670
|
const figure = ancestors(e).some((a) => a.tag === "figure");
|
|
48657
48671
|
return h(
|
|
@@ -50070,8 +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|$)/;
|
|
50087
|
+
var VISUALLY_HIDDEN_CLASS2 = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
|
|
50073
50088
|
var FIELD_DESCENDANT = /* @__PURE__ */ new Set(["input", "select", "textarea", "button", "datalist", "output"]);
|
|
50074
50089
|
function primaryLabelText(label) {
|
|
50090
|
+
if ([label, ...ancestors(label)].some((e) => VISUALLY_HIDDEN_CLASS2.test(attr(e, "class") ?? ""))) return "";
|
|
50075
50091
|
let out2 = "";
|
|
50076
50092
|
const nonText = /* @__PURE__ */ new Set(["script", "style", "title", "desc", "noscript", "template", "canvas", "video", "img", "svg"]);
|
|
50077
50093
|
const walk3 = (n) => {
|
|
@@ -50340,7 +50356,7 @@ var figureCaptionUnassociated = {
|
|
|
50340
50356
|
for (const el of doc.elements) {
|
|
50341
50357
|
if (el.tag !== "figure" || isHidden(el) || hasDynamicSpread(el)) continue;
|
|
50342
50358
|
const desc = descendants(el);
|
|
50343
|
-
const caption = desc.find((d) => d.tag === "figcaption");
|
|
50359
|
+
const caption = desc.find((d) => d.tag === "figcaption" && ancestors(d).find((a) => a.tag === "figure") === el);
|
|
50344
50360
|
if (!caption || !desc.some((d) => d !== caption && isCaptionedImage(d) && !ancestors(d).includes(caption))) continue;
|
|
50345
50361
|
const captionText = collapseWs(textContent(caption));
|
|
50346
50362
|
if (!captionText || captionText.includes("{") || mayInjectContent(caption)) continue;
|
|
@@ -51017,7 +51033,9 @@ var menuitemEmptyName = {
|
|
|
51017
51033
|
criteria: ["4.1.2"],
|
|
51018
51034
|
severity: "bloquant",
|
|
51019
51035
|
run(doc) {
|
|
51020
|
-
return doc.elements.filter((el) => ["menuitem", "menuitemcheckbox", "menuitemradio"].includes((attr(el, "role") ?? "").trim().toLowerCase())).filter(
|
|
51036
|
+
return doc.elements.filter((el) => ["menuitem", "menuitemcheckbox", "menuitemradio"].includes((attr(el, "role") ?? "").trim().toLowerCase())).filter(
|
|
51037
|
+
(el) => !isHiddenFromAT(el) && !hasDynamicSpread(el) && !mayInjectContent(el) && !labelledbyIsDynamic(el) && accessibleName(el, doc).trim() === ""
|
|
51038
|
+
).map((el) => ({ criteriaId: "4.1.2", el, msgId: "menuitem-empty-name" }));
|
|
51021
51039
|
}
|
|
51022
51040
|
};
|
|
51023
51041
|
var nestedInteractive = {
|
|
@@ -51693,6 +51711,9 @@ var ALLOWED_IN_LIST = /* @__PURE__ */ new Set(["li", "script", "template", "slot
|
|
|
51693
51711
|
function rendersElsewhere(tag) {
|
|
51694
51712
|
return !isIntrinsic(tag) || tag.includes("-") || tag === "component";
|
|
51695
51713
|
}
|
|
51714
|
+
function listChildren(el) {
|
|
51715
|
+
return el.children.flatMap((c2) => c2.type !== "element" ? [] : c2.tag === "#fragment" ? listChildren(c2) : [c2]);
|
|
51716
|
+
}
|
|
51696
51717
|
var listStructure = {
|
|
51697
51718
|
id: "list-structure",
|
|
51698
51719
|
criteria: ["1.3.1"],
|
|
@@ -51701,8 +51722,8 @@ var listStructure = {
|
|
|
51701
51722
|
const out2 = [];
|
|
51702
51723
|
for (const el of doc.elements) {
|
|
51703
51724
|
if (el.tag === "ul" || el.tag === "ol") {
|
|
51704
|
-
const bad = el.
|
|
51705
|
-
if (bad
|
|
51725
|
+
const bad = listChildren(el).find((c2) => !rendersElsewhere(c2.tag) && !ALLOWED_IN_LIST.has(c2.tag));
|
|
51726
|
+
if (bad) {
|
|
51706
51727
|
out2.push({
|
|
51707
51728
|
criteriaId: "1.3.1",
|
|
51708
51729
|
el: bad,
|
|
@@ -51716,7 +51737,7 @@ var listStructure = {
|
|
|
51716
51737
|
if (parent.tag === "template" || ancestors(el).some((a) => a.tag === "template" || a.tag !== "#fragment" && rendersElsewhere(a.tag))) continue;
|
|
51717
51738
|
let host = parent;
|
|
51718
51739
|
while (host && host.tag === "#fragment") host = host.parent;
|
|
51719
|
-
if (!host) continue;
|
|
51740
|
+
if (!host || ["ul", "ol", "menu"].includes(host.tag)) continue;
|
|
51720
51741
|
out2.push({
|
|
51721
51742
|
criteriaId: "1.3.1",
|
|
51722
51743
|
el,
|
|
@@ -52450,7 +52471,8 @@ var controlLabelMissing = {
|
|
|
52450
52471
|
if (via === "title") continue;
|
|
52451
52472
|
if (hasDynamicSpread(el)) continue;
|
|
52452
52473
|
if (hasAttr(el, "placeholder")) continue;
|
|
52453
|
-
|
|
52474
|
+
const id = attr(el, "id");
|
|
52475
|
+
if (id === void 0 ? hasBoundAttr(el, "id") : id.includes("{")) continue;
|
|
52454
52476
|
out2.push({
|
|
52455
52477
|
criteriaId: "4.1.2",
|
|
52456
52478
|
el,
|
|
@@ -56341,10 +56363,9 @@ function axeFindings(violations, file, page) {
|
|
|
56341
56363
|
for (const v of violations) {
|
|
56342
56364
|
if (!v?.id) continue;
|
|
56343
56365
|
const criteriaId = scForAxe(v.id, v.tags);
|
|
56344
|
-
const severity = severityFromImpact(v.impact);
|
|
56345
|
-
const advisory = isAxeAdvisory(v.id, v.tags);
|
|
56346
56366
|
const nodes = v.nodes?.length ? v.nodes : [{ target: [], html: "" }];
|
|
56347
56367
|
for (const n of nodes) {
|
|
56368
|
+
const { severity, advisory } = axeNodeTreatment(v.id, v.tags, v.impact, n.html);
|
|
56348
56369
|
out2.push({
|
|
56349
56370
|
ruleId: `axe:${v.id}`,
|
|
56350
56371
|
criteriaId,
|
|
@@ -60599,9 +60620,13 @@ var wcag_default2 = {
|
|
|
60599
60620
|
examples: [
|
|
60600
60621
|
{
|
|
60601
60622
|
lang: "html",
|
|
60602
|
-
good:
|
|
60623
|
+
good: `<dialog aria-labelledby="alert-heading" id="date-alert" role="alertdialog">
|
|
60624
|
+
<h1 id="alert-heading">Error</h1>
|
|
60625
|
+
<p>Employee's Birth Date is after their hire date. Please verify the birth date and hire date.</p>
|
|
60626
|
+
<button command="close" commandfor="date-alert" type="button">Return to page and correct error</button>
|
|
60627
|
+
</dialog>`,
|
|
60603
60628
|
note: {
|
|
60604
|
-
en: "Good: Using aria-
|
|
60629
|
+
en: "Good: Using aria-alertdialog to Identify Errors (ARIA18)."
|
|
60605
60630
|
}
|
|
60606
60631
|
}
|
|
60607
60632
|
],
|
|
@@ -60714,7 +60739,7 @@ var wcag_default2 = {
|
|
|
60714
60739
|
fr: "Nom, r\xF4le et valeur"
|
|
60715
60740
|
},
|
|
60716
60741
|
summary: {
|
|
60717
|
-
en: "Give components
|
|
60742
|
+
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
60743
|
},
|
|
60719
60744
|
examples: [
|
|
60720
60745
|
{
|
|
@@ -69941,9 +69966,8 @@ function toDynamicResult(out2, target, lang = "en", engine = "axe-core@playwrigh
|
|
|
69941
69966
|
const findings = [];
|
|
69942
69967
|
for (const v of out2.violations) {
|
|
69943
69968
|
const criteriaId = scForAxe(v.id, v.tags);
|
|
69944
|
-
const severity = severityFromImpact(v.impact);
|
|
69945
|
-
const advisory = isAxeAdvisory(v.id, v.tags);
|
|
69946
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);
|
|
69947
69971
|
findings.push({
|
|
69948
69972
|
criteriaId,
|
|
69949
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
|
|
@@ -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/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 {
|
|
@@ -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/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;
|
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.
|
|
@@ -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/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,
|