• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{
2    "tests": [
3        {
4            "fragmentContext": null,
5            "description": "<!doctype html></head> <head>",
6            "input": "<!doctype html></head> <head>",
7            "output": [
8                [
9                    "DOCTYPE",
10                    "html",
11                    null,
12                    null,
13                    true
14                ],
15                [
16                    "EndTag",
17                    "head"
18                ],
19                [
20                    "Character",
21                    " "
22                ],
23                [
24                    "StartTag",
25                    "head",
26                    {}
27                ]
28            ]
29        },
30        {
31            "fragmentContext": null,
32            "description": "<!doctype html><form><div></form><div>",
33            "input": "<!doctype html><form><div></form><div>",
34            "output": [
35                [
36                    "DOCTYPE",
37                    "html",
38                    null,
39                    null,
40                    true
41                ],
42                [
43                    "StartTag",
44                    "form",
45                    {}
46                ],
47                [
48                    "StartTag",
49                    "div",
50                    {}
51                ],
52                [
53                    "EndTag",
54                    "form"
55                ],
56                [
57                    "StartTag",
58                    "div",
59                    {}
60                ]
61            ]
62        },
63        {
64            "fragmentContext": null,
65            "description": "<!doctype html><title>&amp;</title>",
66            "input": "<!doctype html><title>&amp;</title>",
67            "output": [
68                [
69                    "DOCTYPE",
70                    "html",
71                    null,
72                    null,
73                    true
74                ],
75                [
76                    "StartTag",
77                    "title",
78                    {}
79                ],
80                [
81                    "Character",
82                    "&"
83                ],
84                [
85                    "EndTag",
86                    "title"
87                ]
88            ]
89        },
90        {
91            "fragmentContext": null,
92            "description": "<!doctype html><title><!--&amp;--></title>",
93            "input": "<!doctype html><title><!--&amp;--></title>",
94            "output": [
95                [
96                    "DOCTYPE",
97                    "html",
98                    null,
99                    null,
100                    true
101                ],
102                [
103                    "StartTag",
104                    "title",
105                    {}
106                ],
107                [
108                    "Character",
109                    "<!--&-->"
110                ],
111                [
112                    "EndTag",
113                    "title"
114                ]
115            ]
116        },
117        {
118            "fragmentContext": null,
119            "description": "<!doctype>",
120            "input": "<!doctype>",
121            "output": [
122                [
123                    "DOCTYPE",
124                    null,
125                    null,
126                    null,
127                    false
128                ]
129            ]
130        },
131        {
132            "fragmentContext": null,
133            "description": "<!---x",
134            "input": "<!---x",
135            "output": [
136                [
137                    "Comment",
138                    "-x"
139                ]
140            ]
141        },
142        {
143            "fragmentContext": "div",
144            "description": "<body>\\n<div>",
145            "input": "<body>\n<div>",
146            "output": [
147                [
148                    "StartTag",
149                    "body",
150                    {}
151                ],
152                [
153                    "Character",
154                    "\n"
155                ],
156                [
157                    "StartTag",
158                    "div",
159                    {}
160                ]
161            ]
162        },
163        {
164            "fragmentContext": null,
165            "description": "<frameset></frameset>\\nfoo",
166            "input": "<frameset></frameset>\nfoo",
167            "output": [
168                [
169                    "StartTag",
170                    "frameset",
171                    {}
172                ],
173                [
174                    "EndTag",
175                    "frameset"
176                ],
177                [
178                    "Character",
179                    "\nfoo"
180                ]
181            ]
182        },
183        {
184            "fragmentContext": null,
185            "description": "<frameset></frameset>\\n<noframes>",
186            "input": "<frameset></frameset>\n<noframes>",
187            "output": [
188                [
189                    "StartTag",
190                    "frameset",
191                    {}
192                ],
193                [
194                    "EndTag",
195                    "frameset"
196                ],
197                [
198                    "Character",
199                    "\n"
200                ],
201                [
202                    "StartTag",
203                    "noframes",
204                    {}
205                ]
206            ]
207        },
208        {
209            "fragmentContext": null,
210            "description": "<frameset></frameset>\\n<div>",
211            "input": "<frameset></frameset>\n<div>",
212            "output": [
213                [
214                    "StartTag",
215                    "frameset",
216                    {}
217                ],
218                [
219                    "EndTag",
220                    "frameset"
221                ],
222                [
223                    "Character",
224                    "\n"
225                ],
226                [
227                    "StartTag",
228                    "div",
229                    {}
230                ]
231            ]
232        },
233        {
234            "fragmentContext": null,
235            "description": "<frameset></frameset>\\n</html>",
236            "input": "<frameset></frameset>\n</html>",
237            "output": [
238                [
239                    "StartTag",
240                    "frameset",
241                    {}
242                ],
243                [
244                    "EndTag",
245                    "frameset"
246                ],
247                [
248                    "Character",
249                    "\n"
250                ],
251                [
252                    "EndTag",
253                    "html"
254                ]
255            ]
256        },
257        {
258            "fragmentContext": null,
259            "description": "<frameset></frameset>\\n</div>",
260            "input": "<frameset></frameset>\n</div>",
261            "output": [
262                [
263                    "StartTag",
264                    "frameset",
265                    {}
266                ],
267                [
268                    "EndTag",
269                    "frameset"
270                ],
271                [
272                    "Character",
273                    "\n"
274                ],
275                [
276                    "EndTag",
277                    "div"
278                ]
279            ]
280        },
281        {
282            "fragmentContext": null,
283            "description": "<form><form>",
284            "input": "<form><form>",
285            "output": [
286                [
287                    "StartTag",
288                    "form",
289                    {}
290                ],
291                [
292                    "StartTag",
293                    "form",
294                    {}
295                ]
296            ]
297        },
298        {
299            "fragmentContext": null,
300            "description": "<button><button>",
301            "input": "<button><button>",
302            "output": [
303                [
304                    "StartTag",
305                    "button",
306                    {}
307                ],
308                [
309                    "StartTag",
310                    "button",
311                    {}
312                ]
313            ]
314        },
315        {
316            "fragmentContext": null,
317            "description": "<table><tr><td></th>",
318            "input": "<table><tr><td></th>",
319            "output": [
320                [
321                    "StartTag",
322                    "table",
323                    {}
324                ],
325                [
326                    "StartTag",
327                    "tr",
328                    {}
329                ],
330                [
331                    "StartTag",
332                    "td",
333                    {}
334                ],
335                [
336                    "EndTag",
337                    "th"
338                ]
339            ]
340        },
341        {
342            "fragmentContext": null,
343            "description": "<table><caption><td>",
344            "input": "<table><caption><td>",
345            "output": [
346                [
347                    "StartTag",
348                    "table",
349                    {}
350                ],
351                [
352                    "StartTag",
353                    "caption",
354                    {}
355                ],
356                [
357                    "StartTag",
358                    "td",
359                    {}
360                ]
361            ]
362        },
363        {
364            "fragmentContext": null,
365            "description": "<table><caption><div>",
366            "input": "<table><caption><div>",
367            "output": [
368                [
369                    "StartTag",
370                    "table",
371                    {}
372                ],
373                [
374                    "StartTag",
375                    "caption",
376                    {}
377                ],
378                [
379                    "StartTag",
380                    "div",
381                    {}
382                ]
383            ]
384        },
385        {
386            "fragmentContext": "caption",
387            "description": "</caption><div>",
388            "input": "</caption><div>",
389            "output": [
390                [
391                    "EndTag",
392                    "caption"
393                ],
394                [
395                    "StartTag",
396                    "div",
397                    {}
398                ]
399            ]
400        },
401        {
402            "fragmentContext": null,
403            "description": "<table><caption><div></caption>",
404            "input": "<table><caption><div></caption>",
405            "output": [
406                [
407                    "StartTag",
408                    "table",
409                    {}
410                ],
411                [
412                    "StartTag",
413                    "caption",
414                    {}
415                ],
416                [
417                    "StartTag",
418                    "div",
419                    {}
420                ],
421                [
422                    "EndTag",
423                    "caption"
424                ]
425            ]
426        },
427        {
428            "fragmentContext": null,
429            "description": "<table><caption></table>",
430            "input": "<table><caption></table>",
431            "output": [
432                [
433                    "StartTag",
434                    "table",
435                    {}
436                ],
437                [
438                    "StartTag",
439                    "caption",
440                    {}
441                ],
442                [
443                    "EndTag",
444                    "table"
445                ]
446            ]
447        },
448        {
449            "fragmentContext": "caption",
450            "description": "</table><div>",
451            "input": "</table><div>",
452            "output": [
453                [
454                    "EndTag",
455                    "table"
456                ],
457                [
458                    "StartTag",
459                    "div",
460                    {}
461                ]
462            ]
463        },
464        {
465            "fragmentContext": null,
466            "description": "<table><caption></body></col></colgroup></html></tbody></td></tfoot></th></thead></tr>",
467            "input": "<table><caption></body></col></colgroup></html></tbody></td></tfoot></th></thead></tr>",
468            "output": [
469                [
470                    "StartTag",
471                    "table",
472                    {}
473                ],
474                [
475                    "StartTag",
476                    "caption",
477                    {}
478                ],
479                [
480                    "EndTag",
481                    "body"
482                ],
483                [
484                    "EndTag",
485                    "col"
486                ],
487                [
488                    "EndTag",
489                    "colgroup"
490                ],
491                [
492                    "EndTag",
493                    "html"
494                ],
495                [
496                    "EndTag",
497                    "tbody"
498                ],
499                [
500                    "EndTag",
501                    "td"
502                ],
503                [
504                    "EndTag",
505                    "tfoot"
506                ],
507                [
508                    "EndTag",
509                    "th"
510                ],
511                [
512                    "EndTag",
513                    "thead"
514                ],
515                [
516                    "EndTag",
517                    "tr"
518                ]
519            ]
520        },
521        {
522            "fragmentContext": null,
523            "description": "<table><caption><div></div>",
524            "input": "<table><caption><div></div>",
525            "output": [
526                [
527                    "StartTag",
528                    "table",
529                    {}
530                ],
531                [
532                    "StartTag",
533                    "caption",
534                    {}
535                ],
536                [
537                    "StartTag",
538                    "div",
539                    {}
540                ],
541                [
542                    "EndTag",
543                    "div"
544                ]
545            ]
546        },
547        {
548            "fragmentContext": null,
549            "description": "<table><tr><td></body></caption></col></colgroup></html>",
550            "input": "<table><tr><td></body></caption></col></colgroup></html>",
551            "output": [
552                [
553                    "StartTag",
554                    "table",
555                    {}
556                ],
557                [
558                    "StartTag",
559                    "tr",
560                    {}
561                ],
562                [
563                    "StartTag",
564                    "td",
565                    {}
566                ],
567                [
568                    "EndTag",
569                    "body"
570                ],
571                [
572                    "EndTag",
573                    "caption"
574                ],
575                [
576                    "EndTag",
577                    "col"
578                ],
579                [
580                    "EndTag",
581                    "colgroup"
582                ],
583                [
584                    "EndTag",
585                    "html"
586                ]
587            ]
588        },
589        {
590            "fragmentContext": "td",
591            "description": "</table></tbody></tfoot></thead></tr><div>",
592            "input": "</table></tbody></tfoot></thead></tr><div>",
593            "output": [
594                [
595                    "EndTag",
596                    "table"
597                ],
598                [
599                    "EndTag",
600                    "tbody"
601                ],
602                [
603                    "EndTag",
604                    "tfoot"
605                ],
606                [
607                    "EndTag",
608                    "thead"
609                ],
610                [
611                    "EndTag",
612                    "tr"
613                ],
614                [
615                    "StartTag",
616                    "div",
617                    {}
618                ]
619            ]
620        },
621        {
622            "fragmentContext": null,
623            "description": "<table><colgroup>foo",
624            "input": "<table><colgroup>foo",
625            "output": [
626                [
627                    "StartTag",
628                    "table",
629                    {}
630                ],
631                [
632                    "StartTag",
633                    "colgroup",
634                    {}
635                ],
636                [
637                    "Character",
638                    "foo"
639                ]
640            ]
641        },
642        {
643            "fragmentContext": "colgroup",
644            "description": "foo<col>",
645            "input": "foo<col>",
646            "output": [
647                [
648                    "Character",
649                    "foo"
650                ],
651                [
652                    "StartTag",
653                    "col",
654                    {}
655                ]
656            ]
657        },
658        {
659            "fragmentContext": null,
660            "description": "<table><colgroup></col>",
661            "input": "<table><colgroup></col>",
662            "output": [
663                [
664                    "StartTag",
665                    "table",
666                    {}
667                ],
668                [
669                    "StartTag",
670                    "colgroup",
671                    {}
672                ],
673                [
674                    "EndTag",
675                    "col"
676                ]
677            ]
678        },
679        {
680            "fragmentContext": null,
681            "description": "<frameset><div>",
682            "input": "<frameset><div>",
683            "output": [
684                [
685                    "StartTag",
686                    "frameset",
687                    {}
688                ],
689                [
690                    "StartTag",
691                    "div",
692                    {}
693                ]
694            ]
695        },
696        {
697            "fragmentContext": "frameset",
698            "description": "</frameset><frame>",
699            "input": "</frameset><frame>",
700            "output": [
701                [
702                    "EndTag",
703                    "frameset"
704                ],
705                [
706                    "StartTag",
707                    "frame",
708                    {}
709                ]
710            ]
711        },
712        {
713            "fragmentContext": null,
714            "description": "<frameset></div>",
715            "input": "<frameset></div>",
716            "output": [
717                [
718                    "StartTag",
719                    "frameset",
720                    {}
721                ],
722                [
723                    "EndTag",
724                    "div"
725                ]
726            ]
727        },
728        {
729            "fragmentContext": "body",
730            "description": "</body><div>",
731            "input": "</body><div>",
732            "output": [
733                [
734                    "EndTag",
735                    "body"
736                ],
737                [
738                    "StartTag",
739                    "div",
740                    {}
741                ]
742            ]
743        },
744        {
745            "fragmentContext": null,
746            "description": "<table><tr><div>",
747            "input": "<table><tr><div>",
748            "output": [
749                [
750                    "StartTag",
751                    "table",
752                    {}
753                ],
754                [
755                    "StartTag",
756                    "tr",
757                    {}
758                ],
759                [
760                    "StartTag",
761                    "div",
762                    {}
763                ]
764            ]
765        },
766        {
767            "fragmentContext": "tr",
768            "description": "</tr><td>",
769            "input": "</tr><td>",
770            "output": [
771                [
772                    "EndTag",
773                    "tr"
774                ],
775                [
776                    "StartTag",
777                    "td",
778                    {}
779                ]
780            ]
781        },
782        {
783            "fragmentContext": "tr",
784            "description": "</tbody></tfoot></thead><td>",
785            "input": "</tbody></tfoot></thead><td>",
786            "output": [
787                [
788                    "EndTag",
789                    "tbody"
790                ],
791                [
792                    "EndTag",
793                    "tfoot"
794                ],
795                [
796                    "EndTag",
797                    "thead"
798                ],
799                [
800                    "StartTag",
801                    "td",
802                    {}
803                ]
804            ]
805        },
806        {
807            "fragmentContext": null,
808            "description": "<table><tr><div><td>",
809            "input": "<table><tr><div><td>",
810            "output": [
811                [
812                    "StartTag",
813                    "table",
814                    {}
815                ],
816                [
817                    "StartTag",
818                    "tr",
819                    {}
820                ],
821                [
822                    "StartTag",
823                    "div",
824                    {}
825                ],
826                [
827                    "StartTag",
828                    "td",
829                    {}
830                ]
831            ]
832        },
833        {
834            "fragmentContext": "tbody",
835            "description": "<caption><col><colgroup><tbody><tfoot><thead><tr>",
836            "input": "<caption><col><colgroup><tbody><tfoot><thead><tr>",
837            "output": [
838                [
839                    "StartTag",
840                    "caption",
841                    {}
842                ],
843                [
844                    "StartTag",
845                    "col",
846                    {}
847                ],
848                [
849                    "StartTag",
850                    "colgroup",
851                    {}
852                ],
853                [
854                    "StartTag",
855                    "tbody",
856                    {}
857                ],
858                [
859                    "StartTag",
860                    "tfoot",
861                    {}
862                ],
863                [
864                    "StartTag",
865                    "thead",
866                    {}
867                ],
868                [
869                    "StartTag",
870                    "tr",
871                    {}
872                ]
873            ]
874        },
875        {
876            "fragmentContext": null,
877            "description": "<table><tbody></thead>",
878            "input": "<table><tbody></thead>",
879            "output": [
880                [
881                    "StartTag",
882                    "table",
883                    {}
884                ],
885                [
886                    "StartTag",
887                    "tbody",
888                    {}
889                ],
890                [
891                    "EndTag",
892                    "thead"
893                ]
894            ]
895        },
896        {
897            "fragmentContext": "tbody",
898            "description": "</table><tr>",
899            "input": "</table><tr>",
900            "output": [
901                [
902                    "EndTag",
903                    "table"
904                ],
905                [
906                    "StartTag",
907                    "tr",
908                    {}
909                ]
910            ]
911        },
912        {
913            "fragmentContext": null,
914            "description": "<table><tbody></body></caption></col></colgroup></html></td></th></tr>",
915            "input": "<table><tbody></body></caption></col></colgroup></html></td></th></tr>",
916            "output": [
917                [
918                    "StartTag",
919                    "table",
920                    {}
921                ],
922                [
923                    "StartTag",
924                    "tbody",
925                    {}
926                ],
927                [
928                    "EndTag",
929                    "body"
930                ],
931                [
932                    "EndTag",
933                    "caption"
934                ],
935                [
936                    "EndTag",
937                    "col"
938                ],
939                [
940                    "EndTag",
941                    "colgroup"
942                ],
943                [
944                    "EndTag",
945                    "html"
946                ],
947                [
948                    "EndTag",
949                    "td"
950                ],
951                [
952                    "EndTag",
953                    "th"
954                ],
955                [
956                    "EndTag",
957                    "tr"
958                ]
959            ]
960        },
961        {
962            "fragmentContext": null,
963            "description": "<table><tbody></div>",
964            "input": "<table><tbody></div>",
965            "output": [
966                [
967                    "StartTag",
968                    "table",
969                    {}
970                ],
971                [
972                    "StartTag",
973                    "tbody",
974                    {}
975                ],
976                [
977                    "EndTag",
978                    "div"
979                ]
980            ]
981        },
982        {
983            "fragmentContext": null,
984            "description": "<table><table>",
985            "input": "<table><table>",
986            "output": [
987                [
988                    "StartTag",
989                    "table",
990                    {}
991                ],
992                [
993                    "StartTag",
994                    "table",
995                    {}
996                ]
997            ]
998        },
999        {
1000            "fragmentContext": null,
1001            "description": "<table></body></caption></col></colgroup></html></tbody></td></tfoot></th></thead></tr>",
1002            "input": "<table></body></caption></col></colgroup></html></tbody></td></tfoot></th></thead></tr>",
1003            "output": [
1004                [
1005                    "StartTag",
1006                    "table",
1007                    {}
1008                ],
1009                [
1010                    "EndTag",
1011                    "body"
1012                ],
1013                [
1014                    "EndTag",
1015                    "caption"
1016                ],
1017                [
1018                    "EndTag",
1019                    "col"
1020                ],
1021                [
1022                    "EndTag",
1023                    "colgroup"
1024                ],
1025                [
1026                    "EndTag",
1027                    "html"
1028                ],
1029                [
1030                    "EndTag",
1031                    "tbody"
1032                ],
1033                [
1034                    "EndTag",
1035                    "td"
1036                ],
1037                [
1038                    "EndTag",
1039                    "tfoot"
1040                ],
1041                [
1042                    "EndTag",
1043                    "th"
1044                ],
1045                [
1046                    "EndTag",
1047                    "thead"
1048                ],
1049                [
1050                    "EndTag",
1051                    "tr"
1052                ]
1053            ]
1054        },
1055        {
1056            "fragmentContext": "table",
1057            "description": "</table><tr>",
1058            "input": "</table><tr>",
1059            "output": [
1060                [
1061                    "EndTag",
1062                    "table"
1063                ],
1064                [
1065                    "StartTag",
1066                    "tr",
1067                    {}
1068                ]
1069            ]
1070        },
1071        {
1072            "fragmentContext": "html",
1073            "description": "<body></body></html>",
1074            "input": "<body></body></html>",
1075            "output": [
1076                [
1077                    "StartTag",
1078                    "body",
1079                    {}
1080                ],
1081                [
1082                    "EndTag",
1083                    "body"
1084                ],
1085                [
1086                    "EndTag",
1087                    "html"
1088                ]
1089            ]
1090        },
1091        {
1092            "fragmentContext": null,
1093            "description": "<html><frameset></frameset></html> ",
1094            "input": "<html><frameset></frameset></html> ",
1095            "output": [
1096                [
1097                    "StartTag",
1098                    "html",
1099                    {}
1100                ],
1101                [
1102                    "StartTag",
1103                    "frameset",
1104                    {}
1105                ],
1106                [
1107                    "EndTag",
1108                    "frameset"
1109                ],
1110                [
1111                    "EndTag",
1112                    "html"
1113                ],
1114                [
1115                    "Character",
1116                    " "
1117                ]
1118            ]
1119        },
1120        {
1121            "fragmentContext": null,
1122            "description": "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\"><html></html>",
1123            "input": "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\"><html></html>",
1124            "output": [
1125                [
1126                    "DOCTYPE",
1127                    "html",
1128                    "-//W3C//DTD HTML 4.01//EN",
1129                    null,
1130                    true
1131                ],
1132                [
1133                    "StartTag",
1134                    "html",
1135                    {}
1136                ],
1137                [
1138                    "EndTag",
1139                    "html"
1140                ]
1141            ]
1142        },
1143        {
1144            "fragmentContext": null,
1145            "description": "<param><frameset></frameset>",
1146            "input": "<param><frameset></frameset>",
1147            "output": [
1148                [
1149                    "StartTag",
1150                    "param",
1151                    {}
1152                ],
1153                [
1154                    "StartTag",
1155                    "frameset",
1156                    {}
1157                ],
1158                [
1159                    "EndTag",
1160                    "frameset"
1161                ]
1162            ]
1163        },
1164        {
1165            "fragmentContext": null,
1166            "description": "<source><frameset></frameset>",
1167            "input": "<source><frameset></frameset>",
1168            "output": [
1169                [
1170                    "StartTag",
1171                    "source",
1172                    {}
1173                ],
1174                [
1175                    "StartTag",
1176                    "frameset",
1177                    {}
1178                ],
1179                [
1180                    "EndTag",
1181                    "frameset"
1182                ]
1183            ]
1184        },
1185        {
1186            "fragmentContext": null,
1187            "description": "<track><frameset></frameset>",
1188            "input": "<track><frameset></frameset>",
1189            "output": [
1190                [
1191                    "StartTag",
1192                    "track",
1193                    {}
1194                ],
1195                [
1196                    "StartTag",
1197                    "frameset",
1198                    {}
1199                ],
1200                [
1201                    "EndTag",
1202                    "frameset"
1203                ]
1204            ]
1205        },
1206        {
1207            "fragmentContext": null,
1208            "description": "</html><frameset></frameset>",
1209            "input": "</html><frameset></frameset>",
1210            "output": [
1211                [
1212                    "EndTag",
1213                    "html"
1214                ],
1215                [
1216                    "StartTag",
1217                    "frameset",
1218                    {}
1219                ],
1220                [
1221                    "EndTag",
1222                    "frameset"
1223                ]
1224            ]
1225        },
1226        {
1227            "fragmentContext": null,
1228            "description": "</body><frameset></frameset>",
1229            "input": "</body><frameset></frameset>",
1230            "output": [
1231                [
1232                    "EndTag",
1233                    "body"
1234                ],
1235                [
1236                    "StartTag",
1237                    "frameset",
1238                    {}
1239                ],
1240                [
1241                    "EndTag",
1242                    "frameset"
1243                ]
1244            ]
1245        }
1246    ]
1247}