ultra11y 5.55.2 → 5.55.4

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.
@@ -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.2",
13
+ "version": "5.55.4",
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.2",
4
+ "version": "5.55.4",
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.2",
4
+ "version": "5.55.4",
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.2";
30
+ const ULTRA11Y_PLUGIN_VERSION = "5.55.4";
31
31
 
32
32
  const here = dirname(fileURLToPath(import.meta.url));
33
33
 
package/dist/cypress.mjs CHANGED
@@ -59,6 +59,16 @@ var COLLECT_SNAPSHOT = `(() => {
59
59
  els.push(child);
60
60
  const name = child.localName;
61
61
  if (RAW_TEXT.has(name)) continue;
62
+ // With scripting on, a <noscript>'s content is raw TEXT to the browser, while the reparse
63
+ // reads it as elements (#112). Parse that text with the page's own parser and count what
64
+ // it yields, in place, so every later ordinal still lines up. The inert parsed nodes have
65
+ // no computed style and an empty box, which the rules read as \xAB nothing measured \xBB.
66
+ if (name === 'noscript' && child.children.length === 0 && (child.textContent || '').includes('<')) {
67
+ const parsed = document.createElement('template');
68
+ parsed.innerHTML = child.textContent || '';
69
+ walkElements(parsed.content);
70
+ continue;
71
+ }
62
72
  walkElements(name === 'template' && child.content ? child.content : child);
63
73
  }
64
74
  };
@@ -64,6 +64,16 @@ var COLLECT_SNAPSHOT = `(() => {
64
64
  els.push(child);
65
65
  const name = child.localName;
66
66
  if (RAW_TEXT.has(name)) continue;
67
+ // With scripting on, a <noscript>'s content is raw TEXT to the browser, while the reparse
68
+ // reads it as elements (#112). Parse that text with the page's own parser and count what
69
+ // it yields, in place, so every later ordinal still lines up. The inert parsed nodes have
70
+ // no computed style and an empty box, which the rules read as \xAB nothing measured \xBB.
71
+ if (name === 'noscript' && child.children.length === 0 && (child.textContent || '').includes('<')) {
72
+ const parsed = document.createElement('template');
73
+ parsed.innerHTML = child.textContent || '';
74
+ walkElements(parsed.content);
75
+ continue;
76
+ }
67
77
  walkElements(name === 'template' && child.content ? child.content : child);
68
78
  }
69
79
  };
package/docker/runner.mjs CHANGED
@@ -3,7 +3,7 @@ import axe from "axe-core";
3
3
  const target = process.argv[2];
4
4
  const isFile = target.startsWith("/work/");
5
5
  const SNAPSHOT = process.env.ULTRA11Y_SNAPSHOT !== "0";
6
- const COLLECT = "(() => {\n const PROPS = [\"color\",\"backgroundColor\",\"backgroundImage\",\"fontSize\",\"fontWeight\",\"fontStyle\",\"textDecorationLine\",\"textTransform\",\"lineHeight\",\"letterSpacing\",\"wordSpacing\",\"whiteSpace\",\"display\",\"visibility\",\"opacity\",\"position\",\"overflowX\",\"overflowY\",\"outlineStyle\",\"outlineWidth\",\"outlineColor\",\"borderTopStyle\",\"borderRightStyle\",\"borderBottomStyle\",\"borderLeftStyle\",\"borderTopWidth\",\"borderRightWidth\",\"borderBottomWidth\",\"borderLeftWidth\",\"borderTopColor\",\"borderRightColor\",\"borderBottomColor\",\"borderLeftColor\",\"boxShadow\",\"cursor\"];\n const MAX = 5000;\n // The ordinal is a JOIN KEY against parseHtml(dom), so the walk must enumerate elements\n // exactly as a reparse of the serialisation below will (#101). querySelectorAll('*') did not:\n // - an element appended INSIDE a raw-text element (Next's dev overlay puts <nextjs-portal>\n // in a <script>) is serialised as that element's raw text, and a reparse reads text —\n // one ordinal too many, and every digest refused from there on;\n // - <template> contents are serialised and reparsed as elements, but live in\n // template.content, which querySelectorAll never traverses — one ordinal too few.\n // Pre-order, children of the raw-text elements HTML parsers (htmlparser2 included) treat as\n // text skipped, template.content descended.\n const RAW_TEXT = new Set(['script', 'style', 'title', 'textarea', 'xmp', 'iframe', 'noembed', 'noframes']);\n const els = [];\n const walkElements = (parent) => {\n for (const child of parent.children) {\n els.push(child);\n const name = child.localName;\n if (RAW_TEXT.has(name)) continue;\n walkElements(name === 'template' && child.content ? child.content : child);\n }\n };\n walkElements(document);\n const styles = [];\n const boxes = [];\n const n = Math.min(els.length, MAX);\n for (let i = 0; i < n; i++) {\n const el = els[i];\n const tag = el.tagName.toLowerCase();\n const cs = getComputedStyle(el);\n const css = {};\n for (const p of PROPS) {\n const v = cs[p];\n if (v !== undefined && v !== null && v !== '') css[p] = String(v);\n }\n styles.push({ i: i, tag: tag, css: css });\n const r = el.getBoundingClientRect();\n boxes.push({ i: i, tag: tag, x: Math.round(r.left), y: Math.round(r.top), w: Math.round(r.width), h: Math.round(r.height) });\n }\n // The page's own stylesheets. Some criteria are properties of the STYLESHEET rather than of\n // any element's computed style — focus styling removed with no replacement (2.4.7), a media\n // query that locks the orientation (1.3.4) — and this is the only place they exist.\n // A cross-origin sheet throws on .cssRules: COUNT those instead of ignoring them, so a rule\n // reading this digest can tell \"nothing there\" apart from \"I could not look\".\n // The cap is on the ORDINARY pool only, and the traversal never stops early.\n //\n // It used to return the moment the pool filled, which abandoned every remaining sheet —\n // and on a design-system app the pool fills long before the end. Measured on a real capture\n // of 38 pages: all 38 came back truncated, so rendered-focus-not-visible declined on every\n // one of them and 2.4.7 could never be decided by any number of scans. The rule was right to\n // decline (a :focus rule might have been among the dropped ones); the collector was wrong to\n // make that unavoidable.\n //\n // So the rules a rendered criterion actually READS — :focus styling, orientation locks,\n // pinned positioning, animation — are kept whatever the pool is doing, and truncated now\n // means \"some ordinary rule was dropped\", which is a much weaker statement. A rule can then\n // ask for what it needs instead of refusing on a cap that never concerned it.\n const cssRules = [];\n let unreadable = 0;\n let dropped = 0;\n const MAXR = 4000;\n const camel = (p) => p.replace(/-([a-z])/g, (_, c) => c.toUpperCase());\n const KEEP_SELECTOR = /:focus|:target|:active/i;\n const KEEP_PROP = /^(?:outline|position|animation|transition|transform)/;\n const walk = (list, media) => {\n for (const r of list) {\n if (typeof r.selectorText === 'string' && r.style) {\n const decls = {};\n for (let i = 0; i < r.style.length; i++) {\n const prop = r.style[i];\n decls[camel(prop)] = r.style.getPropertyValue(prop);\n }\n const keep = KEEP_SELECTOR.test(r.selectorText) || Object.keys(decls).some((k) => KEEP_PROP.test(k));\n if (cssRules.length >= MAXR && !keep) { dropped++; continue; }\n cssRules.push(media ? { selector: r.selectorText, media: media, decls: decls } : { selector: r.selectorText, decls: decls });\n } else if (r.cssRules) {\n const cond = r.conditionText || (r.media && r.media.mediaText) || media;\n walk(r.cssRules, cond);\n }\n }\n };\n for (const sheet of document.styleSheets) {\n try {\n walk(sheet.cssRules, undefined);\n } catch (e) {\n unreadable++;\n }\n }\n\n const truncated = els.length > MAX;\n return {\n dom: document.documentElement.outerHTML,\n css: { v: 1, rules: cssRules, unreadable: unreadable, truncated: dropped > 0, dropped: dropped },\n title: document.title,\n // The doctype is NOT part of documentElement.outerHTML, so a capture that records only\n // the DOM drops it — and RGAA 8.1 (is a doctype present, valid, and before <html>?) then\n // has nothing to look at. Recorded as its own field for that reason.\n doctype: document.doctype ? '<!DOCTYPE ' + document.doctype.name + (document.doctype.publicId ? ' PUBLIC \"' + document.doctype.publicId + '\"' : '') + (document.doctype.systemId ? ' \"' + document.doctype.systemId + '\"' : '') + '>' : '',\n lang: document.documentElement.getAttribute('lang') || '',\n url: location.href,\n viewport: { width: window.innerWidth, height: window.innerHeight },\n styles: { v: 1, entries: styles, truncated: truncated },\n boxes: { v: 1, entries: boxes, truncated: truncated }\n };\n})()";
6
+ const COLLECT = "(() => {\n const PROPS = [\"color\",\"backgroundColor\",\"backgroundImage\",\"fontSize\",\"fontWeight\",\"fontStyle\",\"textDecorationLine\",\"textTransform\",\"lineHeight\",\"letterSpacing\",\"wordSpacing\",\"whiteSpace\",\"display\",\"visibility\",\"opacity\",\"position\",\"overflowX\",\"overflowY\",\"outlineStyle\",\"outlineWidth\",\"outlineColor\",\"borderTopStyle\",\"borderRightStyle\",\"borderBottomStyle\",\"borderLeftStyle\",\"borderTopWidth\",\"borderRightWidth\",\"borderBottomWidth\",\"borderLeftWidth\",\"borderTopColor\",\"borderRightColor\",\"borderBottomColor\",\"borderLeftColor\",\"boxShadow\",\"cursor\"];\n const MAX = 5000;\n // The ordinal is a JOIN KEY against parseHtml(dom), so the walk must enumerate elements\n // exactly as a reparse of the serialisation below will (#101). querySelectorAll('*') did not:\n // - an element appended INSIDE a raw-text element (Next's dev overlay puts <nextjs-portal>\n // in a <script>) is serialised as that element's raw text, and a reparse reads text —\n // one ordinal too many, and every digest refused from there on;\n // - <template> contents are serialised and reparsed as elements, but live in\n // template.content, which querySelectorAll never traverses — one ordinal too few.\n // Pre-order, children of the raw-text elements HTML parsers (htmlparser2 included) treat as\n // text skipped, template.content descended.\n const RAW_TEXT = new Set(['script', 'style', 'title', 'textarea', 'xmp', 'iframe', 'noembed', 'noframes']);\n const els = [];\n const walkElements = (parent) => {\n for (const child of parent.children) {\n els.push(child);\n const name = child.localName;\n if (RAW_TEXT.has(name)) continue;\n // With scripting on, a <noscript>'s content is raw TEXT to the browser, while the reparse\n // reads it as elements (#112). Parse that text with the page's own parser and count what\n // it yields, in place, so every later ordinal still lines up. The inert parsed nodes have\n // no computed style and an empty box, which the rules read as « nothing measured ».\n if (name === 'noscript' && child.children.length === 0 && (child.textContent || '').includes('<')) {\n const parsed = document.createElement('template');\n parsed.innerHTML = child.textContent || '';\n walkElements(parsed.content);\n continue;\n }\n walkElements(name === 'template' && child.content ? child.content : child);\n }\n };\n walkElements(document);\n const styles = [];\n const boxes = [];\n const n = Math.min(els.length, MAX);\n for (let i = 0; i < n; i++) {\n const el = els[i];\n const tag = el.tagName.toLowerCase();\n const cs = getComputedStyle(el);\n const css = {};\n for (const p of PROPS) {\n const v = cs[p];\n if (v !== undefined && v !== null && v !== '') css[p] = String(v);\n }\n styles.push({ i: i, tag: tag, css: css });\n const r = el.getBoundingClientRect();\n boxes.push({ i: i, tag: tag, x: Math.round(r.left), y: Math.round(r.top), w: Math.round(r.width), h: Math.round(r.height) });\n }\n // The page's own stylesheets. Some criteria are properties of the STYLESHEET rather than of\n // any element's computed style — focus styling removed with no replacement (2.4.7), a media\n // query that locks the orientation (1.3.4) — and this is the only place they exist.\n // A cross-origin sheet throws on .cssRules: COUNT those instead of ignoring them, so a rule\n // reading this digest can tell \"nothing there\" apart from \"I could not look\".\n // The cap is on the ORDINARY pool only, and the traversal never stops early.\n //\n // It used to return the moment the pool filled, which abandoned every remaining sheet —\n // and on a design-system app the pool fills long before the end. Measured on a real capture\n // of 38 pages: all 38 came back truncated, so rendered-focus-not-visible declined on every\n // one of them and 2.4.7 could never be decided by any number of scans. The rule was right to\n // decline (a :focus rule might have been among the dropped ones); the collector was wrong to\n // make that unavoidable.\n //\n // So the rules a rendered criterion actually READS — :focus styling, orientation locks,\n // pinned positioning, animation — are kept whatever the pool is doing, and truncated now\n // means \"some ordinary rule was dropped\", which is a much weaker statement. A rule can then\n // ask for what it needs instead of refusing on a cap that never concerned it.\n const cssRules = [];\n let unreadable = 0;\n let dropped = 0;\n const MAXR = 4000;\n const camel = (p) => p.replace(/-([a-z])/g, (_, c) => c.toUpperCase());\n const KEEP_SELECTOR = /:focus|:target|:active/i;\n const KEEP_PROP = /^(?:outline|position|animation|transition|transform)/;\n const walk = (list, media) => {\n for (const r of list) {\n if (typeof r.selectorText === 'string' && r.style) {\n const decls = {};\n for (let i = 0; i < r.style.length; i++) {\n const prop = r.style[i];\n decls[camel(prop)] = r.style.getPropertyValue(prop);\n }\n const keep = KEEP_SELECTOR.test(r.selectorText) || Object.keys(decls).some((k) => KEEP_PROP.test(k));\n if (cssRules.length >= MAXR && !keep) { dropped++; continue; }\n cssRules.push(media ? { selector: r.selectorText, media: media, decls: decls } : { selector: r.selectorText, decls: decls });\n } else if (r.cssRules) {\n const cond = r.conditionText || (r.media && r.media.mediaText) || media;\n walk(r.cssRules, cond);\n }\n }\n };\n for (const sheet of document.styleSheets) {\n try {\n walk(sheet.cssRules, undefined);\n } catch (e) {\n unreadable++;\n }\n }\n\n const truncated = els.length > MAX;\n return {\n dom: document.documentElement.outerHTML,\n css: { v: 1, rules: cssRules, unreadable: unreadable, truncated: dropped > 0, dropped: dropped },\n title: document.title,\n // The doctype is NOT part of documentElement.outerHTML, so a capture that records only\n // the DOM drops it — and RGAA 8.1 (is a doctype present, valid, and before <html>?) then\n // has nothing to look at. Recorded as its own field for that reason.\n doctype: document.doctype ? '<!DOCTYPE ' + document.doctype.name + (document.doctype.publicId ? ' PUBLIC \"' + document.doctype.publicId + '\"' : '') + (document.doctype.systemId ? ' \"' + document.doctype.systemId + '\"' : '') + '>' : '',\n lang: document.documentElement.getAttribute('lang') || '',\n url: location.href,\n viewport: { width: window.innerWidth, height: window.innerHeight },\n styles: { v: 1, entries: styles, truncated: truncated },\n boxes: { v: 1, entries: boxes, truncated: truncated }\n };\n})()";
7
7
  const browser = await chromium.launch({ args: ["--no-sandbox", "--disable-dev-shm-usage"] });
8
8
  try {
9
9
  const page = await browser.newPage();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultra11y",
3
- "version": "5.55.2",
3
+ "version": "5.55.4",
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",
@@ -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.2";
9
+ var VERSION = "5.55.4";
10
10
  var SCHEMA_VERSION = 2;
11
11
  function isAdjudicated(by) {
12
12
  return by === "agent" || by === "human";
@@ -38458,6 +38458,16 @@ var COLLECT_SNAPSHOT = `(() => {
38458
38458
  els.push(child);
38459
38459
  const name = child.localName;
38460
38460
  if (RAW_TEXT.has(name)) continue;
38461
+ // With scripting on, a <noscript>'s content is raw TEXT to the browser, while the reparse
38462
+ // reads it as elements (#112). Parse that text with the page's own parser and count what
38463
+ // it yields, in place, so every later ordinal still lines up. The inert parsed nodes have
38464
+ // no computed style and an empty box, which the rules read as \xAB nothing measured \xBB.
38465
+ if (name === 'noscript' && child.children.length === 0 && (child.textContent || '').includes('<')) {
38466
+ const parsed = document.createElement('template');
38467
+ parsed.innerHTML = child.textContent || '';
38468
+ walkElements(parsed.content);
38469
+ continue;
38470
+ }
38461
38471
  walkElements(name === 'template' && child.content ? child.content : child);
38462
38472
  }
38463
38473
  };
@@ -40598,6 +40608,7 @@ function borderColours(css) {
40598
40608
  }
40599
40609
  return out2;
40600
40610
  }
40611
+ var VISUALLY_HIDDEN_CLASS = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
40601
40612
  var renderedNonTextContrast = {
40602
40613
  id: "rendered-nontext-contrast",
40603
40614
  criteria: ["1.4.11"],
@@ -40614,6 +40625,9 @@ var renderedNonTextContrast = {
40614
40625
  if (el.tag === "input" && ["button", "submit", "reset"].includes(type) && WORD.test(el.attribs.value ?? "")) continue;
40615
40626
  const css = styleAt(doc, i2)?.css;
40616
40627
  if (!css || invisible(css)) continue;
40628
+ if (VISUALLY_HIDDEN_CLASS.test(el.attribs.class ?? "")) continue;
40629
+ const box = doc.signals?.boxes?.get(i2);
40630
+ if (box && box.w <= 1 && box.h <= 1) continue;
40617
40631
  if (css.boxShadow && css.boxShadow !== "none") continue;
40618
40632
  if ((css.outlineStyle ?? "none") !== "none" && Number.parseFloat(css.outlineWidth ?? "0") > 0) continue;
40619
40633
  const surrounding = el.parent ? backdropOf(doc, index, el.parent) : void 0;
@@ -40621,6 +40635,9 @@ var renderedNonTextContrast = {
40621
40635
  const own = parseColor(css.backgroundColor ?? "");
40622
40636
  const fill = own && own.a >= 1 ? own : surrounding.color;
40623
40637
  if (contrastRatio(fill, surrounding.color) >= 3) continue;
40638
+ const isButton3 = el.tag === "button" || el.tag === "input" && ["button", "submit", "reset"].includes(type);
40639
+ const glyph = parseColor(css.color ?? "");
40640
+ if (isButton3 && glyph && glyph.a >= 1 && contrastRatio(glyph, surrounding.color) >= 3) continue;
40624
40641
  const borders = borderColours(css);
40625
40642
  if (borders.some((b) => contrastRatio(b, surrounding.color) >= 3 || contrastRatio(b, fill) >= 3)) continue;
40626
40643
  out2.push({
@@ -40974,6 +40991,13 @@ function axeAdvisory(tags) {
40974
40991
  function isAxeAdvisory(ruleId, tags) {
40975
40992
  return AXE_ADVISORY_EXCEPTIONS[ruleId] ?? axeAdvisory(tags);
40976
40993
  }
40994
+ function axeNodeTreatment(ruleId, tags, impact, nodeHtml) {
40995
+ if (ruleId === "label-title-only") {
40996
+ const labelledby = /\saria-labelledby\s*=\s*["'][^"']*\S[^"']*["']/i.test(nodeHtml ?? "");
40997
+ return { severity: "mineur", advisory: labelledby || isAxeAdvisory(ruleId, tags) };
40998
+ }
40999
+ return { severity: severityFromImpact(impact), advisory: isAxeAdvisory(ruleId, tags) };
41000
+ }
40977
41001
  function scForAxe(ruleId, tags) {
40978
41002
  return AXE_WCAG[ruleId] ?? scFromWcagTags(tags) ?? FALLBACK_SC;
40979
41003
  }
@@ -50070,10 +50094,10 @@ function visibleLabelText(el) {
50070
50094
  return collapse(out2);
50071
50095
  }
50072
50096
  var NOT_INTITULE_CLASS = /(^|\s)(fr-hint-text|fr-sr-only|sr-only|visually-hidden|visuallyhidden|hint-text|help-text)(\s|$)/;
50073
- var VISUALLY_HIDDEN_CLASS = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
50097
+ var VISUALLY_HIDDEN_CLASS2 = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
50074
50098
  var FIELD_DESCENDANT = /* @__PURE__ */ new Set(["input", "select", "textarea", "button", "datalist", "output"]);
50075
50099
  function primaryLabelText(label) {
50076
- if ([label, ...ancestors(label)].some((e) => VISUALLY_HIDDEN_CLASS.test(attr(e, "class") ?? ""))) return "";
50100
+ if ([label, ...ancestors(label)].some((e) => VISUALLY_HIDDEN_CLASS2.test(attr(e, "class") ?? ""))) return "";
50077
50101
  let out2 = "";
50078
50102
  const nonText = /* @__PURE__ */ new Set(["script", "style", "title", "desc", "noscript", "template", "canvas", "video", "img", "svg"]);
50079
50103
  const walk3 = (n) => {
@@ -56349,10 +56373,9 @@ function axeFindings(violations, file, page) {
56349
56373
  for (const v of violations) {
56350
56374
  if (!v?.id) continue;
56351
56375
  const criteriaId = scForAxe(v.id, v.tags);
56352
- const severity = severityFromImpact(v.impact);
56353
- const advisory = isAxeAdvisory(v.id, v.tags);
56354
56376
  const nodes = v.nodes?.length ? v.nodes : [{ target: [], html: "" }];
56355
56377
  for (const n of nodes) {
56378
+ const { severity, advisory } = axeNodeTreatment(v.id, v.tags, v.impact, n.html);
56356
56379
  out2.push({
56357
56380
  ruleId: `axe:${v.id}`,
56358
56381
  criteriaId,
@@ -69953,9 +69976,8 @@ function toDynamicResult(out2, target, lang = "en", engine = "axe-core@playwrigh
69953
69976
  const findings = [];
69954
69977
  for (const v of out2.violations) {
69955
69978
  const criteriaId = scForAxe(v.id, v.tags);
69956
- const severity = severityFromImpact(v.impact);
69957
- const advisory = isAxeAdvisory(v.id, v.tags);
69958
69979
  for (const n of v.nodes.length ? v.nodes : [{ target: [], html: "" }]) {
69980
+ const { severity, advisory } = axeNodeTreatment(v.id, v.tags, v.impact, n.html);
69959
69981
  findings.push({
69960
69982
  criteriaId,
69961
69983
  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.2
6
+ version: 5.55.4
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.2";
9
+ var VERSION = "5.55.4";
10
10
  var SCHEMA_VERSION = 2;
11
11
  function isAdjudicated(by) {
12
12
  return by === "agent" || by === "human";
@@ -38458,6 +38458,16 @@ var COLLECT_SNAPSHOT = `(() => {
38458
38458
  els.push(child);
38459
38459
  const name = child.localName;
38460
38460
  if (RAW_TEXT.has(name)) continue;
38461
+ // With scripting on, a <noscript>'s content is raw TEXT to the browser, while the reparse
38462
+ // reads it as elements (#112). Parse that text with the page's own parser and count what
38463
+ // it yields, in place, so every later ordinal still lines up. The inert parsed nodes have
38464
+ // no computed style and an empty box, which the rules read as \xAB nothing measured \xBB.
38465
+ if (name === 'noscript' && child.children.length === 0 && (child.textContent || '').includes('<')) {
38466
+ const parsed = document.createElement('template');
38467
+ parsed.innerHTML = child.textContent || '';
38468
+ walkElements(parsed.content);
38469
+ continue;
38470
+ }
38461
38471
  walkElements(name === 'template' && child.content ? child.content : child);
38462
38472
  }
38463
38473
  };
@@ -40598,6 +40608,7 @@ function borderColours(css) {
40598
40608
  }
40599
40609
  return out2;
40600
40610
  }
40611
+ var VISUALLY_HIDDEN_CLASS = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
40601
40612
  var renderedNonTextContrast = {
40602
40613
  id: "rendered-nontext-contrast",
40603
40614
  criteria: ["1.4.11"],
@@ -40614,6 +40625,9 @@ var renderedNonTextContrast = {
40614
40625
  if (el.tag === "input" && ["button", "submit", "reset"].includes(type) && WORD.test(el.attribs.value ?? "")) continue;
40615
40626
  const css = styleAt(doc, i2)?.css;
40616
40627
  if (!css || invisible(css)) continue;
40628
+ if (VISUALLY_HIDDEN_CLASS.test(el.attribs.class ?? "")) continue;
40629
+ const box = doc.signals?.boxes?.get(i2);
40630
+ if (box && box.w <= 1 && box.h <= 1) continue;
40617
40631
  if (css.boxShadow && css.boxShadow !== "none") continue;
40618
40632
  if ((css.outlineStyle ?? "none") !== "none" && Number.parseFloat(css.outlineWidth ?? "0") > 0) continue;
40619
40633
  const surrounding = el.parent ? backdropOf(doc, index, el.parent) : void 0;
@@ -40621,6 +40635,9 @@ var renderedNonTextContrast = {
40621
40635
  const own = parseColor(css.backgroundColor ?? "");
40622
40636
  const fill = own && own.a >= 1 ? own : surrounding.color;
40623
40637
  if (contrastRatio(fill, surrounding.color) >= 3) continue;
40638
+ const isButton3 = el.tag === "button" || el.tag === "input" && ["button", "submit", "reset"].includes(type);
40639
+ const glyph = parseColor(css.color ?? "");
40640
+ if (isButton3 && glyph && glyph.a >= 1 && contrastRatio(glyph, surrounding.color) >= 3) continue;
40624
40641
  const borders = borderColours(css);
40625
40642
  if (borders.some((b) => contrastRatio(b, surrounding.color) >= 3 || contrastRatio(b, fill) >= 3)) continue;
40626
40643
  out2.push({
@@ -40974,6 +40991,13 @@ function axeAdvisory(tags) {
40974
40991
  function isAxeAdvisory(ruleId, tags) {
40975
40992
  return AXE_ADVISORY_EXCEPTIONS[ruleId] ?? axeAdvisory(tags);
40976
40993
  }
40994
+ function axeNodeTreatment(ruleId, tags, impact, nodeHtml) {
40995
+ if (ruleId === "label-title-only") {
40996
+ const labelledby = /\saria-labelledby\s*=\s*["'][^"']*\S[^"']*["']/i.test(nodeHtml ?? "");
40997
+ return { severity: "mineur", advisory: labelledby || isAxeAdvisory(ruleId, tags) };
40998
+ }
40999
+ return { severity: severityFromImpact(impact), advisory: isAxeAdvisory(ruleId, tags) };
41000
+ }
40977
41001
  function scForAxe(ruleId, tags) {
40978
41002
  return AXE_WCAG[ruleId] ?? scFromWcagTags(tags) ?? FALLBACK_SC;
40979
41003
  }
@@ -50070,10 +50094,10 @@ function visibleLabelText(el) {
50070
50094
  return collapse(out2);
50071
50095
  }
50072
50096
  var NOT_INTITULE_CLASS = /(^|\s)(fr-hint-text|fr-sr-only|sr-only|visually-hidden|visuallyhidden|hint-text|help-text)(\s|$)/;
50073
- var VISUALLY_HIDDEN_CLASS = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
50097
+ var VISUALLY_HIDDEN_CLASS2 = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
50074
50098
  var FIELD_DESCENDANT = /* @__PURE__ */ new Set(["input", "select", "textarea", "button", "datalist", "output"]);
50075
50099
  function primaryLabelText(label) {
50076
- if ([label, ...ancestors(label)].some((e) => VISUALLY_HIDDEN_CLASS.test(attr(e, "class") ?? ""))) return "";
50100
+ if ([label, ...ancestors(label)].some((e) => VISUALLY_HIDDEN_CLASS2.test(attr(e, "class") ?? ""))) return "";
50077
50101
  let out2 = "";
50078
50102
  const nonText = /* @__PURE__ */ new Set(["script", "style", "title", "desc", "noscript", "template", "canvas", "video", "img", "svg"]);
50079
50103
  const walk3 = (n) => {
@@ -56349,10 +56373,9 @@ function axeFindings(violations, file, page) {
56349
56373
  for (const v of violations) {
56350
56374
  if (!v?.id) continue;
56351
56375
  const criteriaId = scForAxe(v.id, v.tags);
56352
- const severity = severityFromImpact(v.impact);
56353
- const advisory = isAxeAdvisory(v.id, v.tags);
56354
56376
  const nodes = v.nodes?.length ? v.nodes : [{ target: [], html: "" }];
56355
56377
  for (const n of nodes) {
56378
+ const { severity, advisory } = axeNodeTreatment(v.id, v.tags, v.impact, n.html);
56356
56379
  out2.push({
56357
56380
  ruleId: `axe:${v.id}`,
56358
56381
  criteriaId,
@@ -69953,9 +69976,8 @@ function toDynamicResult(out2, target, lang = "en", engine = "axe-core@playwrigh
69953
69976
  const findings = [];
69954
69977
  for (const v of out2.violations) {
69955
69978
  const criteriaId = scForAxe(v.id, v.tags);
69956
- const severity = severityFromImpact(v.impact);
69957
- const advisory = isAxeAdvisory(v.id, v.tags);
69958
69979
  for (const n of v.nodes.length ? v.nodes : [{ target: [], html: "" }]) {
69980
+ const { severity, advisory } = axeNodeTreatment(v.id, v.tags, v.impact, n.html);
69959
69981
  findings.push({
69960
69982
  criteriaId,
69961
69983
  axeRule: v.id,
@@ -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.2
6
+ version: 5.55.4
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.2";
9
+ var VERSION = "5.55.4";
10
10
  var SCHEMA_VERSION = 2;
11
11
  function isAdjudicated(by) {
12
12
  return by === "agent" || by === "human";
@@ -38458,6 +38458,16 @@ var COLLECT_SNAPSHOT = `(() => {
38458
38458
  els.push(child);
38459
38459
  const name = child.localName;
38460
38460
  if (RAW_TEXT.has(name)) continue;
38461
+ // With scripting on, a <noscript>'s content is raw TEXT to the browser, while the reparse
38462
+ // reads it as elements (#112). Parse that text with the page's own parser and count what
38463
+ // it yields, in place, so every later ordinal still lines up. The inert parsed nodes have
38464
+ // no computed style and an empty box, which the rules read as \xAB nothing measured \xBB.
38465
+ if (name === 'noscript' && child.children.length === 0 && (child.textContent || '').includes('<')) {
38466
+ const parsed = document.createElement('template');
38467
+ parsed.innerHTML = child.textContent || '';
38468
+ walkElements(parsed.content);
38469
+ continue;
38470
+ }
38461
38471
  walkElements(name === 'template' && child.content ? child.content : child);
38462
38472
  }
38463
38473
  };
@@ -40598,6 +40608,7 @@ function borderColours(css) {
40598
40608
  }
40599
40609
  return out2;
40600
40610
  }
40611
+ var VISUALLY_HIDDEN_CLASS = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
40601
40612
  var renderedNonTextContrast = {
40602
40613
  id: "rendered-nontext-contrast",
40603
40614
  criteria: ["1.4.11"],
@@ -40614,6 +40625,9 @@ var renderedNonTextContrast = {
40614
40625
  if (el.tag === "input" && ["button", "submit", "reset"].includes(type) && WORD.test(el.attribs.value ?? "")) continue;
40615
40626
  const css = styleAt(doc, i2)?.css;
40616
40627
  if (!css || invisible(css)) continue;
40628
+ if (VISUALLY_HIDDEN_CLASS.test(el.attribs.class ?? "")) continue;
40629
+ const box = doc.signals?.boxes?.get(i2);
40630
+ if (box && box.w <= 1 && box.h <= 1) continue;
40617
40631
  if (css.boxShadow && css.boxShadow !== "none") continue;
40618
40632
  if ((css.outlineStyle ?? "none") !== "none" && Number.parseFloat(css.outlineWidth ?? "0") > 0) continue;
40619
40633
  const surrounding = el.parent ? backdropOf(doc, index, el.parent) : void 0;
@@ -40621,6 +40635,9 @@ var renderedNonTextContrast = {
40621
40635
  const own = parseColor(css.backgroundColor ?? "");
40622
40636
  const fill = own && own.a >= 1 ? own : surrounding.color;
40623
40637
  if (contrastRatio(fill, surrounding.color) >= 3) continue;
40638
+ const isButton3 = el.tag === "button" || el.tag === "input" && ["button", "submit", "reset"].includes(type);
40639
+ const glyph = parseColor(css.color ?? "");
40640
+ if (isButton3 && glyph && glyph.a >= 1 && contrastRatio(glyph, surrounding.color) >= 3) continue;
40624
40641
  const borders = borderColours(css);
40625
40642
  if (borders.some((b) => contrastRatio(b, surrounding.color) >= 3 || contrastRatio(b, fill) >= 3)) continue;
40626
40643
  out2.push({
@@ -40974,6 +40991,13 @@ function axeAdvisory(tags) {
40974
40991
  function isAxeAdvisory(ruleId, tags) {
40975
40992
  return AXE_ADVISORY_EXCEPTIONS[ruleId] ?? axeAdvisory(tags);
40976
40993
  }
40994
+ function axeNodeTreatment(ruleId, tags, impact, nodeHtml) {
40995
+ if (ruleId === "label-title-only") {
40996
+ const labelledby = /\saria-labelledby\s*=\s*["'][^"']*\S[^"']*["']/i.test(nodeHtml ?? "");
40997
+ return { severity: "mineur", advisory: labelledby || isAxeAdvisory(ruleId, tags) };
40998
+ }
40999
+ return { severity: severityFromImpact(impact), advisory: isAxeAdvisory(ruleId, tags) };
41000
+ }
40977
41001
  function scForAxe(ruleId, tags) {
40978
41002
  return AXE_WCAG[ruleId] ?? scFromWcagTags(tags) ?? FALLBACK_SC;
40979
41003
  }
@@ -50070,10 +50094,10 @@ function visibleLabelText(el) {
50070
50094
  return collapse(out2);
50071
50095
  }
50072
50096
  var NOT_INTITULE_CLASS = /(^|\s)(fr-hint-text|fr-sr-only|sr-only|visually-hidden|visuallyhidden|hint-text|help-text)(\s|$)/;
50073
- var VISUALLY_HIDDEN_CLASS = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
50097
+ var VISUALLY_HIDDEN_CLASS2 = /(^|\s)(fr-sr-only|sr-only|visually-hidden|visuallyhidden)(\s|$)/;
50074
50098
  var FIELD_DESCENDANT = /* @__PURE__ */ new Set(["input", "select", "textarea", "button", "datalist", "output"]);
50075
50099
  function primaryLabelText(label) {
50076
- if ([label, ...ancestors(label)].some((e) => VISUALLY_HIDDEN_CLASS.test(attr(e, "class") ?? ""))) return "";
50100
+ if ([label, ...ancestors(label)].some((e) => VISUALLY_HIDDEN_CLASS2.test(attr(e, "class") ?? ""))) return "";
50077
50101
  let out2 = "";
50078
50102
  const nonText = /* @__PURE__ */ new Set(["script", "style", "title", "desc", "noscript", "template", "canvas", "video", "img", "svg"]);
50079
50103
  const walk3 = (n) => {
@@ -56349,10 +56373,9 @@ function axeFindings(violations, file, page) {
56349
56373
  for (const v of violations) {
56350
56374
  if (!v?.id) continue;
56351
56375
  const criteriaId = scForAxe(v.id, v.tags);
56352
- const severity = severityFromImpact(v.impact);
56353
- const advisory = isAxeAdvisory(v.id, v.tags);
56354
56376
  const nodes = v.nodes?.length ? v.nodes : [{ target: [], html: "" }];
56355
56377
  for (const n of nodes) {
56378
+ const { severity, advisory } = axeNodeTreatment(v.id, v.tags, v.impact, n.html);
56356
56379
  out2.push({
56357
56380
  ruleId: `axe:${v.id}`,
56358
56381
  criteriaId,
@@ -69953,9 +69976,8 @@ function toDynamicResult(out2, target, lang = "en", engine = "axe-core@playwrigh
69953
69976
  const findings = [];
69954
69977
  for (const v of out2.violations) {
69955
69978
  const criteriaId = scForAxe(v.id, v.tags);
69956
- const severity = severityFromImpact(v.impact);
69957
- const advisory = isAxeAdvisory(v.id, v.tags);
69958
69979
  for (const n of v.nodes.length ? v.nodes : [{ target: [], html: "" }]) {
69980
+ const { severity, advisory } = axeNodeTreatment(v.id, v.tags, v.impact, n.html);
69959
69981
  findings.push({
69960
69982
  criteriaId,
69961
69983
  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.2'
30
+ ULTRA11Y_VERSION: '5.55.4'
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, isAxeAdvisory, scForAxe, severityFromImpact } from "./axe-map.js";
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/collector.ts CHANGED
@@ -77,6 +77,16 @@ export const COLLECT_SNAPSHOT = `(() => {
77
77
  els.push(child);
78
78
  const name = child.localName;
79
79
  if (RAW_TEXT.has(name)) continue;
80
+ // With scripting on, a <noscript>'s content is raw TEXT to the browser, while the reparse
81
+ // reads it as elements (#112). Parse that text with the page's own parser and count what
82
+ // it yields, in place, so every later ordinal still lines up. The inert parsed nodes have
83
+ // no computed style and an empty box, which the rules read as « nothing measured ».
84
+ if (name === 'noscript' && child.children.length === 0 && (child.textContent || '').includes('<')) {
85
+ const parsed = document.createElement('template');
86
+ parsed.innerHTML = child.textContent || '';
87
+ walkElements(parsed.content);
88
+ continue;
89
+ }
80
90
  walkElements(name === 'template' && child.content ? child.content : child);
81
91
  }
82
92
  };
@@ -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, scForAxe, severityFromImpact, isAxeAdvisory } from "./axe-map.js";
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.2";
3
+ export const VERSION = "5.55.4";
4
4
  export const SCHEMA_VERSION = 2;
5
5
 
6
6
  // Lang = the UI FRAME's language — the `L` localization tables each module (report,