@accesslint/core 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -11
- package/dist/index.cjs +5 -5
- package/dist/index.iife.js +5 -5
- package/dist/index.js +421 -384
- package/dist/rules/aria/aria-attr-audit.d.ts.map +1 -1
- package/dist/rules/color/color-contrast.d.ts.map +1 -1
- package/dist/rules/index.d.ts.map +1 -1
- package/dist/rules/keyboard/interactive-rules.d.ts.map +1 -1
- package/dist/rules/utils/aria.d.ts +1 -0
- package/dist/rules/utils/aria.d.ts.map +1 -1
- package/dist/rules/utils/selector.d.ts +1 -0
- package/dist/rules/utils/selector.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
let
|
|
2
|
-
function
|
|
3
|
-
|
|
1
|
+
let M = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
function Q() {
|
|
3
|
+
M = /* @__PURE__ */ new WeakMap();
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function J(t) {
|
|
6
6
|
var i;
|
|
7
7
|
const a = t.tagName.toLowerCase(), e = (i = t.getAttribute("type")) == null ? void 0 : i.toLowerCase();
|
|
8
8
|
switch (a) {
|
|
@@ -117,14 +117,24 @@ function Y(t) {
|
|
|
117
117
|
return null;
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function E(t) {
|
|
121
121
|
var n;
|
|
122
|
-
const a =
|
|
122
|
+
const a = M.get(t);
|
|
123
123
|
if (a !== void 0) return a;
|
|
124
|
-
const i = ((n = t.getAttribute("role")) == null ? void 0 : n.trim().toLowerCase()) || null ||
|
|
125
|
-
return
|
|
124
|
+
const i = ((n = t.getAttribute("role")) == null ? void 0 : n.trim().toLowerCase()) || null || J(t);
|
|
125
|
+
return M.set(t, i), i;
|
|
126
|
+
}
|
|
127
|
+
let $ = /* @__PURE__ */ new WeakMap();
|
|
128
|
+
function Z() {
|
|
129
|
+
$ = /* @__PURE__ */ new WeakMap();
|
|
126
130
|
}
|
|
127
131
|
function b(t) {
|
|
132
|
+
const a = $.get(t);
|
|
133
|
+
if (a !== void 0) return a;
|
|
134
|
+
const e = de(t);
|
|
135
|
+
return $.set(t, e), e;
|
|
136
|
+
}
|
|
137
|
+
function de(t) {
|
|
128
138
|
var r, o, s, u, h;
|
|
129
139
|
const a = t.getAttribute("aria-labelledby");
|
|
130
140
|
if (a) {
|
|
@@ -171,7 +181,7 @@ function b(t) {
|
|
|
171
181
|
}
|
|
172
182
|
return t instanceof HTMLImageElement || t instanceof HTMLAreaElement ? ((u = t.alt) == null ? void 0 : u.trim()) ?? "" : t instanceof HTMLInputElement && t.type === "image" ? ((h = t.alt) == null ? void 0 : h.trim()) ?? "" : "";
|
|
173
183
|
}
|
|
174
|
-
const
|
|
184
|
+
const ue = /* @__PURE__ */ new Set([
|
|
175
185
|
"alert",
|
|
176
186
|
"alertdialog",
|
|
177
187
|
"application",
|
|
@@ -255,21 +265,21 @@ const oe = /* @__PURE__ */ new Set([
|
|
|
255
265
|
"treegrid",
|
|
256
266
|
"treeitem"
|
|
257
267
|
]);
|
|
258
|
-
function
|
|
268
|
+
function me(t) {
|
|
259
269
|
const a = t.trim().toLowerCase().replace(/[\u201C\u201D\u2018\u2019\u00AB\u00BB]/g, "");
|
|
260
|
-
return
|
|
270
|
+
return ue.has(a);
|
|
261
271
|
}
|
|
262
|
-
let
|
|
263
|
-
function
|
|
264
|
-
|
|
272
|
+
let H = /* @__PURE__ */ new WeakMap();
|
|
273
|
+
function ee() {
|
|
274
|
+
H = /* @__PURE__ */ new WeakMap();
|
|
265
275
|
}
|
|
266
276
|
function m(t) {
|
|
267
|
-
const a =
|
|
277
|
+
const a = H.get(t);
|
|
268
278
|
if (a !== void 0) return a;
|
|
269
279
|
let e;
|
|
270
|
-
return t.getAttribute("aria-hidden") === "true" || t instanceof HTMLElement && (t.hidden || t.style.display === "none") ? e = !0 : t.parentElement ? e = m(t.parentElement) : e = !1,
|
|
280
|
+
return t.getAttribute("aria-hidden") === "true" || t instanceof HTMLElement && (t.hidden || t.style.display === "none") ? e = !0 : t.parentElement ? e = m(t.parentElement) : e = !1, H.set(t, e), e;
|
|
271
281
|
}
|
|
272
|
-
function
|
|
282
|
+
function pe(t) {
|
|
273
283
|
return !!(t.getAttribute("aria-hidden") === "true" || t instanceof HTMLElement && (t.hidden || t.style.display === "none"));
|
|
274
284
|
}
|
|
275
285
|
function w(t) {
|
|
@@ -280,7 +290,7 @@ function w(t) {
|
|
|
280
290
|
a += o.textContent ?? "";
|
|
281
291
|
else if (o.nodeType === 1) {
|
|
282
292
|
const s = o;
|
|
283
|
-
if (!
|
|
293
|
+
if (!pe(s)) {
|
|
284
294
|
const u = (e = s.tagName) == null ? void 0 : e.toLowerCase();
|
|
285
295
|
if (u === "img" || u === "area")
|
|
286
296
|
a += ((i = s.getAttribute("aria-label")) == null ? void 0 : i.trim()) ?? s.getAttribute("alt") ?? "";
|
|
@@ -297,10 +307,14 @@ function w(t) {
|
|
|
297
307
|
}
|
|
298
308
|
return a;
|
|
299
309
|
}
|
|
300
|
-
|
|
310
|
+
let D = /* @__PURE__ */ new WeakMap();
|
|
311
|
+
function te() {
|
|
312
|
+
D = /* @__PURE__ */ new WeakMap();
|
|
313
|
+
}
|
|
314
|
+
function he(t) {
|
|
301
315
|
return t.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
302
316
|
}
|
|
303
|
-
const
|
|
317
|
+
const ge = [
|
|
304
318
|
"data-testid",
|
|
305
319
|
"data-test-id",
|
|
306
320
|
"data-cy",
|
|
@@ -310,20 +324,20 @@ const de = [
|
|
|
310
324
|
"for",
|
|
311
325
|
"aria-label"
|
|
312
326
|
];
|
|
313
|
-
function
|
|
327
|
+
function be(t) {
|
|
314
328
|
const a = t.tagName.toLowerCase();
|
|
315
|
-
for (const i of
|
|
329
|
+
for (const i of ge) {
|
|
316
330
|
const n = t.getAttribute(i);
|
|
317
331
|
if (n != null && n.length > 0 && n.length < 100)
|
|
318
|
-
return `${a}[${i}="${
|
|
332
|
+
return `${a}[${i}="${he(n)}"]`;
|
|
319
333
|
}
|
|
320
334
|
const e = t.parentElement;
|
|
321
335
|
if (e) {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
if (i
|
|
326
|
-
return `${a}:nth-of-type(${
|
|
336
|
+
let i = 0, n = 0;
|
|
337
|
+
for (let r = 0; r < e.children.length; r++)
|
|
338
|
+
e.children[r].tagName === t.tagName && (i++, e.children[r] === t && (n = i));
|
|
339
|
+
if (i > 1)
|
|
340
|
+
return `${a}:nth-of-type(${n})`;
|
|
327
341
|
}
|
|
328
342
|
return a;
|
|
329
343
|
}
|
|
@@ -336,7 +350,7 @@ function R(t) {
|
|
|
336
350
|
i.unshift(`#${CSS.escape(n.id)}`);
|
|
337
351
|
break;
|
|
338
352
|
}
|
|
339
|
-
if (i.unshift(
|
|
353
|
+
if (i.unshift(be(n)), i.length >= 2) {
|
|
340
354
|
const r = i.join(" > ");
|
|
341
355
|
try {
|
|
342
356
|
const o = a.querySelectorAll(r);
|
|
@@ -349,26 +363,29 @@ function R(t) {
|
|
|
349
363
|
return i.join(" > ");
|
|
350
364
|
}
|
|
351
365
|
function c(t) {
|
|
352
|
-
var
|
|
353
|
-
const a =
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
366
|
+
var r;
|
|
367
|
+
const a = D.get(t);
|
|
368
|
+
if (a !== void 0) return a;
|
|
369
|
+
const e = [];
|
|
370
|
+
let i = t;
|
|
371
|
+
for (; i; ) {
|
|
372
|
+
const o = i.getRootNode();
|
|
373
|
+
if (o instanceof ShadowRoot)
|
|
374
|
+
e.unshift({ selector: R(i), delimiter: " >>> " }), i = o.host;
|
|
359
375
|
else {
|
|
360
|
-
const
|
|
361
|
-
if (
|
|
362
|
-
|
|
376
|
+
const s = (r = o.defaultView) == null ? void 0 : r.frameElement;
|
|
377
|
+
if (s)
|
|
378
|
+
e.unshift({ selector: R(i), delimiter: " >>>iframe> " }), i = s;
|
|
363
379
|
else {
|
|
364
|
-
|
|
380
|
+
e.unshift({ selector: R(i), delimiter: "" });
|
|
365
381
|
break;
|
|
366
382
|
}
|
|
367
383
|
}
|
|
368
384
|
}
|
|
369
|
-
|
|
385
|
+
const n = e.map((o, s) => (s === 0 ? "" : o.delimiter) + o.selector).join("");
|
|
386
|
+
return D.set(t, n), n;
|
|
370
387
|
}
|
|
371
|
-
function
|
|
388
|
+
function Wa(t) {
|
|
372
389
|
const a = [], e = [];
|
|
373
390
|
let i = t;
|
|
374
391
|
for (; i; ) {
|
|
@@ -405,7 +422,7 @@ function l(t) {
|
|
|
405
422
|
const a = t.outerHTML;
|
|
406
423
|
return a.length > 200 ? a.slice(0, 200) + "..." : a;
|
|
407
424
|
}
|
|
408
|
-
const
|
|
425
|
+
const fe = /* @__PURE__ */ new Set([
|
|
409
426
|
"aria-activedescendant",
|
|
410
427
|
"aria-atomic",
|
|
411
428
|
"aria-autocomplete",
|
|
@@ -459,7 +476,7 @@ const me = /* @__PURE__ */ new Set([
|
|
|
459
476
|
"aria-valuemin",
|
|
460
477
|
"aria-valuenow",
|
|
461
478
|
"aria-valuetext"
|
|
462
|
-
]),
|
|
479
|
+
]), ve = /* @__PURE__ */ new Set([
|
|
463
480
|
"aria-atomic",
|
|
464
481
|
"aria-busy",
|
|
465
482
|
"aria-disabled",
|
|
@@ -470,7 +487,7 @@ const me = /* @__PURE__ */ new Set([
|
|
|
470
487
|
"aria-multiselectable",
|
|
471
488
|
"aria-readonly",
|
|
472
489
|
"aria-required"
|
|
473
|
-
]),
|
|
490
|
+
]), ye = /* @__PURE__ */ new Set(["aria-checked", "aria-pressed"]), we = /* @__PURE__ */ new Set([
|
|
474
491
|
"aria-colcount",
|
|
475
492
|
"aria-colindex",
|
|
476
493
|
"aria-colspan",
|
|
@@ -480,11 +497,11 @@ const me = /* @__PURE__ */ new Set([
|
|
|
480
497
|
"aria-rowindex",
|
|
481
498
|
"aria-rowspan",
|
|
482
499
|
"aria-setsize"
|
|
483
|
-
]),
|
|
500
|
+
]), Ae = /* @__PURE__ */ new Set([
|
|
484
501
|
"aria-valuemax",
|
|
485
502
|
"aria-valuemin",
|
|
486
503
|
"aria-valuenow"
|
|
487
|
-
]),
|
|
504
|
+
]), P = {
|
|
488
505
|
"aria-autocomplete": /* @__PURE__ */ new Set(["inline", "list", "both", "none"]),
|
|
489
506
|
"aria-current": /* @__PURE__ */ new Set(["page", "step", "location", "date", "time", "true", "false"]),
|
|
490
507
|
"aria-dropeffect": /* @__PURE__ */ new Set(["copy", "execute", "link", "move", "none", "popup"]),
|
|
@@ -494,7 +511,7 @@ const me = /* @__PURE__ */ new Set([
|
|
|
494
511
|
"aria-orientation": /* @__PURE__ */ new Set(["horizontal", "vertical", "undefined"]),
|
|
495
512
|
"aria-relevant": /* @__PURE__ */ new Set(["additions", "all", "removals", "text"]),
|
|
496
513
|
"aria-sort": /* @__PURE__ */ new Set(["ascending", "descending", "none", "other"])
|
|
497
|
-
},
|
|
514
|
+
}, V = /* @__PURE__ */ new Set([
|
|
498
515
|
"caption",
|
|
499
516
|
"code",
|
|
500
517
|
"deletion",
|
|
@@ -511,7 +528,7 @@ const me = /* @__PURE__ */ new Set([
|
|
|
511
528
|
"suggestion",
|
|
512
529
|
"term",
|
|
513
530
|
"time"
|
|
514
|
-
]),
|
|
531
|
+
]), Se = {
|
|
515
532
|
abbr: !0,
|
|
516
533
|
bdi: !0,
|
|
517
534
|
bdo: !0,
|
|
@@ -539,7 +556,7 @@ const me = /* @__PURE__ */ new Set([
|
|
|
539
556
|
u: !0,
|
|
540
557
|
var: !0,
|
|
541
558
|
wbr: !0
|
|
542
|
-
},
|
|
559
|
+
}, xe = {
|
|
543
560
|
alert: /* @__PURE__ */ new Set(["aria-disabled", "aria-errormessage", "aria-haspopup", "aria-invalid"]),
|
|
544
561
|
article: /* @__PURE__ */ new Set(["aria-disabled", "aria-errormessage", "aria-haspopup", "aria-invalid"]),
|
|
545
562
|
banner: /* @__PURE__ */ new Set(["aria-disabled", "aria-errormessage", "aria-haspopup", "aria-invalid"]),
|
|
@@ -573,10 +590,10 @@ const me = /* @__PURE__ */ new Set([
|
|
|
573
590
|
tooltip: /* @__PURE__ */ new Set(["aria-disabled", "aria-errormessage", "aria-haspopup", "aria-invalid"])
|
|
574
591
|
};
|
|
575
592
|
let I = null, q = null;
|
|
576
|
-
function
|
|
593
|
+
function ae() {
|
|
577
594
|
I = null, q = null;
|
|
578
595
|
}
|
|
579
|
-
function
|
|
596
|
+
function _(t) {
|
|
580
597
|
var n;
|
|
581
598
|
if (q && (I == null ? void 0 : I.deref()) === t) return q;
|
|
582
599
|
const a = [], e = [], i = [];
|
|
@@ -588,13 +605,15 @@ function O(t) {
|
|
|
588
605
|
break;
|
|
589
606
|
}
|
|
590
607
|
if (!o) continue;
|
|
591
|
-
|
|
608
|
+
let s, u;
|
|
609
|
+
const h = () => (s === void 0 && (s = c(r), u = l(r)), { selector: s, html: u });
|
|
592
610
|
for (const d of r.attributes)
|
|
593
|
-
if (d.name.startsWith("aria-") && !
|
|
611
|
+
if (d.name.startsWith("aria-") && !fe.has(d.name)) {
|
|
612
|
+
const p = h();
|
|
594
613
|
a.push({
|
|
595
614
|
ruleId: "aria-valid-attr",
|
|
596
|
-
selector:
|
|
597
|
-
html:
|
|
615
|
+
selector: p.selector,
|
|
616
|
+
html: p.html,
|
|
598
617
|
impact: "critical",
|
|
599
618
|
message: `Invalid ARIA attribute "${d.name}".`
|
|
600
619
|
});
|
|
@@ -603,46 +622,59 @@ function O(t) {
|
|
|
603
622
|
for (const d of r.attributes) {
|
|
604
623
|
if (!d.name.startsWith("aria-")) continue;
|
|
605
624
|
const p = d.value.trim();
|
|
606
|
-
if (
|
|
607
|
-
p !== "true" && p !== "false"
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
625
|
+
if (ve.has(d.name)) {
|
|
626
|
+
if (p !== "true" && p !== "false") {
|
|
627
|
+
const g = h();
|
|
628
|
+
e.push({
|
|
629
|
+
ruleId: "aria-valid-attr-value",
|
|
630
|
+
selector: g.selector,
|
|
631
|
+
html: g.html,
|
|
632
|
+
impact: "critical",
|
|
633
|
+
message: `${d.name} must be "true" or "false", got "${p}".`
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
} else if (ye.has(d.name)) {
|
|
637
|
+
if (p !== "true" && p !== "false" && p !== "mixed") {
|
|
638
|
+
const g = h();
|
|
639
|
+
e.push({
|
|
640
|
+
ruleId: "aria-valid-attr-value",
|
|
641
|
+
selector: g.selector,
|
|
642
|
+
html: g.html,
|
|
643
|
+
impact: "critical",
|
|
644
|
+
message: `${d.name} must be "true", "false", or "mixed", got "${p}".`
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
} else if (we.has(d.name)) {
|
|
648
|
+
if (p === "" || !/^-?\d+$/.test(p)) {
|
|
649
|
+
const g = h();
|
|
650
|
+
e.push({
|
|
651
|
+
ruleId: "aria-valid-attr-value",
|
|
652
|
+
selector: g.selector,
|
|
653
|
+
html: g.html,
|
|
654
|
+
impact: "critical",
|
|
655
|
+
message: `${d.name} must be an integer, got "${p}".`
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
} else if (Ae.has(d.name)) {
|
|
659
|
+
if (p === "" || isNaN(Number(p))) {
|
|
660
|
+
const g = h();
|
|
661
|
+
e.push({
|
|
662
|
+
ruleId: "aria-valid-attr-value",
|
|
663
|
+
selector: g.selector,
|
|
664
|
+
html: g.html,
|
|
665
|
+
impact: "critical",
|
|
666
|
+
message: `${d.name} must be a number, got "${p}".`
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
} else if (P[d.name]) {
|
|
639
670
|
const g = p.split(/\s+/);
|
|
640
671
|
for (const f of g)
|
|
641
|
-
if (!
|
|
672
|
+
if (!P[d.name].has(f)) {
|
|
673
|
+
const v = h();
|
|
642
674
|
e.push({
|
|
643
675
|
ruleId: "aria-valid-attr-value",
|
|
644
|
-
selector:
|
|
645
|
-
html:
|
|
676
|
+
selector: v.selector,
|
|
677
|
+
html: v.html,
|
|
646
678
|
impact: "critical",
|
|
647
679
|
message: `Invalid value "${p}" for ${d.name}.`
|
|
648
680
|
});
|
|
@@ -650,38 +682,45 @@ function O(t) {
|
|
|
650
682
|
}
|
|
651
683
|
}
|
|
652
684
|
}
|
|
653
|
-
if (!
|
|
685
|
+
if (!m(r)) {
|
|
654
686
|
const d = (n = r.getAttribute("role")) == null ? void 0 : n.trim().toLowerCase(), p = r.tagName.toLowerCase();
|
|
655
|
-
if (!d &&
|
|
687
|
+
if (!d && Se[p]) {
|
|
656
688
|
const g = r.hasAttribute("aria-label"), f = r.hasAttribute("aria-labelledby");
|
|
657
|
-
(g || f)
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
html: u,
|
|
661
|
-
impact: "serious",
|
|
662
|
-
message: `aria-label and aria-labelledby are prohibited on <${p}> elements.`
|
|
663
|
-
});
|
|
664
|
-
} else if (d) {
|
|
665
|
-
if (_.has(d)) {
|
|
666
|
-
const f = r.hasAttribute("aria-label"), v = r.hasAttribute("aria-labelledby");
|
|
667
|
-
(f || v) && i.push({
|
|
689
|
+
if (g || f) {
|
|
690
|
+
const v = h();
|
|
691
|
+
i.push({
|
|
668
692
|
ruleId: "aria-prohibited-attr",
|
|
669
|
-
selector:
|
|
670
|
-
html:
|
|
693
|
+
selector: v.selector,
|
|
694
|
+
html: v.html,
|
|
671
695
|
impact: "serious",
|
|
672
|
-
message: `aria-label and aria-labelledby are prohibited on
|
|
696
|
+
message: `aria-label and aria-labelledby are prohibited on <${p}> elements.`
|
|
673
697
|
});
|
|
674
698
|
}
|
|
675
|
-
|
|
699
|
+
} else if (d) {
|
|
700
|
+
if (V.has(d)) {
|
|
701
|
+
const f = r.hasAttribute("aria-label"), v = r.hasAttribute("aria-labelledby");
|
|
702
|
+
if (f || v) {
|
|
703
|
+
const y = h();
|
|
704
|
+
i.push({
|
|
705
|
+
ruleId: "aria-prohibited-attr",
|
|
706
|
+
selector: y.selector,
|
|
707
|
+
html: y.html,
|
|
708
|
+
impact: "serious",
|
|
709
|
+
message: `aria-label and aria-labelledby are prohibited on role "${d}".`
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
const g = xe[d];
|
|
676
714
|
if (g) {
|
|
677
715
|
for (const f of r.attributes)
|
|
678
716
|
if (f.name.startsWith("aria-") && g.has(f.name)) {
|
|
679
|
-
if ((f.name === "aria-label" || f.name === "aria-labelledby") &&
|
|
717
|
+
if ((f.name === "aria-label" || f.name === "aria-labelledby") && V.has(d))
|
|
680
718
|
continue;
|
|
719
|
+
const v = h();
|
|
681
720
|
i.push({
|
|
682
721
|
ruleId: "aria-prohibited-attr",
|
|
683
|
-
selector:
|
|
684
|
-
html:
|
|
722
|
+
selector: v.selector,
|
|
723
|
+
html: v.html,
|
|
685
724
|
impact: "serious",
|
|
686
725
|
message: `Attribute "${f.name}" is prohibited on role "${d}".`
|
|
687
726
|
});
|
|
@@ -692,41 +731,41 @@ function O(t) {
|
|
|
692
731
|
}
|
|
693
732
|
return I = new WeakRef(t), q = { validAttr: a, validAttrValue: e, prohibitedAttr: i }, q;
|
|
694
733
|
}
|
|
695
|
-
let
|
|
696
|
-
function
|
|
697
|
-
|
|
734
|
+
let B = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap();
|
|
735
|
+
function ie() {
|
|
736
|
+
B = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap();
|
|
698
737
|
}
|
|
699
|
-
function
|
|
700
|
-
let a =
|
|
701
|
-
return a || (a = getComputedStyle(t),
|
|
738
|
+
function C(t) {
|
|
739
|
+
let a = B.get(t);
|
|
740
|
+
return a || (a = getComputedStyle(t), B.set(t, a), a);
|
|
702
741
|
}
|
|
703
|
-
function
|
|
742
|
+
function U(t, a, e) {
|
|
704
743
|
const [i, n, r] = [t, a, e].map((o) => {
|
|
705
744
|
const s = o / 255;
|
|
706
745
|
return s <= 0.04045 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);
|
|
707
746
|
});
|
|
708
747
|
return 0.2126 * i + 0.7152 * n + 0.0722 * r;
|
|
709
748
|
}
|
|
710
|
-
function
|
|
749
|
+
function ke(t, a) {
|
|
711
750
|
const e = Math.max(t, a), i = Math.min(t, a);
|
|
712
751
|
return (e + 0.05) / (i + 0.05);
|
|
713
752
|
}
|
|
714
|
-
function
|
|
753
|
+
function ne(t) {
|
|
715
754
|
const a = t.match(
|
|
716
755
|
/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*[\d.]+)?\s*\)/
|
|
717
756
|
);
|
|
718
757
|
return a ? [parseInt(a[1]), parseInt(a[2]), parseInt(a[3])] : null;
|
|
719
758
|
}
|
|
720
|
-
function
|
|
721
|
-
const a =
|
|
759
|
+
function Ie(t) {
|
|
760
|
+
const a = O.get(t);
|
|
722
761
|
if (a !== void 0) return a;
|
|
723
|
-
const e =
|
|
724
|
-
return
|
|
762
|
+
const e = qe(t);
|
|
763
|
+
return O.set(t, e), e;
|
|
725
764
|
}
|
|
726
|
-
function
|
|
765
|
+
function qe(t) {
|
|
727
766
|
let a = t;
|
|
728
767
|
for (; a; ) {
|
|
729
|
-
const e =
|
|
768
|
+
const e = C(a), i = e.backgroundColor;
|
|
730
769
|
if (i === "transparent" || i === "rgba(0, 0, 0, 0)") {
|
|
731
770
|
a = a.parentElement;
|
|
732
771
|
continue;
|
|
@@ -736,15 +775,15 @@ function Ae(t) {
|
|
|
736
775
|
a = a.parentElement;
|
|
737
776
|
continue;
|
|
738
777
|
}
|
|
739
|
-
return e.backgroundImage && e.backgroundImage !== "none" ? null :
|
|
778
|
+
return e.backgroundImage && e.backgroundImage !== "none" ? null : ne(i);
|
|
740
779
|
}
|
|
741
780
|
return [255, 255, 255];
|
|
742
781
|
}
|
|
743
|
-
function
|
|
744
|
-
const a =
|
|
782
|
+
function Ce(t) {
|
|
783
|
+
const a = C(t), e = parseFloat(a.fontSize), i = parseInt(a.fontWeight) || (a.fontWeight === "bold" ? 700 : 400);
|
|
745
784
|
return e >= 24 || e >= 18.66 && i >= 700;
|
|
746
785
|
}
|
|
747
|
-
function
|
|
786
|
+
function Te(t) {
|
|
748
787
|
var r, o;
|
|
749
788
|
const a = [], e = t.closest("a");
|
|
750
789
|
if (e) {
|
|
@@ -764,7 +803,7 @@ function xe(t) {
|
|
|
764
803
|
return a.length > 0 ? a.join(`
|
|
765
804
|
`) : void 0;
|
|
766
805
|
}
|
|
767
|
-
const
|
|
806
|
+
const Ee = {
|
|
768
807
|
id: "img-alt",
|
|
769
808
|
wcag: ["1.1.1"],
|
|
770
809
|
level: "A",
|
|
@@ -780,11 +819,11 @@ const ke = {
|
|
|
780
819
|
html: l(e),
|
|
781
820
|
impact: "critical",
|
|
782
821
|
message: "Image element missing alt attribute.",
|
|
783
|
-
context:
|
|
822
|
+
context: Te(e)
|
|
784
823
|
});
|
|
785
824
|
return a;
|
|
786
825
|
}
|
|
787
|
-
},
|
|
826
|
+
}, Le = {
|
|
788
827
|
id: "svg-img-alt",
|
|
789
828
|
wcag: ["1.1.1"],
|
|
790
829
|
level: "A",
|
|
@@ -805,7 +844,7 @@ const ke = {
|
|
|
805
844
|
}
|
|
806
845
|
return a;
|
|
807
846
|
}
|
|
808
|
-
},
|
|
847
|
+
}, Re = {
|
|
809
848
|
id: "input-image-alt",
|
|
810
849
|
wcag: ["1.1.1", "4.1.2"],
|
|
811
850
|
level: "A",
|
|
@@ -824,7 +863,7 @@ const ke = {
|
|
|
824
863
|
});
|
|
825
864
|
return a;
|
|
826
865
|
}
|
|
827
|
-
},
|
|
866
|
+
}, Ne = {
|
|
828
867
|
id: "image-redundant-alt",
|
|
829
868
|
wcag: [],
|
|
830
869
|
level: "A",
|
|
@@ -852,7 +891,7 @@ const ke = {
|
|
|
852
891
|
}
|
|
853
892
|
return a;
|
|
854
893
|
}
|
|
855
|
-
},
|
|
894
|
+
}, Me = ["image", "picture", "photo", "graphic", "icon", "img"], $e = {
|
|
856
895
|
id: "image-alt-redundant-words",
|
|
857
896
|
wcag: [],
|
|
858
897
|
level: "A",
|
|
@@ -864,7 +903,7 @@ const ke = {
|
|
|
864
903
|
const a = [];
|
|
865
904
|
for (const e of t.querySelectorAll("img[alt]")) {
|
|
866
905
|
const i = e.getAttribute("alt").toLowerCase();
|
|
867
|
-
i &&
|
|
906
|
+
i && Me.some((n) => i.split(/\s+/).includes(n)) && a.push({
|
|
868
907
|
ruleId: "image-alt-redundant-words",
|
|
869
908
|
selector: c(e),
|
|
870
909
|
html: l(e),
|
|
@@ -874,7 +913,7 @@ const ke = {
|
|
|
874
913
|
}
|
|
875
914
|
return a;
|
|
876
915
|
}
|
|
877
|
-
},
|
|
916
|
+
}, He = {
|
|
878
917
|
id: "area-alt",
|
|
879
918
|
wcag: ["1.1.1", "4.1.2"],
|
|
880
919
|
level: "A",
|
|
@@ -895,7 +934,7 @@ const ke = {
|
|
|
895
934
|
}
|
|
896
935
|
return a;
|
|
897
936
|
}
|
|
898
|
-
},
|
|
937
|
+
}, De = {
|
|
899
938
|
id: "object-alt",
|
|
900
939
|
wcag: ["1.1.1"],
|
|
901
940
|
level: "A",
|
|
@@ -914,7 +953,7 @@ const ke = {
|
|
|
914
953
|
});
|
|
915
954
|
return a;
|
|
916
955
|
}
|
|
917
|
-
},
|
|
956
|
+
}, Be = {
|
|
918
957
|
id: "role-img-alt",
|
|
919
958
|
wcag: ["1.1.1"],
|
|
920
959
|
level: "A",
|
|
@@ -936,7 +975,7 @@ const ke = {
|
|
|
936
975
|
return a;
|
|
937
976
|
}
|
|
938
977
|
};
|
|
939
|
-
function
|
|
978
|
+
function _a(t) {
|
|
940
979
|
if (typeof t != "object" || t === null)
|
|
941
980
|
return "Rule spec must be an object";
|
|
942
981
|
const a = t;
|
|
@@ -966,10 +1005,10 @@ function Ha(t) {
|
|
|
966
1005
|
return "Rule must have a wcag array";
|
|
967
1006
|
if (typeof a.level != "string" || !["A", "AA"].includes(a.level))
|
|
968
1007
|
return "Rule must have level A or AA";
|
|
969
|
-
const n =
|
|
1008
|
+
const n = Oe(e);
|
|
970
1009
|
return n || null;
|
|
971
1010
|
}
|
|
972
|
-
function
|
|
1011
|
+
function Oe(t) {
|
|
973
1012
|
switch (t.type) {
|
|
974
1013
|
case "selector-exists":
|
|
975
1014
|
return null;
|
|
@@ -1025,7 +1064,7 @@ function x(t) {
|
|
|
1025
1064
|
for (const s of e.querySelectorAll(t.selector)) {
|
|
1026
1065
|
if (a && m(s)) continue;
|
|
1027
1066
|
const u = s.getAttribute(n);
|
|
1028
|
-
u !== null &&
|
|
1067
|
+
u !== null && We(u, r, o) && i.push({
|
|
1029
1068
|
ruleId: t.id,
|
|
1030
1069
|
selector: c(s),
|
|
1031
1070
|
html: l(s),
|
|
@@ -1119,7 +1158,7 @@ function x(t) {
|
|
|
1119
1158
|
}
|
|
1120
1159
|
};
|
|
1121
1160
|
}
|
|
1122
|
-
function
|
|
1161
|
+
function We(t, a, e) {
|
|
1123
1162
|
switch (a) {
|
|
1124
1163
|
case ">":
|
|
1125
1164
|
return parseFloat(t) > e;
|
|
@@ -1137,7 +1176,7 @@ function Me(t, a, e) {
|
|
|
1137
1176
|
return !1;
|
|
1138
1177
|
}
|
|
1139
1178
|
}
|
|
1140
|
-
const
|
|
1179
|
+
const _e = {
|
|
1141
1180
|
id: "server-side-image-map",
|
|
1142
1181
|
selector: "img[ismap], input[type='image'][ismap]",
|
|
1143
1182
|
check: { type: "selector-exists" },
|
|
@@ -1148,7 +1187,7 @@ const He = {
|
|
|
1148
1187
|
level: "A",
|
|
1149
1188
|
guidance: "Server-side image maps (using ismap attribute) send click coordinates to the server, which is inaccessible to keyboard users and screen readers who can't precisely click specific regions. Replace with client-side image maps (<map> with <area> elements) that provide keyboard access and accessible names, or use linked images/buttons instead.",
|
|
1150
1189
|
prompt: "Explain that the ismap attribute should be removed and the functionality replaced with a client-side <map> element with <area> children, or separate linked images/buttons."
|
|
1151
|
-
},
|
|
1190
|
+
}, Fe = x(_e), Pe = {
|
|
1152
1191
|
id: "label",
|
|
1153
1192
|
wcag: ["4.1.2"],
|
|
1154
1193
|
level: "A",
|
|
@@ -1171,7 +1210,7 @@ const He = {
|
|
|
1171
1210
|
}
|
|
1172
1211
|
return a;
|
|
1173
1212
|
}
|
|
1174
|
-
},
|
|
1213
|
+
}, Ve = {
|
|
1175
1214
|
id: "form-field-multiple-labels",
|
|
1176
1215
|
wcag: [],
|
|
1177
1216
|
level: "A",
|
|
@@ -1203,7 +1242,7 @@ const He = {
|
|
|
1203
1242
|
}
|
|
1204
1243
|
return a;
|
|
1205
1244
|
}
|
|
1206
|
-
},
|
|
1245
|
+
}, Ue = {
|
|
1207
1246
|
id: "select-name",
|
|
1208
1247
|
wcag: ["4.1.2"],
|
|
1209
1248
|
level: "A",
|
|
@@ -1222,7 +1261,7 @@ const He = {
|
|
|
1222
1261
|
});
|
|
1223
1262
|
return a;
|
|
1224
1263
|
}
|
|
1225
|
-
},
|
|
1264
|
+
}, je = {
|
|
1226
1265
|
id: "input-button-name",
|
|
1227
1266
|
wcag: ["4.1.2"],
|
|
1228
1267
|
level: "A",
|
|
@@ -1247,7 +1286,7 @@ const He = {
|
|
|
1247
1286
|
}
|
|
1248
1287
|
return a;
|
|
1249
1288
|
}
|
|
1250
|
-
},
|
|
1289
|
+
}, ze = /* @__PURE__ */ new Set([
|
|
1251
1290
|
"off",
|
|
1252
1291
|
"on",
|
|
1253
1292
|
"name",
|
|
@@ -1302,7 +1341,7 @@ const He = {
|
|
|
1302
1341
|
"impp",
|
|
1303
1342
|
"url",
|
|
1304
1343
|
"photo"
|
|
1305
|
-
]),
|
|
1344
|
+
]), Ge = {
|
|
1306
1345
|
id: "autocomplete-valid",
|
|
1307
1346
|
wcag: ["1.3.5"],
|
|
1308
1347
|
level: "AA",
|
|
@@ -1315,7 +1354,7 @@ const He = {
|
|
|
1315
1354
|
const i = e.getAttribute("autocomplete").trim();
|
|
1316
1355
|
if (!i) continue;
|
|
1317
1356
|
const n = i.split(/\s+/), r = n[n.length - 1];
|
|
1318
|
-
|
|
1357
|
+
ze.has(r) || a.push({
|
|
1319
1358
|
ruleId: "autocomplete-valid",
|
|
1320
1359
|
selector: c(e),
|
|
1321
1360
|
html: l(e),
|
|
@@ -1326,16 +1365,16 @@ const He = {
|
|
|
1326
1365
|
return a;
|
|
1327
1366
|
}
|
|
1328
1367
|
};
|
|
1329
|
-
function
|
|
1368
|
+
function j(t) {
|
|
1330
1369
|
return t.toLowerCase().replace(/\s+/g, " ").trim();
|
|
1331
1370
|
}
|
|
1332
|
-
function
|
|
1333
|
-
const e =
|
|
1371
|
+
function z(t, a) {
|
|
1372
|
+
const e = j(t), i = j(a);
|
|
1334
1373
|
if (!e || !i || e.includes(i) || i.includes(e)) return !0;
|
|
1335
1374
|
const n = i.split(/\s+/).map((r) => r.replace(/[.,;:!?\u2026]+$/g, "")).filter((r) => r.length > 2);
|
|
1336
1375
|
return n.length >= 2 && n.filter((o) => e.includes(o)).length / n.length > 0.5;
|
|
1337
1376
|
}
|
|
1338
|
-
function
|
|
1377
|
+
function W(t) {
|
|
1339
1378
|
let a = "";
|
|
1340
1379
|
for (const e of t.childNodes)
|
|
1341
1380
|
if (e.nodeType === 3)
|
|
@@ -1345,11 +1384,11 @@ function B(t) {
|
|
|
1345
1384
|
if (n === "style" || n === "script" || n === "svg" || i.getAttribute("aria-hidden") === "true" || i instanceof HTMLElement && i.style.display === "none") continue;
|
|
1346
1385
|
const r = i.getAttribute("role");
|
|
1347
1386
|
if (r === "img" || r === "presentation" || r === "none") continue;
|
|
1348
|
-
a +=
|
|
1387
|
+
a += W(i);
|
|
1349
1388
|
}
|
|
1350
1389
|
return a;
|
|
1351
1390
|
}
|
|
1352
|
-
const
|
|
1391
|
+
const Xe = {
|
|
1353
1392
|
id: "label-content-name-mismatch",
|
|
1354
1393
|
wcag: ["2.5.3"],
|
|
1355
1394
|
level: "A",
|
|
@@ -1363,11 +1402,11 @@ const Ve = {
|
|
|
1363
1402
|
const i = b(e);
|
|
1364
1403
|
if (!i) continue;
|
|
1365
1404
|
let n = "";
|
|
1366
|
-
e instanceof HTMLInputElement ? n = e.value || "" : n =
|
|
1405
|
+
e instanceof HTMLInputElement ? n = e.value || "" : n = W(e);
|
|
1367
1406
|
const r = n.trim();
|
|
1368
1407
|
if (!r || r.length <= 2) continue;
|
|
1369
1408
|
const o = e.hasAttribute("aria-label"), s = e.hasAttribute("aria-labelledby");
|
|
1370
|
-
!o && !s ||
|
|
1409
|
+
!o && !s || z(i, n) || a.push({
|
|
1371
1410
|
ruleId: "label-content-name-mismatch",
|
|
1372
1411
|
selector: c(e),
|
|
1373
1412
|
html: l(e),
|
|
@@ -1383,9 +1422,9 @@ const Ve = {
|
|
|
1383
1422
|
let o = "";
|
|
1384
1423
|
if (r) {
|
|
1385
1424
|
const s = t.querySelector(`label[for="${CSS.escape(r)}"]`);
|
|
1386
|
-
s && (o =
|
|
1425
|
+
s && (o = W(s));
|
|
1387
1426
|
}
|
|
1388
|
-
o.trim() && (
|
|
1427
|
+
o.trim() && (z(i, o) || a.push({
|
|
1389
1428
|
ruleId: "label-content-name-mismatch",
|
|
1390
1429
|
selector: c(e),
|
|
1391
1430
|
html: l(e),
|
|
@@ -1395,7 +1434,7 @@ const Ve = {
|
|
|
1395
1434
|
}
|
|
1396
1435
|
return a;
|
|
1397
1436
|
}
|
|
1398
|
-
},
|
|
1437
|
+
}, Ke = {
|
|
1399
1438
|
id: "label-title-only",
|
|
1400
1439
|
wcag: [],
|
|
1401
1440
|
level: "A",
|
|
@@ -1428,7 +1467,7 @@ const Ve = {
|
|
|
1428
1467
|
}
|
|
1429
1468
|
return a;
|
|
1430
1469
|
}
|
|
1431
|
-
},
|
|
1470
|
+
}, Ye = {
|
|
1432
1471
|
id: "tabindex",
|
|
1433
1472
|
selector: "[tabindex]",
|
|
1434
1473
|
check: { type: "attribute-value", attribute: "tabindex", operator: ">", value: 0 },
|
|
@@ -1440,7 +1479,7 @@ const Ve = {
|
|
|
1440
1479
|
tags: ["best-practice"],
|
|
1441
1480
|
guidance: "Positive tabindex values force elements to the front of the tab order regardless of DOM position, creating unpredictable navigation for keyboard users. Use tabindex='0' to add elements to the natural tab order, or tabindex='-1' to make elements programmatically focusable but not in tab order. Rely on DOM order for tab sequence.",
|
|
1442
1481
|
prompt: "Change the positive tabindex value to tabindex='0' and rely on DOM order for tab sequence instead."
|
|
1443
|
-
},
|
|
1482
|
+
}, Qe = x(Ye), Je = /* @__PURE__ */ new Set([
|
|
1444
1483
|
"div",
|
|
1445
1484
|
"span",
|
|
1446
1485
|
"p",
|
|
@@ -1467,7 +1506,7 @@ const Ve = {
|
|
|
1467
1506
|
"tr",
|
|
1468
1507
|
"td",
|
|
1469
1508
|
"th"
|
|
1470
|
-
]),
|
|
1509
|
+
]), Ze = {
|
|
1471
1510
|
id: "focus-order-semantics",
|
|
1472
1511
|
wcag: [],
|
|
1473
1512
|
tags: ["best-practice"],
|
|
@@ -1479,7 +1518,7 @@ const Ve = {
|
|
|
1479
1518
|
const a = [];
|
|
1480
1519
|
for (const e of t.querySelectorAll('[tabindex="0"]')) {
|
|
1481
1520
|
const i = e.tagName.toLowerCase();
|
|
1482
|
-
if (!
|
|
1521
|
+
if (!Je.has(i)) continue;
|
|
1483
1522
|
e.getAttribute("role") || a.push({
|
|
1484
1523
|
ruleId: "focus-order-semantics",
|
|
1485
1524
|
selector: c(e),
|
|
@@ -1490,7 +1529,7 @@ const Ve = {
|
|
|
1490
1529
|
}
|
|
1491
1530
|
return a;
|
|
1492
1531
|
}
|
|
1493
|
-
},
|
|
1532
|
+
}, et = /* @__PURE__ */ new Set([
|
|
1494
1533
|
"a",
|
|
1495
1534
|
"audio",
|
|
1496
1535
|
"button",
|
|
@@ -1499,7 +1538,7 @@ const Ve = {
|
|
|
1499
1538
|
"select",
|
|
1500
1539
|
"textarea",
|
|
1501
1540
|
"video"
|
|
1502
|
-
]),
|
|
1541
|
+
]), tt = /* @__PURE__ */ new Set([
|
|
1503
1542
|
"button",
|
|
1504
1543
|
"checkbox",
|
|
1505
1544
|
"combobox",
|
|
@@ -1523,7 +1562,7 @@ const Ve = {
|
|
|
1523
1562
|
"tabpanel",
|
|
1524
1563
|
"textbox",
|
|
1525
1564
|
"treeitem"
|
|
1526
|
-
]),
|
|
1565
|
+
]), at = {
|
|
1527
1566
|
grid: /* @__PURE__ */ new Set(["gridcell", "row", "columnheader", "rowheader"]),
|
|
1528
1567
|
listbox: /* @__PURE__ */ new Set(["option"]),
|
|
1529
1568
|
menu: /* @__PURE__ */ new Set(["menuitem", "menuitemcheckbox", "menuitemradio"]),
|
|
@@ -1533,26 +1572,26 @@ const Ve = {
|
|
|
1533
1572
|
tree: /* @__PURE__ */ new Set(["treeitem"]),
|
|
1534
1573
|
treegrid: /* @__PURE__ */ new Set(["gridcell", "row", "columnheader", "rowheader", "treeitem"])
|
|
1535
1574
|
};
|
|
1536
|
-
function
|
|
1575
|
+
function it(t, a) {
|
|
1537
1576
|
var n, r, o;
|
|
1538
1577
|
const e = (n = t.getAttribute("role")) == null ? void 0 : n.toLowerCase(), i = (r = a.getAttribute("role")) == null ? void 0 : r.toLowerCase();
|
|
1539
|
-
return !e || !i ? !1 : ((o =
|
|
1578
|
+
return !e || !i ? !1 : ((o = at[e]) == null ? void 0 : o.has(i)) ?? !1;
|
|
1540
1579
|
}
|
|
1541
|
-
function
|
|
1580
|
+
function nt(t) {
|
|
1542
1581
|
var n;
|
|
1543
1582
|
const a = t.tagName.toLowerCase();
|
|
1544
|
-
if (
|
|
1583
|
+
if (et.has(a))
|
|
1545
1584
|
return a === "a" && !t.hasAttribute("href") ? !1 : a === "audio" || a === "video" ? t.hasAttribute("controls") : !(a === "img" && !t.hasAttribute("usemap") || a === "input" && t.type === "hidden" || t.disabled);
|
|
1546
1585
|
const e = (n = t.getAttribute("role")) == null ? void 0 : n.toLowerCase();
|
|
1547
|
-
if (e &&
|
|
1586
|
+
if (e && tt.has(e)) return !0;
|
|
1548
1587
|
const i = t.getAttribute("tabindex");
|
|
1549
1588
|
return i !== null && i !== "-1" || t.getAttribute("contenteditable") === "true";
|
|
1550
1589
|
}
|
|
1551
|
-
function
|
|
1590
|
+
function rt(t) {
|
|
1552
1591
|
const a = t.tagName.toLowerCase();
|
|
1553
1592
|
return !!(a === "a" && t.hasAttribute("href") || a === "button" && !t.disabled);
|
|
1554
1593
|
}
|
|
1555
|
-
const
|
|
1594
|
+
const ot = {
|
|
1556
1595
|
id: "nested-interactive",
|
|
1557
1596
|
wcag: ["4.1.2"],
|
|
1558
1597
|
level: "A",
|
|
@@ -1567,10 +1606,10 @@ const tt = {
|
|
|
1567
1606
|
for (; o; ) {
|
|
1568
1607
|
for (; r.length > 0 && !r[r.length - 1].contains(o); )
|
|
1569
1608
|
r.pop();
|
|
1570
|
-
if (!m(o) &&
|
|
1609
|
+
if (!m(o) && nt(o)) {
|
|
1571
1610
|
if (r.length > 0) {
|
|
1572
1611
|
const s = r[r.length - 1];
|
|
1573
|
-
|
|
1612
|
+
it(s, o) || a.push({
|
|
1574
1613
|
ruleId: "nested-interactive",
|
|
1575
1614
|
selector: c(o),
|
|
1576
1615
|
html: l(o),
|
|
@@ -1578,13 +1617,13 @@ const tt = {
|
|
|
1578
1617
|
message: `Interactive element <${o.tagName.toLowerCase()}> is nested inside <${s.tagName.toLowerCase()}>.`
|
|
1579
1618
|
});
|
|
1580
1619
|
}
|
|
1581
|
-
|
|
1620
|
+
rt(o) && r.push(o);
|
|
1582
1621
|
}
|
|
1583
1622
|
o = n.nextNode();
|
|
1584
1623
|
}
|
|
1585
1624
|
return a;
|
|
1586
1625
|
}
|
|
1587
|
-
},
|
|
1626
|
+
}, st = {
|
|
1588
1627
|
id: "scrollable-region-focusable",
|
|
1589
1628
|
wcag: ["2.1.1"],
|
|
1590
1629
|
level: "A",
|
|
@@ -1595,12 +1634,10 @@ const tt = {
|
|
|
1595
1634
|
const a = [];
|
|
1596
1635
|
for (const e of t.querySelectorAll("*")) {
|
|
1597
1636
|
if (m(e) || !(e instanceof HTMLElement)) continue;
|
|
1598
|
-
const i =
|
|
1599
|
-
if (!n) continue;
|
|
1600
|
-
const
|
|
1601
|
-
|
|
1602
|
-
const h = e.getAttribute("tabindex");
|
|
1603
|
-
h !== null && h !== "-1" || e.querySelector(
|
|
1637
|
+
const i = C(e), n = i.overflowX, r = i.overflowY;
|
|
1638
|
+
if (!(n === "scroll" || n === "auto" || r === "scroll" || r === "auto") || !(e.scrollHeight > e.clientHeight || e.scrollWidth > e.clientWidth)) continue;
|
|
1639
|
+
const u = e.getAttribute("tabindex");
|
|
1640
|
+
u !== null && u !== "-1" || e.querySelector(
|
|
1604
1641
|
'a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'
|
|
1605
1642
|
) || a.push({
|
|
1606
1643
|
ruleId: "scrollable-region-focusable",
|
|
@@ -1612,7 +1649,7 @@ const tt = {
|
|
|
1612
1649
|
}
|
|
1613
1650
|
return a;
|
|
1614
1651
|
}
|
|
1615
|
-
},
|
|
1652
|
+
}, lt = {
|
|
1616
1653
|
id: "accesskeys",
|
|
1617
1654
|
wcag: [],
|
|
1618
1655
|
level: "A",
|
|
@@ -1642,7 +1679,7 @@ const tt = {
|
|
|
1642
1679
|
});
|
|
1643
1680
|
return a;
|
|
1644
1681
|
}
|
|
1645
|
-
},
|
|
1682
|
+
}, ct = {
|
|
1646
1683
|
id: "heading-order",
|
|
1647
1684
|
wcag: [],
|
|
1648
1685
|
level: "A",
|
|
@@ -1667,7 +1704,7 @@ const tt = {
|
|
|
1667
1704
|
}
|
|
1668
1705
|
return a;
|
|
1669
1706
|
}
|
|
1670
|
-
}, L = 'article, aside, main, nav, section, [role="article"], [role="complementary"], [role="main"], [role="navigation"], [role="region"]',
|
|
1707
|
+
}, L = 'article, aside, main, nav, section, [role="article"], [role="complementary"], [role="main"], [role="navigation"], [role="region"]', G = 'main, [role="main"], header, [role="banner"], footer, [role="contentinfo"], nav, [role="navigation"], aside, [role="complementary"], section[aria-label], section[aria-labelledby], [role="region"][aria-label], [role="region"][aria-labelledby], form[aria-label], form[aria-labelledby], [role="form"][aria-label], [role="form"][aria-labelledby], [role="search"]', dt = {
|
|
1671
1708
|
id: "landmark-one-main",
|
|
1672
1709
|
wcag: [],
|
|
1673
1710
|
level: "A",
|
|
@@ -1691,7 +1728,7 @@ const tt = {
|
|
|
1691
1728
|
message: "Page has multiple main landmarks."
|
|
1692
1729
|
})) : [];
|
|
1693
1730
|
}
|
|
1694
|
-
},
|
|
1731
|
+
}, ut = {
|
|
1695
1732
|
id: "landmark-no-duplicate-banner",
|
|
1696
1733
|
wcag: [],
|
|
1697
1734
|
level: "A",
|
|
@@ -1711,7 +1748,7 @@ const tt = {
|
|
|
1711
1748
|
})
|
|
1712
1749
|
), a;
|
|
1713
1750
|
}
|
|
1714
|
-
},
|
|
1751
|
+
}, mt = {
|
|
1715
1752
|
id: "landmark-no-duplicate-contentinfo",
|
|
1716
1753
|
wcag: [],
|
|
1717
1754
|
level: "A",
|
|
@@ -1731,7 +1768,7 @@ const tt = {
|
|
|
1731
1768
|
})
|
|
1732
1769
|
), a;
|
|
1733
1770
|
}
|
|
1734
|
-
},
|
|
1771
|
+
}, pt = {
|
|
1735
1772
|
id: "landmark-no-duplicate-main",
|
|
1736
1773
|
wcag: [],
|
|
1737
1774
|
level: "A",
|
|
@@ -1751,7 +1788,7 @@ const tt = {
|
|
|
1751
1788
|
})
|
|
1752
1789
|
), a;
|
|
1753
1790
|
}
|
|
1754
|
-
},
|
|
1791
|
+
}, ht = {
|
|
1755
1792
|
id: "landmark-banner-is-top-level",
|
|
1756
1793
|
wcag: [],
|
|
1757
1794
|
level: "A",
|
|
@@ -1771,7 +1808,7 @@ const tt = {
|
|
|
1771
1808
|
});
|
|
1772
1809
|
return a;
|
|
1773
1810
|
}
|
|
1774
|
-
},
|
|
1811
|
+
}, gt = {
|
|
1775
1812
|
id: "landmark-contentinfo-is-top-level",
|
|
1776
1813
|
wcag: [],
|
|
1777
1814
|
level: "A",
|
|
@@ -1791,7 +1828,7 @@ const tt = {
|
|
|
1791
1828
|
});
|
|
1792
1829
|
return a;
|
|
1793
1830
|
}
|
|
1794
|
-
},
|
|
1831
|
+
}, bt = {
|
|
1795
1832
|
id: "landmark-main-is-top-level",
|
|
1796
1833
|
wcag: [],
|
|
1797
1834
|
level: "A",
|
|
@@ -1813,7 +1850,7 @@ const tt = {
|
|
|
1813
1850
|
}
|
|
1814
1851
|
return a;
|
|
1815
1852
|
}
|
|
1816
|
-
},
|
|
1853
|
+
}, ft = {
|
|
1817
1854
|
id: "landmark-complementary-is-top-level",
|
|
1818
1855
|
wcag: [],
|
|
1819
1856
|
level: "A",
|
|
@@ -1835,7 +1872,7 @@ const tt = {
|
|
|
1835
1872
|
}
|
|
1836
1873
|
return a;
|
|
1837
1874
|
}
|
|
1838
|
-
},
|
|
1875
|
+
}, vt = {
|
|
1839
1876
|
id: "landmark-unique",
|
|
1840
1877
|
wcag: [],
|
|
1841
1878
|
level: "A",
|
|
@@ -1871,7 +1908,7 @@ const tt = {
|
|
|
1871
1908
|
}
|
|
1872
1909
|
return a;
|
|
1873
1910
|
}
|
|
1874
|
-
},
|
|
1911
|
+
}, yt = {
|
|
1875
1912
|
id: "region",
|
|
1876
1913
|
wcag: [],
|
|
1877
1914
|
level: "A",
|
|
@@ -1885,8 +1922,8 @@ const tt = {
|
|
|
1885
1922
|
if (!e) return [];
|
|
1886
1923
|
for (const n of e.children) {
|
|
1887
1924
|
if (m(n) || n instanceof HTMLScriptElement || n instanceof HTMLStyleElement || n.tagName === "NOSCRIPT" || n instanceof HTMLElement && n.hidden || n.matches('a[href^="#"]')) continue;
|
|
1888
|
-
const r = n.matches(
|
|
1889
|
-
!r && o && (n.querySelector(
|
|
1925
|
+
const r = n.matches(G), o = (i = n.textContent) == null ? void 0 : i.trim();
|
|
1926
|
+
!r && o && (n.querySelector(G) || a.push({
|
|
1890
1927
|
ruleId: "region",
|
|
1891
1928
|
selector: c(n),
|
|
1892
1929
|
html: l(n),
|
|
@@ -1896,7 +1933,7 @@ const tt = {
|
|
|
1896
1933
|
}
|
|
1897
1934
|
return a;
|
|
1898
1935
|
}
|
|
1899
|
-
},
|
|
1936
|
+
}, wt = {
|
|
1900
1937
|
id: "list",
|
|
1901
1938
|
selector: "ul, ol",
|
|
1902
1939
|
check: { type: "child-invalid", allowedChildren: ["li", "script", "template"] },
|
|
@@ -1907,7 +1944,7 @@ const tt = {
|
|
|
1907
1944
|
level: "A",
|
|
1908
1945
|
guidance: "Screen readers announce list structure ('list with 5 items') based on proper markup. Placing non-<li> elements directly inside <ul> or <ol> breaks this structure. Wrap content in <li> elements, or if you need wrapper divs for styling, restructure your CSS to style the <li> elements directly.",
|
|
1909
1946
|
prompt: "Explain how to restructure this element within the list properly."
|
|
1910
|
-
},
|
|
1947
|
+
}, At = x(wt), St = {
|
|
1911
1948
|
id: "dlitem",
|
|
1912
1949
|
wcag: ["1.3.1"],
|
|
1913
1950
|
level: "A",
|
|
@@ -1926,7 +1963,7 @@ const tt = {
|
|
|
1926
1963
|
});
|
|
1927
1964
|
return a;
|
|
1928
1965
|
}
|
|
1929
|
-
},
|
|
1966
|
+
}, xt = {
|
|
1930
1967
|
id: "definition-list",
|
|
1931
1968
|
selector: "dl",
|
|
1932
1969
|
check: { type: "child-invalid", allowedChildren: ["dt", "dd", "div", "script", "template"] },
|
|
@@ -1937,7 +1974,7 @@ const tt = {
|
|
|
1937
1974
|
level: "A",
|
|
1938
1975
|
guidance: "Definition lists have strict content requirements. Only <dt> (terms), <dd> (definitions), and <div> (for grouping dt/dd pairs) are valid children. Other elements break the list structure for screen readers. Move invalid elements outside the <dl>, or restructure using proper definition list markup.",
|
|
1939
1976
|
prompt: "Explain whether to move this element outside the <dl> or convert it to dt/dd."
|
|
1940
|
-
},
|
|
1977
|
+
}, kt = x(xt), It = {
|
|
1941
1978
|
id: "document-title",
|
|
1942
1979
|
wcag: ["2.4.2"],
|
|
1943
1980
|
level: "A",
|
|
@@ -1955,7 +1992,7 @@ const tt = {
|
|
|
1955
1992
|
message: a ? "Document <title> element is empty." : "Document is missing a <title> element."
|
|
1956
1993
|
}] : [];
|
|
1957
1994
|
}
|
|
1958
|
-
},
|
|
1995
|
+
}, qt = {
|
|
1959
1996
|
id: "bypass",
|
|
1960
1997
|
wcag: ["2.4.1"],
|
|
1961
1998
|
level: "A",
|
|
@@ -1982,7 +2019,7 @@ const tt = {
|
|
|
1982
2019
|
message: "Page has no mechanism to bypass repeated content. Add a <main> landmark or skip link."
|
|
1983
2020
|
}];
|
|
1984
2021
|
}
|
|
1985
|
-
},
|
|
2022
|
+
}, Ct = {
|
|
1986
2023
|
id: "page-has-heading-one",
|
|
1987
2024
|
wcag: [],
|
|
1988
2025
|
level: "A",
|
|
@@ -2004,7 +2041,7 @@ const tt = {
|
|
|
2004
2041
|
message: "Page does not contain a level-one heading."
|
|
2005
2042
|
}];
|
|
2006
2043
|
}
|
|
2007
|
-
},
|
|
2044
|
+
}, Tt = {
|
|
2008
2045
|
id: "frame-title",
|
|
2009
2046
|
wcag: ["4.1.2"],
|
|
2010
2047
|
level: "A",
|
|
@@ -2025,7 +2062,7 @@ const tt = {
|
|
|
2025
2062
|
}
|
|
2026
2063
|
return a;
|
|
2027
2064
|
}
|
|
2028
|
-
},
|
|
2065
|
+
}, Et = {
|
|
2029
2066
|
id: "frame-title-unique",
|
|
2030
2067
|
wcag: ["4.1.2"],
|
|
2031
2068
|
level: "A",
|
|
@@ -2058,7 +2095,7 @@ const tt = {
|
|
|
2058
2095
|
});
|
|
2059
2096
|
return a;
|
|
2060
2097
|
}
|
|
2061
|
-
},
|
|
2098
|
+
}, Lt = {
|
|
2062
2099
|
id: "empty-heading",
|
|
2063
2100
|
wcag: [],
|
|
2064
2101
|
level: "A",
|
|
@@ -2078,7 +2115,7 @@ const tt = {
|
|
|
2078
2115
|
});
|
|
2079
2116
|
return a;
|
|
2080
2117
|
}
|
|
2081
|
-
},
|
|
2118
|
+
}, Rt = {
|
|
2082
2119
|
id: "meta-viewport",
|
|
2083
2120
|
wcag: ["1.4.4"],
|
|
2084
2121
|
level: "AA",
|
|
@@ -2110,7 +2147,7 @@ const tt = {
|
|
|
2110
2147
|
}
|
|
2111
2148
|
return a;
|
|
2112
2149
|
}
|
|
2113
|
-
},
|
|
2150
|
+
}, Nt = {
|
|
2114
2151
|
id: "meta-refresh",
|
|
2115
2152
|
wcag: ["2.2.1", "2.2.4", "3.2.5"],
|
|
2116
2153
|
level: "A",
|
|
@@ -2145,7 +2182,7 @@ const tt = {
|
|
|
2145
2182
|
}
|
|
2146
2183
|
return a;
|
|
2147
2184
|
}
|
|
2148
|
-
},
|
|
2185
|
+
}, Mt = {
|
|
2149
2186
|
id: "blink",
|
|
2150
2187
|
selector: "blink",
|
|
2151
2188
|
check: { type: "selector-exists" },
|
|
@@ -2156,7 +2193,7 @@ const tt = {
|
|
|
2156
2193
|
level: "A",
|
|
2157
2194
|
guidance: "Blinking content can cause seizures in users with photosensitive epilepsy and is distracting for users with attention disorders. The <blink> element is deprecated and should never be used. If you need to draw attention to content, use less intrusive methods like color, borders, or icons.",
|
|
2158
2195
|
prompt: "Suggest static alternatives to the blinking effect."
|
|
2159
|
-
},
|
|
2196
|
+
}, $t = x(Mt), Ht = {
|
|
2160
2197
|
id: "marquee",
|
|
2161
2198
|
selector: "marquee",
|
|
2162
2199
|
check: { type: "selector-exists" },
|
|
@@ -2167,7 +2204,7 @@ const tt = {
|
|
|
2167
2204
|
level: "A",
|
|
2168
2205
|
guidance: "Scrolling or moving content is difficult for many users to read, especially those with cognitive or visual disabilities. The <marquee> element is deprecated. Replace scrolling text with static content. If content must scroll, provide pause/stop controls and ensure it stops after 5 seconds.",
|
|
2169
2206
|
prompt: "Suggest static alternatives or accessible carousel patterns."
|
|
2170
|
-
},
|
|
2207
|
+
}, Dt = x(Ht), Bt = {
|
|
2171
2208
|
id: "p-as-heading",
|
|
2172
2209
|
wcag: [],
|
|
2173
2210
|
level: "A",
|
|
@@ -2194,7 +2231,7 @@ const tt = {
|
|
|
2194
2231
|
}
|
|
2195
2232
|
return a;
|
|
2196
2233
|
}
|
|
2197
|
-
},
|
|
2234
|
+
}, Ot = {
|
|
2198
2235
|
id: "aria-roles",
|
|
2199
2236
|
wcag: ["4.1.2"],
|
|
2200
2237
|
level: "A",
|
|
@@ -2206,7 +2243,7 @@ const tt = {
|
|
|
2206
2243
|
for (const e of t.querySelectorAll("[role]")) {
|
|
2207
2244
|
const r = e.getAttribute("role").replace(/[\u201C\u201D\u2018\u2019\u00AB\u00BB]/g, "").split(/\s+/);
|
|
2208
2245
|
for (const o of r)
|
|
2209
|
-
if (o && !
|
|
2246
|
+
if (o && !me(o)) {
|
|
2210
2247
|
a.push({
|
|
2211
2248
|
ruleId: "aria-roles",
|
|
2212
2249
|
selector: c(e),
|
|
@@ -2219,7 +2256,7 @@ const tt = {
|
|
|
2219
2256
|
}
|
|
2220
2257
|
return a;
|
|
2221
2258
|
}
|
|
2222
|
-
},
|
|
2259
|
+
}, Wt = {
|
|
2223
2260
|
id: "aria-valid-attr",
|
|
2224
2261
|
wcag: ["4.1.2"],
|
|
2225
2262
|
level: "A",
|
|
@@ -2227,9 +2264,9 @@ const tt = {
|
|
|
2227
2264
|
guidance: "Misspelled ARIA attributes are ignored by assistive technologies. Check the spelling against the WAI-ARIA specification. Common mistakes: aria-labeledby (should be aria-labelledby), aria-role (should be role), aria-description (valid in ARIA 1.3+).",
|
|
2228
2265
|
prompt: "Identify the misspelled attribute and provide the correct spelling.",
|
|
2229
2266
|
run(t) {
|
|
2230
|
-
return
|
|
2267
|
+
return _(t).validAttr;
|
|
2231
2268
|
}
|
|
2232
|
-
},
|
|
2269
|
+
}, _t = {
|
|
2233
2270
|
id: "aria-valid-attr-value",
|
|
2234
2271
|
wcag: ["4.1.2"],
|
|
2235
2272
|
level: "A",
|
|
@@ -2237,9 +2274,9 @@ const tt = {
|
|
|
2237
2274
|
guidance: "Each ARIA attribute accepts specific value types. Boolean attributes (aria-hidden, aria-disabled) accept only 'true' or 'false'. Tristate attributes (aria-checked, aria-pressed) also accept 'mixed'. Token attributes (aria-live, aria-autocomplete) accept predefined values. ID reference attributes (aria-labelledby, aria-describedby) must reference existing element IDs.",
|
|
2238
2275
|
prompt: "Show the invalid value and list the valid values for this specific attribute.",
|
|
2239
2276
|
run(t) {
|
|
2240
|
-
return
|
|
2277
|
+
return _(t).validAttrValue;
|
|
2241
2278
|
}
|
|
2242
|
-
},
|
|
2279
|
+
}, Ft = {
|
|
2243
2280
|
checkbox: ["aria-checked"],
|
|
2244
2281
|
combobox: ["aria-expanded"],
|
|
2245
2282
|
heading: ["aria-level"],
|
|
@@ -2254,7 +2291,7 @@ const tt = {
|
|
|
2254
2291
|
slider: ["aria-valuenow"],
|
|
2255
2292
|
spinbutton: ["aria-valuenow"],
|
|
2256
2293
|
switch: ["aria-checked"]
|
|
2257
|
-
},
|
|
2294
|
+
}, Pt = {
|
|
2258
2295
|
id: "aria-required-attr",
|
|
2259
2296
|
wcag: ["4.1.2"],
|
|
2260
2297
|
level: "A",
|
|
@@ -2264,7 +2301,7 @@ const tt = {
|
|
|
2264
2301
|
run(t) {
|
|
2265
2302
|
const a = [];
|
|
2266
2303
|
for (const e of t.querySelectorAll("[role]")) {
|
|
2267
|
-
const i = e.getAttribute("role").trim().toLowerCase(), n =
|
|
2304
|
+
const i = e.getAttribute("role").trim().toLowerCase(), n = Ft[i];
|
|
2268
2305
|
if (n && !(i === "checkbox" && e instanceof HTMLInputElement && e.type === "checkbox") && !(i === "radio" && e instanceof HTMLInputElement && e.type === "radio") && !(i === "option" && e instanceof HTMLOptionElement) && !(i === "heading" && /^h[1-6]$/i.test(e.tagName))) {
|
|
2269
2306
|
if (i === "separator") {
|
|
2270
2307
|
const r = e.getAttribute("tabindex");
|
|
@@ -2288,7 +2325,7 @@ const tt = {
|
|
|
2288
2325
|
return a;
|
|
2289
2326
|
}
|
|
2290
2327
|
};
|
|
2291
|
-
function
|
|
2328
|
+
function Vt(t) {
|
|
2292
2329
|
var r, o, s;
|
|
2293
2330
|
const a = [], e = t.className;
|
|
2294
2331
|
e && typeof e == "string" && e.trim() && a.push(`Classes: ${e.trim().slice(0, 100)}`);
|
|
@@ -2305,7 +2342,7 @@ function Ot(t) {
|
|
|
2305
2342
|
return a.length > 0 ? a.join(`
|
|
2306
2343
|
`) : void 0;
|
|
2307
2344
|
}
|
|
2308
|
-
const
|
|
2345
|
+
const Ut = {
|
|
2309
2346
|
id: "button-name",
|
|
2310
2347
|
wcag: ["4.1.2"],
|
|
2311
2348
|
level: "A",
|
|
@@ -2322,12 +2359,12 @@ const Wt = {
|
|
|
2322
2359
|
html: l(e),
|
|
2323
2360
|
impact: "critical",
|
|
2324
2361
|
message: "Button has no discernible text.",
|
|
2325
|
-
context:
|
|
2362
|
+
context: Vt(e)
|
|
2326
2363
|
});
|
|
2327
2364
|
}
|
|
2328
2365
|
return a;
|
|
2329
2366
|
}
|
|
2330
|
-
},
|
|
2367
|
+
}, jt = {
|
|
2331
2368
|
alert: /* @__PURE__ */ new Set(["aria-atomic", "aria-busy", "aria-live", "aria-relevant"]),
|
|
2332
2369
|
alertdialog: /* @__PURE__ */ new Set(["aria-describedby", "aria-modal"]),
|
|
2333
2370
|
application: /* @__PURE__ */ new Set(["aria-activedescendant", "aria-disabled", "aria-errormessage", "aria-expanded", "aria-haspopup", "aria-invalid"]),
|
|
@@ -2399,7 +2436,7 @@ const Wt = {
|
|
|
2399
2436
|
tree: /* @__PURE__ */ new Set(["aria-activedescendant", "aria-disabled", "aria-errormessage", "aria-invalid", "aria-multiselectable", "aria-orientation", "aria-required"]),
|
|
2400
2437
|
treegrid: /* @__PURE__ */ new Set(["aria-activedescendant", "aria-colcount", "aria-disabled", "aria-errormessage", "aria-invalid", "aria-multiselectable", "aria-orientation", "aria-readonly", "aria-required", "aria-rowcount"]),
|
|
2401
2438
|
treeitem: /* @__PURE__ */ new Set(["aria-checked", "aria-disabled", "aria-expanded", "aria-haspopup", "aria-level", "aria-posinset", "aria-selected", "aria-setsize"])
|
|
2402
|
-
},
|
|
2439
|
+
}, zt = /* @__PURE__ */ new Set([
|
|
2403
2440
|
"aria-atomic",
|
|
2404
2441
|
"aria-busy",
|
|
2405
2442
|
"aria-controls",
|
|
@@ -2423,7 +2460,7 @@ const Wt = {
|
|
|
2423
2460
|
"aria-roledescription",
|
|
2424
2461
|
"aria-braillelabel",
|
|
2425
2462
|
"aria-brailleroledescription"
|
|
2426
|
-
]),
|
|
2463
|
+
]), Gt = {
|
|
2427
2464
|
id: "aria-allowed-attr",
|
|
2428
2465
|
wcag: ["4.1.2"],
|
|
2429
2466
|
level: "A",
|
|
@@ -2434,12 +2471,12 @@ const Wt = {
|
|
|
2434
2471
|
const a = [];
|
|
2435
2472
|
for (const e of t.querySelectorAll("[role], [aria-*]")) {
|
|
2436
2473
|
if (m(e)) continue;
|
|
2437
|
-
const i =
|
|
2474
|
+
const i = E(e);
|
|
2438
2475
|
if (!i) continue;
|
|
2439
|
-
const n =
|
|
2476
|
+
const n = jt[i];
|
|
2440
2477
|
if (n)
|
|
2441
2478
|
for (const r of e.attributes)
|
|
2442
|
-
r.name.startsWith("aria-") && (
|
|
2479
|
+
r.name.startsWith("aria-") && (zt.has(r.name) || n.has(r.name) || a.push({
|
|
2443
2480
|
ruleId: "aria-allowed-attr",
|
|
2444
2481
|
selector: c(e),
|
|
2445
2482
|
html: l(e),
|
|
@@ -2449,7 +2486,7 @@ const Wt = {
|
|
|
2449
2486
|
}
|
|
2450
2487
|
return a;
|
|
2451
2488
|
}
|
|
2452
|
-
},
|
|
2489
|
+
}, Xt = /* @__PURE__ */ new Set([
|
|
2453
2490
|
"base",
|
|
2454
2491
|
"col",
|
|
2455
2492
|
"colgroup",
|
|
@@ -2571,10 +2608,10 @@ const Wt = {
|
|
|
2571
2608
|
video: /* @__PURE__ */ new Set(["application"]),
|
|
2572
2609
|
wbr: /* @__PURE__ */ new Set(["none", "presentation"])
|
|
2573
2610
|
};
|
|
2574
|
-
function
|
|
2611
|
+
function Kt(t) {
|
|
2575
2612
|
var e;
|
|
2576
2613
|
const a = t.tagName.toLowerCase();
|
|
2577
|
-
if (
|
|
2614
|
+
if (Xt.has(a))
|
|
2578
2615
|
return "none";
|
|
2579
2616
|
if (a === "a" && t.hasAttribute("href"))
|
|
2580
2617
|
return k["a[href]"];
|
|
@@ -2586,7 +2623,7 @@ function Ut(t) {
|
|
|
2586
2623
|
}
|
|
2587
2624
|
return k[a] || "any";
|
|
2588
2625
|
}
|
|
2589
|
-
const
|
|
2626
|
+
const Yt = {
|
|
2590
2627
|
id: "aria-allowed-role",
|
|
2591
2628
|
wcag: ["4.1.2"],
|
|
2592
2629
|
level: "A",
|
|
@@ -2600,9 +2637,9 @@ const jt = {
|
|
|
2600
2637
|
if (m(i)) continue;
|
|
2601
2638
|
const n = (e = i.getAttribute("role")) == null ? void 0 : e.trim().toLowerCase();
|
|
2602
2639
|
if (!n) continue;
|
|
2603
|
-
const r =
|
|
2640
|
+
const r = J(i);
|
|
2604
2641
|
if (r && n === r) continue;
|
|
2605
|
-
const o =
|
|
2642
|
+
const o = Kt(i);
|
|
2606
2643
|
o === "none" ? a.push({
|
|
2607
2644
|
ruleId: "aria-allowed-role",
|
|
2608
2645
|
selector: c(i),
|
|
@@ -2619,7 +2656,7 @@ const jt = {
|
|
|
2619
2656
|
}
|
|
2620
2657
|
return a;
|
|
2621
2658
|
}
|
|
2622
|
-
},
|
|
2659
|
+
}, X = {
|
|
2623
2660
|
// Each array is an OR group - at least one of each inner array must be present
|
|
2624
2661
|
combobox: [["listbox", "tree", "grid", "dialog", "textbox"]],
|
|
2625
2662
|
// Must own/contain one of these
|
|
@@ -2636,7 +2673,7 @@ const jt = {
|
|
|
2636
2673
|
tablist: [["tab"]],
|
|
2637
2674
|
tree: [["treeitem", "group"]],
|
|
2638
2675
|
treegrid: [["row", "rowgroup"]]
|
|
2639
|
-
},
|
|
2676
|
+
}, K = {
|
|
2640
2677
|
caption: ["figure", "table", "grid", "treegrid"],
|
|
2641
2678
|
// cell/gridcell/columnheader/rowheader must be in a row
|
|
2642
2679
|
// but we skip checking native td/th since they're handled by HTML semantics
|
|
@@ -2650,17 +2687,17 @@ const jt = {
|
|
|
2650
2687
|
tab: ["tablist"],
|
|
2651
2688
|
treeitem: ["tree", "group"]
|
|
2652
2689
|
};
|
|
2653
|
-
function
|
|
2690
|
+
function Qt(t, a) {
|
|
2654
2691
|
var r;
|
|
2655
2692
|
const e = ((r = t.getAttribute("aria-owns")) == null ? void 0 : r.split(/\s+/)) || [], i = t.ownerDocument, n = /* @__PURE__ */ new Set();
|
|
2656
2693
|
for (const o of t.querySelectorAll("*")) {
|
|
2657
|
-
const s =
|
|
2694
|
+
const s = E(o);
|
|
2658
2695
|
s && !m(o) && n.add(s);
|
|
2659
2696
|
}
|
|
2660
2697
|
for (const o of e) {
|
|
2661
2698
|
const s = i.getElementById(o);
|
|
2662
2699
|
if (s) {
|
|
2663
|
-
const u =
|
|
2700
|
+
const u = E(s);
|
|
2664
2701
|
u && !m(s) && n.add(u);
|
|
2665
2702
|
}
|
|
2666
2703
|
}
|
|
@@ -2668,7 +2705,7 @@ function zt(t, a) {
|
|
|
2668
2705
|
if (!o.some((u) => n.has(u))) return !1;
|
|
2669
2706
|
return !0;
|
|
2670
2707
|
}
|
|
2671
|
-
const
|
|
2708
|
+
const Jt = {
|
|
2672
2709
|
id: "aria-required-children",
|
|
2673
2710
|
wcag: ["4.1.2"],
|
|
2674
2711
|
level: "A",
|
|
@@ -2681,9 +2718,9 @@ const Gt = {
|
|
|
2681
2718
|
for (const i of t.querySelectorAll("[role]")) {
|
|
2682
2719
|
if (m(i)) continue;
|
|
2683
2720
|
const n = (e = i.getAttribute("role")) == null ? void 0 : e.trim().toLowerCase();
|
|
2684
|
-
if (!n || !(n in
|
|
2685
|
-
const r =
|
|
2686
|
-
if (!
|
|
2721
|
+
if (!n || !(n in X)) continue;
|
|
2722
|
+
const r = X[n];
|
|
2723
|
+
if (!Qt(i, r)) {
|
|
2687
2724
|
const o = r.map((s) => s.join(" or ")).join(", ");
|
|
2688
2725
|
a.push({
|
|
2689
2726
|
ruleId: "aria-required-children",
|
|
@@ -2696,7 +2733,7 @@ const Gt = {
|
|
|
2696
2733
|
}
|
|
2697
2734
|
return a;
|
|
2698
2735
|
}
|
|
2699
|
-
},
|
|
2736
|
+
}, Zt = {
|
|
2700
2737
|
id: "aria-required-parent",
|
|
2701
2738
|
wcag: ["4.1.2"],
|
|
2702
2739
|
level: "A",
|
|
@@ -2709,11 +2746,11 @@ const Gt = {
|
|
|
2709
2746
|
for (const i of t.querySelectorAll("[role]")) {
|
|
2710
2747
|
if (m(i)) continue;
|
|
2711
2748
|
const n = (e = i.getAttribute("role")) == null ? void 0 : e.trim().toLowerCase();
|
|
2712
|
-
if (!n || !(n in
|
|
2713
|
-
const r =
|
|
2749
|
+
if (!n || !(n in K)) continue;
|
|
2750
|
+
const r = K[n];
|
|
2714
2751
|
let o = i.parentElement, s = !1;
|
|
2715
2752
|
for (; o && o !== t.documentElement; ) {
|
|
2716
|
-
const u =
|
|
2753
|
+
const u = E(o);
|
|
2717
2754
|
if (u && r.includes(u)) {
|
|
2718
2755
|
s = !0;
|
|
2719
2756
|
break;
|
|
@@ -2730,7 +2767,7 @@ const Gt = {
|
|
|
2730
2767
|
}
|
|
2731
2768
|
return a;
|
|
2732
2769
|
}
|
|
2733
|
-
},
|
|
2770
|
+
}, ea = [
|
|
2734
2771
|
"a[href]",
|
|
2735
2772
|
"button:not([disabled])",
|
|
2736
2773
|
'input:not([disabled]):not([type="hidden"])',
|
|
@@ -2746,7 +2783,7 @@ const Gt = {
|
|
|
2746
2783
|
"embed",
|
|
2747
2784
|
"area[href]"
|
|
2748
2785
|
].join(", ");
|
|
2749
|
-
function
|
|
2786
|
+
function ta(t) {
|
|
2750
2787
|
let a = t;
|
|
2751
2788
|
const e = t.ownerDocument, i = e.defaultView;
|
|
2752
2789
|
for (; a && a !== e.body; ) {
|
|
@@ -2759,7 +2796,7 @@ function Yt(t) {
|
|
|
2759
2796
|
}
|
|
2760
2797
|
return !0;
|
|
2761
2798
|
}
|
|
2762
|
-
const
|
|
2799
|
+
const aa = {
|
|
2763
2800
|
id: "aria-hidden-body",
|
|
2764
2801
|
selector: 'body[aria-hidden="true"]',
|
|
2765
2802
|
check: { type: "selector-exists" },
|
|
@@ -2771,7 +2808,7 @@ const Qt = {
|
|
|
2771
2808
|
guidance: "Setting aria-hidden='true' on the body element hides all page content from assistive technologies, making the page completely inaccessible to screen reader users. Remove aria-hidden from the body element. If you need to hide content temporarily (e.g., behind a modal), use aria-hidden on specific sections instead.",
|
|
2772
2809
|
prompt: "Instruct to remove aria-hidden='true' from the body element.",
|
|
2773
2810
|
skipAriaHidden: !1
|
|
2774
|
-
},
|
|
2811
|
+
}, ia = x(aa), na = {
|
|
2775
2812
|
id: "aria-hidden-focus",
|
|
2776
2813
|
wcag: ["4.1.2"],
|
|
2777
2814
|
level: "A",
|
|
@@ -2782,10 +2819,10 @@ const Qt = {
|
|
|
2782
2819
|
const a = [];
|
|
2783
2820
|
for (const e of t.querySelectorAll('[aria-hidden="true"]')) {
|
|
2784
2821
|
if (e === t.body) continue;
|
|
2785
|
-
const i = e.querySelectorAll(
|
|
2822
|
+
const i = e.querySelectorAll(ea);
|
|
2786
2823
|
for (const n of i)
|
|
2787
2824
|
if (n instanceof HTMLElement) {
|
|
2788
|
-
if (n.getAttribute("tabindex") === "-1" || n.disabled || n instanceof HTMLInputElement && n.type === "hidden" || !
|
|
2825
|
+
if (n.getAttribute("tabindex") === "-1" || n.disabled || n instanceof HTMLInputElement && n.type === "hidden" || !ta(n)) continue;
|
|
2789
2826
|
a.push({
|
|
2790
2827
|
ruleId: "aria-hidden-focus",
|
|
2791
2828
|
selector: c(n),
|
|
@@ -2797,7 +2834,7 @@ const Qt = {
|
|
|
2797
2834
|
}
|
|
2798
2835
|
return a;
|
|
2799
2836
|
}
|
|
2800
|
-
},
|
|
2837
|
+
}, ra = {
|
|
2801
2838
|
id: "aria-command-name",
|
|
2802
2839
|
wcag: ["4.1.2"],
|
|
2803
2840
|
level: "A",
|
|
@@ -2823,7 +2860,7 @@ const Qt = {
|
|
|
2823
2860
|
}
|
|
2824
2861
|
return a;
|
|
2825
2862
|
}
|
|
2826
|
-
},
|
|
2863
|
+
}, oa = {
|
|
2827
2864
|
id: "aria-input-field-name",
|
|
2828
2865
|
wcag: ["4.1.2"],
|
|
2829
2866
|
level: "A",
|
|
@@ -2844,7 +2881,7 @@ const Qt = {
|
|
|
2844
2881
|
}
|
|
2845
2882
|
return a;
|
|
2846
2883
|
}
|
|
2847
|
-
},
|
|
2884
|
+
}, sa = {
|
|
2848
2885
|
id: "aria-toggle-field-name",
|
|
2849
2886
|
wcag: ["4.1.2"],
|
|
2850
2887
|
level: "A",
|
|
@@ -2865,7 +2902,7 @@ const Qt = {
|
|
|
2865
2902
|
}
|
|
2866
2903
|
return a;
|
|
2867
2904
|
}
|
|
2868
|
-
},
|
|
2905
|
+
}, la = {
|
|
2869
2906
|
id: "aria-meter-name",
|
|
2870
2907
|
wcag: ["4.1.2"],
|
|
2871
2908
|
level: "A",
|
|
@@ -2886,7 +2923,7 @@ const Qt = {
|
|
|
2886
2923
|
}
|
|
2887
2924
|
return a;
|
|
2888
2925
|
}
|
|
2889
|
-
},
|
|
2926
|
+
}, ca = {
|
|
2890
2927
|
id: "aria-progressbar-name",
|
|
2891
2928
|
wcag: ["4.1.2"],
|
|
2892
2929
|
level: "A",
|
|
@@ -2907,7 +2944,7 @@ const Qt = {
|
|
|
2907
2944
|
}
|
|
2908
2945
|
return a;
|
|
2909
2946
|
}
|
|
2910
|
-
},
|
|
2947
|
+
}, da = {
|
|
2911
2948
|
id: "aria-dialog-name",
|
|
2912
2949
|
wcag: ["4.1.2"],
|
|
2913
2950
|
level: "A",
|
|
@@ -2928,7 +2965,7 @@ const Qt = {
|
|
|
2928
2965
|
}
|
|
2929
2966
|
return a;
|
|
2930
2967
|
}
|
|
2931
|
-
},
|
|
2968
|
+
}, ua = {
|
|
2932
2969
|
id: "aria-tooltip-name",
|
|
2933
2970
|
wcag: ["4.1.2"],
|
|
2934
2971
|
level: "A",
|
|
@@ -2949,7 +2986,7 @@ const Qt = {
|
|
|
2949
2986
|
}
|
|
2950
2987
|
return a;
|
|
2951
2988
|
}
|
|
2952
|
-
},
|
|
2989
|
+
}, ma = {
|
|
2953
2990
|
id: "aria-treeitem-name",
|
|
2954
2991
|
wcag: ["4.1.2"],
|
|
2955
2992
|
level: "A",
|
|
@@ -2970,7 +3007,7 @@ const Qt = {
|
|
|
2970
3007
|
}
|
|
2971
3008
|
return a;
|
|
2972
3009
|
}
|
|
2973
|
-
},
|
|
3010
|
+
}, pa = {
|
|
2974
3011
|
id: "aria-prohibited-attr",
|
|
2975
3012
|
wcag: ["4.1.2"],
|
|
2976
3013
|
level: "A",
|
|
@@ -2978,16 +3015,16 @@ const Qt = {
|
|
|
2978
3015
|
guidance: "Some ARIA roles prohibit certain attributes. For example, roles like 'none', 'presentation', 'generic', and text-level roles (code, emphasis, strong) prohibit aria-label and aria-labelledby because naming is not supported for these roles. Remove the prohibited attributes or change the role.",
|
|
2979
3016
|
prompt: "Identify the prohibited attribute and recommend removing it from this element.",
|
|
2980
3017
|
run(t) {
|
|
2981
|
-
return
|
|
3018
|
+
return _(t).prohibitedAttr;
|
|
2982
3019
|
}
|
|
2983
|
-
},
|
|
3020
|
+
}, ha = [
|
|
2984
3021
|
"a[href]",
|
|
2985
3022
|
"button:not([disabled])",
|
|
2986
3023
|
'input:not([disabled]):not([type="hidden"])',
|
|
2987
3024
|
"select:not([disabled])",
|
|
2988
3025
|
"textarea:not([disabled])",
|
|
2989
3026
|
'[tabindex]:not([tabindex="-1"])'
|
|
2990
|
-
].join(", "),
|
|
3027
|
+
].join(", "), ga = [
|
|
2991
3028
|
"aria-atomic",
|
|
2992
3029
|
"aria-busy",
|
|
2993
3030
|
"aria-controls",
|
|
@@ -3001,7 +3038,7 @@ const Qt = {
|
|
|
3001
3038
|
"aria-live",
|
|
3002
3039
|
"aria-owns",
|
|
3003
3040
|
"aria-relevant"
|
|
3004
|
-
],
|
|
3041
|
+
], ba = {
|
|
3005
3042
|
id: "presentation-role-conflict",
|
|
3006
3043
|
wcag: ["4.1.2"],
|
|
3007
3044
|
level: "A",
|
|
@@ -3013,8 +3050,8 @@ const Qt = {
|
|
|
3013
3050
|
for (const e of t.querySelectorAll('[role="presentation"], [role="none"]')) {
|
|
3014
3051
|
if (m(e)) continue;
|
|
3015
3052
|
const i = [];
|
|
3016
|
-
e.matches(
|
|
3017
|
-
for (const n of
|
|
3053
|
+
e.matches(ha) && i.push("element is focusable");
|
|
3054
|
+
for (const n of ga)
|
|
3018
3055
|
if (e.hasAttribute(n)) {
|
|
3019
3056
|
i.push(`has ${n}`);
|
|
3020
3057
|
break;
|
|
@@ -3029,7 +3066,7 @@ const Qt = {
|
|
|
3029
3066
|
}
|
|
3030
3067
|
return a;
|
|
3031
3068
|
}
|
|
3032
|
-
},
|
|
3069
|
+
}, fa = {
|
|
3033
3070
|
id: "summary-name",
|
|
3034
3071
|
wcag: ["4.1.2"],
|
|
3035
3072
|
level: "A",
|
|
@@ -3051,7 +3088,7 @@ const Qt = {
|
|
|
3051
3088
|
return a;
|
|
3052
3089
|
}
|
|
3053
3090
|
};
|
|
3054
|
-
function
|
|
3091
|
+
function va(t) {
|
|
3055
3092
|
var n, r;
|
|
3056
3093
|
const a = [], e = t.getAttribute("href");
|
|
3057
3094
|
e && a.push(`href: ${e}`);
|
|
@@ -3068,7 +3105,7 @@ function pa(t) {
|
|
|
3068
3105
|
return a.length > 0 ? a.join(`
|
|
3069
3106
|
`) : void 0;
|
|
3070
3107
|
}
|
|
3071
|
-
const
|
|
3108
|
+
const ya = {
|
|
3072
3109
|
id: "link-name",
|
|
3073
3110
|
wcag: ["2.4.4", "4.1.2"],
|
|
3074
3111
|
level: "A",
|
|
@@ -3085,12 +3122,12 @@ const ha = {
|
|
|
3085
3122
|
html: l(e),
|
|
3086
3123
|
impact: "serious",
|
|
3087
3124
|
message: "Link has no discernible text.",
|
|
3088
|
-
context:
|
|
3125
|
+
context: va(e)
|
|
3089
3126
|
});
|
|
3090
3127
|
}
|
|
3091
3128
|
return a;
|
|
3092
3129
|
}
|
|
3093
|
-
},
|
|
3130
|
+
}, wa = {
|
|
3094
3131
|
id: "skip-link",
|
|
3095
3132
|
wcag: ["2.4.1"],
|
|
3096
3133
|
level: "A",
|
|
@@ -3116,7 +3153,7 @@ const ha = {
|
|
|
3116
3153
|
}
|
|
3117
3154
|
return a;
|
|
3118
3155
|
}
|
|
3119
|
-
},
|
|
3156
|
+
}, Aa = {
|
|
3120
3157
|
id: "link-in-text-block",
|
|
3121
3158
|
wcag: ["1.4.1"],
|
|
3122
3159
|
level: "A",
|
|
@@ -3143,7 +3180,7 @@ const ha = {
|
|
|
3143
3180
|
}
|
|
3144
3181
|
return a;
|
|
3145
3182
|
}
|
|
3146
|
-
},
|
|
3183
|
+
}, Sa = {
|
|
3147
3184
|
id: "html-has-lang",
|
|
3148
3185
|
wcag: ["3.1.1"],
|
|
3149
3186
|
level: "A",
|
|
@@ -3161,7 +3198,7 @@ const ha = {
|
|
|
3161
3198
|
message: "<html> element missing lang attribute."
|
|
3162
3199
|
}];
|
|
3163
3200
|
}
|
|
3164
|
-
},
|
|
3201
|
+
}, re = /^[a-z]{2,3}(-[a-z0-9]{2,8})*$/i, xa = {
|
|
3165
3202
|
id: "html-lang-valid",
|
|
3166
3203
|
wcag: ["3.1.1"],
|
|
3167
3204
|
level: "A",
|
|
@@ -3171,7 +3208,7 @@ const ha = {
|
|
|
3171
3208
|
run(t) {
|
|
3172
3209
|
var e;
|
|
3173
3210
|
const a = (e = t.documentElement.getAttribute("lang")) == null ? void 0 : e.trim();
|
|
3174
|
-
return a && !
|
|
3211
|
+
return a && !re.test(a) ? [{
|
|
3175
3212
|
ruleId: "html-lang-valid",
|
|
3176
3213
|
selector: "html",
|
|
3177
3214
|
html: l(t.documentElement),
|
|
@@ -3179,7 +3216,7 @@ const ha = {
|
|
|
3179
3216
|
message: `Invalid lang attribute value "${a}".`
|
|
3180
3217
|
}] : [];
|
|
3181
3218
|
}
|
|
3182
|
-
},
|
|
3219
|
+
}, ka = {
|
|
3183
3220
|
id: "valid-lang",
|
|
3184
3221
|
wcag: ["3.1.2"],
|
|
3185
3222
|
level: "AA",
|
|
@@ -3192,7 +3229,7 @@ const ha = {
|
|
|
3192
3229
|
for (const i of t.querySelectorAll("[lang]")) {
|
|
3193
3230
|
if (m(i) || i === t.documentElement) continue;
|
|
3194
3231
|
const n = (e = i.getAttribute("lang")) == null ? void 0 : e.trim();
|
|
3195
|
-
n && !
|
|
3232
|
+
n && !re.test(n) && a.push({
|
|
3196
3233
|
ruleId: "valid-lang",
|
|
3197
3234
|
selector: c(i),
|
|
3198
3235
|
html: l(i),
|
|
@@ -3202,7 +3239,7 @@ const ha = {
|
|
|
3202
3239
|
}
|
|
3203
3240
|
return a;
|
|
3204
3241
|
}
|
|
3205
|
-
},
|
|
3242
|
+
}, Ia = {
|
|
3206
3243
|
id: "html-xml-lang-mismatch",
|
|
3207
3244
|
wcag: ["3.1.1"],
|
|
3208
3245
|
level: "A",
|
|
@@ -3225,7 +3262,7 @@ const ha = {
|
|
|
3225
3262
|
}
|
|
3226
3263
|
return [];
|
|
3227
3264
|
}
|
|
3228
|
-
},
|
|
3265
|
+
}, qa = {
|
|
3229
3266
|
id: "td-headers-attr",
|
|
3230
3267
|
wcag: ["1.3.1"],
|
|
3231
3268
|
level: "A",
|
|
@@ -3253,7 +3290,7 @@ const ha = {
|
|
|
3253
3290
|
}
|
|
3254
3291
|
return a;
|
|
3255
3292
|
}
|
|
3256
|
-
},
|
|
3293
|
+
}, Ca = {
|
|
3257
3294
|
id: "th-has-data-cells",
|
|
3258
3295
|
wcag: ["1.3.1"],
|
|
3259
3296
|
level: "A",
|
|
@@ -3275,7 +3312,7 @@ const ha = {
|
|
|
3275
3312
|
}
|
|
3276
3313
|
return a;
|
|
3277
3314
|
}
|
|
3278
|
-
},
|
|
3315
|
+
}, Ta = {
|
|
3279
3316
|
id: "td-has-header",
|
|
3280
3317
|
wcag: ["1.3.1"],
|
|
3281
3318
|
level: "A",
|
|
@@ -3305,9 +3342,9 @@ const ha = {
|
|
|
3305
3342
|
if (!g) continue;
|
|
3306
3343
|
const f = g.querySelector("th") !== null, v = Array.from(g.children).indexOf(p);
|
|
3307
3344
|
let y = !1;
|
|
3308
|
-
const
|
|
3309
|
-
if (
|
|
3310
|
-
const A =
|
|
3345
|
+
const T = n.querySelector("thead");
|
|
3346
|
+
if (T) {
|
|
3347
|
+
const A = T.querySelector("tr");
|
|
3311
3348
|
A && ((e = A.querySelectorAll("th, td")[v]) == null ? void 0 : e.tagName.toLowerCase()) === "th" && (y = !0);
|
|
3312
3349
|
}
|
|
3313
3350
|
if (!y) {
|
|
@@ -3328,7 +3365,7 @@ const ha = {
|
|
|
3328
3365
|
}
|
|
3329
3366
|
return a;
|
|
3330
3367
|
}
|
|
3331
|
-
},
|
|
3368
|
+
}, Ea = {
|
|
3332
3369
|
id: "scope-attr-valid",
|
|
3333
3370
|
wcag: ["1.3.1"],
|
|
3334
3371
|
level: "A",
|
|
@@ -3351,7 +3388,7 @@ const ha = {
|
|
|
3351
3388
|
}
|
|
3352
3389
|
return a;
|
|
3353
3390
|
}
|
|
3354
|
-
},
|
|
3391
|
+
}, La = {
|
|
3355
3392
|
id: "empty-table-header",
|
|
3356
3393
|
wcag: [],
|
|
3357
3394
|
level: "A",
|
|
@@ -3374,7 +3411,7 @@ const ha = {
|
|
|
3374
3411
|
}
|
|
3375
3412
|
return a;
|
|
3376
3413
|
}
|
|
3377
|
-
}, N = ["aria-labelledby", "aria-describedby", "aria-controls", "aria-owns", "aria-flowto"],
|
|
3414
|
+
}, N = ["aria-labelledby", "aria-describedby", "aria-controls", "aria-owns", "aria-flowto"], Ra = {
|
|
3378
3415
|
id: "duplicate-id-aria",
|
|
3379
3416
|
wcag: ["4.1.2"],
|
|
3380
3417
|
level: "A",
|
|
@@ -3422,7 +3459,7 @@ Referenced by: ${h}` : ""}`
|
|
|
3422
3459
|
}
|
|
3423
3460
|
return a;
|
|
3424
3461
|
}
|
|
3425
|
-
},
|
|
3462
|
+
}, Na = {
|
|
3426
3463
|
id: "video-caption",
|
|
3427
3464
|
wcag: ["1.2.2"],
|
|
3428
3465
|
level: "A",
|
|
@@ -3443,7 +3480,7 @@ Referenced by: ${h}` : ""}`
|
|
|
3443
3480
|
}
|
|
3444
3481
|
return a;
|
|
3445
3482
|
}
|
|
3446
|
-
},
|
|
3483
|
+
}, Ma = {
|
|
3447
3484
|
id: "audio-caption",
|
|
3448
3485
|
wcag: ["1.2.1"],
|
|
3449
3486
|
level: "A",
|
|
@@ -3465,7 +3502,7 @@ Referenced by: ${h}` : ""}`
|
|
|
3465
3502
|
}
|
|
3466
3503
|
return a;
|
|
3467
3504
|
}
|
|
3468
|
-
},
|
|
3505
|
+
}, $a = /* @__PURE__ */ new Set([
|
|
3469
3506
|
"SCRIPT",
|
|
3470
3507
|
"STYLE",
|
|
3471
3508
|
"NOSCRIPT",
|
|
@@ -3481,23 +3518,23 @@ Referenced by: ${h}` : ""}`
|
|
|
3481
3518
|
"BR",
|
|
3482
3519
|
"HR"
|
|
3483
3520
|
]);
|
|
3484
|
-
function
|
|
3521
|
+
function Y([t, a, e]) {
|
|
3485
3522
|
return "#" + [t, a, e].map((i) => i.toString(16).padStart(2, "0")).join("");
|
|
3486
3523
|
}
|
|
3487
|
-
function
|
|
3524
|
+
function Ha(t) {
|
|
3488
3525
|
return t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof HTMLSelectElement || t instanceof HTMLButtonElement ? t.disabled : !!t.closest("fieldset[disabled]");
|
|
3489
3526
|
}
|
|
3490
|
-
function
|
|
3527
|
+
function Da(t) {
|
|
3528
|
+
if (m(t)) return !0;
|
|
3491
3529
|
let a = t;
|
|
3492
3530
|
for (; a; ) {
|
|
3493
|
-
|
|
3494
|
-
const e = E(a);
|
|
3531
|
+
const e = C(a);
|
|
3495
3532
|
if (e.display === "none" || e.visibility === "hidden") return !0;
|
|
3496
3533
|
a = a.parentElement;
|
|
3497
3534
|
}
|
|
3498
3535
|
return !1;
|
|
3499
3536
|
}
|
|
3500
|
-
const
|
|
3537
|
+
const Ba = {
|
|
3501
3538
|
id: "color-contrast",
|
|
3502
3539
|
wcag: ["1.4.3"],
|
|
3503
3540
|
level: "AA",
|
|
@@ -3512,138 +3549,138 @@ const Na = {
|
|
|
3512
3549
|
for (; r = i.nextNode(); ) {
|
|
3513
3550
|
if (!r.textContent || !r.textContent.trim()) continue;
|
|
3514
3551
|
const o = r.parentElement;
|
|
3515
|
-
if (!o || n.has(o) || (n.add(o),
|
|
3516
|
-
const s =
|
|
3552
|
+
if (!o || n.has(o) || (n.add(o), $a.has(o.tagName)) || Ha(o) || Da(o)) continue;
|
|
3553
|
+
const s = C(o);
|
|
3517
3554
|
if (parseFloat(s.opacity) === 0) continue;
|
|
3518
|
-
const u =
|
|
3555
|
+
const u = ne(s.color);
|
|
3519
3556
|
if (!u) continue;
|
|
3520
3557
|
const h = s.color.match(/rgba\(.+?,\s*([\d.]+)\s*\)/);
|
|
3521
3558
|
if (h && parseFloat(h[1]) === 0) continue;
|
|
3522
|
-
const d =
|
|
3559
|
+
const d = Ie(o);
|
|
3523
3560
|
if (!d) continue;
|
|
3524
|
-
const p =
|
|
3561
|
+
const p = U(u[0], u[1], u[2]), g = U(d[0], d[1], d[2]), f = ke(p, g), v = Ce(o) ? 3 : 4.5;
|
|
3525
3562
|
if (f < v) {
|
|
3526
|
-
const y = Math.round(f * 100) / 100,
|
|
3563
|
+
const y = Math.round(f * 100) / 100, T = Y(u), A = Y(d);
|
|
3527
3564
|
a.push({
|
|
3528
3565
|
ruleId: "color-contrast",
|
|
3529
3566
|
selector: c(o),
|
|
3530
3567
|
html: l(o),
|
|
3531
3568
|
impact: "serious",
|
|
3532
3569
|
message: `Insufficient color contrast ratio of ${y}:1 (required ${v}:1).`,
|
|
3533
|
-
context: `foreground: ${
|
|
3570
|
+
context: `foreground: ${T} rgb(${u.join(", ")}), background: ${A} rgb(${d.join(", ")}), ratio: ${y}:1, required: ${v}:1`
|
|
3534
3571
|
});
|
|
3535
3572
|
}
|
|
3536
3573
|
}
|
|
3537
3574
|
return a;
|
|
3538
3575
|
}
|
|
3539
|
-
},
|
|
3576
|
+
}, oe = [
|
|
3540
3577
|
// Document Structure
|
|
3541
|
-
|
|
3542
|
-
At,
|
|
3543
|
-
St,
|
|
3544
|
-
xt,
|
|
3545
|
-
kt,
|
|
3578
|
+
It,
|
|
3546
3579
|
qt,
|
|
3547
3580
|
Ct,
|
|
3581
|
+
Tt,
|
|
3548
3582
|
Et,
|
|
3549
3583
|
Rt,
|
|
3584
|
+
Nt,
|
|
3585
|
+
$t,
|
|
3586
|
+
Dt,
|
|
3550
3587
|
// Images
|
|
3551
|
-
ke,
|
|
3552
|
-
Ie,
|
|
3553
|
-
qe,
|
|
3554
|
-
Ce,
|
|
3555
3588
|
Ee,
|
|
3556
3589
|
Le,
|
|
3557
3590
|
Re,
|
|
3558
3591
|
Ne,
|
|
3592
|
+
$e,
|
|
3593
|
+
He,
|
|
3559
3594
|
De,
|
|
3560
|
-
// Forms
|
|
3561
3595
|
Be,
|
|
3562
|
-
Oe,
|
|
3563
|
-
We,
|
|
3564
3596
|
Fe,
|
|
3597
|
+
// Forms
|
|
3565
3598
|
Pe,
|
|
3566
3599
|
Ve,
|
|
3567
3600
|
Ue,
|
|
3568
|
-
|
|
3569
|
-
|
|
3601
|
+
je,
|
|
3602
|
+
Ge,
|
|
3570
3603
|
Xe,
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
nt,
|
|
3576
|
-
It,
|
|
3577
|
-
Nt,
|
|
3578
|
-
rt,
|
|
3604
|
+
Ke,
|
|
3605
|
+
// Keyboard
|
|
3606
|
+
Qe,
|
|
3607
|
+
Ze,
|
|
3579
3608
|
ot,
|
|
3580
3609
|
st,
|
|
3581
3610
|
lt,
|
|
3611
|
+
// Structure
|
|
3582
3612
|
ct,
|
|
3613
|
+
Lt,
|
|
3614
|
+
Bt,
|
|
3583
3615
|
dt,
|
|
3584
3616
|
ut,
|
|
3585
3617
|
mt,
|
|
3586
3618
|
pt,
|
|
3587
3619
|
ht,
|
|
3620
|
+
gt,
|
|
3588
3621
|
bt,
|
|
3589
3622
|
ft,
|
|
3623
|
+
vt,
|
|
3590
3624
|
yt,
|
|
3625
|
+
At,
|
|
3626
|
+
St,
|
|
3627
|
+
kt,
|
|
3591
3628
|
// ARIA
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
Bt,
|
|
3629
|
+
Ot,
|
|
3630
|
+
Wt,
|
|
3631
|
+
_t,
|
|
3596
3632
|
Pt,
|
|
3597
|
-
jt,
|
|
3598
3633
|
Gt,
|
|
3599
|
-
|
|
3634
|
+
Yt,
|
|
3600
3635
|
Jt,
|
|
3601
3636
|
Zt,
|
|
3602
|
-
ea,
|
|
3603
|
-
ta,
|
|
3604
|
-
aa,
|
|
3605
3637
|
ia,
|
|
3606
3638
|
na,
|
|
3607
3639
|
ra,
|
|
3608
3640
|
oa,
|
|
3609
3641
|
sa,
|
|
3610
3642
|
la,
|
|
3643
|
+
ca,
|
|
3644
|
+
da,
|
|
3611
3645
|
ua,
|
|
3612
|
-
Wt,
|
|
3613
3646
|
ma,
|
|
3614
|
-
|
|
3615
|
-
ha,
|
|
3616
|
-
ga,
|
|
3647
|
+
pa,
|
|
3617
3648
|
ba,
|
|
3618
|
-
|
|
3649
|
+
Ut,
|
|
3619
3650
|
fa,
|
|
3620
|
-
|
|
3651
|
+
// Links
|
|
3621
3652
|
ya,
|
|
3622
3653
|
wa,
|
|
3623
|
-
// Tables
|
|
3624
3654
|
Aa,
|
|
3655
|
+
// Language
|
|
3625
3656
|
Sa,
|
|
3626
3657
|
xa,
|
|
3627
3658
|
ka,
|
|
3628
3659
|
Ia,
|
|
3629
|
-
//
|
|
3660
|
+
// Tables
|
|
3630
3661
|
qa,
|
|
3631
|
-
// Media
|
|
3632
3662
|
Ca,
|
|
3633
3663
|
Ta,
|
|
3664
|
+
Ea,
|
|
3665
|
+
La,
|
|
3666
|
+
// Parsing
|
|
3667
|
+
Ra,
|
|
3668
|
+
// Media
|
|
3669
|
+
Na,
|
|
3670
|
+
Ma,
|
|
3634
3671
|
// Color
|
|
3635
|
-
|
|
3672
|
+
Ba
|
|
3636
3673
|
];
|
|
3637
|
-
let
|
|
3638
|
-
function
|
|
3639
|
-
t.additionalRules && (
|
|
3674
|
+
let F = [], se = /* @__PURE__ */ new Set();
|
|
3675
|
+
function Fa(t) {
|
|
3676
|
+
t.additionalRules && (F = t.additionalRules), t.disabledRules && (se = new Set(t.disabledRules));
|
|
3640
3677
|
}
|
|
3641
|
-
function
|
|
3642
|
-
return
|
|
3678
|
+
function le() {
|
|
3679
|
+
return oe.filter((a) => !se.has(a.id)).concat(F);
|
|
3643
3680
|
}
|
|
3644
|
-
function
|
|
3645
|
-
|
|
3646
|
-
const a =
|
|
3681
|
+
function Pa(t) {
|
|
3682
|
+
ee(), Q(), Z(), ie(), ae(), te();
|
|
3683
|
+
const a = le(), e = [];
|
|
3647
3684
|
let i = 0;
|
|
3648
3685
|
return {
|
|
3649
3686
|
processChunk(n) {
|
|
@@ -3662,10 +3699,10 @@ function Ba(t) {
|
|
|
3662
3699
|
}
|
|
3663
3700
|
};
|
|
3664
3701
|
}
|
|
3665
|
-
function
|
|
3702
|
+
function Va(t) {
|
|
3666
3703
|
var i;
|
|
3667
|
-
|
|
3668
|
-
const a =
|
|
3704
|
+
ee(), Q(), Z(), ie(), ae(), te();
|
|
3705
|
+
const a = le(), e = [];
|
|
3669
3706
|
for (const n of a)
|
|
3670
3707
|
try {
|
|
3671
3708
|
e.push(...n.run(t));
|
|
@@ -3678,31 +3715,31 @@ function Oa(t) {
|
|
|
3678
3715
|
ruleCount: a.length
|
|
3679
3716
|
};
|
|
3680
3717
|
}
|
|
3681
|
-
const
|
|
3682
|
-
function
|
|
3683
|
-
const a =
|
|
3684
|
-
return a ||
|
|
3718
|
+
const Oa = new Map(oe.map((t) => [t.id, t]));
|
|
3719
|
+
function Ua(t) {
|
|
3720
|
+
const a = Oa.get(t);
|
|
3721
|
+
return a || F.find((e) => e.id === t);
|
|
3685
3722
|
}
|
|
3686
3723
|
export {
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3724
|
+
ae as clearAriaAttrAuditCache,
|
|
3725
|
+
ee as clearAriaHiddenCache,
|
|
3726
|
+
ie as clearColorCaches,
|
|
3727
|
+
Q as clearComputedRoleCache,
|
|
3691
3728
|
x as compileDeclarativeRule,
|
|
3692
|
-
|
|
3693
|
-
|
|
3729
|
+
Fa as configureRules,
|
|
3730
|
+
Pa as createChunkedAudit,
|
|
3694
3731
|
b as getAccessibleName,
|
|
3695
3732
|
w as getAccessibleTextContent,
|
|
3696
|
-
|
|
3697
|
-
|
|
3733
|
+
le as getActiveRules,
|
|
3734
|
+
E as getComputedRole,
|
|
3698
3735
|
l as getHtmlSnippet,
|
|
3699
|
-
|
|
3700
|
-
|
|
3736
|
+
J as getImplicitRole,
|
|
3737
|
+
Ua as getRuleById,
|
|
3701
3738
|
c as getSelector,
|
|
3702
3739
|
m as isAriaHidden,
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3740
|
+
me as isValidRole,
|
|
3741
|
+
Wa as querySelectorShadowAware,
|
|
3742
|
+
oe as rules,
|
|
3743
|
+
Va as runAudit,
|
|
3744
|
+
_a as validateDeclarativeRule
|
|
3708
3745
|
};
|