html-validate 8.9.1 → 8.11.0

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.
@@ -18,6 +18,21 @@ const ReferrerPolicy = [
18
18
  "strict-origin-when-cross-origin",
19
19
  "unsafe-url"
20
20
  ];
21
+ function isInsideLandmark(node) {
22
+ const selectors = [
23
+ "article",
24
+ "aside",
25
+ "main",
26
+ "nav",
27
+ "section",
28
+ '[role="article"]',
29
+ '[role="complementary"]',
30
+ '[role="main"]',
31
+ '[role="navigation"]',
32
+ '[role="region"]'
33
+ ];
34
+ return Boolean(node.closest(selectors.join(",")));
35
+ }
21
36
  var html5 = defineMetadata({
22
37
  "*": {
23
38
  attributes: {
@@ -111,14 +126,22 @@ var html5 = defineMetadata({
111
126
  }
112
127
  },
113
128
  permittedDescendants: [{ exclude: "@interactive" }],
114
- implicitRole(node) {
115
- return node.hasAttribute("href") ? "link" : null;
129
+ aria: {
130
+ implicitRole(node) {
131
+ return node.hasAttribute("href") ? "link" : "generic";
132
+ },
133
+ naming(node) {
134
+ return node.hasAttribute("href") ? "allowed" : "prohibited";
135
+ }
116
136
  }
117
137
  },
118
138
  abbr: {
119
139
  flow: true,
120
140
  phrasing: true,
121
- permittedContent: ["@phrasing"]
141
+ permittedContent: ["@phrasing"],
142
+ aria: {
143
+ naming: "prohibited"
144
+ }
122
145
  },
123
146
  acronym: {
124
147
  deprecated: {
@@ -129,8 +152,8 @@ var html5 = defineMetadata({
129
152
  },
130
153
  address: {
131
154
  flow: true,
132
- implicitRole() {
133
- return "group";
155
+ aria: {
156
+ implicitRole: "group"
134
157
  },
135
158
  permittedContent: ["@flow"],
136
159
  permittedDescendants: [{ exclude: ["address", "header", "footer", "@heading", "@sectioning"] }]
@@ -208,8 +231,13 @@ var html5 = defineMetadata({
208
231
  enum: ["/[^_].*/", "_blank", "_self", "_parent", "_top"]
209
232
  }
210
233
  },
211
- implicitRole(node) {
212
- return node.hasAttribute("href") ? "link" : null;
234
+ aria: {
235
+ implicitRole(node) {
236
+ return node.hasAttribute("href") ? "link" : "generic";
237
+ },
238
+ naming(node) {
239
+ return node.hasAttribute("href") ? "allowed" : "prohibited";
240
+ }
213
241
  },
214
242
  requiredAncestors: ["map"]
215
243
  },
@@ -218,8 +246,8 @@ var html5 = defineMetadata({
218
246
  sectioning: true,
219
247
  permittedContent: ["@flow"],
220
248
  permittedDescendants: [{ exclude: ["main"] }],
221
- implicitRole() {
222
- return "article";
249
+ aria: {
250
+ implicitRole: "article"
223
251
  }
224
252
  },
225
253
  aside: {
@@ -227,8 +255,8 @@ var html5 = defineMetadata({
227
255
  sectioning: true,
228
256
  permittedContent: ["@flow"],
229
257
  permittedDescendants: [{ exclude: ["main"] }],
230
- implicitRole() {
231
- return "complementary";
258
+ aria: {
259
+ implicitRole: "complementary"
232
260
  }
233
261
  },
234
262
  audio: {
@@ -260,12 +288,19 @@ var html5 = defineMetadata({
260
288
  b: {
261
289
  flow: true,
262
290
  phrasing: true,
263
- permittedContent: ["@phrasing"]
291
+ permittedContent: ["@phrasing"],
292
+ aria: {
293
+ implicitRole: "generic",
294
+ naming: "prohibited"
295
+ }
264
296
  },
265
297
  base: {
266
298
  metadata: true,
267
299
  void: true,
268
- permittedParent: ["head"]
300
+ permittedParent: ["head"],
301
+ aria: {
302
+ naming: "prohibited"
303
+ }
269
304
  },
270
305
  basefont: {
271
306
  deprecated: {
@@ -277,12 +312,20 @@ var html5 = defineMetadata({
277
312
  bdi: {
278
313
  flow: true,
279
314
  phrasing: true,
280
- permittedContent: ["@phrasing"]
315
+ permittedContent: ["@phrasing"],
316
+ aria: {
317
+ implicitRole: "generic",
318
+ naming: "prohibited"
319
+ }
281
320
  },
282
321
  bdo: {
283
322
  flow: true,
284
323
  phrasing: true,
285
- permittedContent: ["@phrasing"]
324
+ permittedContent: ["@phrasing"],
325
+ aria: {
326
+ implicitRole: "generic",
327
+ naming: "prohibited"
328
+ }
286
329
  },
287
330
  bgsound: {
288
331
  deprecated: {
@@ -307,8 +350,8 @@ var html5 = defineMetadata({
307
350
  blockquote: {
308
351
  flow: true,
309
352
  sectioning: true,
310
- implicitRole() {
311
- return "blockquote";
353
+ aria: {
354
+ implicitRole: "blockquote"
312
355
  },
313
356
  permittedContent: ["@flow"]
314
357
  },
@@ -352,6 +395,10 @@ var html5 = defineMetadata({
352
395
  vlink: {
353
396
  deprecated: true
354
397
  }
398
+ },
399
+ aria: {
400
+ implicitRole: "generic",
401
+ naming: "prohibited"
355
402
  }
356
403
  },
357
404
  br: {
@@ -362,6 +409,9 @@ var html5 = defineMetadata({
362
409
  clear: {
363
410
  deprecated: true
364
411
  }
412
+ },
413
+ aria: {
414
+ naming: "prohibited"
365
415
  }
366
416
  },
367
417
  button: {
@@ -411,8 +461,8 @@ var html5 = defineMetadata({
411
461
  enum: ["submit", "reset", "button"]
412
462
  }
413
463
  },
414
- implicitRole() {
415
- return "button";
464
+ aria: {
465
+ implicitRole: "button"
416
466
  },
417
467
  permittedContent: ["@phrasing"],
418
468
  permittedDescendants: [{ exclude: ["@interactive"] }],
@@ -431,6 +481,10 @@ var html5 = defineMetadata({
431
481
  align: {
432
482
  deprecated: true
433
483
  }
484
+ },
485
+ aria: {
486
+ implicitRole: "caption",
487
+ naming: "prohibited"
434
488
  }
435
489
  },
436
490
  center: {
@@ -443,12 +497,19 @@ var html5 = defineMetadata({
443
497
  cite: {
444
498
  flow: true,
445
499
  phrasing: true,
446
- permittedContent: ["@phrasing"]
500
+ permittedContent: ["@phrasing"],
501
+ aria: {
502
+ naming: "prohibited"
503
+ }
447
504
  },
448
505
  code: {
449
506
  flow: true,
450
507
  phrasing: true,
451
- permittedContent: ["@phrasing"]
508
+ permittedContent: ["@phrasing"],
509
+ aria: {
510
+ implicitRole: "code",
511
+ naming: "prohibited"
512
+ }
452
513
  },
453
514
  col: {
454
515
  attributes: {
@@ -471,7 +532,10 @@ var html5 = defineMetadata({
471
532
  deprecated: true
472
533
  }
473
534
  },
474
- void: true
535
+ void: true,
536
+ aria: {
537
+ naming: "prohibited"
538
+ }
475
539
  },
476
540
  colgroup: {
477
541
  implicitClosed: ["colgroup"],
@@ -480,18 +544,26 @@ var html5 = defineMetadata({
480
544
  enum: ["/\\d+/"]
481
545
  }
482
546
  },
483
- permittedContent: ["col", "template"]
547
+ permittedContent: ["col", "template"],
548
+ aria: {
549
+ naming: "prohibited"
550
+ }
484
551
  },
485
552
  data: {
486
553
  flow: true,
487
554
  phrasing: true,
488
- permittedContent: ["@phrasing"]
555
+ permittedContent: ["@phrasing"],
556
+ aria: {
557
+ implicitRole: "generic",
558
+ naming: "prohibited"
559
+ }
489
560
  },
490
561
  datalist: {
491
562
  flow: true,
492
563
  phrasing: true,
493
- implicitRole() {
494
- return "listbox";
564
+ aria: {
565
+ implicitRole: "listbox",
566
+ naming: "prohibited"
495
567
  },
496
568
  permittedContent: ["@phrasing", "option"]
497
569
  },
@@ -503,7 +575,11 @@ var html5 = defineMetadata({
503
575
  del: {
504
576
  flow: true,
505
577
  phrasing: true,
506
- transparent: true
578
+ transparent: true,
579
+ aria: {
580
+ implicitRole: "deletion",
581
+ naming: "prohibited"
582
+ }
507
583
  },
508
584
  details: {
509
585
  flow: true,
@@ -514,8 +590,8 @@ var html5 = defineMetadata({
514
590
  boolean: true
515
591
  }
516
592
  },
517
- implicitRole() {
518
- return "group";
593
+ aria: {
594
+ implicitRole: "group"
519
595
  },
520
596
  permittedContent: ["summary", "@flow"],
521
597
  permittedOrder: ["summary", "@flow"],
@@ -524,8 +600,8 @@ var html5 = defineMetadata({
524
600
  dfn: {
525
601
  flow: true,
526
602
  phrasing: true,
527
- implicitRole() {
528
- return "term";
603
+ aria: {
604
+ implicitRole: "term"
529
605
  },
530
606
  permittedContent: ["@phrasing"],
531
607
  permittedDescendants: [{ exclude: ["dfn"] }]
@@ -538,8 +614,8 @@ var html5 = defineMetadata({
538
614
  boolean: true
539
615
  }
540
616
  },
541
- implicitRole() {
542
- return "dialog";
617
+ aria: {
618
+ implicitRole: "dialog"
543
619
  }
544
620
  },
545
621
  dir: {
@@ -564,6 +640,10 @@ var html5 = defineMetadata({
564
640
  datasrc: {
565
641
  deprecated: true
566
642
  }
643
+ },
644
+ aria: {
645
+ implicitRole: "generic",
646
+ naming: "prohibited"
567
647
  }
568
648
  },
569
649
  dl: {
@@ -584,7 +664,11 @@ var html5 = defineMetadata({
584
664
  em: {
585
665
  flow: true,
586
666
  phrasing: true,
587
- permittedContent: ["@phrasing"]
667
+ permittedContent: ["@phrasing"],
668
+ aria: {
669
+ implicitRole: "emphasis",
670
+ naming: "prohibited"
671
+ }
588
672
  },
589
673
  embed: {
590
674
  flow: true,
@@ -615,19 +699,22 @@ var html5 = defineMetadata({
615
699
  boolean: true
616
700
  }
617
701
  },
618
- implicitRole() {
619
- return "group";
702
+ aria: {
703
+ implicitRole: "group"
620
704
  },
621
705
  permittedContent: ["@flow", "legend?"],
622
706
  permittedOrder: ["legend", "@flow"]
623
707
  },
624
708
  figcaption: {
625
- permittedContent: ["@flow"]
709
+ permittedContent: ["@flow"],
710
+ aria: {
711
+ naming: "prohibited"
712
+ }
626
713
  },
627
714
  figure: {
628
715
  flow: true,
629
- implicitRole() {
630
- return "figure";
716
+ aria: {
717
+ implicitRole: "figure"
631
718
  },
632
719
  permittedContent: ["@flow", "figcaption?"],
633
720
  permittedOrder: ["figcaption", "@flow", "figcaption"]
@@ -641,23 +728,20 @@ var html5 = defineMetadata({
641
728
  },
642
729
  footer: {
643
730
  flow: true,
644
- implicitRole(node) {
645
- const selectors = [
646
- "article",
647
- "aside",
648
- "main",
649
- "nav",
650
- "section",
651
- '[role="article"]',
652
- '[role="complementary"]',
653
- '[role="main"]',
654
- '[role="navigation"]',
655
- '[role="region"]'
656
- ];
657
- if (node.closest(selectors.join(","))) {
658
- return null;
659
- } else {
660
- return "contentinfo";
731
+ aria: {
732
+ implicitRole(node) {
733
+ if (isInsideLandmark(node)) {
734
+ return "generic";
735
+ } else {
736
+ return "contentinfo";
737
+ }
738
+ },
739
+ naming(node) {
740
+ if (isInsideLandmark(node)) {
741
+ return "prohibited";
742
+ } else {
743
+ return "allowed";
744
+ }
661
745
  }
662
746
  },
663
747
  permittedContent: ["@flow"],
@@ -686,8 +770,8 @@ var html5 = defineMetadata({
686
770
  enum: ["/[^_].*/", "_blank", "_self", "_parent", "_top"]
687
771
  }
688
772
  },
689
- implicitRole() {
690
- return "form";
773
+ aria: {
774
+ implicitRole: "form"
691
775
  },
692
776
  permittedContent: ["@flow"],
693
777
  permittedDescendants: [{ exclude: ["@form"] }]
@@ -724,8 +808,8 @@ var html5 = defineMetadata({
724
808
  deprecated: true
725
809
  }
726
810
  },
727
- implicitRole() {
728
- return "heading";
811
+ aria: {
812
+ implicitRole: "heading"
729
813
  }
730
814
  },
731
815
  h2: {
@@ -737,8 +821,8 @@ var html5 = defineMetadata({
737
821
  deprecated: true
738
822
  }
739
823
  },
740
- implicitRole() {
741
- return "heading";
824
+ aria: {
825
+ implicitRole: "heading"
742
826
  }
743
827
  },
744
828
  h3: {
@@ -750,8 +834,8 @@ var html5 = defineMetadata({
750
834
  deprecated: true
751
835
  }
752
836
  },
753
- implicitRole() {
754
- return "heading";
837
+ aria: {
838
+ implicitRole: "heading"
755
839
  }
756
840
  },
757
841
  h4: {
@@ -763,8 +847,8 @@ var html5 = defineMetadata({
763
847
  deprecated: true
764
848
  }
765
849
  },
766
- implicitRole() {
767
- return "heading";
850
+ aria: {
851
+ implicitRole: "heading"
768
852
  }
769
853
  },
770
854
  h5: {
@@ -776,8 +860,8 @@ var html5 = defineMetadata({
776
860
  deprecated: true
777
861
  }
778
862
  },
779
- implicitRole() {
780
- return "heading";
863
+ aria: {
864
+ implicitRole: "heading"
781
865
  }
782
866
  },
783
867
  h6: {
@@ -789,8 +873,8 @@ var html5 = defineMetadata({
789
873
  deprecated: true
790
874
  }
791
875
  },
792
- implicitRole() {
793
- return "heading";
876
+ aria: {
877
+ implicitRole: "heading"
794
878
  }
795
879
  },
796
880
  head: {
@@ -801,27 +885,27 @@ var html5 = defineMetadata({
801
885
  profile: {
802
886
  deprecated: true
803
887
  }
888
+ },
889
+ aria: {
890
+ naming: "prohibited"
804
891
  }
805
892
  },
806
893
  header: {
807
894
  flow: true,
808
- implicitRole(node) {
809
- const selectors = [
810
- "article",
811
- "aside",
812
- "main",
813
- "nav",
814
- "section",
815
- '[role="article"]',
816
- '[role="complementary"]',
817
- '[role="main"]',
818
- '[role="navigation"]',
819
- '[role="region"]'
820
- ];
821
- if (node.closest(selectors.join(","))) {
822
- return null;
823
- } else {
824
- return "banner";
895
+ aria: {
896
+ implicitRole(node) {
897
+ if (isInsideLandmark(node)) {
898
+ return "generic";
899
+ } else {
900
+ return "banner";
901
+ }
902
+ },
903
+ naming(node) {
904
+ if (isInsideLandmark(node)) {
905
+ return "prohibited";
906
+ } else {
907
+ return "allowed";
908
+ }
825
909
  }
826
910
  },
827
911
  permittedContent: ["@flow"],
@@ -832,7 +916,10 @@ var html5 = defineMetadata({
832
916
  heading: true,
833
917
  permittedContent: ["p", "@heading?"],
834
918
  permittedDescendants: [{ exclude: ["hgroup"] }],
835
- requiredContent: ["@heading"]
919
+ requiredContent: ["@heading"],
920
+ aria: {
921
+ implicitRole: "group"
922
+ }
836
923
  },
837
924
  hr: {
838
925
  flow: true,
@@ -854,8 +941,8 @@ var html5 = defineMetadata({
854
941
  deprecated: true
855
942
  }
856
943
  },
857
- implicitRole() {
858
- return "separator";
944
+ aria: {
945
+ implicitRole: "separator"
859
946
  }
860
947
  },
861
948
  html: {
@@ -870,14 +957,19 @@ var html5 = defineMetadata({
870
957
  deprecated: true
871
958
  }
872
959
  },
873
- implicitRole() {
874
- return "document";
960
+ aria: {
961
+ implicitRole: "document",
962
+ naming: "prohibited"
875
963
  }
876
964
  },
877
965
  i: {
878
966
  flow: true,
879
967
  phrasing: true,
880
- permittedContent: ["@phrasing"]
968
+ permittedContent: ["@phrasing"],
969
+ aria: {
970
+ implicitRole: "generic",
971
+ naming: "prohibited"
972
+ }
881
973
  },
882
974
  iframe: {
883
975
  flow: true,
@@ -979,12 +1071,28 @@ var html5 = defineMetadata({
979
1071
  deprecated: true
980
1072
  }
981
1073
  },
982
- implicitRole(node) {
983
- const alt = node.getAttribute("alt");
984
- if (alt === "") {
985
- return "presentation";
986
- } else {
987
- return "img";
1074
+ aria: {
1075
+ implicitRole(node) {
1076
+ const alt = node.getAttribute("alt");
1077
+ const ariaLabel = node.getAttribute("aria-label");
1078
+ const ariaLabelledBy = node.getAttribute("aria-labelledby");
1079
+ const title = node.getAttribute("title");
1080
+ if (alt === "" && !ariaLabel && !ariaLabelledBy && !title) {
1081
+ return "none";
1082
+ } else {
1083
+ return "img";
1084
+ }
1085
+ },
1086
+ naming(node) {
1087
+ const alt = node.getAttribute("alt");
1088
+ const ariaLabel = node.getAttribute("aria-label");
1089
+ const ariaLabelledBy = node.getAttribute("aria-labelledby");
1090
+ const title = node.getAttribute("title");
1091
+ if (!alt && !ariaLabel && !ariaLabelledBy && !title) {
1092
+ return "prohibited";
1093
+ } else {
1094
+ return "allowed";
1095
+ }
988
1096
  }
989
1097
  }
990
1098
  },
@@ -1076,7 +1184,6 @@ var html5 = defineMetadata({
1076
1184
  enum: ["default", "false", "true"]
1077
1185
  },
1078
1186
  type: {
1079
- required: true,
1080
1187
  enum: [
1081
1188
  "button",
1082
1189
  "checkbox",
@@ -1109,49 +1216,76 @@ var html5 = defineMetadata({
1109
1216
  deprecated: true
1110
1217
  }
1111
1218
  },
1112
- /* eslint-disable-next-line complexity -- the standard is complicated */
1113
- implicitRole(node) {
1114
- const list = node.hasAttribute("list");
1115
- if (list) {
1116
- return "combobox";
1117
- }
1118
- const type = node.getAttribute("type");
1119
- switch (type) {
1120
- case "button":
1121
- return "button";
1122
- case "checkbox":
1123
- return "checkbox";
1124
- case "email":
1125
- return "textbox";
1126
- case "image":
1127
- return "button";
1128
- case "number":
1129
- return "spinbutton";
1130
- case "radio":
1131
- return "radio";
1132
- case "range":
1133
- return "slider";
1134
- case "reset":
1135
- return "button";
1136
- case "search":
1137
- return "searchbox";
1138
- case "submit":
1139
- return "button";
1140
- case "tel":
1141
- return "textbox";
1142
- case "text":
1143
- return "textbox";
1144
- case "url":
1145
- return "textbox";
1146
- default:
1147
- return "textbox";
1219
+ aria: {
1220
+ /* eslint-disable-next-line complexity -- the standard is complicated */
1221
+ implicitRole(node) {
1222
+ const list = node.hasAttribute("list");
1223
+ if (list) {
1224
+ return "combobox";
1225
+ }
1226
+ const type = node.getAttribute("type");
1227
+ switch (type) {
1228
+ case "button":
1229
+ return "button";
1230
+ case "checkbox":
1231
+ return "checkbox";
1232
+ case "color":
1233
+ return null;
1234
+ case "date":
1235
+ return null;
1236
+ case "datetime-local":
1237
+ return null;
1238
+ case "email":
1239
+ return "textbox";
1240
+ case "file":
1241
+ return null;
1242
+ case "hidden":
1243
+ return null;
1244
+ case "image":
1245
+ return "button";
1246
+ case "month":
1247
+ return null;
1248
+ case "number":
1249
+ return "spinbutton";
1250
+ case "password":
1251
+ return null;
1252
+ case "radio":
1253
+ return "radio";
1254
+ case "range":
1255
+ return "slider";
1256
+ case "reset":
1257
+ return "button";
1258
+ case "search":
1259
+ return "searchbox";
1260
+ case "submit":
1261
+ return "button";
1262
+ case "tel":
1263
+ return "textbox";
1264
+ case "text":
1265
+ return "textbox";
1266
+ case "time":
1267
+ return null;
1268
+ case "url":
1269
+ return "textbox";
1270
+ case "week":
1271
+ return null;
1272
+ default:
1273
+ return "textbox";
1274
+ }
1275
+ },
1276
+ naming(node) {
1277
+ return node.getAttribute("type") !== "hidden" ? "allowed" : "prohibited";
1148
1278
  }
1149
1279
  }
1150
1280
  },
1151
1281
  ins: {
1152
1282
  flow: true,
1153
1283
  phrasing: true,
1154
- transparent: true
1284
+ transparent: true,
1285
+ aria: {
1286
+ implicitRole: "insertion",
1287
+ naming: "prohibited"
1288
+ }
1155
1289
  },
1156
1290
  isindex: {
1157
1291
  deprecated: {
@@ -1161,7 +1295,10 @@ var html5 = defineMetadata({
1161
1295
  kbd: {
1162
1296
  flow: true,
1163
1297
  phrasing: true,
1164
- permittedContent: ["@phrasing"]
1298
+ permittedContent: ["@phrasing"],
1299
+ aria: {
1300
+ naming: "prohibited"
1301
+ }
1165
1302
  },
1166
1303
  keygen: {
1167
1304
  flow: true,
@@ -1190,6 +1327,9 @@ var html5 = defineMetadata({
1190
1327
  for: {
1191
1328
  enum: [validId]
1192
1329
  }
1330
+ },
1331
+ aria: {
1332
+ naming: "prohibited"
1193
1333
  }
1194
1334
  },
1195
1335
  legend: {
@@ -1207,6 +1347,9 @@ var html5 = defineMetadata({
1207
1347
  datasrc: {
1208
1348
  deprecated: true
1209
1349
  }
1350
+ },
1351
+ aria: {
1352
+ naming: "prohibited"
1210
1353
  }
1211
1354
  },
1212
1355
  li: {
@@ -1218,8 +1361,10 @@ var html5 = defineMetadata({
1218
1361
  deprecated: true
1219
1362
  }
1220
1363
  },
1221
- implicitRole(node) {
1222
- return node.closest("ul, ol, menu") ? "listitem" : null;
1364
+ aria: {
1365
+ implicitRole(node) {
1366
+ return node.closest("ul, ol, menu") ? "listitem" : "generic";
1367
+ }
1223
1368
  }
1224
1369
  },
1225
1370
  link: {
@@ -1289,6 +1434,9 @@ var html5 = defineMetadata({
1289
1434
  urn: {
1290
1435
  deprecated: true
1291
1436
  }
1437
+ },
1438
+ aria: {
1439
+ naming: "prohibited"
1292
1440
  }
1293
1441
  },
1294
1442
  listing: {
@@ -1298,8 +1446,8 @@ var html5 = defineMetadata({
1298
1446
  },
1299
1447
  main: {
1300
1448
  flow: true,
1301
- implicitRole() {
1302
- return "main";
1449
+ aria: {
1450
+ implicitRole: "main"
1303
1451
  }
1304
1452
  },
1305
1453
  map: {
@@ -1311,12 +1459,18 @@ var html5 = defineMetadata({
1311
1459
  required: true,
1312
1460
  enum: ["/\\S+/"]
1313
1461
  }
1462
+ },
1463
+ aria: {
1464
+ naming: "prohibited"
1314
1465
  }
1315
1466
  },
1316
1467
  mark: {
1317
1468
  flow: true,
1318
1469
  phrasing: true,
1319
- permittedContent: ["@phrasing"]
1470
+ permittedContent: ["@phrasing"],
1471
+ aria: {
1472
+ naming: "prohibited"
1473
+ }
1320
1474
  },
1321
1475
  marquee: {
1322
1476
  deprecated: {
@@ -1363,14 +1517,14 @@ var html5 = defineMetadata({
1363
1517
  deprecated: true
1364
1518
  }
1365
1519
  },
1366
- implicitRole() {
1367
- return "math";
1520
+ aria: {
1521
+ implicitRole: "math"
1368
1522
  }
1369
1523
  },
1370
1524
  menu: {
1371
1525
  flow: true,
1372
- implicitRole() {
1373
- return "list";
1526
+ aria: {
1527
+ implicitRole: "list"
1374
1528
  },
1375
1529
  permittedContent: ["@script", "li"]
1376
1530
  },
@@ -1398,14 +1552,17 @@ var html5 = defineMetadata({
1398
1552
  scheme: {
1399
1553
  deprecated: true
1400
1554
  }
1555
+ },
1556
+ aria: {
1557
+ naming: "prohibited"
1401
1558
  }
1402
1559
  },
1403
1560
  meter: {
1404
1561
  flow: true,
1405
1562
  phrasing: true,
1406
1563
  labelable: true,
1407
- implicitRole() {
1408
- return "meter";
1564
+ aria: {
1565
+ implicitRole: "meter"
1409
1566
  },
1410
1567
  permittedContent: ["@phrasing"],
1411
1568
  permittedDescendants: [{ exclude: "meter" }]
@@ -1420,8 +1577,8 @@ var html5 = defineMetadata({
1420
1577
  nav: {
1421
1578
  flow: true,
1422
1579
  sectioning: true,
1423
- implicitRole() {
1424
- return "navigation";
1580
+ aria: {
1581
+ implicitRole: "navigation"
1425
1582
  },
1426
1583
  permittedContent: ["@flow"],
1427
1584
  permittedDescendants: [{ exclude: "main" }]
@@ -1453,7 +1610,10 @@ var html5 = defineMetadata({
1453
1610
  flow: true,
1454
1611
  phrasing: true,
1455
1612
  transparent: true,
1456
- permittedDescendants: [{ exclude: "noscript" }]
1613
+ permittedDescendants: [{ exclude: "noscript" }],
1614
+ aria: {
1615
+ naming: "prohibited"
1616
+ }
1457
1617
  },
1458
1618
  object: {
1459
1619
  flow: true,
@@ -1535,8 +1695,8 @@ var html5 = defineMetadata({
1535
1695
  enum: ["a", "A", "i", "I", "1"]
1536
1696
  }
1537
1697
  },
1538
- implicitRole() {
1539
- return "list";
1698
+ aria: {
1699
+ implicitRole: "list"
1540
1700
  },
1541
1701
  permittedContent: ["@script", "li"]
1542
1702
  },
@@ -1547,8 +1707,8 @@ var html5 = defineMetadata({
1547
1707
  boolean: true
1548
1708
  }
1549
1709
  },
1550
- implicitRole() {
1551
- return "group";
1710
+ aria: {
1711
+ implicitRole: "group"
1552
1712
  },
1553
1713
  permittedContent: ["@script", "option"]
1554
1714
  },
@@ -1571,8 +1731,8 @@ var html5 = defineMetadata({
1571
1731
  boolean: true
1572
1732
  }
1573
1733
  },
1574
- implicitRole() {
1575
- return "option";
1734
+ aria: {
1735
+ implicitRole: "option"
1576
1736
  },
1577
1737
  permittedContent: []
1578
1738
  },
@@ -1583,8 +1743,8 @@ var html5 = defineMetadata({
1583
1743
  listed: true
1584
1744
  },
1585
1745
  labelable: true,
1586
- implicitRole() {
1587
- return "status";
1746
+ aria: {
1747
+ implicitRole: "status"
1588
1748
  },
1589
1749
  permittedContent: ["@phrasing"]
1590
1750
  },
@@ -1623,6 +1783,10 @@ var html5 = defineMetadata({
1623
1783
  align: {
1624
1784
  deprecated: true
1625
1785
  }
1786
+ },
1787
+ aria: {
1788
+ implicitRole: "paragraph",
1789
+ naming: "prohibited"
1626
1790
  }
1627
1791
  },
1628
1792
  param: {
@@ -1637,6 +1801,9 @@ var html5 = defineMetadata({
1637
1801
  valuetype: {
1638
1802
  deprecated: true
1639
1803
  }
1804
+ },
1805
+ aria: {
1806
+ naming: "prohibited"
1640
1807
  }
1641
1808
  },
1642
1809
  picture: {
@@ -1644,7 +1811,10 @@ var html5 = defineMetadata({
1644
1811
  phrasing: true,
1645
1812
  embedded: true,
1646
1813
  permittedContent: ["@script", "source", "img"],
1647
- permittedOrder: ["source", "img"]
1814
+ permittedOrder: ["source", "img"],
1815
+ aria: {
1816
+ naming: "prohibited"
1817
+ }
1648
1818
  },
1649
1819
  plaintext: {
1650
1820
  deprecated: {
@@ -1660,14 +1830,18 @@ var html5 = defineMetadata({
1660
1830
  width: {
1661
1831
  deprecated: true
1662
1832
  }
1833
+ },
1834
+ aria: {
1835
+ implicitRole: "generic",
1836
+ naming: "prohibited"
1663
1837
  }
1664
1838
  },
1665
1839
  progress: {
1666
1840
  flow: true,
1667
1841
  phrasing: true,
1668
1842
  labelable: true,
1669
- implicitRole() {
1670
- return "progressbar";
1843
+ aria: {
1844
+ implicitRole: "progressbar"
1671
1845
  },
1672
1846
  permittedContent: ["@phrasing"],
1673
1847
  permittedDescendants: [{ exclude: "progress" }]
@@ -1675,7 +1849,11 @@ var html5 = defineMetadata({
1675
1849
  q: {
1676
1850
  flow: true,
1677
1851
  phrasing: true,
1678
- permittedContent: ["@phrasing"]
1852
+ permittedContent: ["@phrasing"],
1853
+ aria: {
1854
+ implicitRole: "generic",
1855
+ naming: "prohibited"
1856
+ }
1679
1857
  },
1680
1858
  rb: {
1681
1859
  implicitClosed: ["rb", "rt", "rtc", "rp"],
@@ -1683,11 +1861,17 @@ var html5 = defineMetadata({
1683
1861
  },
1684
1862
  rp: {
1685
1863
  implicitClosed: ["rb", "rt", "rtc", "rp"],
1686
- permittedContent: ["@phrasing"]
1864
+ permittedContent: ["@phrasing"],
1865
+ aria: {
1866
+ naming: "prohibited"
1867
+ }
1687
1868
  },
1688
1869
  rt: {
1689
1870
  implicitClosed: ["rb", "rt", "rtc", "rp"],
1690
- permittedContent: ["@phrasing"]
1871
+ permittedContent: ["@phrasing"],
1872
+ aria: {
1873
+ naming: "prohibited"
1874
+ }
1691
1875
  },
1692
1876
  rtc: {
1693
1877
  implicitClosed: ["rb", "rtc", "rp"],
@@ -1701,12 +1885,20 @@ var html5 = defineMetadata({
1701
1885
  s: {
1702
1886
  flow: true,
1703
1887
  phrasing: true,
1704
- permittedContent: ["@phrasing"]
1888
+ permittedContent: ["@phrasing"],
1889
+ aria: {
1890
+ implicitRole: "deletion",
1891
+ naming: "prohibited"
1892
+ }
1705
1893
  },
1706
1894
  samp: {
1707
1895
  flow: true,
1708
1896
  phrasing: true,
1709
- permittedContent: ["@phrasing"]
1897
+ permittedContent: ["@phrasing"],
1898
+ aria: {
1899
+ implicitRole: "generic",
1900
+ naming: "prohibited"
1901
+ }
1710
1902
  },
1711
1903
  script: {
1712
1904
  metadata: true,
@@ -1746,19 +1938,25 @@ var html5 = defineMetadata({
1746
1938
  src: {
1747
1939
  enum: ["/.+/"]
1748
1940
  }
1941
+ },
1942
+ aria: {
1943
+ naming: "prohibited"
1749
1944
  }
1750
1945
  },
1751
1946
  search: {
1752
1947
  flow: true,
1753
- implicitRole() {
1754
- return "search";
1948
+ aria: {
1949
+ implicitRole: "search"
1755
1950
  }
1756
1951
  },
1757
1952
  section: {
1758
1953
  flow: true,
1759
1954
  sectioning: true,
1760
- implicitRole() {
1761
- return "region";
1955
+ aria: {
1956
+ implicitRole(node) {
1957
+ const name = node.hasAttribute("aria-label") || node.hasAttribute("aria-labelledby");
1958
+ return name ? "region" : "generic";
1959
+ }
1762
1960
  },
1763
1961
  permittedContent: ["@flow"]
1764
1962
  },
@@ -1788,31 +1986,40 @@ var html5 = defineMetadata({
1788
1986
  enum: ["/\\d+/"]
1789
1987
  }
1790
1988
  },
1791
- implicitRole(node) {
1792
- const multiple = node.hasAttribute("multiple");
1793
- if (multiple) {
1794
- return "listbox";
1795
- }
1796
- const size = node.getAttribute("size");
1797
- if (typeof size === "string") {
1798
- const parsed = parseInt(size, 10);
1799
- if (parsed > 1) {
1989
+ aria: {
1990
+ implicitRole(node) {
1991
+ const multiple = node.hasAttribute("multiple");
1992
+ if (multiple) {
1800
1993
  return "listbox";
1801
1994
  }
1995
+ const size = node.getAttribute("size");
1996
+ if (typeof size === "string") {
1997
+ const parsed = parseInt(size, 10);
1998
+ if (parsed > 1) {
1999
+ return "listbox";
2000
+ }
2001
+ }
2002
+ return "combobox";
1802
2003
  }
1803
- return "combobox";
1804
2004
  },
1805
2005
  permittedContent: ["@script", "datasrc", "datafld", "dataformatas", "option", "optgroup"]
1806
2006
  },
1807
2007
  slot: {
1808
2008
  flow: true,
1809
2009
  phrasing: true,
1810
- transparent: true
2010
+ transparent: true,
2011
+ aria: {
2012
+ naming: "prohibited"
2013
+ }
1811
2014
  },
1812
2015
  small: {
1813
2016
  flow: true,
1814
2017
  phrasing: true,
1815
- permittedContent: ["@phrasing"]
2018
+ permittedContent: ["@phrasing"],
2019
+ aria: {
2020
+ implicitRole: "generic",
2021
+ naming: "prohibited"
2022
+ }
1816
2023
  },
1817
2024
  source: {
1818
2025
  void: true,
@@ -1836,6 +2043,9 @@ var html5 = defineMetadata({
1836
2043
  allowed: allowedIfParentIsPresent("picture"),
1837
2044
  enum: ["/\\d+/"]
1838
2045
  }
2046
+ },
2047
+ aria: {
2048
+ naming: "prohibited"
1839
2049
  }
1840
2050
  },
1841
2051
  spacer: {
@@ -1859,6 +2069,10 @@ var html5 = defineMetadata({
1859
2069
  datasrc: {
1860
2070
  deprecated: true
1861
2071
  }
2072
+ },
2073
+ aria: {
2074
+ implicitRole: "generic",
2075
+ naming: "prohibited"
1862
2076
  }
1863
2077
  },
1864
2078
  strike: {
@@ -1871,29 +2085,50 @@ var html5 = defineMetadata({
1871
2085
  strong: {
1872
2086
  flow: true,
1873
2087
  phrasing: true,
1874
- permittedContent: ["@phrasing"]
2088
+ permittedContent: ["@phrasing"],
2089
+ aria: {
2090
+ implicitRole: "strong",
2091
+ naming: "prohibited"
2092
+ }
1875
2093
  },
1876
2094
  style: {
1877
- metadata: true
2095
+ metadata: true,
2096
+ aria: {
2097
+ naming: "prohibited"
2098
+ }
1878
2099
  },
1879
2100
  sub: {
1880
2101
  flow: true,
1881
2102
  phrasing: true,
1882
- permittedContent: ["@phrasing"]
2103
+ permittedContent: ["@phrasing"],
2104
+ aria: {
2105
+ implicitRole: "subscript",
2106
+ naming: "prohibited"
2107
+ }
1883
2108
  },
1884
2109
  summary: {
1885
- permittedContent: ["@phrasing", "@heading"]
2110
+ permittedContent: ["@phrasing", "@heading"],
2111
+ aria: {
2112
+ implicitRole: "button"
2113
+ }
1886
2114
  },
1887
2115
  sup: {
1888
2116
  flow: true,
1889
2117
  phrasing: true,
1890
- permittedContent: ["@phrasing"]
2118
+ permittedContent: ["@phrasing"],
2119
+ aria: {
2120
+ implicitRole: "superscript",
2121
+ naming: "prohibited"
2122
+ }
1891
2123
  },
1892
2124
  svg: {
1893
2125
  flow: true,
1894
2126
  foreign: true,
1895
2127
  phrasing: true,
1896
- embedded: true
2128
+ embedded: true,
2129
+ aria: {
2130
+ implicitRole: "graphics-document"
2131
+ }
1897
2132
  },
1898
2133
  /* while not part of HTML 5 specification these two elements are handled as
1899
2134
  * special cases to allow them as accessible text and to avoid issues with
@@ -1945,8 +2180,8 @@ var html5 = defineMetadata({
1945
2180
  deprecated: true
1946
2181
  }
1947
2182
  },
1948
- implicitRole() {
1949
- return "table";
2183
+ aria: {
2184
+ implicitRole: "table"
1950
2185
  }
1951
2186
  },
1952
2187
  tbody: {
@@ -1969,8 +2204,8 @@ var html5 = defineMetadata({
1969
2204
  deprecated: true
1970
2205
  }
1971
2206
  },
1972
- implicitRole() {
1973
- return "rowgroup";
2207
+ aria: {
2208
+ implicitRole: "rowgroup"
1974
2209
  }
1975
2210
  },
1976
2211
  td: {
@@ -2017,13 +2252,19 @@ var html5 = defineMetadata({
2017
2252
  deprecated: true
2018
2253
  }
2019
2254
  },
2020
- implicitRole(node) {
2021
- if (node.closest('table[role="grid"], table[role="treegrid"]')) {
2022
- return "gridcell";
2023
- } else if (node.closest("table")) {
2024
- return "cell";
2025
- } else {
2026
- return null;
2255
+ aria: {
2256
+ implicitRole(node) {
2257
+ const table = node.closest("table");
2258
+ const tableRole = (table == null ? void 0 : table.getAttribute("role")) ?? "table";
2259
+ switch (tableRole) {
2260
+ case "table":
2261
+ return "cell";
2262
+ case "grid":
2263
+ case "treegrid":
2264
+ return "gridcell";
2265
+ default:
2266
+ return null;
2267
+ }
2027
2268
  }
2028
2269
  },
2029
2270
  permittedContent: ["@flow"]
@@ -2032,7 +2273,10 @@ var html5 = defineMetadata({
2032
2273
  metadata: true,
2033
2274
  flow: true,
2034
2275
  phrasing: true,
2035
- scriptSupporting: true
2276
+ scriptSupporting: true,
2277
+ aria: {
2278
+ naming: "prohibited"
2279
+ }
2036
2280
  },
2037
2281
  textarea: {
2038
2282
  flow: true,
@@ -2084,8 +2328,8 @@ var html5 = defineMetadata({
2084
2328
  enum: ["hard", "soft"]
2085
2329
  }
2086
2330
  },
2087
- implicitRole() {
2088
- return "textbox";
2331
+ aria: {
2332
+ implicitRole: "textbox"
2089
2333
  },
2090
2334
  permittedContent: []
2091
2335
  },
@@ -2109,8 +2353,8 @@ var html5 = defineMetadata({
2109
2353
  deprecated: true
2110
2354
  }
2111
2355
  },
2112
- implicitRole() {
2113
- return "rowgroup";
2356
+ aria: {
2357
+ implicitRole: "rowgroup"
2114
2358
  }
2115
2359
  },
2116
2360
  th: {
@@ -2157,23 +2401,22 @@ var html5 = defineMetadata({
2157
2401
  deprecated: true
2158
2402
  }
2159
2403
  },
2160
- implicitRole(node) {
2161
- const table = node.closest("table");
2162
- if (!table) {
2163
- return null;
2164
- }
2165
- const tableRole = table.getAttribute("role") ?? "table";
2166
- if (typeof tableRole !== "string" || !["table", "grid", "treegrid"].includes(tableRole)) {
2167
- return null;
2168
- }
2169
- const scope = node.getAttribute("scope");
2170
- switch (scope) {
2171
- case "col":
2172
- return "columnheader";
2173
- case "row":
2174
- return "rowheader";
2175
- default:
2176
- return tableRole === "table" ? "cell" : "gridcell";
2404
+ aria: {
2405
+ implicitRole(node) {
2406
+ const table = node.closest("table");
2407
+ const tableRole = (table == null ? void 0 : table.getAttribute("role")) ?? "table";
2408
+ if (typeof tableRole !== "string" || !["table", "grid", "treegrid"].includes(tableRole)) {
2409
+ return null;
2410
+ }
2411
+ const scope = node.getAttribute("scope");
2412
+ switch (scope) {
2413
+ case "col":
2414
+ return "columnheader";
2415
+ case "row":
2416
+ return "rowheader";
2417
+ default:
2418
+ return tableRole === "table" ? "cell" : "gridcell";
2419
+ }
2177
2420
  }
2178
2421
  },
2179
2422
  permittedContent: ["@flow"],
@@ -2199,22 +2442,26 @@ var html5 = defineMetadata({
2199
2442
  deprecated: true
2200
2443
  }
2201
2444
  },
2202
- implicitRole() {
2203
- return "rowgroup";
2445
+ aria: {
2446
+ implicitRole: "rowgroup"
2204
2447
  }
2205
2448
  },
2206
2449
  time: {
2207
2450
  flow: true,
2208
2451
  phrasing: true,
2209
- implicitRole() {
2210
- return "time";
2452
+ aria: {
2453
+ implicitRole: "time",
2454
+ naming: "prohibited"
2211
2455
  },
2212
2456
  permittedContent: ["@phrasing"]
2213
2457
  },
2214
2458
  title: {
2215
2459
  metadata: true,
2216
2460
  permittedContent: [],
2217
- permittedParent: ["head"]
2461
+ permittedParent: ["head"],
2462
+ aria: {
2463
+ naming: "prohibited"
2464
+ }
2218
2465
  },
2219
2466
  tr: {
2220
2467
  implicitClosed: ["tr"],
@@ -2239,12 +2486,15 @@ var html5 = defineMetadata({
2239
2486
  deprecated: true
2240
2487
  }
2241
2488
  },
2242
- implicitRole() {
2243
- return "row";
2489
+ aria: {
2490
+ implicitRole: "row"
2244
2491
  }
2245
2492
  },
2246
2493
  track: {
2247
- void: true
2494
+ void: true,
2495
+ aria: {
2496
+ naming: "prohibited"
2497
+ }
2248
2498
  },
2249
2499
  tt: {
2250
2500
  deprecated: {
@@ -2255,7 +2505,11 @@ var html5 = defineMetadata({
2255
2505
  u: {
2256
2506
  flow: true,
2257
2507
  phrasing: true,
2258
- permittedContent: ["@phrasing"]
2508
+ permittedContent: ["@phrasing"],
2509
+ aria: {
2510
+ implicitRole: "generic",
2511
+ naming: "prohibited"
2512
+ }
2259
2513
  },
2260
2514
  ul: {
2261
2515
  flow: true,
@@ -2268,14 +2522,17 @@ var html5 = defineMetadata({
2268
2522
  deprecated: true
2269
2523
  }
2270
2524
  },
2271
- implicitRole() {
2272
- return "list";
2525
+ aria: {
2526
+ implicitRole: "list"
2273
2527
  }
2274
2528
  },
2275
2529
  var: {
2276
2530
  flow: true,
2277
2531
  phrasing: true,
2278
- permittedContent: ["@phrasing"]
2532
+ permittedContent: ["@phrasing"],
2533
+ aria: {
2534
+ naming: "prohibited"
2535
+ }
2279
2536
  },
2280
2537
  video: {
2281
2538
  flow: true,
@@ -2306,7 +2563,10 @@ var html5 = defineMetadata({
2306
2563
  wbr: {
2307
2564
  flow: true,
2308
2565
  phrasing: true,
2309
- void: true
2566
+ void: true,
2567
+ aria: {
2568
+ naming: "prohibited"
2569
+ }
2310
2570
  },
2311
2571
  xmp: {
2312
2572
  deprecated: {