ultra11y 5.56.0 → 5.56.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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.56.0",
13
+ "version": "5.56.2",
14
14
  "author": { "name": "maxgfr" },
15
15
  "homepage": "https://github.com/SocialGouv/ultra11y",
16
16
  "repository": "https://github.com/SocialGouv/ultra11y",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ultra11y",
3
3
  "description": "RGAA 4.1.2 accessibility audits, the French State's standard, on a WCAG 2.2 AA core: automatic review before commit, push and pull request, plus dated, evidenced Markdown, HTML and per-page conformance reports. Never declares conforming what it has not verified.",
4
- "version": "5.56.0",
4
+ "version": "5.56.2",
5
5
  "author": { "name": "maxgfr" },
6
6
  "homepage": "https://github.com/SocialGouv/ultra11y",
7
7
  "repository": "https://github.com/SocialGouv/ultra11y",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ultra11y",
3
3
  "description": "RGAA 4.1.2 accessibility audits, the French State's standard, on a WCAG 2.2 AA core: automatic review before commit, push and pull request, plus dated, evidenced Markdown, HTML and per-page conformance reports. Never declares conforming what it has not verified.",
4
- "version": "5.56.0",
4
+ "version": "5.56.2",
5
5
  "author": { "name": "maxgfr", "url": "https://github.com/maxgfr" },
6
6
  "homepage": "https://github.com/SocialGouv/ultra11y",
7
7
  "repository": "https://github.com/SocialGouv/ultra11y",
@@ -27,7 +27,7 @@ import { fileURLToPath } from "node:url";
27
27
  // Ownership marker: `ultra11y install --opencode` refuses to overwrite a plugin file that
28
28
  // does not carry it, so a user's own ultra11y.js is never clobbered.
29
29
  const ULTRA11Y_OPENCODE_PLUGIN = "ULTRA11Y_OPENCODE_PLUGIN";
30
- const ULTRA11Y_PLUGIN_VERSION = "5.56.0";
30
+ const ULTRA11Y_PLUGIN_VERSION = "5.56.2";
31
31
 
32
32
  const here = dirname(fileURLToPath(import.meta.url));
33
33
 
@@ -476,10 +476,15 @@ function focusSetupExpr(scope = "", maxFocusables = PROBE_DEFAULTS.maxFocusables
476
476
  return { n: n, total: total };
477
477
  })()`;
478
478
  }
479
+ var DEV_TOOL_HOSTS = ["nextjs-portal", "vite-error-overlay", "astro-dev-toolbar", "nuxt-devtools-container", "nuxt-devtools"];
479
480
  var FOCUS_CHECK_PROBE = `(() => {
480
481
  const e = document.activeElement;
481
482
  // FOCUS LEFT THE DOCUMENT \u2014 the normal end of a tab ring, and nothing to measure.
482
483
  if (!e || e === document.body || e === document.documentElement) return null;
484
+ // A FRAMEWORK'S DEV-TOOLS OVERLAY is not the product (#127): Next's <nextjs-portal> holds a
485
+ // focusable button in its shadow root, and counting it as an untagged stop refused every page
486
+ // captured under a dev server. Not compared, not counted; the walk goes on.
487
+ if (${JSON.stringify(DEV_TOOL_HOSTS)}.indexOf((e.localName || '').toLowerCase()) >= 0) return { devTools: true, key: '', changed: true, selector: '', html: '' };
483
488
  const key = e.getAttribute && e.getAttribute('data-u11y-f');
484
489
  // FOCUS IS ON SOMETHING THE SETUP NEVER TAGGED, which is a different fact entirely and used
485
490
  // to be reported as the same one. A skip link revealed only on focus, a widget that moves
@@ -597,7 +602,7 @@ async function probeFocusRing(page, scope = "", limits = PROBE_DEFAULTS, deadlin
597
602
  }
598
603
  await page.keyboard.press("Tab");
599
604
  const r = await page.evaluate(FOCUS_CHECK_PROBE);
600
- if (!r) continue;
605
+ if (!r || r.devTools) continue;
601
606
  if (r.untagged) {
602
607
  untagged++;
603
608
  continue;
@@ -648,6 +653,7 @@ function tabPressBudget(count, limits) {
648
653
  var FOCUS_WHERE_PROBE = `(() => { ${PRELUDE}
649
654
  const e = document.activeElement;
650
655
  if (!e || e === document.body || e === document.documentElement) return null;
656
+ if (${JSON.stringify(DEV_TOOL_HOSTS)}.indexOf((e.localName || '').toLowerCase()) >= 0) return null; // dev tooling, not the product (#127)
651
657
  const key = e.getAttribute && e.getAttribute('data-u11y-f');
652
658
  const stops = ${JSON.stringify(NATIVE_SEGMENT_STOPS)};
653
659
  const type = e.tagName === 'INPUT' ? (e.getAttribute('type') || 'text').toLowerCase() : '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultra11y",
3
- "version": "5.56.0",
3
+ "version": "5.56.2",
4
4
  "description": "Audit d'accessibilité RGAA 4.1.2, le référentiel de l'État : rapport daté, grille des 106 critères, backlog et tickets. Moteur statique, navigateur et jugement IA contre-vérifié. Il ne déclare jamais conforme ce qu'il n'a pas vérifié. Socle WCAG 2.2 AA.",
5
5
  "homepage": "https://socialgouv.github.io/ultra11y/",
6
6
  "type": "module",
@@ -6,7 +6,7 @@ import { join as join55, relative as relative7, 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.56.0";
9
+ var VERSION = "5.56.2";
10
10
  var SCHEMA_VERSION = 2;
11
11
  function isAdjudicated(by) {
12
12
  return by === "agent" || by === "human";
@@ -37967,10 +37967,15 @@ function focusSetupExpr(scope = "", maxFocusables = PROBE_DEFAULTS.maxFocusables
37967
37967
  return { n: n, total: total };
37968
37968
  })()`;
37969
37969
  }
37970
+ var DEV_TOOL_HOSTS = ["nextjs-portal", "vite-error-overlay", "astro-dev-toolbar", "nuxt-devtools-container", "nuxt-devtools"];
37970
37971
  var FOCUS_CHECK_PROBE = `(() => {
37971
37972
  const e = document.activeElement;
37972
37973
  // FOCUS LEFT THE DOCUMENT \u2014 the normal end of a tab ring, and nothing to measure.
37973
37974
  if (!e || e === document.body || e === document.documentElement) return null;
37975
+ // A FRAMEWORK'S DEV-TOOLS OVERLAY is not the product (#127): Next's <nextjs-portal> holds a
37976
+ // focusable button in its shadow root, and counting it as an untagged stop refused every page
37977
+ // captured under a dev server. Not compared, not counted; the walk goes on.
37978
+ if (${JSON.stringify(DEV_TOOL_HOSTS)}.indexOf((e.localName || '').toLowerCase()) >= 0) return { devTools: true, key: '', changed: true, selector: '', html: '' };
37974
37979
  const key = e.getAttribute && e.getAttribute('data-u11y-f');
37975
37980
  // FOCUS IS ON SOMETHING THE SETUP NEVER TAGGED, which is a different fact entirely and used
37976
37981
  // to be reported as the same one. A skip link revealed only on focus, a widget that moves
@@ -38091,7 +38096,7 @@ async function probeFocusRing(page, scope = "", limits = PROBE_DEFAULTS, deadlin
38091
38096
  }
38092
38097
  await page.keyboard.press("Tab");
38093
38098
  const r = await page.evaluate(FOCUS_CHECK_PROBE);
38094
- if (!r) continue;
38099
+ if (!r || r.devTools) continue;
38095
38100
  if (r.untagged) {
38096
38101
  untagged++;
38097
38102
  continue;
@@ -38142,6 +38147,7 @@ function tabPressBudget(count, limits) {
38142
38147
  var FOCUS_WHERE_PROBE = `(() => { ${PRELUDE}
38143
38148
  const e = document.activeElement;
38144
38149
  if (!e || e === document.body || e === document.documentElement) return null;
38150
+ if (${JSON.stringify(DEV_TOOL_HOSTS)}.indexOf((e.localName || '').toLowerCase()) >= 0) return null; // dev tooling, not the product (#127)
38145
38151
  const key = e.getAttribute && e.getAttribute('data-u11y-f');
38146
38152
  const stops = ${JSON.stringify(NATIVE_SEGMENT_STOPS)};
38147
38153
  const type = e.tagName === 'INPUT' ? (e.getAttribute('type') || 'text').toLowerCase() : '';
@@ -54892,7 +54898,10 @@ var PdfUnreadable = class extends Error {
54892
54898
  };
54893
54899
  var WS = /* @__PURE__ */ new Set([0, 9, 10, 12, 13, 32]);
54894
54900
  var DELIM = /* @__PURE__ */ new Set([40, 41, 60, 62, 91, 93, 123, 125, 47, 37]);
54895
- var isRegular = (c2) => c2 !== void 0 && !WS.has(c2) && !DELIM.has(c2);
54901
+ var CLASS = new Uint8Array(256);
54902
+ for (const c2 of WS) CLASS[c2] = 1;
54903
+ for (const c2 of DELIM) CLASS[c2] = 2;
54904
+ var isRegular = (c2) => c2 !== void 0 && CLASS[c2] === 0;
54896
54905
  var MAX_NESTING = 64;
54897
54906
  var Lexer = class {
54898
54907
  buf;
@@ -55042,6 +55051,7 @@ var Lexer = class {
55042
55051
  var MAX_DECODED_TOTAL = 256 * 1024 * 1024;
55043
55052
  var MAX_STREAM_DECODED = 64 * 1024 * 1024;
55044
55053
  var tooLarge = () => new PdfUnreadable("too-large", `a decoded stream exceeds ${MAX_STREAM_DECODED} bytes`);
55054
+ var isTooLarge = (e) => e instanceof PdfUnreadable && e.reason === "too-large";
55045
55055
  var ByteSink = class {
55046
55056
  buf = Buffer.alloc(4096);
55047
55057
  length = 0;
@@ -55141,37 +55151,37 @@ function asciiHex(data2) {
55141
55151
  return Buffer.from(s, "hex");
55142
55152
  }
55143
55153
  function ascii85(data2) {
55144
- let s = data2.toString("latin1").replace(/\s+/g, "");
55145
- if (s.startsWith("<~")) s = s.slice(2);
55146
- const end = s.indexOf("~>");
55147
- if (end >= 0) s = s.slice(0, end);
55148
- const out2 = [];
55149
- let group = [];
55150
- const flush = (n) => {
55151
- let v = 0;
55152
- for (const c2 of group) v = v * 85 + c2;
55153
- const bytes = [v >>> 24 & 255, v >>> 16 & 255, v >>> 8 & 255, v & 255];
55154
- out2.push(...bytes.slice(0, n));
55155
- };
55156
- for (const ch of s) {
55157
- if (ch === "z" && group.length === 0) {
55158
- out2.push(0, 0, 0, 0);
55154
+ const out2 = new ByteSink();
55155
+ let i2 = 0;
55156
+ while (i2 < data2.length && WS.has(data2[i2])) i2++;
55157
+ if (data2[i2] === 60 && data2[i2 + 1] === 126) i2 += 2;
55158
+ let v = 0;
55159
+ let n = 0;
55160
+ for (; i2 < data2.length; i2++) {
55161
+ const c2 = data2[i2];
55162
+ if (c2 === 126) break;
55163
+ if (c2 === 122 && n === 0) {
55164
+ out2.fill(0, 4);
55159
55165
  continue;
55160
55166
  }
55161
- const c2 = ch.charCodeAt(0) - 33;
55162
- if (c2 < 0 || c2 > 84) continue;
55163
- group.push(c2);
55164
- if (group.length === 5) {
55165
- flush(4);
55166
- group = [];
55167
+ if (c2 < 33 || c2 > 117) continue;
55168
+ v = v * 85 + (c2 - 33);
55169
+ if (++n === 5) {
55170
+ out2.push(v >>> 24 & 255);
55171
+ out2.push(v >>> 16 & 255);
55172
+ out2.push(v >>> 8 & 255);
55173
+ out2.push(v & 255);
55174
+ v = 0;
55175
+ n = 0;
55167
55176
  }
55168
55177
  }
55169
- if (group.length) {
55170
- const n = group.length - 1;
55171
- while (group.length < 5) group.push(84);
55172
- flush(n);
55178
+ if (n > 1) {
55179
+ const keep = n - 1;
55180
+ for (; n < 5; n++) v = v * 85 + 84;
55181
+ const bytes = [v >>> 24 & 255, v >>> 16 & 255, v >>> 8 & 255, v & 255];
55182
+ out2.append(bytes.slice(0, keep));
55173
55183
  }
55174
- return Buffer.from(out2);
55184
+ return out2.done();
55175
55185
  }
55176
55186
  function lzw(data2, earlyChange = 1) {
55177
55187
  const out2 = new ByteSink();
@@ -55240,6 +55250,9 @@ var PdfDocument = class {
55240
55250
  objectStreams = false;
55241
55251
  cache = /* @__PURE__ */ new Map();
55242
55252
  objStmCache = /* @__PURE__ */ new Map();
55253
+ /** Decoded bytes (or the error) per stream object: a content stream or form shared by every
55254
+ * page is decoded once, and counted once against the budget. */
55255
+ decoded = /* @__PURE__ */ new Map();
55243
55256
  resolving = /* @__PURE__ */ new Set();
55244
55257
  decodedTotal = 0;
55245
55258
  text;
@@ -55251,7 +55264,7 @@ var PdfDocument = class {
55251
55264
  this.readXrefChain();
55252
55265
  if (!isDict(this.get(this.trailer.get("Root")))) throw new PdfUnreadable("malformed", "the trailer's /Root does not resolve");
55253
55266
  } catch (e) {
55254
- if (e instanceof PdfUnreadable && e.reason === "too-large") throw e;
55267
+ if (isTooLarge(e)) throw e;
55255
55268
  this.repair();
55256
55269
  }
55257
55270
  }
@@ -55349,6 +55362,7 @@ var PdfDocument = class {
55349
55362
  this.repaired = true;
55350
55363
  this.xref.clear();
55351
55364
  this.cache.clear();
55365
+ this.decoded.clear();
55352
55366
  const re = /(?:^|[\r\n\s])(\d{1,10})\s+(\d{1,5})\s+obj\b/g;
55353
55367
  for (let m = re.exec(this.text); m; m = re.exec(this.text)) {
55354
55368
  const at = m.index + m[0].indexOf(m[1]);
@@ -55371,7 +55385,8 @@ var PdfDocument = class {
55371
55385
  let o;
55372
55386
  try {
55373
55387
  o = this.get(new PdfRef(n, e.b));
55374
- } catch {
55388
+ } catch (err2) {
55389
+ if (isTooLarge(err2)) throw err2;
55375
55390
  continue;
55376
55391
  }
55377
55392
  if (!(o instanceof PdfStream)) continue;
@@ -55387,7 +55402,8 @@ var PdfDocument = class {
55387
55402
  if (!this.xref.has(objNum)) this.xref.set(objNum, { type: 2, a: n, b: i2 });
55388
55403
  i2++;
55389
55404
  }
55390
- } catch {
55405
+ } catch (err2) {
55406
+ if (isTooLarge(err2)) throw err2;
55391
55407
  }
55392
55408
  }
55393
55409
  }
@@ -55399,7 +55415,8 @@ var PdfDocument = class {
55399
55415
  trailer.set("Root", new PdfRef(n, e.type === 1 ? e.b : 0));
55400
55416
  break;
55401
55417
  }
55402
- } catch {
55418
+ } catch (err2) {
55419
+ if (isTooLarge(err2)) throw err2;
55403
55420
  }
55404
55421
  }
55405
55422
  }
@@ -55438,7 +55455,8 @@ var PdfDocument = class {
55438
55455
  if (v instanceof PdfRef) {
55439
55456
  try {
55440
55457
  return num2(this.get(v));
55441
- } catch {
55458
+ } catch (err2) {
55459
+ if (isTooLarge(err2)) throw err2;
55442
55460
  return void 0;
55443
55461
  }
55444
55462
  }
@@ -55485,7 +55503,7 @@ var PdfDocument = class {
55485
55503
  this.cache.set(v.num, val);
55486
55504
  return val;
55487
55505
  } catch (err2) {
55488
- if (err2 instanceof PdfUnreadable && err2.reason === "too-large") throw err2;
55506
+ if (isTooLarge(err2)) throw err2;
55489
55507
  this.cache.set(v.num, null);
55490
55508
  return null;
55491
55509
  } finally {
@@ -55502,8 +55520,22 @@ var PdfDocument = class {
55502
55520
  const r = this.get(v);
55503
55521
  return Array.isArray(r) ? r : void 0;
55504
55522
  }
55505
- /** A stream's decoded bytes. Throws for an image codec or an unknown filter. */
55523
+ /** A stream's decoded bytes. Throws for an image codec or an unknown filter — and throws the
55524
+ * same error again, without decoding again, when asked twice. */
55506
55525
  decode(s) {
55526
+ const hit = this.decoded.get(s);
55527
+ if (hit instanceof Error) throw hit;
55528
+ if (hit) return hit;
55529
+ try {
55530
+ const data2 = this.decodeUncached(s);
55531
+ this.decoded.set(s, data2);
55532
+ return data2;
55533
+ } catch (e) {
55534
+ this.decoded.set(s, e instanceof Error ? e : new PdfUnreadable("malformed", String(e)));
55535
+ throw e;
55536
+ }
55537
+ }
55538
+ decodeUncached(s) {
55507
55539
  let data2 = this.buf.subarray(s.start, s.end);
55508
55540
  const fv = this.get(s.dict.get("Filter"));
55509
55541
  const filters = (Array.isArray(fv) ? fv : fv ? [fv] : []).map((f) => nameOf2(this.get(f)) ?? "");
@@ -55539,6 +55571,7 @@ function pdfText(v) {
55539
55571
  var MAX_PAGES_SCANNED = 500;
55540
55572
  var MAX_STRUCT_NODES = 5e4;
55541
55573
  var MAX_FORM_DEPTH = 4;
55574
+ var MAX_SCANNED_TOTAL = 64 * 1024 * 1024;
55542
55575
  var PDF_MAX_BYTES = 64 * 1024 * 1024;
55543
55576
  function unreadable(reason, detail, version) {
55544
55577
  return {
@@ -55569,7 +55602,7 @@ function readPdf(bytes) {
55569
55602
  let version = hv[1];
55570
55603
  try {
55571
55604
  const doc = new PdfDocument(buf);
55572
- if (doc.trailer.has("Encrypt") && doc.get(doc.trailer.get("Encrypt")) !== null) {
55605
+ if (doc.trailer.has("Encrypt")) {
55573
55606
  return unreadable("encrypted", "the file is encrypted; its strings and streams cannot be read without decrypting them", version);
55574
55607
  }
55575
55608
  const catalog = doc.dict(doc.trailer.get("Root"));
@@ -55588,8 +55621,8 @@ function readPdf(bytes) {
55588
55621
  title = xmpTitle(doc, catalog);
55589
55622
  if (title) titleSource = "xmp";
55590
55623
  }
55591
- const pages = collectPages(doc, catalog);
55592
- const content = scanContent(doc, pages);
55624
+ const { pages, complete: treeComplete } = collectPages(doc, catalog);
55625
+ const content = scanContent(doc, pages, treeComplete);
55593
55626
  const structure = structRoot ? walkStructure(doc, structRoot) : void 0;
55594
55627
  return {
55595
55628
  readable: true,
@@ -55621,7 +55654,8 @@ function xmpTitle(doc, catalog) {
55621
55654
  let xml;
55622
55655
  try {
55623
55656
  xml = doc.decode(md).toString("utf8");
55624
- } catch {
55657
+ } catch (e) {
55658
+ if (isTooLarge(e)) throw e;
55625
55659
  return void 0;
55626
55660
  }
55627
55661
  const block = /<dc:title\b[^>]*>([\s\S]*?)<\/dc:title>/i.exec(xml)?.[1];
@@ -55633,8 +55667,17 @@ function xmpTitle(doc, catalog) {
55633
55667
  function collectPages(doc, catalog) {
55634
55668
  const out2 = [];
55635
55669
  const seen = /* @__PURE__ */ new Set();
55670
+ let complete = true;
55636
55671
  const walk3 = (node, inherited, depth) => {
55637
- if (!node || seen.has(node) || depth > MAX_NESTING || out2.length >= MAX_PAGES_SCANNED * 4) return;
55672
+ if (!node) {
55673
+ complete = false;
55674
+ return;
55675
+ }
55676
+ if (seen.has(node)) return;
55677
+ if (depth > MAX_NESTING || out2.length >= MAX_PAGES_SCANNED * 4) {
55678
+ complete = false;
55679
+ return;
55680
+ }
55638
55681
  seen.add(node);
55639
55682
  const resources = doc.dict(node.get("Resources")) ?? inherited;
55640
55683
  const kids = doc.array(node.get("Kids"));
@@ -55643,19 +55686,29 @@ function collectPages(doc, catalog) {
55643
55686
  out2.push({ dict: node, resources });
55644
55687
  return;
55645
55688
  }
55689
+ if (!kids && node.has("Kids")) complete = false;
55646
55690
  for (const k of kids ?? []) walk3(doc.dict(k), resources, depth + 1);
55647
55691
  };
55648
55692
  walk3(doc.dict(catalog.get("Pages")), void 0, 0);
55649
- return out2;
55693
+ return { pages: out2, complete };
55650
55694
  }
55651
55695
  var TEXT_OPS2 = /* @__PURE__ */ new Set(["Tj", "TJ", "'", '"']);
55652
- function scanContent(doc, pages) {
55696
+ function scanContent(doc, pages, treeComplete) {
55653
55697
  let fonts = 0;
55654
55698
  let textOps = 0;
55655
55699
  let images = 0;
55656
- let complete = pages.length > 0;
55700
+ let complete = pages.length > 0 && treeComplete;
55657
55701
  const fontSeen = /* @__PURE__ */ new Set();
55658
55702
  const formSeen = /* @__PURE__ */ new Set();
55703
+ const ids2 = /* @__PURE__ */ new Map();
55704
+ const idOf = (o) => {
55705
+ let id = ids2.get(o);
55706
+ if (id === void 0) ids2.set(o, id = ids2.size + 1);
55707
+ return id;
55708
+ };
55709
+ const pageMemo = /* @__PURE__ */ new Map();
55710
+ let scanned = 0;
55711
+ let exhausted = false;
55659
55712
  const countFonts = (res) => {
55660
55713
  const f = doc.dict(res?.get("Font"));
55661
55714
  if (!f) return;
@@ -55667,44 +55720,83 @@ function scanContent(doc, pages) {
55667
55720
  };
55668
55721
  const scanStream = (data2, res, depth) => {
55669
55722
  countFonts(res);
55723
+ scanned += data2.length;
55724
+ if (scanned > MAX_SCANNED_TOTAL) {
55725
+ exhausted = true;
55726
+ complete = false;
55727
+ return 0;
55728
+ }
55670
55729
  const xobjects = doc.dict(res?.get("XObject"));
55671
55730
  const ops = contentOperators(data2);
55672
55731
  textOps += ops.text;
55673
- images += ops.inlineImages;
55674
- for (const name2 of ops.xobjects) {
55732
+ let drawn = ops.inlineImages;
55733
+ const uses = /* @__PURE__ */ new Map();
55734
+ for (const name2 of ops.xobjects) uses.set(name2, (uses.get(name2) ?? 0) + 1);
55735
+ for (const [name2, count] of uses) {
55675
55736
  const xo = doc.get(xobjects?.get(name2));
55676
- if (!(xo instanceof PdfStream)) continue;
55737
+ if (!(xo instanceof PdfStream)) {
55738
+ complete = false;
55739
+ continue;
55740
+ }
55677
55741
  const sub = nameOf2(doc.get(xo.dict.get("Subtype")));
55678
- if (sub === "Image") images++;
55679
- else if (sub === "Form" && depth < MAX_FORM_DEPTH && !formSeen.has(xo)) {
55742
+ if (sub === "Image") drawn += count;
55743
+ else if (sub === "Form") {
55744
+ if (exhausted || formSeen.has(xo)) continue;
55745
+ if (depth >= MAX_FORM_DEPTH) {
55746
+ complete = false;
55747
+ continue;
55748
+ }
55680
55749
  formSeen.add(xo);
55750
+ let form;
55681
55751
  try {
55682
- scanStream(doc.decode(xo), doc.dict(xo.dict.get("Resources")) ?? res, depth + 1);
55683
- } catch {
55752
+ form = doc.decode(xo);
55753
+ } catch (e) {
55754
+ if (isTooLarge(e)) throw e;
55684
55755
  complete = false;
55756
+ continue;
55685
55757
  }
55686
- }
55758
+ drawn += scanStream(form, doc.dict(xo.dict.get("Resources")) ?? res, depth + 1);
55759
+ } else if (sub !== "PS") complete = false;
55687
55760
  }
55761
+ return drawn;
55688
55762
  };
55689
55763
  for (const [i2, page] of pages.entries()) {
55690
55764
  if (i2 >= MAX_PAGES_SCANNED) {
55691
- if (textOps === 0) complete = false;
55765
+ complete = false;
55692
55766
  break;
55693
55767
  }
55694
- const cv = doc.get(page.dict.get("Contents"));
55695
- const streams = (Array.isArray(cv) ? cv.map((c2) => doc.get(c2)) : [cv]).filter((s) => s instanceof PdfStream);
55696
- const parts2 = [];
55768
+ const raw = page.dict.get("Contents");
55769
+ const cv = doc.get(raw);
55770
+ const entries = raw === void 0 || raw === null ? [] : Array.isArray(cv) ? cv : [raw];
55771
+ const streams = [];
55772
+ for (const c2 of entries) {
55773
+ const s = doc.get(c2);
55774
+ if (s instanceof PdfStream) streams.push(s);
55775
+ else complete = false;
55776
+ }
55777
+ const key2 = `${streams.map((s) => s.start).join(",")}|${page.resources ? idOf(page.resources) : 0}`;
55778
+ const memo = pageMemo.get(key2);
55779
+ if (memo !== void 0) {
55780
+ countFonts(page.resources);
55781
+ images += memo;
55782
+ continue;
55783
+ }
55784
+ let data2;
55697
55785
  try {
55698
- for (const s of streams) parts2.push(doc.decode(s), Buffer.from("\n"));
55699
- } catch {
55786
+ const parts2 = streams.map((s) => doc.decode(s));
55787
+ data2 = parts2.length === 1 ? parts2[0] : Buffer.concat(parts2.flatMap((p) => [p, Buffer.from("\n")]));
55788
+ } catch (e) {
55789
+ if (isTooLarge(e)) throw e;
55700
55790
  complete = false;
55701
55791
  countFonts(page.resources);
55702
55792
  continue;
55703
55793
  }
55704
- scanStream(Buffer.concat(parts2), page.resources, 0);
55705
- if (textOps > 0) break;
55794
+ const drawn = scanStream(data2, page.resources, 0);
55795
+ images += drawn;
55796
+ pageMemo.set(key2, drawn);
55797
+ if (textOps > 0 || exhausted) break;
55706
55798
  }
55707
- return { fonts, textOps, images, complete };
55799
+ return { fonts, textOps, images, complete: complete || textOps > 0 };
55708
55800
  }
55709
55801
  function contentOperators(data2) {
55710
55802
  let text = 0;
@@ -55715,8 +55807,9 @@ function contentOperators(data2) {
55715
55807
  const n = data2.length;
55716
55808
  while (i2 < n) {
55717
55809
  const c2 = data2[i2];
55718
- if (WS.has(c2)) {
55810
+ if (CLASS[c2] === 1) {
55719
55811
  i2++;
55812
+ while (i2 < n && CLASS[data2[i2]] === 1) i2++;
55720
55813
  continue;
55721
55814
  }
55722
55815
  if (c2 === 37) {
@@ -73590,7 +73683,7 @@ import { join as join49 } from "path";
73590
73683
 
73591
73684
  // src/html.ts
73592
73685
  var MARK4 = { C: "C", NC: "NC", NA: "\u2014", manual: "?" };
73593
- var CLASS = { C: "c", NC: "nc", NA: "na", manual: "m" };
73686
+ var CLASS2 = { C: "c", NC: "nc", NA: "na", manual: "m" };
73594
73687
  var T3 = {
73595
73688
  fr: {
73596
73689
  skip: "Aller au contenu",
@@ -73677,7 +73770,7 @@ function cellHtml(c2, tag) {
73677
73770
  if (c2.colspan && c2.colspan > 1) attrs.push(`colspan="${c2.colspan}"`);
73678
73771
  let inner;
73679
73772
  if (c2.status) {
73680
- inner = `<span class="st st-${CLASS[c2.status]}">${esc2(MARK4[c2.status])}</span>`;
73773
+ inner = `<span class="st st-${CLASS2[c2.status]}">${esc2(MARK4[c2.status])}</span>`;
73681
73774
  } else {
73682
73775
  inner = c2.text === "" ? "\u2014" : runHtml({ text: c2.text, mono: c2.mono, strong: c2.strong, ...c2.href ? { href: c2.href } : {} });
73683
73776
  }
@@ -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.56.0
6
+ version: 5.56.2
7
7
  ---
8
8
 
9
9
  # review-a11y — accessibility review of changed code