@tkeron/html-parser 0.1.5 → 1.0.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.
Files changed (91) hide show
  1. package/README.md +1 -7
  2. package/bun.lock +8 -3
  3. package/index.ts +4 -0
  4. package/package.json +13 -6
  5. package/src/css-selector.ts +45 -27
  6. package/src/dom-simulator.ts +162 -20
  7. package/src/encoding.ts +39 -0
  8. package/src/index.ts +9 -0
  9. package/src/parser.ts +478 -183
  10. package/src/serializer.ts +450 -0
  11. package/src/tokenizer.ts +59 -139
  12. package/tests/advanced.test.ts +119 -106
  13. package/tests/custom-elements.test.ts +172 -162
  14. package/tests/dom-extended.test.ts +12 -12
  15. package/tests/dom-manipulation.test.ts +637 -0
  16. package/tests/dom.test.ts +32 -27
  17. package/tests/helpers/tokenizer-adapter.test.ts +70 -0
  18. package/tests/helpers/tokenizer-adapter.ts +65 -0
  19. package/tests/helpers/tree-adapter.test.ts +39 -0
  20. package/tests/helpers/tree-adapter.ts +43 -0
  21. package/tests/html5lib-data/tokenizer/namedEntities.test +42422 -0
  22. package/tests/html5lib-data/tokenizer/pendingSpecChanges.test +9 -0
  23. package/tests/html5lib-data/tree-construction/adoption01.dat +354 -0
  24. package/tests/html5lib-data/tree-construction/adoption02.dat +39 -0
  25. package/tests/html5lib-data/tree-construction/domjs-unsafe.dat +0 -0
  26. package/tests/html5lib-data/tree-construction/entities02.dat +309 -0
  27. package/tests/html5lib-data/tree-construction/html5test-com.dat +301 -0
  28. package/tests/html5lib-data/tree-construction/math.dat +104 -0
  29. package/tests/html5lib-data/tree-construction/namespace-sensitivity.dat +22 -0
  30. package/tests/html5lib-data/tree-construction/noscript01.dat +237 -0
  31. package/tests/html5lib-data/tree-construction/ruby.dat +302 -0
  32. package/tests/html5lib-data/tree-construction/scriptdata01.dat +372 -0
  33. package/tests/html5lib-data/tree-construction/svg.dat +104 -0
  34. package/tests/html5lib-data/tree-construction/template.dat +1673 -0
  35. package/tests/html5lib-data/tree-construction/tests10.dat +853 -0
  36. package/tests/html5lib-data/tree-construction/tests11.dat +523 -0
  37. package/tests/html5lib-data/tree-construction/tests20.dat +842 -0
  38. package/tests/html5lib-data/tree-construction/tests21.dat +306 -0
  39. package/tests/html5lib-data/tree-construction/tests23.dat +168 -0
  40. package/tests/html5lib-data/tree-construction/tests24.dat +79 -0
  41. package/tests/html5lib-data/tree-construction/tests5.dat +210 -0
  42. package/tests/html5lib-data/tree-construction/tests6.dat +663 -0
  43. package/tests/html5lib-data/tree-construction/tests_innerHTML_1.dat +844 -0
  44. package/tests/parser.test.ts +172 -193
  45. package/tests/selectors.test.ts +64 -1
  46. package/tests/serializer-core.test.ts +16 -0
  47. package/tests/serializer-data/core.test +125 -0
  48. package/tests/serializer-data/injectmeta.test +66 -0
  49. package/tests/serializer-data/optionaltags.test +965 -0
  50. package/tests/serializer-data/options.test +60 -0
  51. package/tests/serializer-data/whitespace.test +51 -0
  52. package/tests/serializer-injectmeta.test.ts +16 -0
  53. package/tests/serializer-optionaltags.test.ts +16 -0
  54. package/tests/serializer-options.test.ts +16 -0
  55. package/tests/serializer-whitespace.test.ts +16 -0
  56. package/tests/tokenizer-namedEntities.test.ts +20 -0
  57. package/tests/tokenizer-pendingSpecChanges.test.ts +20 -0
  58. package/tests/tokenizer.test.ts +83 -0
  59. package/tests/tree-construction-adoption01.test.ts +37 -0
  60. package/tests/tree-construction-adoption02.test.ts +34 -0
  61. package/tests/tree-construction-domjs-unsafe.test.ts +24 -0
  62. package/tests/tree-construction-entities02.test.ts +33 -0
  63. package/tests/tree-construction-html5test-com.test.ts +24 -0
  64. package/tests/tree-construction-math.test.ts +18 -0
  65. package/tests/tree-construction-namespace-sensitivity.test.ts +18 -0
  66. package/tests/tree-construction-noscript01.test.ts +18 -0
  67. package/tests/tree-construction-ruby.test.ts +21 -0
  68. package/tests/tree-construction-scriptdata01.test.ts +21 -0
  69. package/tests/tree-construction-svg.test.ts +21 -0
  70. package/tests/tree-construction-template.test.ts +21 -0
  71. package/tests/tree-construction-tests10.test.ts +21 -0
  72. package/tests/tree-construction-tests11.test.ts +21 -0
  73. package/tests/tree-construction-tests20.test.ts +18 -0
  74. package/tests/tree-construction-tests21.test.ts +18 -0
  75. package/tests/tree-construction-tests23.test.ts +18 -0
  76. package/tests/tree-construction-tests24.test.ts +18 -0
  77. package/tests/tree-construction-tests5.test.ts +21 -0
  78. package/tests/tree-construction-tests6.test.ts +21 -0
  79. package/tests/tree-construction-tests_innerHTML_1.test.ts +21 -0
  80. package/tests/void-elements.test.ts +471 -0
  81. package/tests/official/README.md +0 -87
  82. package/tests/official/acid/acid-tests.test.ts +0 -309
  83. package/tests/official/final-output/final-output.test.ts +0 -361
  84. package/tests/official/html5lib/tokenizer-utils.ts +0 -192
  85. package/tests/official/html5lib/tokenizer.test.ts +0 -171
  86. package/tests/official/html5lib/tree-construction-utils.ts +0 -194
  87. package/tests/official/html5lib/tree-construction.test.ts +0 -250
  88. package/tests/official/validator/validator-tests.test.ts +0 -237
  89. package/tests/official/validator-nu/validator-nu.test.ts +0 -335
  90. package/tests/official/whatwg/whatwg-tests.test.ts +0 -205
  91. package/tests/official/wpt/wpt-tests.test.ts +0 -409
@@ -0,0 +1,1673 @@
1
+ #data
2
+ <body><template>Hello</template>
3
+ #errors
4
+ no doctype
5
+ #document
6
+ | <html>
7
+ | <head>
8
+ | <body>
9
+ | <template>
10
+ | content
11
+ | "Hello"
12
+
13
+ #data
14
+ <template>Hello</template>
15
+ #errors
16
+ no doctype
17
+ #document
18
+ | <html>
19
+ | <head>
20
+ | <template>
21
+ | content
22
+ | "Hello"
23
+ | <body>
24
+
25
+ #data
26
+ <template></template><div></div>
27
+ #errors
28
+ no doctype
29
+ #document
30
+ | <html>
31
+ | <head>
32
+ | <template>
33
+ | content
34
+ | <body>
35
+ | <div>
36
+
37
+ #data
38
+ <html><template>Hello</template>
39
+ #errors
40
+ no doctype
41
+ #document
42
+ | <html>
43
+ | <head>
44
+ | <template>
45
+ | content
46
+ | "Hello"
47
+ | <body>
48
+
49
+ #data
50
+ <head><template><div></div></template></head>
51
+ #errors
52
+ no doctype
53
+ #document
54
+ | <html>
55
+ | <head>
56
+ | <template>
57
+ | content
58
+ | <div>
59
+ | <body>
60
+
61
+ #data
62
+ <div><template><div><span></template><b>
63
+ #errors
64
+ * (1,6) missing DOCTYPE
65
+ * (1,38) mismatched template end tag
66
+ * (1,41) unexpected end of file
67
+ #document
68
+ | <html>
69
+ | <head>
70
+ | <body>
71
+ | <div>
72
+ | <template>
73
+ | content
74
+ | <div>
75
+ | <span>
76
+ | <b>
77
+
78
+ #data
79
+ <div><template></div>Hello
80
+ #errors
81
+ * (1,6) missing DOCTYPE
82
+ * (1,22) unexpected token in template
83
+ * (1,27) unexpected end of file in template
84
+ * (1,27) unexpected end of file
85
+ #document
86
+ | <html>
87
+ | <head>
88
+ | <body>
89
+ | <div>
90
+ | <template>
91
+ | content
92
+ | "Hello"
93
+
94
+ #data
95
+ <div></template></div>
96
+ #errors
97
+ * (1,6) missing DOCTYPE
98
+ * (1,17) unexpected template end tag
99
+ #document
100
+ | <html>
101
+ | <head>
102
+ | <body>
103
+ | <div>
104
+
105
+ #data
106
+ <table><template></template></table>
107
+ #errors
108
+ no doctype
109
+ #document
110
+ | <html>
111
+ | <head>
112
+ | <body>
113
+ | <table>
114
+ | <template>
115
+ | content
116
+
117
+ #data
118
+ <table><template></template></div>
119
+ #errors
120
+ * (1,8) missing DOCTYPE
121
+ * (1,35) unexpected token in table - foster parenting
122
+ * (1,35) unexpected end tag
123
+ * (1,35) unexpected end of file
124
+ #document
125
+ | <html>
126
+ | <head>
127
+ | <body>
128
+ | <table>
129
+ | <template>
130
+ | content
131
+
132
+ #data
133
+ <table><div><template></template></div>
134
+ #errors
135
+ * (1,8) missing DOCTYPE
136
+ * (1,13) unexpected token in table - foster parenting
137
+ * (1,40) unexpected token in table - foster parenting
138
+ * (1,40) unexpected end of file
139
+ #document
140
+ | <html>
141
+ | <head>
142
+ | <body>
143
+ | <div>
144
+ | <template>
145
+ | content
146
+ | <table>
147
+
148
+ #data
149
+ <table><template></template><div></div>
150
+ #errors
151
+ no doctype
152
+ bad div in table
153
+ bad /div in table
154
+ eof in table
155
+ #document
156
+ | <html>
157
+ | <head>
158
+ | <body>
159
+ | <div>
160
+ | <table>
161
+ | <template>
162
+ | content
163
+
164
+ #data
165
+ <table> <template></template></table>
166
+ #errors
167
+ no doctype
168
+ #document
169
+ | <html>
170
+ | <head>
171
+ | <body>
172
+ | <table>
173
+ | " "
174
+ | <template>
175
+ | content
176
+
177
+ #data
178
+ <table><tbody><template></template></tbody>
179
+ #errors
180
+ no doctype
181
+ eof in table
182
+ #document
183
+ | <html>
184
+ | <head>
185
+ | <body>
186
+ | <table>
187
+ | <tbody>
188
+ | <template>
189
+ | content
190
+
191
+ #data
192
+ <table><tbody><template></tbody></template>
193
+ #errors
194
+ no doctype
195
+ bad /tbody
196
+ eof in table
197
+ #document
198
+ | <html>
199
+ | <head>
200
+ | <body>
201
+ | <table>
202
+ | <tbody>
203
+ | <template>
204
+ | content
205
+
206
+ #data
207
+ <table><tbody><template></template></tbody></table>
208
+ #errors
209
+ no doctype
210
+ #document
211
+ | <html>
212
+ | <head>
213
+ | <body>
214
+ | <table>
215
+ | <tbody>
216
+ | <template>
217
+ | content
218
+
219
+ #data
220
+ <table><thead><template></template></thead>
221
+ #errors
222
+ no doctype
223
+ eof in table
224
+ #document
225
+ | <html>
226
+ | <head>
227
+ | <body>
228
+ | <table>
229
+ | <thead>
230
+ | <template>
231
+ | content
232
+
233
+ #data
234
+ <table><tfoot><template></template></tfoot>
235
+ #errors
236
+ no doctype
237
+ eof in table
238
+ #document
239
+ | <html>
240
+ | <head>
241
+ | <body>
242
+ | <table>
243
+ | <tfoot>
244
+ | <template>
245
+ | content
246
+
247
+ #data
248
+ <select><template></template></select>
249
+ #errors
250
+ no doctype
251
+ #document
252
+ | <html>
253
+ | <head>
254
+ | <body>
255
+ | <select>
256
+ | <template>
257
+ | content
258
+
259
+ #data
260
+ <select><template><option></option></template></select>
261
+ #errors
262
+ no doctype
263
+ #document
264
+ | <html>
265
+ | <head>
266
+ | <body>
267
+ | <select>
268
+ | <template>
269
+ | content
270
+ | <option>
271
+
272
+ #data
273
+ <template><option></option></select><option></option></template>
274
+ #errors
275
+ no doctype
276
+ bad /select
277
+ #document
278
+ | <html>
279
+ | <head>
280
+ | <template>
281
+ | content
282
+ | <option>
283
+ | <option>
284
+ | <body>
285
+
286
+ #data
287
+ <select><template></template><option></select>
288
+ #errors
289
+ no doctype
290
+ #document
291
+ | <html>
292
+ | <head>
293
+ | <body>
294
+ | <select>
295
+ | <template>
296
+ | content
297
+ | <option>
298
+
299
+ #data
300
+ <select><option><template></template></select>
301
+ #errors
302
+ no doctype
303
+ #document
304
+ | <html>
305
+ | <head>
306
+ | <body>
307
+ | <select>
308
+ | <option>
309
+ | <template>
310
+ | content
311
+
312
+ #data
313
+ <select><template>
314
+ #errors
315
+ no doctype
316
+ eof in template
317
+ eof in select
318
+ #document
319
+ | <html>
320
+ | <head>
321
+ | <body>
322
+ | <select>
323
+ | <template>
324
+ | content
325
+
326
+ #data
327
+ <select><option></option><template>
328
+ #errors
329
+ no doctype
330
+ eof in template
331
+ eof in select
332
+ #document
333
+ | <html>
334
+ | <head>
335
+ | <body>
336
+ | <select>
337
+ | <option>
338
+ | <template>
339
+ | content
340
+
341
+ #data
342
+ <select><option></option><template><option>
343
+ #errors
344
+ no doctype
345
+ eof in template
346
+ eof in select
347
+ #document
348
+ | <html>
349
+ | <head>
350
+ | <body>
351
+ | <select>
352
+ | <option>
353
+ | <template>
354
+ | content
355
+ | <option>
356
+
357
+ #data
358
+ <table><thead><template><td></template></table>
359
+ #errors
360
+ * (1,8) missing DOCTYPE
361
+ #document
362
+ | <html>
363
+ | <head>
364
+ | <body>
365
+ | <table>
366
+ | <thead>
367
+ | <template>
368
+ | content
369
+ | <td>
370
+
371
+ #data
372
+ <table><template><thead></template></table>
373
+ #errors
374
+ no doctype
375
+ #document
376
+ | <html>
377
+ | <head>
378
+ | <body>
379
+ | <table>
380
+ | <template>
381
+ | content
382
+ | <thead>
383
+
384
+ #data
385
+ <body><table><template><td></tr><div></template></table>
386
+ #errors
387
+ no doctype
388
+ bad </tr>
389
+ missing </div>
390
+ #document
391
+ | <html>
392
+ | <head>
393
+ | <body>
394
+ | <table>
395
+ | <template>
396
+ | content
397
+ | <td>
398
+ | <div>
399
+
400
+ #data
401
+ <table><template><thead></template></thead></table>
402
+ #errors
403
+ no doctype
404
+ bad /thead after /template
405
+ #document
406
+ | <html>
407
+ | <head>
408
+ | <body>
409
+ | <table>
410
+ | <template>
411
+ | content
412
+ | <thead>
413
+
414
+ #data
415
+ <table><thead><template><tr></template></table>
416
+ #errors
417
+ no doctype
418
+ #document
419
+ | <html>
420
+ | <head>
421
+ | <body>
422
+ | <table>
423
+ | <thead>
424
+ | <template>
425
+ | content
426
+ | <tr>
427
+
428
+ #data
429
+ <table><template><tr></template></table>
430
+ #errors
431
+ no doctype
432
+ #document
433
+ | <html>
434
+ | <head>
435
+ | <body>
436
+ | <table>
437
+ | <template>
438
+ | content
439
+ | <tr>
440
+
441
+ #data
442
+ <table><tr><template><td>
443
+ #errors
444
+ no doctype
445
+ eof in template
446
+ eof in table
447
+ #document
448
+ | <html>
449
+ | <head>
450
+ | <body>
451
+ | <table>
452
+ | <tbody>
453
+ | <tr>
454
+ | <template>
455
+ | content
456
+ | <td>
457
+
458
+ #data
459
+ <table><template><tr><template><td></template></tr></template></table>
460
+ #errors
461
+ no doctype
462
+ #document
463
+ | <html>
464
+ | <head>
465
+ | <body>
466
+ | <table>
467
+ | <template>
468
+ | content
469
+ | <tr>
470
+ | <template>
471
+ | content
472
+ | <td>
473
+
474
+ #data
475
+ <table><template><tr><template><td></td></template></tr></template></table>
476
+ #errors
477
+ no doctype
478
+ #document
479
+ | <html>
480
+ | <head>
481
+ | <body>
482
+ | <table>
483
+ | <template>
484
+ | content
485
+ | <tr>
486
+ | <template>
487
+ | content
488
+ | <td>
489
+
490
+ #data
491
+ <table><template><td></template>
492
+ #errors
493
+ no doctype
494
+ eof in table
495
+ #document
496
+ | <html>
497
+ | <head>
498
+ | <body>
499
+ | <table>
500
+ | <template>
501
+ | content
502
+ | <td>
503
+
504
+ #data
505
+ <body><template><td></td></template>
506
+ #errors
507
+ no doctype
508
+ #document
509
+ | <html>
510
+ | <head>
511
+ | <body>
512
+ | <template>
513
+ | content
514
+ | <td>
515
+
516
+ #data
517
+ <body><template><template><tr></tr></template><td></td></template>
518
+ #errors
519
+ no doctype
520
+ #document
521
+ | <html>
522
+ | <head>
523
+ | <body>
524
+ | <template>
525
+ | content
526
+ | <template>
527
+ | content
528
+ | <tr>
529
+ | <td>
530
+
531
+ #data
532
+ <table><colgroup><template><col>
533
+ #errors
534
+ no doctype
535
+ eof in template
536
+ eof in table
537
+ #document
538
+ | <html>
539
+ | <head>
540
+ | <body>
541
+ | <table>
542
+ | <colgroup>
543
+ | <template>
544
+ | content
545
+ | <col>
546
+
547
+ #data
548
+ <frameset><template><frame></frame></template></frameset>
549
+ #errors
550
+ * (1,11) missing DOCTYPE
551
+ * (1,21) unexpected start tag token
552
+ * (1,36) unexpected end tag token
553
+ * (1,47) unexpected end tag token
554
+ #document
555
+ | <html>
556
+ | <head>
557
+ | <frameset>
558
+ | <frame>
559
+
560
+ #data
561
+ <template><frame></frame></frameset><frame></frame></template>
562
+ #errors
563
+ * (1,11) missing DOCTYPE
564
+ * (1,18) unexpected start tag
565
+ * (1,26) unexpected end tag
566
+ * (1,37) unexpected end tag
567
+ * (1,44) unexpected start tag
568
+ * (1,52) unexpected end tag
569
+ #document
570
+ | <html>
571
+ | <head>
572
+ | <template>
573
+ | content
574
+ | <body>
575
+
576
+ #data
577
+ <template><div><frameset><span></span></div><span></span></template>
578
+ #errors
579
+ no doctype
580
+ bad frameset
581
+ #document
582
+ | <html>
583
+ | <head>
584
+ | <template>
585
+ | content
586
+ | <div>
587
+ | <span>
588
+ | <span>
589
+ | <body>
590
+
591
+ #data
592
+ <body><template><div><frameset><span></span></div><span></span></template></body>
593
+ #errors
594
+ no doctype
595
+ bad frameset
596
+ #document
597
+ | <html>
598
+ | <head>
599
+ | <body>
600
+ | <template>
601
+ | content
602
+ | <div>
603
+ | <span>
604
+ | <span>
605
+
606
+ #data
607
+ <body><template><script>var i = 1;</script><td></td></template>
608
+ #errors
609
+ no doctype
610
+ #document
611
+ | <html>
612
+ | <head>
613
+ | <body>
614
+ | <template>
615
+ | content
616
+ | <script>
617
+ | "var i = 1;"
618
+ | <td>
619
+
620
+ #data
621
+ <body><template><tr><div></div></tr></template>
622
+ #errors
623
+ no doctype
624
+ foster-parented div
625
+ foster-parented /div
626
+ #document
627
+ | <html>
628
+ | <head>
629
+ | <body>
630
+ | <template>
631
+ | content
632
+ | <tr>
633
+ | <div>
634
+
635
+ #data
636
+ <body><template><tr></tr><td></td></template>
637
+ #errors
638
+ no doctype
639
+ unexpected <td>
640
+ #document
641
+ | <html>
642
+ | <head>
643
+ | <body>
644
+ | <template>
645
+ | content
646
+ | <tr>
647
+ | <tr>
648
+ | <td>
649
+
650
+ #data
651
+ <body><template><td></td></tr><td></td></template>
652
+ #errors
653
+ no doctype
654
+ bad </tr>
655
+ #document
656
+ | <html>
657
+ | <head>
658
+ | <body>
659
+ | <template>
660
+ | content
661
+ | <td>
662
+ | <td>
663
+
664
+ #data
665
+ <body><template><td></td><tbody><td></td></template>
666
+ #errors
667
+ no doctype
668
+ bad <tbody>
669
+ #document
670
+ | <html>
671
+ | <head>
672
+ | <body>
673
+ | <template>
674
+ | content
675
+ | <td>
676
+ | <td>
677
+
678
+ #data
679
+ <body><template><td></td><caption></caption><td></td></template>
680
+ #errors
681
+ * (1,7) missing DOCTYPE
682
+ * (1,35) unexpected start tag in table row
683
+ * (1,45) unexpected end tag in table row
684
+ #document
685
+ | <html>
686
+ | <head>
687
+ | <body>
688
+ | <template>
689
+ | content
690
+ | <td>
691
+ | <td>
692
+
693
+ #data
694
+ <body><template><td></td><colgroup></caption><td></td></template>
695
+ #errors
696
+ * (1,7) missing DOCTYPE
697
+ * (1,36) unexpected start tag in table row
698
+ * (1,46) unexpected end tag in table row
699
+ #document
700
+ | <html>
701
+ | <head>
702
+ | <body>
703
+ | <template>
704
+ | content
705
+ | <td>
706
+ | <td>
707
+
708
+ #data
709
+ <body><template><td></td></table><td></td></template>
710
+ #errors
711
+ no doctype
712
+ bad </table>
713
+ #document
714
+ | <html>
715
+ | <head>
716
+ | <body>
717
+ | <template>
718
+ | content
719
+ | <td>
720
+ | <td>
721
+
722
+ #data
723
+ <body><template><tr></tr><tbody><tr></tr></template>
724
+ #errors
725
+ no doctype
726
+ bad <tbody>
727
+ #document
728
+ | <html>
729
+ | <head>
730
+ | <body>
731
+ | <template>
732
+ | content
733
+ | <tr>
734
+ | <tr>
735
+
736
+ #data
737
+ <body><template><tr></tr><caption><tr></tr></template>
738
+ #errors
739
+ no doctype
740
+ bad <caption>
741
+ #document
742
+ | <html>
743
+ | <head>
744
+ | <body>
745
+ | <template>
746
+ | content
747
+ | <tr>
748
+ | <tr>
749
+
750
+ #data
751
+ <body><template><tr></tr></table><tr></tr></template>
752
+ #errors
753
+ no doctype
754
+ bad </table>
755
+ #document
756
+ | <html>
757
+ | <head>
758
+ | <body>
759
+ | <template>
760
+ | content
761
+ | <tr>
762
+ | <tr>
763
+
764
+ #data
765
+ <body><template><thead></thead><caption></caption><tbody></tbody></template>
766
+ #errors
767
+ no doctype
768
+ #document
769
+ | <html>
770
+ | <head>
771
+ | <body>
772
+ | <template>
773
+ | content
774
+ | <thead>
775
+ | <caption>
776
+ | <tbody>
777
+
778
+ #data
779
+ <body><template><thead></thead></table><tbody></tbody></template></body>
780
+ #errors
781
+ no doctype
782
+ bad </table>
783
+ #document
784
+ | <html>
785
+ | <head>
786
+ | <body>
787
+ | <template>
788
+ | content
789
+ | <thead>
790
+ | <tbody>
791
+
792
+ #data
793
+ <body><template><div><tr></tr></div></template>
794
+ #errors
795
+ no doctype
796
+ bad tr
797
+ bad /tr
798
+ #document
799
+ | <html>
800
+ | <head>
801
+ | <body>
802
+ | <template>
803
+ | content
804
+ | <div>
805
+
806
+ #data
807
+ <body><template><em>Hello</em></template>
808
+ #errors
809
+ no doctype
810
+ #document
811
+ | <html>
812
+ | <head>
813
+ | <body>
814
+ | <template>
815
+ | content
816
+ | <em>
817
+ | "Hello"
818
+
819
+ #data
820
+ <body><template><!--comment--></template>
821
+ #errors
822
+ no doctype
823
+ #document
824
+ | <html>
825
+ | <head>
826
+ | <body>
827
+ | <template>
828
+ | content
829
+ | <!-- comment -->
830
+
831
+ #data
832
+ <body><template><style></style><td></td></template>
833
+ #errors
834
+ no doctype
835
+ #document
836
+ | <html>
837
+ | <head>
838
+ | <body>
839
+ | <template>
840
+ | content
841
+ | <style>
842
+ | <td>
843
+
844
+ #data
845
+ <body><template><meta><td></td></template>
846
+ #errors
847
+ no doctype
848
+ #document
849
+ | <html>
850
+ | <head>
851
+ | <body>
852
+ | <template>
853
+ | content
854
+ | <meta>
855
+ | <td>
856
+
857
+ #data
858
+ <body><template><link><td></td></template>
859
+ #errors
860
+ no doctype
861
+ #document
862
+ | <html>
863
+ | <head>
864
+ | <body>
865
+ | <template>
866
+ | content
867
+ | <link>
868
+ | <td>
869
+
870
+ #data
871
+ <body><table><colgroup><template><col></col></template></colgroup></table></body>
872
+ #errors
873
+ no doctype
874
+ bad /col
875
+ #document
876
+ | <html>
877
+ | <head>
878
+ | <body>
879
+ | <table>
880
+ | <colgroup>
881
+ | <template>
882
+ | content
883
+ | <col>
884
+
885
+ #data
886
+ <body a=b><template><div></div><body c=d><div></div></body></template></body>
887
+ #errors
888
+ no doctype
889
+ bad <body>
890
+ bad </body>
891
+ #document
892
+ | <html>
893
+ | <head>
894
+ | <body>
895
+ | a="b"
896
+ | <template>
897
+ | content
898
+ | <div>
899
+ | <div>
900
+
901
+ #data
902
+ <html a=b><template><div><html b=c><span></template>
903
+ #errors
904
+ no doctype
905
+ bad <html>
906
+ missing end tags in template
907
+ #document
908
+ | <html>
909
+ | a="b"
910
+ | <head>
911
+ | <template>
912
+ | content
913
+ | <div>
914
+ | <span>
915
+ | <body>
916
+
917
+ #data
918
+ <html a=b><template><col></col><html b=c><col></col></template>
919
+ #errors
920
+ no doctype
921
+ bad /col
922
+ bad html
923
+ bad /col
924
+ #document
925
+ | <html>
926
+ | a="b"
927
+ | <head>
928
+ | <template>
929
+ | content
930
+ | <col>
931
+ | <col>
932
+ | <body>
933
+
934
+ #data
935
+ <html a=b><template><frame></frame><html b=c><frame></frame></template>
936
+ #errors
937
+ no doctype
938
+ bad frame
939
+ bad /frame
940
+ bad html
941
+ bad frame
942
+ bad /frame
943
+ #document
944
+ | <html>
945
+ | a="b"
946
+ | <head>
947
+ | <template>
948
+ | content
949
+ | <body>
950
+
951
+ #data
952
+ <body><template><tr></tr><template></template><td></td></template>
953
+ #errors
954
+ no doctype
955
+ unexpected <td>
956
+ #document
957
+ | <html>
958
+ | <head>
959
+ | <body>
960
+ | <template>
961
+ | content
962
+ | <tr>
963
+ | <template>
964
+ | content
965
+ | <tr>
966
+ | <td>
967
+
968
+ #data
969
+ <body><template><thead></thead><template><tr></tr></template><tr></tr><tfoot></tfoot></template>
970
+ #errors
971
+ no doctype
972
+ #document
973
+ | <html>
974
+ | <head>
975
+ | <body>
976
+ | <template>
977
+ | content
978
+ | <thead>
979
+ | <template>
980
+ | content
981
+ | <tr>
982
+ | <tbody>
983
+ | <tr>
984
+ | <tfoot>
985
+
986
+ #data
987
+ <body><template><template><b><template></template></template>text</template>
988
+ #errors
989
+ no doctype
990
+ missing </b>
991
+ #document
992
+ | <html>
993
+ | <head>
994
+ | <body>
995
+ | <template>
996
+ | content
997
+ | <template>
998
+ | content
999
+ | <b>
1000
+ | <template>
1001
+ | content
1002
+ | "text"
1003
+
1004
+ #data
1005
+ <body><template><col><colgroup>
1006
+ #errors
1007
+ no doctype
1008
+ bad colgroup
1009
+ eof in template
1010
+ #document
1011
+ | <html>
1012
+ | <head>
1013
+ | <body>
1014
+ | <template>
1015
+ | content
1016
+ | <col>
1017
+
1018
+ #data
1019
+ <body><template><col></colgroup>
1020
+ #errors
1021
+ no doctype
1022
+ bogus /colgroup
1023
+ eof in template
1024
+ #document
1025
+ | <html>
1026
+ | <head>
1027
+ | <body>
1028
+ | <template>
1029
+ | content
1030
+ | <col>
1031
+
1032
+ #data
1033
+ <body><template><col><colgroup></template></body>
1034
+ #errors
1035
+ no doctype
1036
+ bad colgroup
1037
+ #document
1038
+ | <html>
1039
+ | <head>
1040
+ | <body>
1041
+ | <template>
1042
+ | content
1043
+ | <col>
1044
+
1045
+ #data
1046
+ <body><template><col><div>
1047
+ #errors
1048
+ * (1,7) missing DOCTYPE
1049
+ * (1,27) unexpected token
1050
+ * (1,27) unexpected end of file in template
1051
+ #document
1052
+ | <html>
1053
+ | <head>
1054
+ | <body>
1055
+ | <template>
1056
+ | content
1057
+ | <col>
1058
+
1059
+ #data
1060
+ <body><template><col></div>
1061
+ #errors
1062
+ no doctype
1063
+ bad /div
1064
+ eof in template
1065
+ #document
1066
+ | <html>
1067
+ | <head>
1068
+ | <body>
1069
+ | <template>
1070
+ | content
1071
+ | <col>
1072
+
1073
+ #data
1074
+ <body><template><col>Hello
1075
+ #errors
1076
+ no doctype
1077
+ (1,27): foster-parenting-character
1078
+ (1,27): foster-parenting-character
1079
+ (1,27): foster-parenting-character
1080
+ (1,27): foster-parenting-character
1081
+ (1,27): foster-parenting-character
1082
+ eof in template
1083
+ #document
1084
+ | <html>
1085
+ | <head>
1086
+ | <body>
1087
+ | <template>
1088
+ | content
1089
+ | <col>
1090
+
1091
+ #data
1092
+ <body><template><i><menu>Foo</i>
1093
+ #errors
1094
+ no doctype
1095
+ missing /menu
1096
+ eof in template
1097
+ #document
1098
+ | <html>
1099
+ | <head>
1100
+ | <body>
1101
+ | <template>
1102
+ | content
1103
+ | <i>
1104
+ | <menu>
1105
+ | <i>
1106
+ | "Foo"
1107
+
1108
+ #data
1109
+ <body><template></div><div>Foo</div><template></template><tr></tr>
1110
+ #errors
1111
+ no doctype
1112
+ bogus /div
1113
+ bogus tr
1114
+ bogus /tr
1115
+ eof in template
1116
+ #document
1117
+ | <html>
1118
+ | <head>
1119
+ | <body>
1120
+ | <template>
1121
+ | content
1122
+ | <div>
1123
+ | "Foo"
1124
+ | <template>
1125
+ | content
1126
+
1127
+ #data
1128
+ <body><div><template></div><tr><td>Foo</td></tr></template>
1129
+ #errors
1130
+ * (1,7) missing DOCTYPE
1131
+ * (1,28) unexpected token in template
1132
+ * (1,60) unexpected end of file
1133
+ #document
1134
+ | <html>
1135
+ | <head>
1136
+ | <body>
1137
+ | <div>
1138
+ | <template>
1139
+ | content
1140
+ | <tr>
1141
+ | <td>
1142
+ | "Foo"
1143
+
1144
+ #data
1145
+ <template></figcaption><sub><table></table>
1146
+ #errors
1147
+ no doctype
1148
+ bad /figcaption
1149
+ eof in template
1150
+ #document
1151
+ | <html>
1152
+ | <head>
1153
+ | <template>
1154
+ | content
1155
+ | <sub>
1156
+ | <table>
1157
+ | <body>
1158
+
1159
+ #data
1160
+ <template><template>
1161
+ #errors
1162
+ no doctype
1163
+ eof in template
1164
+ eof in template
1165
+ #document
1166
+ | <html>
1167
+ | <head>
1168
+ | <template>
1169
+ | content
1170
+ | <template>
1171
+ | content
1172
+ | <body>
1173
+
1174
+ #data
1175
+ <template><div>
1176
+ #errors
1177
+ no doctype
1178
+ eof in template
1179
+ #document
1180
+ | <html>
1181
+ | <head>
1182
+ | <template>
1183
+ | content
1184
+ | <div>
1185
+ | <body>
1186
+
1187
+ #data
1188
+ <template><template><div>
1189
+ #errors
1190
+ no doctype
1191
+ eof in template
1192
+ eof in template
1193
+ #document
1194
+ | <html>
1195
+ | <head>
1196
+ | <template>
1197
+ | content
1198
+ | <template>
1199
+ | content
1200
+ | <div>
1201
+ | <body>
1202
+
1203
+ #data
1204
+ <template><template><table>
1205
+ #errors
1206
+ no doctype
1207
+ eof in template
1208
+ eof in template
1209
+ #document
1210
+ | <html>
1211
+ | <head>
1212
+ | <template>
1213
+ | content
1214
+ | <template>
1215
+ | content
1216
+ | <table>
1217
+ | <body>
1218
+
1219
+ #data
1220
+ <template><template><tbody>
1221
+ #errors
1222
+ no doctype
1223
+ eof in template
1224
+ eof in template
1225
+ #document
1226
+ | <html>
1227
+ | <head>
1228
+ | <template>
1229
+ | content
1230
+ | <template>
1231
+ | content
1232
+ | <tbody>
1233
+ | <body>
1234
+
1235
+ #data
1236
+ <template><template><tr>
1237
+ #errors
1238
+ no doctype
1239
+ eof in template
1240
+ eof in template
1241
+ #document
1242
+ | <html>
1243
+ | <head>
1244
+ | <template>
1245
+ | content
1246
+ | <template>
1247
+ | content
1248
+ | <tr>
1249
+ | <body>
1250
+
1251
+ #data
1252
+ <template><template><td>
1253
+ #errors
1254
+ no doctype
1255
+ eof in template
1256
+ eof in template
1257
+ #document
1258
+ | <html>
1259
+ | <head>
1260
+ | <template>
1261
+ | content
1262
+ | <template>
1263
+ | content
1264
+ | <td>
1265
+ | <body>
1266
+
1267
+ #data
1268
+ <template><template><caption>
1269
+ #errors
1270
+ no doctype
1271
+ eof in template
1272
+ eof in template
1273
+ #document
1274
+ | <html>
1275
+ | <head>
1276
+ | <template>
1277
+ | content
1278
+ | <template>
1279
+ | content
1280
+ | <caption>
1281
+ | <body>
1282
+
1283
+ #data
1284
+ <template><template><colgroup>
1285
+ #errors
1286
+ no doctype
1287
+ eof in template
1288
+ eof in template
1289
+ #document
1290
+ | <html>
1291
+ | <head>
1292
+ | <template>
1293
+ | content
1294
+ | <template>
1295
+ | content
1296
+ | <colgroup>
1297
+ | <body>
1298
+
1299
+ #data
1300
+ <template><template><col>
1301
+ #errors
1302
+ no doctype
1303
+ eof in template
1304
+ eof in template
1305
+ #document
1306
+ | <html>
1307
+ | <head>
1308
+ | <template>
1309
+ | content
1310
+ | <template>
1311
+ | content
1312
+ | <col>
1313
+ | <body>
1314
+
1315
+ #data
1316
+ <template><template><tbody><select>
1317
+ #errors
1318
+ * (1,11) missing DOCTYPE
1319
+ * (1,36) unexpected token in table - foster parenting
1320
+ * (1,36) unexpected end of file in template
1321
+ * (1,36) unexpected end of file in template
1322
+ #document
1323
+ | <html>
1324
+ | <head>
1325
+ | <template>
1326
+ | content
1327
+ | <template>
1328
+ | content
1329
+ | <tbody>
1330
+ | <select>
1331
+ | <body>
1332
+
1333
+ #data
1334
+ <template><template><table>Foo
1335
+ #errors
1336
+ no doctype
1337
+ foster-parenting text F
1338
+ foster-parenting text o
1339
+ foster-parenting text o
1340
+ eof
1341
+ eof
1342
+ #document
1343
+ | <html>
1344
+ | <head>
1345
+ | <template>
1346
+ | content
1347
+ | <template>
1348
+ | content
1349
+ | "Foo"
1350
+ | <table>
1351
+ | <body>
1352
+
1353
+ #data
1354
+ <template><template><frame>
1355
+ #errors
1356
+ no doctype
1357
+ bad tag
1358
+ eof
1359
+ eof
1360
+ #document
1361
+ | <html>
1362
+ | <head>
1363
+ | <template>
1364
+ | content
1365
+ | <template>
1366
+ | content
1367
+ | <body>
1368
+
1369
+ #data
1370
+ <template><template><script>var i
1371
+ #errors
1372
+ no doctype
1373
+ eof in script
1374
+ eof in template
1375
+ eof in template
1376
+ #document
1377
+ | <html>
1378
+ | <head>
1379
+ | <template>
1380
+ | content
1381
+ | <template>
1382
+ | content
1383
+ | <script>
1384
+ | "var i"
1385
+ | <body>
1386
+
1387
+ #data
1388
+ <template><template><style>var i
1389
+ #errors
1390
+ no doctype
1391
+ eof in style
1392
+ eof in template
1393
+ eof in template
1394
+ #document
1395
+ | <html>
1396
+ | <head>
1397
+ | <template>
1398
+ | content
1399
+ | <template>
1400
+ | content
1401
+ | <style>
1402
+ | "var i"
1403
+ | <body>
1404
+
1405
+ #data
1406
+ <template><table></template><body><span>Foo
1407
+ #errors
1408
+ no doctype
1409
+ missing /table
1410
+ bad eof
1411
+ #document
1412
+ | <html>
1413
+ | <head>
1414
+ | <template>
1415
+ | content
1416
+ | <table>
1417
+ | <body>
1418
+ | <span>
1419
+ | "Foo"
1420
+
1421
+ #data
1422
+ <template><td></template><body><span>Foo
1423
+ #errors
1424
+ no doctype
1425
+ bad eof
1426
+ #document
1427
+ | <html>
1428
+ | <head>
1429
+ | <template>
1430
+ | content
1431
+ | <td>
1432
+ | <body>
1433
+ | <span>
1434
+ | "Foo"
1435
+
1436
+ #data
1437
+ <template><object></template><body><span>Foo
1438
+ #errors
1439
+ no doctype
1440
+ missing /object
1441
+ bad eof
1442
+ #document
1443
+ | <html>
1444
+ | <head>
1445
+ | <template>
1446
+ | content
1447
+ | <object>
1448
+ | <body>
1449
+ | <span>
1450
+ | "Foo"
1451
+
1452
+ #data
1453
+ <template><svg><template>
1454
+ #errors
1455
+ no doctype
1456
+ eof in template
1457
+ #document
1458
+ | <html>
1459
+ | <head>
1460
+ | <template>
1461
+ | content
1462
+ | <svg svg>
1463
+ | <svg template>
1464
+ | <body>
1465
+
1466
+ #data
1467
+ <template><svg><foo><template><foreignObject><div></template><div>
1468
+ #errors
1469
+ no doctype
1470
+ ugly template closure
1471
+ bad eof
1472
+ #document
1473
+ | <html>
1474
+ | <head>
1475
+ | <template>
1476
+ | content
1477
+ | <svg svg>
1478
+ | <svg foo>
1479
+ | <svg template>
1480
+ | <svg foreignObject>
1481
+ | <div>
1482
+ | <body>
1483
+ | <div>
1484
+
1485
+ #data
1486
+ <dummy><template><span></dummy>
1487
+ #errors
1488
+ no doctype
1489
+ bad end tag </dummy>
1490
+ eof in template
1491
+ eof in dummy
1492
+ #document
1493
+ | <html>
1494
+ | <head>
1495
+ | <body>
1496
+ | <dummy>
1497
+ | <template>
1498
+ | content
1499
+ | <span>
1500
+
1501
+ #data
1502
+ <body><table><tr><td><select><template>Foo</template><caption>A</table>
1503
+ #errors
1504
+ no doctype
1505
+ (1,62): unexpected-caption-in-select-in-table
1506
+ #document
1507
+ | <html>
1508
+ | <head>
1509
+ | <body>
1510
+ | <table>
1511
+ | <tbody>
1512
+ | <tr>
1513
+ | <td>
1514
+ | <select>
1515
+ | <template>
1516
+ | content
1517
+ | "Foo"
1518
+ | <caption>
1519
+ | "A"
1520
+
1521
+ #data
1522
+ <body></body><template>
1523
+ #errors
1524
+ no doctype
1525
+ (1,23): template-after-body
1526
+ (1,24): eof-in-template
1527
+ #document
1528
+ | <html>
1529
+ | <head>
1530
+ | <body>
1531
+ | <template>
1532
+ | content
1533
+
1534
+ #data
1535
+ <head></head><template>
1536
+ #errors
1537
+ no doctype
1538
+ (1,23): template-after-head
1539
+ (1,24): eof-in-template
1540
+ #document
1541
+ | <html>
1542
+ | <head>
1543
+ | <template>
1544
+ | content
1545
+ | <body>
1546
+
1547
+ #data
1548
+ <head></head><template>Foo</template>
1549
+ #errors
1550
+ no doctype
1551
+ (1,23): template-after-head
1552
+ #document
1553
+ | <html>
1554
+ | <head>
1555
+ | <template>
1556
+ | content
1557
+ | "Foo"
1558
+ | <body>
1559
+
1560
+ #data
1561
+ <html><head></head><template></template><head>
1562
+ #errors
1563
+ no doctype
1564
+ template-after-head
1565
+ head-after-head
1566
+ #document
1567
+ | <html>
1568
+ | <head>
1569
+ | <template>
1570
+ | content
1571
+ | <body>
1572
+
1573
+ #data
1574
+ <!DOCTYPE HTML><dummy><table><template><table><template><table><script>
1575
+ #errors
1576
+ eof script
1577
+ eof template
1578
+ eof template
1579
+ eof table
1580
+ #document
1581
+ | <!DOCTYPE html>
1582
+ | <html>
1583
+ | <head>
1584
+ | <body>
1585
+ | <dummy>
1586
+ | <table>
1587
+ | <template>
1588
+ | content
1589
+ | <table>
1590
+ | <template>
1591
+ | content
1592
+ | <table>
1593
+ | <script>
1594
+
1595
+ #data
1596
+ <template><a><table><a>
1597
+ #errors
1598
+ (1,10): expected-doctype-but-got-start-tag
1599
+ (1,23): foster-parenting-start-tag
1600
+ (1,23): unexpected-start-tag
1601
+ (1,23): formatting-element-not-in-scope
1602
+ (1,24): eof-in-template
1603
+ #document
1604
+ | <html>
1605
+ | <head>
1606
+ | <template>
1607
+ | content
1608
+ | <a>
1609
+ | <a>
1610
+ | <table>
1611
+ | <body>
1612
+
1613
+ #data
1614
+ <template><form><input name="q"></form><div>second</div></template>
1615
+ #errors
1616
+ #document-fragment
1617
+ template
1618
+ #document
1619
+ | <template>
1620
+ | content
1621
+ | <form>
1622
+ | <input>
1623
+ | name="q"
1624
+ | <div>
1625
+ | "second"
1626
+
1627
+ #data
1628
+ <!DOCTYPE HTML><template><tr><td>cell</td></tr></template>
1629
+ #errors
1630
+ #document
1631
+ | <!DOCTYPE html>
1632
+ | <html>
1633
+ | <head>
1634
+ | <template>
1635
+ | content
1636
+ | <tr>
1637
+ | <td>
1638
+ | "cell"
1639
+ | <body>
1640
+
1641
+ #data
1642
+ <!DOCTYPE HTML><template> <tr> <td>cell</td> </tr> </template>
1643
+ #errors
1644
+ #document
1645
+ | <!DOCTYPE html>
1646
+ | <html>
1647
+ | <head>
1648
+ | <template>
1649
+ | content
1650
+ | " "
1651
+ | <tr>
1652
+ | " "
1653
+ | <td>
1654
+ | "cell"
1655
+ | " "
1656
+ | " "
1657
+ | <body>
1658
+
1659
+ #data
1660
+ <!DOCTYPE HTML><template><tr><td>cell</td></tr>a</template>
1661
+ #errors
1662
+ (1,59): foster-parenting-character
1663
+ #document
1664
+ | <!DOCTYPE html>
1665
+ | <html>
1666
+ | <head>
1667
+ | <template>
1668
+ | content
1669
+ | <tr>
1670
+ | <td>
1671
+ | "cell"
1672
+ | "a"
1673
+ | <body>