@accesslint/core 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -26
- package/dist/index.cjs +5 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.iife.js +5 -5
- package/dist/index.js +249 -245
- package/dist/rules/index.d.ts +1 -0
- package/dist/rules/index.d.ts.map +1 -1
- package/package.json +4 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
let M = /* @__PURE__ */ new WeakMap();
|
|
2
|
-
function
|
|
2
|
+
function re() {
|
|
3
3
|
M = /* @__PURE__ */ new WeakMap();
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function Q(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) {
|
|
@@ -121,20 +121,20 @@ function E(t) {
|
|
|
121
121
|
var n;
|
|
122
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 ||
|
|
124
|
+
const i = ((n = t.getAttribute("role")) == null ? void 0 : n.trim().toLowerCase()) || null || Q(t);
|
|
125
125
|
return M.set(t, i), i;
|
|
126
126
|
}
|
|
127
127
|
let $ = /* @__PURE__ */ new WeakMap();
|
|
128
|
-
function
|
|
128
|
+
function oe() {
|
|
129
129
|
$ = /* @__PURE__ */ new WeakMap();
|
|
130
130
|
}
|
|
131
131
|
function b(t) {
|
|
132
132
|
const a = $.get(t);
|
|
133
133
|
if (a !== void 0) return a;
|
|
134
|
-
const e =
|
|
134
|
+
const e = se(t);
|
|
135
135
|
return $.set(t, e), e;
|
|
136
136
|
}
|
|
137
|
-
function
|
|
137
|
+
function se(t) {
|
|
138
138
|
var r, o, s, u, h;
|
|
139
139
|
const a = t.getAttribute("aria-labelledby");
|
|
140
140
|
if (a) {
|
|
@@ -181,7 +181,7 @@ function de(t) {
|
|
|
181
181
|
}
|
|
182
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()) ?? "" : "";
|
|
183
183
|
}
|
|
184
|
-
const
|
|
184
|
+
const le = /* @__PURE__ */ new Set([
|
|
185
185
|
"alert",
|
|
186
186
|
"alertdialog",
|
|
187
187
|
"application",
|
|
@@ -265,12 +265,12 @@ const ue = /* @__PURE__ */ new Set([
|
|
|
265
265
|
"treegrid",
|
|
266
266
|
"treeitem"
|
|
267
267
|
]);
|
|
268
|
-
function
|
|
268
|
+
function ce(t) {
|
|
269
269
|
const a = t.trim().toLowerCase().replace(/[\u201C\u201D\u2018\u2019\u00AB\u00BB]/g, "");
|
|
270
|
-
return
|
|
270
|
+
return le.has(a);
|
|
271
271
|
}
|
|
272
272
|
let H = /* @__PURE__ */ new WeakMap();
|
|
273
|
-
function
|
|
273
|
+
function de() {
|
|
274
274
|
H = /* @__PURE__ */ new WeakMap();
|
|
275
275
|
}
|
|
276
276
|
function m(t) {
|
|
@@ -279,7 +279,7 @@ function m(t) {
|
|
|
279
279
|
let e;
|
|
280
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;
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function ue(t) {
|
|
283
283
|
return !!(t.getAttribute("aria-hidden") === "true" || t instanceof HTMLElement && (t.hidden || t.style.display === "none"));
|
|
284
284
|
}
|
|
285
285
|
function w(t) {
|
|
@@ -290,7 +290,7 @@ function w(t) {
|
|
|
290
290
|
a += o.textContent ?? "";
|
|
291
291
|
else if (o.nodeType === 1) {
|
|
292
292
|
const s = o;
|
|
293
|
-
if (!
|
|
293
|
+
if (!ue(s)) {
|
|
294
294
|
const u = (e = s.tagName) == null ? void 0 : e.toLowerCase();
|
|
295
295
|
if (u === "img" || u === "area")
|
|
296
296
|
a += ((i = s.getAttribute("aria-label")) == null ? void 0 : i.trim()) ?? s.getAttribute("alt") ?? "";
|
|
@@ -308,13 +308,13 @@ function w(t) {
|
|
|
308
308
|
return a;
|
|
309
309
|
}
|
|
310
310
|
let D = /* @__PURE__ */ new WeakMap();
|
|
311
|
-
function
|
|
311
|
+
function me() {
|
|
312
312
|
D = /* @__PURE__ */ new WeakMap();
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function pe(t) {
|
|
315
315
|
return t.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
316
316
|
}
|
|
317
|
-
const
|
|
317
|
+
const he = [
|
|
318
318
|
"data-testid",
|
|
319
319
|
"data-test-id",
|
|
320
320
|
"data-cy",
|
|
@@ -324,12 +324,12 @@ const ge = [
|
|
|
324
324
|
"for",
|
|
325
325
|
"aria-label"
|
|
326
326
|
];
|
|
327
|
-
function
|
|
327
|
+
function ge(t) {
|
|
328
328
|
const a = t.tagName.toLowerCase();
|
|
329
|
-
for (const i of
|
|
329
|
+
for (const i of he) {
|
|
330
330
|
const n = t.getAttribute(i);
|
|
331
331
|
if (n != null && n.length > 0 && n.length < 100)
|
|
332
|
-
return `${a}[${i}="${
|
|
332
|
+
return `${a}[${i}="${pe(n)}"]`;
|
|
333
333
|
}
|
|
334
334
|
const e = t.parentElement;
|
|
335
335
|
if (e) {
|
|
@@ -350,7 +350,7 @@ function R(t) {
|
|
|
350
350
|
i.unshift(`#${CSS.escape(n.id)}`);
|
|
351
351
|
break;
|
|
352
352
|
}
|
|
353
|
-
if (i.unshift(
|
|
353
|
+
if (i.unshift(ge(n)), i.length >= 2) {
|
|
354
354
|
const r = i.join(" > ");
|
|
355
355
|
try {
|
|
356
356
|
const o = a.querySelectorAll(r);
|
|
@@ -385,7 +385,7 @@ function c(t) {
|
|
|
385
385
|
const n = e.map((o, s) => (s === 0 ? "" : o.delimiter) + o.selector).join("");
|
|
386
386
|
return D.set(t, n), n;
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function _a(t) {
|
|
389
389
|
const a = [], e = [];
|
|
390
390
|
let i = t;
|
|
391
391
|
for (; i; ) {
|
|
@@ -422,7 +422,7 @@ function l(t) {
|
|
|
422
422
|
const a = t.outerHTML;
|
|
423
423
|
return a.length > 200 ? a.slice(0, 200) + "..." : a;
|
|
424
424
|
}
|
|
425
|
-
const
|
|
425
|
+
const be = /* @__PURE__ */ new Set([
|
|
426
426
|
"aria-activedescendant",
|
|
427
427
|
"aria-atomic",
|
|
428
428
|
"aria-autocomplete",
|
|
@@ -476,7 +476,7 @@ const fe = /* @__PURE__ */ new Set([
|
|
|
476
476
|
"aria-valuemin",
|
|
477
477
|
"aria-valuenow",
|
|
478
478
|
"aria-valuetext"
|
|
479
|
-
]),
|
|
479
|
+
]), fe = /* @__PURE__ */ new Set([
|
|
480
480
|
"aria-atomic",
|
|
481
481
|
"aria-busy",
|
|
482
482
|
"aria-disabled",
|
|
@@ -487,7 +487,7 @@ const fe = /* @__PURE__ */ new Set([
|
|
|
487
487
|
"aria-multiselectable",
|
|
488
488
|
"aria-readonly",
|
|
489
489
|
"aria-required"
|
|
490
|
-
]),
|
|
490
|
+
]), ve = /* @__PURE__ */ new Set(["aria-checked", "aria-pressed"]), ye = /* @__PURE__ */ new Set([
|
|
491
491
|
"aria-colcount",
|
|
492
492
|
"aria-colindex",
|
|
493
493
|
"aria-colspan",
|
|
@@ -497,7 +497,7 @@ const fe = /* @__PURE__ */ new Set([
|
|
|
497
497
|
"aria-rowindex",
|
|
498
498
|
"aria-rowspan",
|
|
499
499
|
"aria-setsize"
|
|
500
|
-
]),
|
|
500
|
+
]), we = /* @__PURE__ */ new Set([
|
|
501
501
|
"aria-valuemax",
|
|
502
502
|
"aria-valuemin",
|
|
503
503
|
"aria-valuenow"
|
|
@@ -528,7 +528,7 @@ const fe = /* @__PURE__ */ new Set([
|
|
|
528
528
|
"suggestion",
|
|
529
529
|
"term",
|
|
530
530
|
"time"
|
|
531
|
-
]),
|
|
531
|
+
]), Ae = {
|
|
532
532
|
abbr: !0,
|
|
533
533
|
bdi: !0,
|
|
534
534
|
bdo: !0,
|
|
@@ -556,7 +556,7 @@ const fe = /* @__PURE__ */ new Set([
|
|
|
556
556
|
u: !0,
|
|
557
557
|
var: !0,
|
|
558
558
|
wbr: !0
|
|
559
|
-
},
|
|
559
|
+
}, Se = {
|
|
560
560
|
alert: /* @__PURE__ */ new Set(["aria-disabled", "aria-errormessage", "aria-haspopup", "aria-invalid"]),
|
|
561
561
|
article: /* @__PURE__ */ new Set(["aria-disabled", "aria-errormessage", "aria-haspopup", "aria-invalid"]),
|
|
562
562
|
banner: /* @__PURE__ */ new Set(["aria-disabled", "aria-errormessage", "aria-haspopup", "aria-invalid"]),
|
|
@@ -590,7 +590,7 @@ const fe = /* @__PURE__ */ new Set([
|
|
|
590
590
|
tooltip: /* @__PURE__ */ new Set(["aria-disabled", "aria-errormessage", "aria-haspopup", "aria-invalid"])
|
|
591
591
|
};
|
|
592
592
|
let I = null, q = null;
|
|
593
|
-
function
|
|
593
|
+
function xe() {
|
|
594
594
|
I = null, q = null;
|
|
595
595
|
}
|
|
596
596
|
function _(t) {
|
|
@@ -608,7 +608,7 @@ function _(t) {
|
|
|
608
608
|
let s, u;
|
|
609
609
|
const h = () => (s === void 0 && (s = c(r), u = l(r)), { selector: s, html: u });
|
|
610
610
|
for (const d of r.attributes)
|
|
611
|
-
if (d.name.startsWith("aria-") && !
|
|
611
|
+
if (d.name.startsWith("aria-") && !be.has(d.name)) {
|
|
612
612
|
const p = h();
|
|
613
613
|
a.push({
|
|
614
614
|
ruleId: "aria-valid-attr",
|
|
@@ -622,7 +622,7 @@ function _(t) {
|
|
|
622
622
|
for (const d of r.attributes) {
|
|
623
623
|
if (!d.name.startsWith("aria-")) continue;
|
|
624
624
|
const p = d.value.trim();
|
|
625
|
-
if (
|
|
625
|
+
if (fe.has(d.name)) {
|
|
626
626
|
if (p !== "true" && p !== "false") {
|
|
627
627
|
const g = h();
|
|
628
628
|
e.push({
|
|
@@ -633,7 +633,7 @@ function _(t) {
|
|
|
633
633
|
message: `${d.name} must be "true" or "false", got "${p}".`
|
|
634
634
|
});
|
|
635
635
|
}
|
|
636
|
-
} else if (
|
|
636
|
+
} else if (ve.has(d.name)) {
|
|
637
637
|
if (p !== "true" && p !== "false" && p !== "mixed") {
|
|
638
638
|
const g = h();
|
|
639
639
|
e.push({
|
|
@@ -644,7 +644,7 @@ function _(t) {
|
|
|
644
644
|
message: `${d.name} must be "true", "false", or "mixed", got "${p}".`
|
|
645
645
|
});
|
|
646
646
|
}
|
|
647
|
-
} else if (
|
|
647
|
+
} else if (ye.has(d.name)) {
|
|
648
648
|
if (p === "" || !/^-?\d+$/.test(p)) {
|
|
649
649
|
const g = h();
|
|
650
650
|
e.push({
|
|
@@ -655,7 +655,7 @@ function _(t) {
|
|
|
655
655
|
message: `${d.name} must be an integer, got "${p}".`
|
|
656
656
|
});
|
|
657
657
|
}
|
|
658
|
-
} else if (
|
|
658
|
+
} else if (we.has(d.name)) {
|
|
659
659
|
if (p === "" || isNaN(Number(p))) {
|
|
660
660
|
const g = h();
|
|
661
661
|
e.push({
|
|
@@ -684,7 +684,7 @@ function _(t) {
|
|
|
684
684
|
}
|
|
685
685
|
if (!m(r)) {
|
|
686
686
|
const d = (n = r.getAttribute("role")) == null ? void 0 : n.trim().toLowerCase(), p = r.tagName.toLowerCase();
|
|
687
|
-
if (!d &&
|
|
687
|
+
if (!d && Ae[p]) {
|
|
688
688
|
const g = r.hasAttribute("aria-label"), f = r.hasAttribute("aria-labelledby");
|
|
689
689
|
if (g || f) {
|
|
690
690
|
const v = h();
|
|
@@ -710,7 +710,7 @@ function _(t) {
|
|
|
710
710
|
});
|
|
711
711
|
}
|
|
712
712
|
}
|
|
713
|
-
const g =
|
|
713
|
+
const g = Se[d];
|
|
714
714
|
if (g) {
|
|
715
715
|
for (const f of r.attributes)
|
|
716
716
|
if (f.name.startsWith("aria-") && g.has(f.name)) {
|
|
@@ -732,7 +732,7 @@ function _(t) {
|
|
|
732
732
|
return I = new WeakRef(t), q = { validAttr: a, validAttrValue: e, prohibitedAttr: i }, q;
|
|
733
733
|
}
|
|
734
734
|
let B = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap();
|
|
735
|
-
function
|
|
735
|
+
function ke() {
|
|
736
736
|
B = /* @__PURE__ */ new WeakMap(), O = /* @__PURE__ */ new WeakMap();
|
|
737
737
|
}
|
|
738
738
|
function C(t) {
|
|
@@ -746,23 +746,23 @@ function U(t, a, e) {
|
|
|
746
746
|
});
|
|
747
747
|
return 0.2126 * i + 0.7152 * n + 0.0722 * r;
|
|
748
748
|
}
|
|
749
|
-
function
|
|
749
|
+
function Ie(t, a) {
|
|
750
750
|
const e = Math.max(t, a), i = Math.min(t, a);
|
|
751
751
|
return (e + 0.05) / (i + 0.05);
|
|
752
752
|
}
|
|
753
|
-
function
|
|
753
|
+
function J(t) {
|
|
754
754
|
const a = t.match(
|
|
755
755
|
/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*[\d.]+)?\s*\)/
|
|
756
756
|
);
|
|
757
757
|
return a ? [parseInt(a[1]), parseInt(a[2]), parseInt(a[3])] : null;
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function qe(t) {
|
|
760
760
|
const a = O.get(t);
|
|
761
761
|
if (a !== void 0) return a;
|
|
762
|
-
const e =
|
|
762
|
+
const e = Ce(t);
|
|
763
763
|
return O.set(t, e), e;
|
|
764
764
|
}
|
|
765
|
-
function
|
|
765
|
+
function Ce(t) {
|
|
766
766
|
let a = t;
|
|
767
767
|
for (; a; ) {
|
|
768
768
|
const e = C(a), i = e.backgroundColor;
|
|
@@ -775,15 +775,15 @@ function qe(t) {
|
|
|
775
775
|
a = a.parentElement;
|
|
776
776
|
continue;
|
|
777
777
|
}
|
|
778
|
-
return e.backgroundImage && e.backgroundImage !== "none" ? null :
|
|
778
|
+
return e.backgroundImage && e.backgroundImage !== "none" ? null : J(i);
|
|
779
779
|
}
|
|
780
780
|
return [255, 255, 255];
|
|
781
781
|
}
|
|
782
|
-
function
|
|
782
|
+
function Te(t) {
|
|
783
783
|
const a = C(t), e = parseFloat(a.fontSize), i = parseInt(a.fontWeight) || (a.fontWeight === "bold" ? 700 : 400);
|
|
784
784
|
return e >= 24 || e >= 18.66 && i >= 700;
|
|
785
785
|
}
|
|
786
|
-
function
|
|
786
|
+
function Ee(t) {
|
|
787
787
|
var r, o;
|
|
788
788
|
const a = [], e = t.closest("a");
|
|
789
789
|
if (e) {
|
|
@@ -803,7 +803,7 @@ function Te(t) {
|
|
|
803
803
|
return a.length > 0 ? a.join(`
|
|
804
804
|
`) : void 0;
|
|
805
805
|
}
|
|
806
|
-
const
|
|
806
|
+
const Le = {
|
|
807
807
|
id: "img-alt",
|
|
808
808
|
wcag: ["1.1.1"],
|
|
809
809
|
level: "A",
|
|
@@ -819,11 +819,11 @@ const Ee = {
|
|
|
819
819
|
html: l(e),
|
|
820
820
|
impact: "critical",
|
|
821
821
|
message: "Image element missing alt attribute.",
|
|
822
|
-
context:
|
|
822
|
+
context: Ee(e)
|
|
823
823
|
});
|
|
824
824
|
return a;
|
|
825
825
|
}
|
|
826
|
-
},
|
|
826
|
+
}, Re = {
|
|
827
827
|
id: "svg-img-alt",
|
|
828
828
|
wcag: ["1.1.1"],
|
|
829
829
|
level: "A",
|
|
@@ -844,7 +844,7 @@ const Ee = {
|
|
|
844
844
|
}
|
|
845
845
|
return a;
|
|
846
846
|
}
|
|
847
|
-
},
|
|
847
|
+
}, Ne = {
|
|
848
848
|
id: "input-image-alt",
|
|
849
849
|
wcag: ["1.1.1", "4.1.2"],
|
|
850
850
|
level: "A",
|
|
@@ -863,7 +863,7 @@ const Ee = {
|
|
|
863
863
|
});
|
|
864
864
|
return a;
|
|
865
865
|
}
|
|
866
|
-
},
|
|
866
|
+
}, Me = {
|
|
867
867
|
id: "image-redundant-alt",
|
|
868
868
|
wcag: [],
|
|
869
869
|
level: "A",
|
|
@@ -891,7 +891,7 @@ const Ee = {
|
|
|
891
891
|
}
|
|
892
892
|
return a;
|
|
893
893
|
}
|
|
894
|
-
},
|
|
894
|
+
}, $e = ["image", "picture", "photo", "graphic", "icon", "img"], He = {
|
|
895
895
|
id: "image-alt-redundant-words",
|
|
896
896
|
wcag: [],
|
|
897
897
|
level: "A",
|
|
@@ -903,7 +903,7 @@ const Ee = {
|
|
|
903
903
|
const a = [];
|
|
904
904
|
for (const e of t.querySelectorAll("img[alt]")) {
|
|
905
905
|
const i = e.getAttribute("alt").toLowerCase();
|
|
906
|
-
i &&
|
|
906
|
+
i && $e.some((n) => i.split(/\s+/).includes(n)) && a.push({
|
|
907
907
|
ruleId: "image-alt-redundant-words",
|
|
908
908
|
selector: c(e),
|
|
909
909
|
html: l(e),
|
|
@@ -913,7 +913,7 @@ const Ee = {
|
|
|
913
913
|
}
|
|
914
914
|
return a;
|
|
915
915
|
}
|
|
916
|
-
},
|
|
916
|
+
}, De = {
|
|
917
917
|
id: "area-alt",
|
|
918
918
|
wcag: ["1.1.1", "4.1.2"],
|
|
919
919
|
level: "A",
|
|
@@ -934,7 +934,7 @@ const Ee = {
|
|
|
934
934
|
}
|
|
935
935
|
return a;
|
|
936
936
|
}
|
|
937
|
-
},
|
|
937
|
+
}, Be = {
|
|
938
938
|
id: "object-alt",
|
|
939
939
|
wcag: ["1.1.1"],
|
|
940
940
|
level: "A",
|
|
@@ -953,7 +953,7 @@ const Ee = {
|
|
|
953
953
|
});
|
|
954
954
|
return a;
|
|
955
955
|
}
|
|
956
|
-
},
|
|
956
|
+
}, Oe = {
|
|
957
957
|
id: "role-img-alt",
|
|
958
958
|
wcag: ["1.1.1"],
|
|
959
959
|
level: "A",
|
|
@@ -975,7 +975,7 @@ const Ee = {
|
|
|
975
975
|
return a;
|
|
976
976
|
}
|
|
977
977
|
};
|
|
978
|
-
function
|
|
978
|
+
function Fa(t) {
|
|
979
979
|
if (typeof t != "object" || t === null)
|
|
980
980
|
return "Rule spec must be an object";
|
|
981
981
|
const a = t;
|
|
@@ -1005,10 +1005,10 @@ function _a(t) {
|
|
|
1005
1005
|
return "Rule must have a wcag array";
|
|
1006
1006
|
if (typeof a.level != "string" || !["A", "AA"].includes(a.level))
|
|
1007
1007
|
return "Rule must have level A or AA";
|
|
1008
|
-
const n =
|
|
1008
|
+
const n = We(e);
|
|
1009
1009
|
return n || null;
|
|
1010
1010
|
}
|
|
1011
|
-
function
|
|
1011
|
+
function We(t) {
|
|
1012
1012
|
switch (t.type) {
|
|
1013
1013
|
case "selector-exists":
|
|
1014
1014
|
return null;
|
|
@@ -1064,7 +1064,7 @@ function x(t) {
|
|
|
1064
1064
|
for (const s of e.querySelectorAll(t.selector)) {
|
|
1065
1065
|
if (a && m(s)) continue;
|
|
1066
1066
|
const u = s.getAttribute(n);
|
|
1067
|
-
u !== null &&
|
|
1067
|
+
u !== null && _e(u, r, o) && i.push({
|
|
1068
1068
|
ruleId: t.id,
|
|
1069
1069
|
selector: c(s),
|
|
1070
1070
|
html: l(s),
|
|
@@ -1158,7 +1158,7 @@ function x(t) {
|
|
|
1158
1158
|
}
|
|
1159
1159
|
};
|
|
1160
1160
|
}
|
|
1161
|
-
function
|
|
1161
|
+
function _e(t, a, e) {
|
|
1162
1162
|
switch (a) {
|
|
1163
1163
|
case ">":
|
|
1164
1164
|
return parseFloat(t) > e;
|
|
@@ -1176,7 +1176,7 @@ function We(t, a, e) {
|
|
|
1176
1176
|
return !1;
|
|
1177
1177
|
}
|
|
1178
1178
|
}
|
|
1179
|
-
const
|
|
1179
|
+
const Fe = {
|
|
1180
1180
|
id: "server-side-image-map",
|
|
1181
1181
|
selector: "img[ismap], input[type='image'][ismap]",
|
|
1182
1182
|
check: { type: "selector-exists" },
|
|
@@ -1187,7 +1187,7 @@ const _e = {
|
|
|
1187
1187
|
level: "A",
|
|
1188
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.",
|
|
1189
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."
|
|
1190
|
-
},
|
|
1190
|
+
}, Pe = x(Fe), Ve = {
|
|
1191
1191
|
id: "label",
|
|
1192
1192
|
wcag: ["4.1.2"],
|
|
1193
1193
|
level: "A",
|
|
@@ -1210,7 +1210,7 @@ const _e = {
|
|
|
1210
1210
|
}
|
|
1211
1211
|
return a;
|
|
1212
1212
|
}
|
|
1213
|
-
},
|
|
1213
|
+
}, Ue = {
|
|
1214
1214
|
id: "form-field-multiple-labels",
|
|
1215
1215
|
wcag: [],
|
|
1216
1216
|
level: "A",
|
|
@@ -1242,7 +1242,7 @@ const _e = {
|
|
|
1242
1242
|
}
|
|
1243
1243
|
return a;
|
|
1244
1244
|
}
|
|
1245
|
-
},
|
|
1245
|
+
}, je = {
|
|
1246
1246
|
id: "select-name",
|
|
1247
1247
|
wcag: ["4.1.2"],
|
|
1248
1248
|
level: "A",
|
|
@@ -1261,7 +1261,7 @@ const _e = {
|
|
|
1261
1261
|
});
|
|
1262
1262
|
return a;
|
|
1263
1263
|
}
|
|
1264
|
-
},
|
|
1264
|
+
}, ze = {
|
|
1265
1265
|
id: "input-button-name",
|
|
1266
1266
|
wcag: ["4.1.2"],
|
|
1267
1267
|
level: "A",
|
|
@@ -1286,7 +1286,7 @@ const _e = {
|
|
|
1286
1286
|
}
|
|
1287
1287
|
return a;
|
|
1288
1288
|
}
|
|
1289
|
-
},
|
|
1289
|
+
}, Ge = /* @__PURE__ */ new Set([
|
|
1290
1290
|
"off",
|
|
1291
1291
|
"on",
|
|
1292
1292
|
"name",
|
|
@@ -1341,7 +1341,7 @@ const _e = {
|
|
|
1341
1341
|
"impp",
|
|
1342
1342
|
"url",
|
|
1343
1343
|
"photo"
|
|
1344
|
-
]),
|
|
1344
|
+
]), Xe = {
|
|
1345
1345
|
id: "autocomplete-valid",
|
|
1346
1346
|
wcag: ["1.3.5"],
|
|
1347
1347
|
level: "AA",
|
|
@@ -1354,7 +1354,7 @@ const _e = {
|
|
|
1354
1354
|
const i = e.getAttribute("autocomplete").trim();
|
|
1355
1355
|
if (!i) continue;
|
|
1356
1356
|
const n = i.split(/\s+/), r = n[n.length - 1];
|
|
1357
|
-
|
|
1357
|
+
Ge.has(r) || a.push({
|
|
1358
1358
|
ruleId: "autocomplete-valid",
|
|
1359
1359
|
selector: c(e),
|
|
1360
1360
|
html: l(e),
|
|
@@ -1388,7 +1388,7 @@ function W(t) {
|
|
|
1388
1388
|
}
|
|
1389
1389
|
return a;
|
|
1390
1390
|
}
|
|
1391
|
-
const
|
|
1391
|
+
const Ke = {
|
|
1392
1392
|
id: "label-content-name-mismatch",
|
|
1393
1393
|
wcag: ["2.5.3"],
|
|
1394
1394
|
level: "A",
|
|
@@ -1434,7 +1434,7 @@ const Xe = {
|
|
|
1434
1434
|
}
|
|
1435
1435
|
return a;
|
|
1436
1436
|
}
|
|
1437
|
-
},
|
|
1437
|
+
}, Ye = {
|
|
1438
1438
|
id: "label-title-only",
|
|
1439
1439
|
wcag: [],
|
|
1440
1440
|
level: "A",
|
|
@@ -1467,7 +1467,7 @@ const Xe = {
|
|
|
1467
1467
|
}
|
|
1468
1468
|
return a;
|
|
1469
1469
|
}
|
|
1470
|
-
},
|
|
1470
|
+
}, Qe = {
|
|
1471
1471
|
id: "tabindex",
|
|
1472
1472
|
selector: "[tabindex]",
|
|
1473
1473
|
check: { type: "attribute-value", attribute: "tabindex", operator: ">", value: 0 },
|
|
@@ -1479,7 +1479,7 @@ const Xe = {
|
|
|
1479
1479
|
tags: ["best-practice"],
|
|
1480
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.",
|
|
1481
1481
|
prompt: "Change the positive tabindex value to tabindex='0' and rely on DOM order for tab sequence instead."
|
|
1482
|
-
},
|
|
1482
|
+
}, Je = x(Qe), Ze = /* @__PURE__ */ new Set([
|
|
1483
1483
|
"div",
|
|
1484
1484
|
"span",
|
|
1485
1485
|
"p",
|
|
@@ -1506,7 +1506,7 @@ const Xe = {
|
|
|
1506
1506
|
"tr",
|
|
1507
1507
|
"td",
|
|
1508
1508
|
"th"
|
|
1509
|
-
]),
|
|
1509
|
+
]), et = {
|
|
1510
1510
|
id: "focus-order-semantics",
|
|
1511
1511
|
wcag: [],
|
|
1512
1512
|
tags: ["best-practice"],
|
|
@@ -1518,7 +1518,7 @@ const Xe = {
|
|
|
1518
1518
|
const a = [];
|
|
1519
1519
|
for (const e of t.querySelectorAll('[tabindex="0"]')) {
|
|
1520
1520
|
const i = e.tagName.toLowerCase();
|
|
1521
|
-
if (!
|
|
1521
|
+
if (!Ze.has(i)) continue;
|
|
1522
1522
|
e.getAttribute("role") || a.push({
|
|
1523
1523
|
ruleId: "focus-order-semantics",
|
|
1524
1524
|
selector: c(e),
|
|
@@ -1529,7 +1529,7 @@ const Xe = {
|
|
|
1529
1529
|
}
|
|
1530
1530
|
return a;
|
|
1531
1531
|
}
|
|
1532
|
-
},
|
|
1532
|
+
}, tt = /* @__PURE__ */ new Set([
|
|
1533
1533
|
"a",
|
|
1534
1534
|
"audio",
|
|
1535
1535
|
"button",
|
|
@@ -1538,7 +1538,7 @@ const Xe = {
|
|
|
1538
1538
|
"select",
|
|
1539
1539
|
"textarea",
|
|
1540
1540
|
"video"
|
|
1541
|
-
]),
|
|
1541
|
+
]), at = /* @__PURE__ */ new Set([
|
|
1542
1542
|
"button",
|
|
1543
1543
|
"checkbox",
|
|
1544
1544
|
"combobox",
|
|
@@ -1562,7 +1562,7 @@ const Xe = {
|
|
|
1562
1562
|
"tabpanel",
|
|
1563
1563
|
"textbox",
|
|
1564
1564
|
"treeitem"
|
|
1565
|
-
]),
|
|
1565
|
+
]), it = {
|
|
1566
1566
|
grid: /* @__PURE__ */ new Set(["gridcell", "row", "columnheader", "rowheader"]),
|
|
1567
1567
|
listbox: /* @__PURE__ */ new Set(["option"]),
|
|
1568
1568
|
menu: /* @__PURE__ */ new Set(["menuitem", "menuitemcheckbox", "menuitemradio"]),
|
|
@@ -1572,26 +1572,26 @@ const Xe = {
|
|
|
1572
1572
|
tree: /* @__PURE__ */ new Set(["treeitem"]),
|
|
1573
1573
|
treegrid: /* @__PURE__ */ new Set(["gridcell", "row", "columnheader", "rowheader", "treeitem"])
|
|
1574
1574
|
};
|
|
1575
|
-
function
|
|
1575
|
+
function nt(t, a) {
|
|
1576
1576
|
var n, r, o;
|
|
1577
1577
|
const e = (n = t.getAttribute("role")) == null ? void 0 : n.toLowerCase(), i = (r = a.getAttribute("role")) == null ? void 0 : r.toLowerCase();
|
|
1578
|
-
return !e || !i ? !1 : ((o =
|
|
1578
|
+
return !e || !i ? !1 : ((o = it[e]) == null ? void 0 : o.has(i)) ?? !1;
|
|
1579
1579
|
}
|
|
1580
|
-
function
|
|
1580
|
+
function rt(t) {
|
|
1581
1581
|
var n;
|
|
1582
1582
|
const a = t.tagName.toLowerCase();
|
|
1583
|
-
if (
|
|
1583
|
+
if (tt.has(a))
|
|
1584
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);
|
|
1585
1585
|
const e = (n = t.getAttribute("role")) == null ? void 0 : n.toLowerCase();
|
|
1586
|
-
if (e &&
|
|
1586
|
+
if (e && at.has(e)) return !0;
|
|
1587
1587
|
const i = t.getAttribute("tabindex");
|
|
1588
1588
|
return i !== null && i !== "-1" || t.getAttribute("contenteditable") === "true";
|
|
1589
1589
|
}
|
|
1590
|
-
function
|
|
1590
|
+
function ot(t) {
|
|
1591
1591
|
const a = t.tagName.toLowerCase();
|
|
1592
1592
|
return !!(a === "a" && t.hasAttribute("href") || a === "button" && !t.disabled);
|
|
1593
1593
|
}
|
|
1594
|
-
const
|
|
1594
|
+
const st = {
|
|
1595
1595
|
id: "nested-interactive",
|
|
1596
1596
|
wcag: ["4.1.2"],
|
|
1597
1597
|
level: "A",
|
|
@@ -1606,10 +1606,10 @@ const ot = {
|
|
|
1606
1606
|
for (; o; ) {
|
|
1607
1607
|
for (; r.length > 0 && !r[r.length - 1].contains(o); )
|
|
1608
1608
|
r.pop();
|
|
1609
|
-
if (!m(o) &&
|
|
1609
|
+
if (!m(o) && rt(o)) {
|
|
1610
1610
|
if (r.length > 0) {
|
|
1611
1611
|
const s = r[r.length - 1];
|
|
1612
|
-
|
|
1612
|
+
nt(s, o) || a.push({
|
|
1613
1613
|
ruleId: "nested-interactive",
|
|
1614
1614
|
selector: c(o),
|
|
1615
1615
|
html: l(o),
|
|
@@ -1617,13 +1617,13 @@ const ot = {
|
|
|
1617
1617
|
message: `Interactive element <${o.tagName.toLowerCase()}> is nested inside <${s.tagName.toLowerCase()}>.`
|
|
1618
1618
|
});
|
|
1619
1619
|
}
|
|
1620
|
-
|
|
1620
|
+
ot(o) && r.push(o);
|
|
1621
1621
|
}
|
|
1622
1622
|
o = n.nextNode();
|
|
1623
1623
|
}
|
|
1624
1624
|
return a;
|
|
1625
1625
|
}
|
|
1626
|
-
},
|
|
1626
|
+
}, lt = {
|
|
1627
1627
|
id: "scrollable-region-focusable",
|
|
1628
1628
|
wcag: ["2.1.1"],
|
|
1629
1629
|
level: "A",
|
|
@@ -1649,7 +1649,7 @@ const ot = {
|
|
|
1649
1649
|
}
|
|
1650
1650
|
return a;
|
|
1651
1651
|
}
|
|
1652
|
-
},
|
|
1652
|
+
}, ct = {
|
|
1653
1653
|
id: "accesskeys",
|
|
1654
1654
|
wcag: [],
|
|
1655
1655
|
level: "A",
|
|
@@ -1679,7 +1679,7 @@ const ot = {
|
|
|
1679
1679
|
});
|
|
1680
1680
|
return a;
|
|
1681
1681
|
}
|
|
1682
|
-
},
|
|
1682
|
+
}, dt = {
|
|
1683
1683
|
id: "heading-order",
|
|
1684
1684
|
wcag: [],
|
|
1685
1685
|
level: "A",
|
|
@@ -1704,7 +1704,7 @@ const ot = {
|
|
|
1704
1704
|
}
|
|
1705
1705
|
return a;
|
|
1706
1706
|
}
|
|
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"]',
|
|
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"]', ut = {
|
|
1708
1708
|
id: "landmark-one-main",
|
|
1709
1709
|
wcag: [],
|
|
1710
1710
|
level: "A",
|
|
@@ -1728,7 +1728,7 @@ const ot = {
|
|
|
1728
1728
|
message: "Page has multiple main landmarks."
|
|
1729
1729
|
})) : [];
|
|
1730
1730
|
}
|
|
1731
|
-
},
|
|
1731
|
+
}, mt = {
|
|
1732
1732
|
id: "landmark-no-duplicate-banner",
|
|
1733
1733
|
wcag: [],
|
|
1734
1734
|
level: "A",
|
|
@@ -1748,7 +1748,7 @@ const ot = {
|
|
|
1748
1748
|
})
|
|
1749
1749
|
), a;
|
|
1750
1750
|
}
|
|
1751
|
-
},
|
|
1751
|
+
}, pt = {
|
|
1752
1752
|
id: "landmark-no-duplicate-contentinfo",
|
|
1753
1753
|
wcag: [],
|
|
1754
1754
|
level: "A",
|
|
@@ -1768,7 +1768,7 @@ const ot = {
|
|
|
1768
1768
|
})
|
|
1769
1769
|
), a;
|
|
1770
1770
|
}
|
|
1771
|
-
},
|
|
1771
|
+
}, ht = {
|
|
1772
1772
|
id: "landmark-no-duplicate-main",
|
|
1773
1773
|
wcag: [],
|
|
1774
1774
|
level: "A",
|
|
@@ -1788,7 +1788,7 @@ const ot = {
|
|
|
1788
1788
|
})
|
|
1789
1789
|
), a;
|
|
1790
1790
|
}
|
|
1791
|
-
},
|
|
1791
|
+
}, gt = {
|
|
1792
1792
|
id: "landmark-banner-is-top-level",
|
|
1793
1793
|
wcag: [],
|
|
1794
1794
|
level: "A",
|
|
@@ -1808,7 +1808,7 @@ const ot = {
|
|
|
1808
1808
|
});
|
|
1809
1809
|
return a;
|
|
1810
1810
|
}
|
|
1811
|
-
},
|
|
1811
|
+
}, bt = {
|
|
1812
1812
|
id: "landmark-contentinfo-is-top-level",
|
|
1813
1813
|
wcag: [],
|
|
1814
1814
|
level: "A",
|
|
@@ -1828,7 +1828,7 @@ const ot = {
|
|
|
1828
1828
|
});
|
|
1829
1829
|
return a;
|
|
1830
1830
|
}
|
|
1831
|
-
},
|
|
1831
|
+
}, ft = {
|
|
1832
1832
|
id: "landmark-main-is-top-level",
|
|
1833
1833
|
wcag: [],
|
|
1834
1834
|
level: "A",
|
|
@@ -1850,7 +1850,7 @@ const ot = {
|
|
|
1850
1850
|
}
|
|
1851
1851
|
return a;
|
|
1852
1852
|
}
|
|
1853
|
-
},
|
|
1853
|
+
}, vt = {
|
|
1854
1854
|
id: "landmark-complementary-is-top-level",
|
|
1855
1855
|
wcag: [],
|
|
1856
1856
|
level: "A",
|
|
@@ -1872,7 +1872,7 @@ const ot = {
|
|
|
1872
1872
|
}
|
|
1873
1873
|
return a;
|
|
1874
1874
|
}
|
|
1875
|
-
},
|
|
1875
|
+
}, yt = {
|
|
1876
1876
|
id: "landmark-unique",
|
|
1877
1877
|
wcag: [],
|
|
1878
1878
|
level: "A",
|
|
@@ -1908,7 +1908,7 @@ const ot = {
|
|
|
1908
1908
|
}
|
|
1909
1909
|
return a;
|
|
1910
1910
|
}
|
|
1911
|
-
},
|
|
1911
|
+
}, wt = {
|
|
1912
1912
|
id: "region",
|
|
1913
1913
|
wcag: [],
|
|
1914
1914
|
level: "A",
|
|
@@ -1933,7 +1933,7 @@ const ot = {
|
|
|
1933
1933
|
}
|
|
1934
1934
|
return a;
|
|
1935
1935
|
}
|
|
1936
|
-
},
|
|
1936
|
+
}, At = {
|
|
1937
1937
|
id: "list",
|
|
1938
1938
|
selector: "ul, ol",
|
|
1939
1939
|
check: { type: "child-invalid", allowedChildren: ["li", "script", "template"] },
|
|
@@ -1944,7 +1944,7 @@ const ot = {
|
|
|
1944
1944
|
level: "A",
|
|
1945
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.",
|
|
1946
1946
|
prompt: "Explain how to restructure this element within the list properly."
|
|
1947
|
-
},
|
|
1947
|
+
}, St = x(At), xt = {
|
|
1948
1948
|
id: "dlitem",
|
|
1949
1949
|
wcag: ["1.3.1"],
|
|
1950
1950
|
level: "A",
|
|
@@ -1963,7 +1963,7 @@ const ot = {
|
|
|
1963
1963
|
});
|
|
1964
1964
|
return a;
|
|
1965
1965
|
}
|
|
1966
|
-
},
|
|
1966
|
+
}, kt = {
|
|
1967
1967
|
id: "definition-list",
|
|
1968
1968
|
selector: "dl",
|
|
1969
1969
|
check: { type: "child-invalid", allowedChildren: ["dt", "dd", "div", "script", "template"] },
|
|
@@ -1974,7 +1974,7 @@ const ot = {
|
|
|
1974
1974
|
level: "A",
|
|
1975
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.",
|
|
1976
1976
|
prompt: "Explain whether to move this element outside the <dl> or convert it to dt/dd."
|
|
1977
|
-
},
|
|
1977
|
+
}, It = x(kt), qt = {
|
|
1978
1978
|
id: "document-title",
|
|
1979
1979
|
wcag: ["2.4.2"],
|
|
1980
1980
|
level: "A",
|
|
@@ -1992,7 +1992,7 @@ const ot = {
|
|
|
1992
1992
|
message: a ? "Document <title> element is empty." : "Document is missing a <title> element."
|
|
1993
1993
|
}] : [];
|
|
1994
1994
|
}
|
|
1995
|
-
},
|
|
1995
|
+
}, Ct = {
|
|
1996
1996
|
id: "bypass",
|
|
1997
1997
|
wcag: ["2.4.1"],
|
|
1998
1998
|
level: "A",
|
|
@@ -2019,7 +2019,7 @@ const ot = {
|
|
|
2019
2019
|
message: "Page has no mechanism to bypass repeated content. Add a <main> landmark or skip link."
|
|
2020
2020
|
}];
|
|
2021
2021
|
}
|
|
2022
|
-
},
|
|
2022
|
+
}, Tt = {
|
|
2023
2023
|
id: "page-has-heading-one",
|
|
2024
2024
|
wcag: [],
|
|
2025
2025
|
level: "A",
|
|
@@ -2041,7 +2041,7 @@ const ot = {
|
|
|
2041
2041
|
message: "Page does not contain a level-one heading."
|
|
2042
2042
|
}];
|
|
2043
2043
|
}
|
|
2044
|
-
},
|
|
2044
|
+
}, Et = {
|
|
2045
2045
|
id: "frame-title",
|
|
2046
2046
|
wcag: ["4.1.2"],
|
|
2047
2047
|
level: "A",
|
|
@@ -2062,7 +2062,7 @@ const ot = {
|
|
|
2062
2062
|
}
|
|
2063
2063
|
return a;
|
|
2064
2064
|
}
|
|
2065
|
-
},
|
|
2065
|
+
}, Lt = {
|
|
2066
2066
|
id: "frame-title-unique",
|
|
2067
2067
|
wcag: ["4.1.2"],
|
|
2068
2068
|
level: "A",
|
|
@@ -2095,7 +2095,7 @@ const ot = {
|
|
|
2095
2095
|
});
|
|
2096
2096
|
return a;
|
|
2097
2097
|
}
|
|
2098
|
-
},
|
|
2098
|
+
}, Rt = {
|
|
2099
2099
|
id: "empty-heading",
|
|
2100
2100
|
wcag: [],
|
|
2101
2101
|
level: "A",
|
|
@@ -2115,7 +2115,7 @@ const ot = {
|
|
|
2115
2115
|
});
|
|
2116
2116
|
return a;
|
|
2117
2117
|
}
|
|
2118
|
-
},
|
|
2118
|
+
}, Nt = {
|
|
2119
2119
|
id: "meta-viewport",
|
|
2120
2120
|
wcag: ["1.4.4"],
|
|
2121
2121
|
level: "AA",
|
|
@@ -2147,7 +2147,7 @@ const ot = {
|
|
|
2147
2147
|
}
|
|
2148
2148
|
return a;
|
|
2149
2149
|
}
|
|
2150
|
-
},
|
|
2150
|
+
}, Mt = {
|
|
2151
2151
|
id: "meta-refresh",
|
|
2152
2152
|
wcag: ["2.2.1", "2.2.4", "3.2.5"],
|
|
2153
2153
|
level: "A",
|
|
@@ -2182,7 +2182,7 @@ const ot = {
|
|
|
2182
2182
|
}
|
|
2183
2183
|
return a;
|
|
2184
2184
|
}
|
|
2185
|
-
},
|
|
2185
|
+
}, $t = {
|
|
2186
2186
|
id: "blink",
|
|
2187
2187
|
selector: "blink",
|
|
2188
2188
|
check: { type: "selector-exists" },
|
|
@@ -2193,7 +2193,7 @@ const ot = {
|
|
|
2193
2193
|
level: "A",
|
|
2194
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.",
|
|
2195
2195
|
prompt: "Suggest static alternatives to the blinking effect."
|
|
2196
|
-
},
|
|
2196
|
+
}, Ht = x($t), Dt = {
|
|
2197
2197
|
id: "marquee",
|
|
2198
2198
|
selector: "marquee",
|
|
2199
2199
|
check: { type: "selector-exists" },
|
|
@@ -2204,7 +2204,7 @@ const ot = {
|
|
|
2204
2204
|
level: "A",
|
|
2205
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.",
|
|
2206
2206
|
prompt: "Suggest static alternatives or accessible carousel patterns."
|
|
2207
|
-
},
|
|
2207
|
+
}, Bt = x(Dt), Ot = {
|
|
2208
2208
|
id: "p-as-heading",
|
|
2209
2209
|
wcag: [],
|
|
2210
2210
|
level: "A",
|
|
@@ -2231,7 +2231,7 @@ const ot = {
|
|
|
2231
2231
|
}
|
|
2232
2232
|
return a;
|
|
2233
2233
|
}
|
|
2234
|
-
},
|
|
2234
|
+
}, Wt = {
|
|
2235
2235
|
id: "aria-roles",
|
|
2236
2236
|
wcag: ["4.1.2"],
|
|
2237
2237
|
level: "A",
|
|
@@ -2243,7 +2243,7 @@ const ot = {
|
|
|
2243
2243
|
for (const e of t.querySelectorAll("[role]")) {
|
|
2244
2244
|
const r = e.getAttribute("role").replace(/[\u201C\u201D\u2018\u2019\u00AB\u00BB]/g, "").split(/\s+/);
|
|
2245
2245
|
for (const o of r)
|
|
2246
|
-
if (o && !
|
|
2246
|
+
if (o && !ce(o)) {
|
|
2247
2247
|
a.push({
|
|
2248
2248
|
ruleId: "aria-roles",
|
|
2249
2249
|
selector: c(e),
|
|
@@ -2256,7 +2256,7 @@ const ot = {
|
|
|
2256
2256
|
}
|
|
2257
2257
|
return a;
|
|
2258
2258
|
}
|
|
2259
|
-
},
|
|
2259
|
+
}, _t = {
|
|
2260
2260
|
id: "aria-valid-attr",
|
|
2261
2261
|
wcag: ["4.1.2"],
|
|
2262
2262
|
level: "A",
|
|
@@ -2266,7 +2266,7 @@ const ot = {
|
|
|
2266
2266
|
run(t) {
|
|
2267
2267
|
return _(t).validAttr;
|
|
2268
2268
|
}
|
|
2269
|
-
},
|
|
2269
|
+
}, Ft = {
|
|
2270
2270
|
id: "aria-valid-attr-value",
|
|
2271
2271
|
wcag: ["4.1.2"],
|
|
2272
2272
|
level: "A",
|
|
@@ -2276,7 +2276,7 @@ const ot = {
|
|
|
2276
2276
|
run(t) {
|
|
2277
2277
|
return _(t).validAttrValue;
|
|
2278
2278
|
}
|
|
2279
|
-
},
|
|
2279
|
+
}, Pt = {
|
|
2280
2280
|
checkbox: ["aria-checked"],
|
|
2281
2281
|
combobox: ["aria-expanded"],
|
|
2282
2282
|
heading: ["aria-level"],
|
|
@@ -2291,7 +2291,7 @@ const ot = {
|
|
|
2291
2291
|
slider: ["aria-valuenow"],
|
|
2292
2292
|
spinbutton: ["aria-valuenow"],
|
|
2293
2293
|
switch: ["aria-checked"]
|
|
2294
|
-
},
|
|
2294
|
+
}, Vt = {
|
|
2295
2295
|
id: "aria-required-attr",
|
|
2296
2296
|
wcag: ["4.1.2"],
|
|
2297
2297
|
level: "A",
|
|
@@ -2301,7 +2301,7 @@ const ot = {
|
|
|
2301
2301
|
run(t) {
|
|
2302
2302
|
const a = [];
|
|
2303
2303
|
for (const e of t.querySelectorAll("[role]")) {
|
|
2304
|
-
const i = e.getAttribute("role").trim().toLowerCase(), n =
|
|
2304
|
+
const i = e.getAttribute("role").trim().toLowerCase(), n = Pt[i];
|
|
2305
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))) {
|
|
2306
2306
|
if (i === "separator") {
|
|
2307
2307
|
const r = e.getAttribute("tabindex");
|
|
@@ -2325,7 +2325,7 @@ const ot = {
|
|
|
2325
2325
|
return a;
|
|
2326
2326
|
}
|
|
2327
2327
|
};
|
|
2328
|
-
function
|
|
2328
|
+
function Ut(t) {
|
|
2329
2329
|
var r, o, s;
|
|
2330
2330
|
const a = [], e = t.className;
|
|
2331
2331
|
e && typeof e == "string" && e.trim() && a.push(`Classes: ${e.trim().slice(0, 100)}`);
|
|
@@ -2342,7 +2342,7 @@ function Vt(t) {
|
|
|
2342
2342
|
return a.length > 0 ? a.join(`
|
|
2343
2343
|
`) : void 0;
|
|
2344
2344
|
}
|
|
2345
|
-
const
|
|
2345
|
+
const jt = {
|
|
2346
2346
|
id: "button-name",
|
|
2347
2347
|
wcag: ["4.1.2"],
|
|
2348
2348
|
level: "A",
|
|
@@ -2359,12 +2359,12 @@ const Ut = {
|
|
|
2359
2359
|
html: l(e),
|
|
2360
2360
|
impact: "critical",
|
|
2361
2361
|
message: "Button has no discernible text.",
|
|
2362
|
-
context:
|
|
2362
|
+
context: Ut(e)
|
|
2363
2363
|
});
|
|
2364
2364
|
}
|
|
2365
2365
|
return a;
|
|
2366
2366
|
}
|
|
2367
|
-
},
|
|
2367
|
+
}, zt = {
|
|
2368
2368
|
alert: /* @__PURE__ */ new Set(["aria-atomic", "aria-busy", "aria-live", "aria-relevant"]),
|
|
2369
2369
|
alertdialog: /* @__PURE__ */ new Set(["aria-describedby", "aria-modal"]),
|
|
2370
2370
|
application: /* @__PURE__ */ new Set(["aria-activedescendant", "aria-disabled", "aria-errormessage", "aria-expanded", "aria-haspopup", "aria-invalid"]),
|
|
@@ -2436,7 +2436,7 @@ const Ut = {
|
|
|
2436
2436
|
tree: /* @__PURE__ */ new Set(["aria-activedescendant", "aria-disabled", "aria-errormessage", "aria-invalid", "aria-multiselectable", "aria-orientation", "aria-required"]),
|
|
2437
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"]),
|
|
2438
2438
|
treeitem: /* @__PURE__ */ new Set(["aria-checked", "aria-disabled", "aria-expanded", "aria-haspopup", "aria-level", "aria-posinset", "aria-selected", "aria-setsize"])
|
|
2439
|
-
},
|
|
2439
|
+
}, Gt = /* @__PURE__ */ new Set([
|
|
2440
2440
|
"aria-atomic",
|
|
2441
2441
|
"aria-busy",
|
|
2442
2442
|
"aria-controls",
|
|
@@ -2460,7 +2460,7 @@ const Ut = {
|
|
|
2460
2460
|
"aria-roledescription",
|
|
2461
2461
|
"aria-braillelabel",
|
|
2462
2462
|
"aria-brailleroledescription"
|
|
2463
|
-
]),
|
|
2463
|
+
]), Xt = {
|
|
2464
2464
|
id: "aria-allowed-attr",
|
|
2465
2465
|
wcag: ["4.1.2"],
|
|
2466
2466
|
level: "A",
|
|
@@ -2473,10 +2473,10 @@ const Ut = {
|
|
|
2473
2473
|
if (m(e)) continue;
|
|
2474
2474
|
const i = E(e);
|
|
2475
2475
|
if (!i) continue;
|
|
2476
|
-
const n =
|
|
2476
|
+
const n = zt[i];
|
|
2477
2477
|
if (n)
|
|
2478
2478
|
for (const r of e.attributes)
|
|
2479
|
-
r.name.startsWith("aria-") && (
|
|
2479
|
+
r.name.startsWith("aria-") && (Gt.has(r.name) || n.has(r.name) || a.push({
|
|
2480
2480
|
ruleId: "aria-allowed-attr",
|
|
2481
2481
|
selector: c(e),
|
|
2482
2482
|
html: l(e),
|
|
@@ -2486,7 +2486,7 @@ const Ut = {
|
|
|
2486
2486
|
}
|
|
2487
2487
|
return a;
|
|
2488
2488
|
}
|
|
2489
|
-
},
|
|
2489
|
+
}, Kt = /* @__PURE__ */ new Set([
|
|
2490
2490
|
"base",
|
|
2491
2491
|
"col",
|
|
2492
2492
|
"colgroup",
|
|
@@ -2608,10 +2608,10 @@ const Ut = {
|
|
|
2608
2608
|
video: /* @__PURE__ */ new Set(["application"]),
|
|
2609
2609
|
wbr: /* @__PURE__ */ new Set(["none", "presentation"])
|
|
2610
2610
|
};
|
|
2611
|
-
function
|
|
2611
|
+
function Yt(t) {
|
|
2612
2612
|
var e;
|
|
2613
2613
|
const a = t.tagName.toLowerCase();
|
|
2614
|
-
if (
|
|
2614
|
+
if (Kt.has(a))
|
|
2615
2615
|
return "none";
|
|
2616
2616
|
if (a === "a" && t.hasAttribute("href"))
|
|
2617
2617
|
return k["a[href]"];
|
|
@@ -2623,7 +2623,7 @@ function Kt(t) {
|
|
|
2623
2623
|
}
|
|
2624
2624
|
return k[a] || "any";
|
|
2625
2625
|
}
|
|
2626
|
-
const
|
|
2626
|
+
const Qt = {
|
|
2627
2627
|
id: "aria-allowed-role",
|
|
2628
2628
|
wcag: ["4.1.2"],
|
|
2629
2629
|
level: "A",
|
|
@@ -2637,9 +2637,9 @@ const Yt = {
|
|
|
2637
2637
|
if (m(i)) continue;
|
|
2638
2638
|
const n = (e = i.getAttribute("role")) == null ? void 0 : e.trim().toLowerCase();
|
|
2639
2639
|
if (!n) continue;
|
|
2640
|
-
const r =
|
|
2640
|
+
const r = Q(i);
|
|
2641
2641
|
if (r && n === r) continue;
|
|
2642
|
-
const o =
|
|
2642
|
+
const o = Yt(i);
|
|
2643
2643
|
o === "none" ? a.push({
|
|
2644
2644
|
ruleId: "aria-allowed-role",
|
|
2645
2645
|
selector: c(i),
|
|
@@ -2687,7 +2687,7 @@ const Yt = {
|
|
|
2687
2687
|
tab: ["tablist"],
|
|
2688
2688
|
treeitem: ["tree", "group"]
|
|
2689
2689
|
};
|
|
2690
|
-
function
|
|
2690
|
+
function Jt(t, a) {
|
|
2691
2691
|
var r;
|
|
2692
2692
|
const e = ((r = t.getAttribute("aria-owns")) == null ? void 0 : r.split(/\s+/)) || [], i = t.ownerDocument, n = /* @__PURE__ */ new Set();
|
|
2693
2693
|
for (const o of t.querySelectorAll("*")) {
|
|
@@ -2705,7 +2705,7 @@ function Qt(t, a) {
|
|
|
2705
2705
|
if (!o.some((u) => n.has(u))) return !1;
|
|
2706
2706
|
return !0;
|
|
2707
2707
|
}
|
|
2708
|
-
const
|
|
2708
|
+
const Zt = {
|
|
2709
2709
|
id: "aria-required-children",
|
|
2710
2710
|
wcag: ["4.1.2"],
|
|
2711
2711
|
level: "A",
|
|
@@ -2720,7 +2720,7 @@ const Jt = {
|
|
|
2720
2720
|
const n = (e = i.getAttribute("role")) == null ? void 0 : e.trim().toLowerCase();
|
|
2721
2721
|
if (!n || !(n in X)) continue;
|
|
2722
2722
|
const r = X[n];
|
|
2723
|
-
if (!
|
|
2723
|
+
if (!Jt(i, r)) {
|
|
2724
2724
|
const o = r.map((s) => s.join(" or ")).join(", ");
|
|
2725
2725
|
a.push({
|
|
2726
2726
|
ruleId: "aria-required-children",
|
|
@@ -2733,7 +2733,7 @@ const Jt = {
|
|
|
2733
2733
|
}
|
|
2734
2734
|
return a;
|
|
2735
2735
|
}
|
|
2736
|
-
},
|
|
2736
|
+
}, ea = {
|
|
2737
2737
|
id: "aria-required-parent",
|
|
2738
2738
|
wcag: ["4.1.2"],
|
|
2739
2739
|
level: "A",
|
|
@@ -2767,7 +2767,7 @@ const Jt = {
|
|
|
2767
2767
|
}
|
|
2768
2768
|
return a;
|
|
2769
2769
|
}
|
|
2770
|
-
},
|
|
2770
|
+
}, ta = [
|
|
2771
2771
|
"a[href]",
|
|
2772
2772
|
"button:not([disabled])",
|
|
2773
2773
|
'input:not([disabled]):not([type="hidden"])',
|
|
@@ -2783,7 +2783,7 @@ const Jt = {
|
|
|
2783
2783
|
"embed",
|
|
2784
2784
|
"area[href]"
|
|
2785
2785
|
].join(", ");
|
|
2786
|
-
function
|
|
2786
|
+
function aa(t) {
|
|
2787
2787
|
let a = t;
|
|
2788
2788
|
const e = t.ownerDocument, i = e.defaultView;
|
|
2789
2789
|
for (; a && a !== e.body; ) {
|
|
@@ -2796,7 +2796,7 @@ function ta(t) {
|
|
|
2796
2796
|
}
|
|
2797
2797
|
return !0;
|
|
2798
2798
|
}
|
|
2799
|
-
const
|
|
2799
|
+
const ia = {
|
|
2800
2800
|
id: "aria-hidden-body",
|
|
2801
2801
|
selector: 'body[aria-hidden="true"]',
|
|
2802
2802
|
check: { type: "selector-exists" },
|
|
@@ -2808,7 +2808,7 @@ const aa = {
|
|
|
2808
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.",
|
|
2809
2809
|
prompt: "Instruct to remove aria-hidden='true' from the body element.",
|
|
2810
2810
|
skipAriaHidden: !1
|
|
2811
|
-
},
|
|
2811
|
+
}, na = x(ia), ra = {
|
|
2812
2812
|
id: "aria-hidden-focus",
|
|
2813
2813
|
wcag: ["4.1.2"],
|
|
2814
2814
|
level: "A",
|
|
@@ -2819,10 +2819,10 @@ const aa = {
|
|
|
2819
2819
|
const a = [];
|
|
2820
2820
|
for (const e of t.querySelectorAll('[aria-hidden="true"]')) {
|
|
2821
2821
|
if (e === t.body) continue;
|
|
2822
|
-
const i = e.querySelectorAll(
|
|
2822
|
+
const i = e.querySelectorAll(ta);
|
|
2823
2823
|
for (const n of i)
|
|
2824
2824
|
if (n instanceof HTMLElement) {
|
|
2825
|
-
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" || !aa(n)) continue;
|
|
2826
2826
|
a.push({
|
|
2827
2827
|
ruleId: "aria-hidden-focus",
|
|
2828
2828
|
selector: c(n),
|
|
@@ -2834,7 +2834,7 @@ const aa = {
|
|
|
2834
2834
|
}
|
|
2835
2835
|
return a;
|
|
2836
2836
|
}
|
|
2837
|
-
},
|
|
2837
|
+
}, oa = {
|
|
2838
2838
|
id: "aria-command-name",
|
|
2839
2839
|
wcag: ["4.1.2"],
|
|
2840
2840
|
level: "A",
|
|
@@ -2860,7 +2860,7 @@ const aa = {
|
|
|
2860
2860
|
}
|
|
2861
2861
|
return a;
|
|
2862
2862
|
}
|
|
2863
|
-
},
|
|
2863
|
+
}, sa = {
|
|
2864
2864
|
id: "aria-input-field-name",
|
|
2865
2865
|
wcag: ["4.1.2"],
|
|
2866
2866
|
level: "A",
|
|
@@ -2881,7 +2881,7 @@ const aa = {
|
|
|
2881
2881
|
}
|
|
2882
2882
|
return a;
|
|
2883
2883
|
}
|
|
2884
|
-
},
|
|
2884
|
+
}, la = {
|
|
2885
2885
|
id: "aria-toggle-field-name",
|
|
2886
2886
|
wcag: ["4.1.2"],
|
|
2887
2887
|
level: "A",
|
|
@@ -2902,7 +2902,7 @@ const aa = {
|
|
|
2902
2902
|
}
|
|
2903
2903
|
return a;
|
|
2904
2904
|
}
|
|
2905
|
-
},
|
|
2905
|
+
}, ca = {
|
|
2906
2906
|
id: "aria-meter-name",
|
|
2907
2907
|
wcag: ["4.1.2"],
|
|
2908
2908
|
level: "A",
|
|
@@ -2923,7 +2923,7 @@ const aa = {
|
|
|
2923
2923
|
}
|
|
2924
2924
|
return a;
|
|
2925
2925
|
}
|
|
2926
|
-
},
|
|
2926
|
+
}, da = {
|
|
2927
2927
|
id: "aria-progressbar-name",
|
|
2928
2928
|
wcag: ["4.1.2"],
|
|
2929
2929
|
level: "A",
|
|
@@ -2944,7 +2944,7 @@ const aa = {
|
|
|
2944
2944
|
}
|
|
2945
2945
|
return a;
|
|
2946
2946
|
}
|
|
2947
|
-
},
|
|
2947
|
+
}, ua = {
|
|
2948
2948
|
id: "aria-dialog-name",
|
|
2949
2949
|
wcag: ["4.1.2"],
|
|
2950
2950
|
level: "A",
|
|
@@ -2965,7 +2965,7 @@ const aa = {
|
|
|
2965
2965
|
}
|
|
2966
2966
|
return a;
|
|
2967
2967
|
}
|
|
2968
|
-
},
|
|
2968
|
+
}, ma = {
|
|
2969
2969
|
id: "aria-tooltip-name",
|
|
2970
2970
|
wcag: ["4.1.2"],
|
|
2971
2971
|
level: "A",
|
|
@@ -2986,7 +2986,7 @@ const aa = {
|
|
|
2986
2986
|
}
|
|
2987
2987
|
return a;
|
|
2988
2988
|
}
|
|
2989
|
-
},
|
|
2989
|
+
}, pa = {
|
|
2990
2990
|
id: "aria-treeitem-name",
|
|
2991
2991
|
wcag: ["4.1.2"],
|
|
2992
2992
|
level: "A",
|
|
@@ -3007,7 +3007,7 @@ const aa = {
|
|
|
3007
3007
|
}
|
|
3008
3008
|
return a;
|
|
3009
3009
|
}
|
|
3010
|
-
},
|
|
3010
|
+
}, ha = {
|
|
3011
3011
|
id: "aria-prohibited-attr",
|
|
3012
3012
|
wcag: ["4.1.2"],
|
|
3013
3013
|
level: "A",
|
|
@@ -3017,14 +3017,14 @@ const aa = {
|
|
|
3017
3017
|
run(t) {
|
|
3018
3018
|
return _(t).prohibitedAttr;
|
|
3019
3019
|
}
|
|
3020
|
-
},
|
|
3020
|
+
}, ga = [
|
|
3021
3021
|
"a[href]",
|
|
3022
3022
|
"button:not([disabled])",
|
|
3023
3023
|
'input:not([disabled]):not([type="hidden"])',
|
|
3024
3024
|
"select:not([disabled])",
|
|
3025
3025
|
"textarea:not([disabled])",
|
|
3026
3026
|
'[tabindex]:not([tabindex="-1"])'
|
|
3027
|
-
].join(", "),
|
|
3027
|
+
].join(", "), ba = [
|
|
3028
3028
|
"aria-atomic",
|
|
3029
3029
|
"aria-busy",
|
|
3030
3030
|
"aria-controls",
|
|
@@ -3038,7 +3038,7 @@ const aa = {
|
|
|
3038
3038
|
"aria-live",
|
|
3039
3039
|
"aria-owns",
|
|
3040
3040
|
"aria-relevant"
|
|
3041
|
-
],
|
|
3041
|
+
], fa = {
|
|
3042
3042
|
id: "presentation-role-conflict",
|
|
3043
3043
|
wcag: ["4.1.2"],
|
|
3044
3044
|
level: "A",
|
|
@@ -3050,8 +3050,8 @@ const aa = {
|
|
|
3050
3050
|
for (const e of t.querySelectorAll('[role="presentation"], [role="none"]')) {
|
|
3051
3051
|
if (m(e)) continue;
|
|
3052
3052
|
const i = [];
|
|
3053
|
-
e.matches(
|
|
3054
|
-
for (const n of
|
|
3053
|
+
e.matches(ga) && i.push("element is focusable");
|
|
3054
|
+
for (const n of ba)
|
|
3055
3055
|
if (e.hasAttribute(n)) {
|
|
3056
3056
|
i.push(`has ${n}`);
|
|
3057
3057
|
break;
|
|
@@ -3066,7 +3066,7 @@ const aa = {
|
|
|
3066
3066
|
}
|
|
3067
3067
|
return a;
|
|
3068
3068
|
}
|
|
3069
|
-
},
|
|
3069
|
+
}, va = {
|
|
3070
3070
|
id: "summary-name",
|
|
3071
3071
|
wcag: ["4.1.2"],
|
|
3072
3072
|
level: "A",
|
|
@@ -3088,7 +3088,7 @@ const aa = {
|
|
|
3088
3088
|
return a;
|
|
3089
3089
|
}
|
|
3090
3090
|
};
|
|
3091
|
-
function
|
|
3091
|
+
function ya(t) {
|
|
3092
3092
|
var n, r;
|
|
3093
3093
|
const a = [], e = t.getAttribute("href");
|
|
3094
3094
|
e && a.push(`href: ${e}`);
|
|
@@ -3105,7 +3105,7 @@ function va(t) {
|
|
|
3105
3105
|
return a.length > 0 ? a.join(`
|
|
3106
3106
|
`) : void 0;
|
|
3107
3107
|
}
|
|
3108
|
-
const
|
|
3108
|
+
const wa = {
|
|
3109
3109
|
id: "link-name",
|
|
3110
3110
|
wcag: ["2.4.4", "4.1.2"],
|
|
3111
3111
|
level: "A",
|
|
@@ -3122,12 +3122,12 @@ const ya = {
|
|
|
3122
3122
|
html: l(e),
|
|
3123
3123
|
impact: "serious",
|
|
3124
3124
|
message: "Link has no discernible text.",
|
|
3125
|
-
context:
|
|
3125
|
+
context: ya(e)
|
|
3126
3126
|
});
|
|
3127
3127
|
}
|
|
3128
3128
|
return a;
|
|
3129
3129
|
}
|
|
3130
|
-
},
|
|
3130
|
+
}, Aa = {
|
|
3131
3131
|
id: "skip-link",
|
|
3132
3132
|
wcag: ["2.4.1"],
|
|
3133
3133
|
level: "A",
|
|
@@ -3153,7 +3153,7 @@ const ya = {
|
|
|
3153
3153
|
}
|
|
3154
3154
|
return a;
|
|
3155
3155
|
}
|
|
3156
|
-
},
|
|
3156
|
+
}, Sa = {
|
|
3157
3157
|
id: "link-in-text-block",
|
|
3158
3158
|
wcag: ["1.4.1"],
|
|
3159
3159
|
level: "A",
|
|
@@ -3180,7 +3180,7 @@ const ya = {
|
|
|
3180
3180
|
}
|
|
3181
3181
|
return a;
|
|
3182
3182
|
}
|
|
3183
|
-
},
|
|
3183
|
+
}, xa = {
|
|
3184
3184
|
id: "html-has-lang",
|
|
3185
3185
|
wcag: ["3.1.1"],
|
|
3186
3186
|
level: "A",
|
|
@@ -3198,7 +3198,7 @@ const ya = {
|
|
|
3198
3198
|
message: "<html> element missing lang attribute."
|
|
3199
3199
|
}];
|
|
3200
3200
|
}
|
|
3201
|
-
},
|
|
3201
|
+
}, Z = /^[a-z]{2,3}(-[a-z0-9]{2,8})*$/i, ka = {
|
|
3202
3202
|
id: "html-lang-valid",
|
|
3203
3203
|
wcag: ["3.1.1"],
|
|
3204
3204
|
level: "A",
|
|
@@ -3208,7 +3208,7 @@ const ya = {
|
|
|
3208
3208
|
run(t) {
|
|
3209
3209
|
var e;
|
|
3210
3210
|
const a = (e = t.documentElement.getAttribute("lang")) == null ? void 0 : e.trim();
|
|
3211
|
-
return a && !
|
|
3211
|
+
return a && !Z.test(a) ? [{
|
|
3212
3212
|
ruleId: "html-lang-valid",
|
|
3213
3213
|
selector: "html",
|
|
3214
3214
|
html: l(t.documentElement),
|
|
@@ -3216,7 +3216,7 @@ const ya = {
|
|
|
3216
3216
|
message: `Invalid lang attribute value "${a}".`
|
|
3217
3217
|
}] : [];
|
|
3218
3218
|
}
|
|
3219
|
-
},
|
|
3219
|
+
}, Ia = {
|
|
3220
3220
|
id: "valid-lang",
|
|
3221
3221
|
wcag: ["3.1.2"],
|
|
3222
3222
|
level: "AA",
|
|
@@ -3229,7 +3229,7 @@ const ya = {
|
|
|
3229
3229
|
for (const i of t.querySelectorAll("[lang]")) {
|
|
3230
3230
|
if (m(i) || i === t.documentElement) continue;
|
|
3231
3231
|
const n = (e = i.getAttribute("lang")) == null ? void 0 : e.trim();
|
|
3232
|
-
n && !
|
|
3232
|
+
n && !Z.test(n) && a.push({
|
|
3233
3233
|
ruleId: "valid-lang",
|
|
3234
3234
|
selector: c(i),
|
|
3235
3235
|
html: l(i),
|
|
@@ -3239,7 +3239,7 @@ const ya = {
|
|
|
3239
3239
|
}
|
|
3240
3240
|
return a;
|
|
3241
3241
|
}
|
|
3242
|
-
},
|
|
3242
|
+
}, qa = {
|
|
3243
3243
|
id: "html-xml-lang-mismatch",
|
|
3244
3244
|
wcag: ["3.1.1"],
|
|
3245
3245
|
level: "A",
|
|
@@ -3262,7 +3262,7 @@ const ya = {
|
|
|
3262
3262
|
}
|
|
3263
3263
|
return [];
|
|
3264
3264
|
}
|
|
3265
|
-
},
|
|
3265
|
+
}, Ca = {
|
|
3266
3266
|
id: "td-headers-attr",
|
|
3267
3267
|
wcag: ["1.3.1"],
|
|
3268
3268
|
level: "A",
|
|
@@ -3290,7 +3290,7 @@ const ya = {
|
|
|
3290
3290
|
}
|
|
3291
3291
|
return a;
|
|
3292
3292
|
}
|
|
3293
|
-
},
|
|
3293
|
+
}, Ta = {
|
|
3294
3294
|
id: "th-has-data-cells",
|
|
3295
3295
|
wcag: ["1.3.1"],
|
|
3296
3296
|
level: "A",
|
|
@@ -3312,7 +3312,7 @@ const ya = {
|
|
|
3312
3312
|
}
|
|
3313
3313
|
return a;
|
|
3314
3314
|
}
|
|
3315
|
-
},
|
|
3315
|
+
}, Ea = {
|
|
3316
3316
|
id: "td-has-header",
|
|
3317
3317
|
wcag: ["1.3.1"],
|
|
3318
3318
|
level: "A",
|
|
@@ -3365,7 +3365,7 @@ const ya = {
|
|
|
3365
3365
|
}
|
|
3366
3366
|
return a;
|
|
3367
3367
|
}
|
|
3368
|
-
},
|
|
3368
|
+
}, La = {
|
|
3369
3369
|
id: "scope-attr-valid",
|
|
3370
3370
|
wcag: ["1.3.1"],
|
|
3371
3371
|
level: "A",
|
|
@@ -3388,7 +3388,7 @@ const ya = {
|
|
|
3388
3388
|
}
|
|
3389
3389
|
return a;
|
|
3390
3390
|
}
|
|
3391
|
-
},
|
|
3391
|
+
}, Ra = {
|
|
3392
3392
|
id: "empty-table-header",
|
|
3393
3393
|
wcag: [],
|
|
3394
3394
|
level: "A",
|
|
@@ -3411,7 +3411,7 @@ const ya = {
|
|
|
3411
3411
|
}
|
|
3412
3412
|
return a;
|
|
3413
3413
|
}
|
|
3414
|
-
}, N = ["aria-labelledby", "aria-describedby", "aria-controls", "aria-owns", "aria-flowto"],
|
|
3414
|
+
}, N = ["aria-labelledby", "aria-describedby", "aria-controls", "aria-owns", "aria-flowto"], Na = {
|
|
3415
3415
|
id: "duplicate-id-aria",
|
|
3416
3416
|
wcag: ["4.1.2"],
|
|
3417
3417
|
level: "A",
|
|
@@ -3459,7 +3459,7 @@ Referenced by: ${h}` : ""}`
|
|
|
3459
3459
|
}
|
|
3460
3460
|
return a;
|
|
3461
3461
|
}
|
|
3462
|
-
},
|
|
3462
|
+
}, Ma = {
|
|
3463
3463
|
id: "video-caption",
|
|
3464
3464
|
wcag: ["1.2.2"],
|
|
3465
3465
|
level: "A",
|
|
@@ -3480,7 +3480,7 @@ Referenced by: ${h}` : ""}`
|
|
|
3480
3480
|
}
|
|
3481
3481
|
return a;
|
|
3482
3482
|
}
|
|
3483
|
-
},
|
|
3483
|
+
}, $a = {
|
|
3484
3484
|
id: "audio-caption",
|
|
3485
3485
|
wcag: ["1.2.1"],
|
|
3486
3486
|
level: "A",
|
|
@@ -3502,7 +3502,7 @@ Referenced by: ${h}` : ""}`
|
|
|
3502
3502
|
}
|
|
3503
3503
|
return a;
|
|
3504
3504
|
}
|
|
3505
|
-
},
|
|
3505
|
+
}, Ha = /* @__PURE__ */ new Set([
|
|
3506
3506
|
"SCRIPT",
|
|
3507
3507
|
"STYLE",
|
|
3508
3508
|
"NOSCRIPT",
|
|
@@ -3521,10 +3521,10 @@ Referenced by: ${h}` : ""}`
|
|
|
3521
3521
|
function Y([t, a, e]) {
|
|
3522
3522
|
return "#" + [t, a, e].map((i) => i.toString(16).padStart(2, "0")).join("");
|
|
3523
3523
|
}
|
|
3524
|
-
function
|
|
3524
|
+
function Da(t) {
|
|
3525
3525
|
return t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof HTMLSelectElement || t instanceof HTMLButtonElement ? t.disabled : !!t.closest("fieldset[disabled]");
|
|
3526
3526
|
}
|
|
3527
|
-
function
|
|
3527
|
+
function Ba(t) {
|
|
3528
3528
|
if (m(t)) return !0;
|
|
3529
3529
|
let a = t;
|
|
3530
3530
|
for (; a; ) {
|
|
@@ -3534,7 +3534,7 @@ function Da(t) {
|
|
|
3534
3534
|
}
|
|
3535
3535
|
return !1;
|
|
3536
3536
|
}
|
|
3537
|
-
const
|
|
3537
|
+
const Oa = {
|
|
3538
3538
|
id: "color-contrast",
|
|
3539
3539
|
wcag: ["1.4.3"],
|
|
3540
3540
|
level: "AA",
|
|
@@ -3549,16 +3549,16 @@ const Ba = {
|
|
|
3549
3549
|
for (; r = i.nextNode(); ) {
|
|
3550
3550
|
if (!r.textContent || !r.textContent.trim()) continue;
|
|
3551
3551
|
const o = r.parentElement;
|
|
3552
|
-
if (!o || n.has(o) || (n.add(o),
|
|
3552
|
+
if (!o || n.has(o) || (n.add(o), Ha.has(o.tagName)) || Da(o) || Ba(o)) continue;
|
|
3553
3553
|
const s = C(o);
|
|
3554
3554
|
if (parseFloat(s.opacity) === 0) continue;
|
|
3555
|
-
const u =
|
|
3555
|
+
const u = J(s.color);
|
|
3556
3556
|
if (!u) continue;
|
|
3557
3557
|
const h = s.color.match(/rgba\(.+?,\s*([\d.]+)\s*\)/);
|
|
3558
3558
|
if (h && parseFloat(h[1]) === 0) continue;
|
|
3559
|
-
const d =
|
|
3559
|
+
const d = qe(o);
|
|
3560
3560
|
if (!d) continue;
|
|
3561
|
-
const p = U(u[0], u[1], u[2]), g = U(d[0], d[1], d[2]), f =
|
|
3561
|
+
const p = U(u[0], u[1], u[2]), g = U(d[0], d[1], d[2]), f = Ie(p, g), v = Te(o) ? 3 : 4.5;
|
|
3562
3562
|
if (f < v) {
|
|
3563
3563
|
const y = Math.round(f * 100) / 100, T = Y(u), A = Y(d);
|
|
3564
3564
|
a.push({
|
|
@@ -3573,46 +3573,45 @@ const Ba = {
|
|
|
3573
3573
|
}
|
|
3574
3574
|
return a;
|
|
3575
3575
|
}
|
|
3576
|
-
},
|
|
3576
|
+
}, ee = [
|
|
3577
3577
|
// Document Structure
|
|
3578
|
-
It,
|
|
3579
3578
|
qt,
|
|
3580
3579
|
Ct,
|
|
3581
3580
|
Tt,
|
|
3582
3581
|
Et,
|
|
3583
|
-
|
|
3582
|
+
Lt,
|
|
3584
3583
|
Nt,
|
|
3585
|
-
|
|
3586
|
-
|
|
3584
|
+
Mt,
|
|
3585
|
+
Ht,
|
|
3586
|
+
Bt,
|
|
3587
3587
|
// Images
|
|
3588
|
-
Ee,
|
|
3589
3588
|
Le,
|
|
3590
3589
|
Re,
|
|
3591
3590
|
Ne,
|
|
3592
|
-
|
|
3591
|
+
Me,
|
|
3593
3592
|
He,
|
|
3594
3593
|
De,
|
|
3595
3594
|
Be,
|
|
3596
|
-
|
|
3597
|
-
// Forms
|
|
3595
|
+
Oe,
|
|
3598
3596
|
Pe,
|
|
3597
|
+
// Forms
|
|
3599
3598
|
Ve,
|
|
3600
3599
|
Ue,
|
|
3601
3600
|
je,
|
|
3602
|
-
|
|
3601
|
+
ze,
|
|
3603
3602
|
Xe,
|
|
3604
3603
|
Ke,
|
|
3604
|
+
Ye,
|
|
3605
3605
|
// Keyboard
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
ot,
|
|
3606
|
+
Je,
|
|
3607
|
+
et,
|
|
3609
3608
|
st,
|
|
3610
3609
|
lt,
|
|
3611
|
-
// Structure
|
|
3612
3610
|
ct,
|
|
3613
|
-
|
|
3614
|
-
Bt,
|
|
3611
|
+
// Structure
|
|
3615
3612
|
dt,
|
|
3613
|
+
Rt,
|
|
3614
|
+
Ot,
|
|
3616
3615
|
ut,
|
|
3617
3616
|
mt,
|
|
3618
3617
|
pt,
|
|
@@ -3622,19 +3621,19 @@ const Ba = {
|
|
|
3622
3621
|
ft,
|
|
3623
3622
|
vt,
|
|
3624
3623
|
yt,
|
|
3625
|
-
|
|
3624
|
+
wt,
|
|
3626
3625
|
St,
|
|
3627
|
-
|
|
3626
|
+
xt,
|
|
3627
|
+
It,
|
|
3628
3628
|
// ARIA
|
|
3629
|
-
Ot,
|
|
3630
3629
|
Wt,
|
|
3631
3630
|
_t,
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3631
|
+
Ft,
|
|
3632
|
+
Vt,
|
|
3633
|
+
Xt,
|
|
3634
|
+
Qt,
|
|
3636
3635
|
Zt,
|
|
3637
|
-
|
|
3636
|
+
ea,
|
|
3638
3637
|
na,
|
|
3639
3638
|
ra,
|
|
3640
3639
|
oa,
|
|
@@ -3645,42 +3644,43 @@ const Ba = {
|
|
|
3645
3644
|
ua,
|
|
3646
3645
|
ma,
|
|
3647
3646
|
pa,
|
|
3648
|
-
|
|
3649
|
-
Ut,
|
|
3647
|
+
ha,
|
|
3650
3648
|
fa,
|
|
3649
|
+
jt,
|
|
3650
|
+
va,
|
|
3651
3651
|
// Links
|
|
3652
|
-
ya,
|
|
3653
3652
|
wa,
|
|
3654
3653
|
Aa,
|
|
3655
|
-
// Language
|
|
3656
3654
|
Sa,
|
|
3655
|
+
// Language
|
|
3657
3656
|
xa,
|
|
3658
3657
|
ka,
|
|
3659
3658
|
Ia,
|
|
3660
|
-
// Tables
|
|
3661
3659
|
qa,
|
|
3660
|
+
// Tables
|
|
3662
3661
|
Ca,
|
|
3663
3662
|
Ta,
|
|
3664
3663
|
Ea,
|
|
3665
3664
|
La,
|
|
3666
|
-
// Parsing
|
|
3667
3665
|
Ra,
|
|
3668
|
-
//
|
|
3666
|
+
// Parsing
|
|
3669
3667
|
Na,
|
|
3668
|
+
// Media
|
|
3670
3669
|
Ma,
|
|
3670
|
+
$a,
|
|
3671
3671
|
// Color
|
|
3672
|
-
|
|
3672
|
+
Oa
|
|
3673
3673
|
];
|
|
3674
|
-
let F = [],
|
|
3675
|
-
function
|
|
3676
|
-
t.additionalRules && (F = t.additionalRules), t.disabledRules && (
|
|
3674
|
+
let F = [], te = /* @__PURE__ */ new Set();
|
|
3675
|
+
function Pa(t) {
|
|
3676
|
+
t.additionalRules && (F = t.additionalRules), t.disabledRules && (te = new Set(t.disabledRules));
|
|
3677
3677
|
}
|
|
3678
|
-
function
|
|
3679
|
-
return
|
|
3678
|
+
function ae() {
|
|
3679
|
+
return ee.filter((a) => !te.has(a.id)).concat(F);
|
|
3680
3680
|
}
|
|
3681
|
-
function
|
|
3682
|
-
|
|
3683
|
-
const a =
|
|
3681
|
+
function Va(t) {
|
|
3682
|
+
ie();
|
|
3683
|
+
const a = ae(), e = [];
|
|
3684
3684
|
let i = 0;
|
|
3685
3685
|
return {
|
|
3686
3686
|
processChunk(n) {
|
|
@@ -3699,10 +3699,13 @@ function Pa(t) {
|
|
|
3699
3699
|
}
|
|
3700
3700
|
};
|
|
3701
3701
|
}
|
|
3702
|
-
function
|
|
3702
|
+
function ie() {
|
|
3703
|
+
de(), re(), oe(), ke(), xe(), me();
|
|
3704
|
+
}
|
|
3705
|
+
function Ua(t) {
|
|
3703
3706
|
var i;
|
|
3704
|
-
|
|
3705
|
-
const a =
|
|
3707
|
+
ie();
|
|
3708
|
+
const a = ae(), e = [];
|
|
3706
3709
|
for (const n of a)
|
|
3707
3710
|
try {
|
|
3708
3711
|
e.push(...n.run(t));
|
|
@@ -3715,31 +3718,32 @@ function Va(t) {
|
|
|
3715
3718
|
ruleCount: a.length
|
|
3716
3719
|
};
|
|
3717
3720
|
}
|
|
3718
|
-
const
|
|
3719
|
-
function
|
|
3720
|
-
const a =
|
|
3721
|
+
const Wa = new Map(ee.map((t) => [t.id, t]));
|
|
3722
|
+
function ja(t) {
|
|
3723
|
+
const a = Wa.get(t);
|
|
3721
3724
|
return a || F.find((e) => e.id === t);
|
|
3722
3725
|
}
|
|
3723
3726
|
export {
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3727
|
+
ie as clearAllCaches,
|
|
3728
|
+
xe as clearAriaAttrAuditCache,
|
|
3729
|
+
de as clearAriaHiddenCache,
|
|
3730
|
+
ke as clearColorCaches,
|
|
3731
|
+
re as clearComputedRoleCache,
|
|
3728
3732
|
x as compileDeclarativeRule,
|
|
3729
|
-
|
|
3730
|
-
|
|
3733
|
+
Pa as configureRules,
|
|
3734
|
+
Va as createChunkedAudit,
|
|
3731
3735
|
b as getAccessibleName,
|
|
3732
3736
|
w as getAccessibleTextContent,
|
|
3733
|
-
|
|
3737
|
+
ae as getActiveRules,
|
|
3734
3738
|
E as getComputedRole,
|
|
3735
3739
|
l as getHtmlSnippet,
|
|
3736
|
-
|
|
3737
|
-
|
|
3740
|
+
Q as getImplicitRole,
|
|
3741
|
+
ja as getRuleById,
|
|
3738
3742
|
c as getSelector,
|
|
3739
3743
|
m as isAriaHidden,
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3744
|
+
ce as isValidRole,
|
|
3745
|
+
_a as querySelectorShadowAware,
|
|
3746
|
+
ee as rules,
|
|
3747
|
+
Ua as runAudit,
|
|
3748
|
+
Fa as validateDeclarativeRule
|
|
3745
3749
|
};
|