• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{
2    "tests": [
3        {
4            "description": "<body><template>Hello</template>",
5            "input": "<body><template>Hello</template>",
6            "output": [
7                [
8                    "StartTag",
9                    "body",
10                    {}
11                ],
12                [
13                    "StartTag",
14                    "template",
15                    {}
16                ],
17                [
18                    "Character",
19                    "Hello"
20                ],
21                [
22                    "EndTag",
23                    "template"
24                ]
25            ]
26        },
27        {
28            "description": "<template>Hello</template>",
29            "input": "<template>Hello</template>",
30            "output": [
31                [
32                    "StartTag",
33                    "template",
34                    {}
35                ],
36                [
37                    "Character",
38                    "Hello"
39                ],
40                [
41                    "EndTag",
42                    "template"
43                ]
44            ]
45        },
46        {
47            "description": "<template></template><div></div>",
48            "input": "<template></template><div></div>",
49            "output": [
50                [
51                    "StartTag",
52                    "template",
53                    {}
54                ],
55                [
56                    "EndTag",
57                    "template"
58                ],
59                [
60                    "StartTag",
61                    "div",
62                    {}
63                ],
64                [
65                    "EndTag",
66                    "div"
67                ]
68            ]
69        },
70        {
71            "description": "<html><template>Hello</template>",
72            "input": "<html><template>Hello</template>",
73            "output": [
74                [
75                    "StartTag",
76                    "html",
77                    {}
78                ],
79                [
80                    "StartTag",
81                    "template",
82                    {}
83                ],
84                [
85                    "Character",
86                    "Hello"
87                ],
88                [
89                    "EndTag",
90                    "template"
91                ]
92            ]
93        },
94        {
95            "description": "<head><template><div></div></template></head>",
96            "input": "<head><template><div></div></template></head>",
97            "output": [
98                [
99                    "StartTag",
100                    "head",
101                    {}
102                ],
103                [
104                    "StartTag",
105                    "template",
106                    {}
107                ],
108                [
109                    "StartTag",
110                    "div",
111                    {}
112                ],
113                [
114                    "EndTag",
115                    "div"
116                ],
117                [
118                    "EndTag",
119                    "template"
120                ],
121                [
122                    "EndTag",
123                    "head"
124                ]
125            ]
126        },
127        {
128            "description": "<div><template><div><span></template><b>",
129            "input": "<div><template><div><span></template><b>",
130            "output": [
131                [
132                    "StartTag",
133                    "div",
134                    {}
135                ],
136                [
137                    "StartTag",
138                    "template",
139                    {}
140                ],
141                [
142                    "StartTag",
143                    "div",
144                    {}
145                ],
146                [
147                    "StartTag",
148                    "span",
149                    {}
150                ],
151                [
152                    "EndTag",
153                    "template"
154                ],
155                [
156                    "StartTag",
157                    "b",
158                    {}
159                ]
160            ]
161        },
162        {
163            "description": "<div><template></div>Hello",
164            "input": "<div><template></div>Hello",
165            "output": [
166                [
167                    "StartTag",
168                    "div",
169                    {}
170                ],
171                [
172                    "StartTag",
173                    "template",
174                    {}
175                ],
176                [
177                    "EndTag",
178                    "div"
179                ],
180                [
181                    "Character",
182                    "Hello"
183                ]
184            ]
185        },
186        {
187            "description": "<div></template></div>",
188            "input": "<div></template></div>",
189            "output": [
190                [
191                    "StartTag",
192                    "div",
193                    {}
194                ],
195                [
196                    "EndTag",
197                    "template"
198                ],
199                [
200                    "EndTag",
201                    "div"
202                ]
203            ]
204        },
205        {
206            "description": "<table><template></template></table>",
207            "input": "<table><template></template></table>",
208            "output": [
209                [
210                    "StartTag",
211                    "table",
212                    {}
213                ],
214                [
215                    "StartTag",
216                    "template",
217                    {}
218                ],
219                [
220                    "EndTag",
221                    "template"
222                ],
223                [
224                    "EndTag",
225                    "table"
226                ]
227            ]
228        },
229        {
230            "description": "<table><template></template></div>",
231            "input": "<table><template></template></div>",
232            "output": [
233                [
234                    "StartTag",
235                    "table",
236                    {}
237                ],
238                [
239                    "StartTag",
240                    "template",
241                    {}
242                ],
243                [
244                    "EndTag",
245                    "template"
246                ],
247                [
248                    "EndTag",
249                    "div"
250                ]
251            ]
252        },
253        {
254            "description": "<table><div><template></template></div>",
255            "input": "<table><div><template></template></div>",
256            "output": [
257                [
258                    "StartTag",
259                    "table",
260                    {}
261                ],
262                [
263                    "StartTag",
264                    "div",
265                    {}
266                ],
267                [
268                    "StartTag",
269                    "template",
270                    {}
271                ],
272                [
273                    "EndTag",
274                    "template"
275                ],
276                [
277                    "EndTag",
278                    "div"
279                ]
280            ]
281        },
282        {
283            "description": "<table><template></template><div></div>",
284            "input": "<table><template></template><div></div>",
285            "output": [
286                [
287                    "StartTag",
288                    "table",
289                    {}
290                ],
291                [
292                    "StartTag",
293                    "template",
294                    {}
295                ],
296                [
297                    "EndTag",
298                    "template"
299                ],
300                [
301                    "StartTag",
302                    "div",
303                    {}
304                ],
305                [
306                    "EndTag",
307                    "div"
308                ]
309            ]
310        },
311        {
312            "description": "<table>   <template></template></table>",
313            "input": "<table>   <template></template></table>",
314            "output": [
315                [
316                    "StartTag",
317                    "table",
318                    {}
319                ],
320                [
321                    "Character",
322                    "   "
323                ],
324                [
325                    "StartTag",
326                    "template",
327                    {}
328                ],
329                [
330                    "EndTag",
331                    "template"
332                ],
333                [
334                    "EndTag",
335                    "table"
336                ]
337            ]
338        },
339        {
340            "description": "<table><tbody><template></template></tbody>",
341            "input": "<table><tbody><template></template></tbody>",
342            "output": [
343                [
344                    "StartTag",
345                    "table",
346                    {}
347                ],
348                [
349                    "StartTag",
350                    "tbody",
351                    {}
352                ],
353                [
354                    "StartTag",
355                    "template",
356                    {}
357                ],
358                [
359                    "EndTag",
360                    "template"
361                ],
362                [
363                    "EndTag",
364                    "tbody"
365                ]
366            ]
367        },
368        {
369            "description": "<table><tbody><template></tbody></template>",
370            "input": "<table><tbody><template></tbody></template>",
371            "output": [
372                [
373                    "StartTag",
374                    "table",
375                    {}
376                ],
377                [
378                    "StartTag",
379                    "tbody",
380                    {}
381                ],
382                [
383                    "StartTag",
384                    "template",
385                    {}
386                ],
387                [
388                    "EndTag",
389                    "tbody"
390                ],
391                [
392                    "EndTag",
393                    "template"
394                ]
395            ]
396        },
397        {
398            "description": "<table><tbody><template></template></tbody></table>",
399            "input": "<table><tbody><template></template></tbody></table>",
400            "output": [
401                [
402                    "StartTag",
403                    "table",
404                    {}
405                ],
406                [
407                    "StartTag",
408                    "tbody",
409                    {}
410                ],
411                [
412                    "StartTag",
413                    "template",
414                    {}
415                ],
416                [
417                    "EndTag",
418                    "template"
419                ],
420                [
421                    "EndTag",
422                    "tbody"
423                ],
424                [
425                    "EndTag",
426                    "table"
427                ]
428            ]
429        },
430        {
431            "description": "<table><thead><template></template></thead>",
432            "input": "<table><thead><template></template></thead>",
433            "output": [
434                [
435                    "StartTag",
436                    "table",
437                    {}
438                ],
439                [
440                    "StartTag",
441                    "thead",
442                    {}
443                ],
444                [
445                    "StartTag",
446                    "template",
447                    {}
448                ],
449                [
450                    "EndTag",
451                    "template"
452                ],
453                [
454                    "EndTag",
455                    "thead"
456                ]
457            ]
458        },
459        {
460            "description": "<table><tfoot><template></template></tfoot>",
461            "input": "<table><tfoot><template></template></tfoot>",
462            "output": [
463                [
464                    "StartTag",
465                    "table",
466                    {}
467                ],
468                [
469                    "StartTag",
470                    "tfoot",
471                    {}
472                ],
473                [
474                    "StartTag",
475                    "template",
476                    {}
477                ],
478                [
479                    "EndTag",
480                    "template"
481                ],
482                [
483                    "EndTag",
484                    "tfoot"
485                ]
486            ]
487        },
488        {
489            "description": "<select><template></template></select>",
490            "input": "<select><template></template></select>",
491            "output": [
492                [
493                    "StartTag",
494                    "select",
495                    {}
496                ],
497                [
498                    "StartTag",
499                    "template",
500                    {}
501                ],
502                [
503                    "EndTag",
504                    "template"
505                ],
506                [
507                    "EndTag",
508                    "select"
509                ]
510            ]
511        },
512        {
513            "description": "<select><template><option></option></template></select>",
514            "input": "<select><template><option></option></template></select>",
515            "output": [
516                [
517                    "StartTag",
518                    "select",
519                    {}
520                ],
521                [
522                    "StartTag",
523                    "template",
524                    {}
525                ],
526                [
527                    "StartTag",
528                    "option",
529                    {}
530                ],
531                [
532                    "EndTag",
533                    "option"
534                ],
535                [
536                    "EndTag",
537                    "template"
538                ],
539                [
540                    "EndTag",
541                    "select"
542                ]
543            ]
544        },
545        {
546            "description": "<template><option></option></select><option></option></template>",
547            "input": "<template><option></option></select><option></option></template>",
548            "output": [
549                [
550                    "StartTag",
551                    "template",
552                    {}
553                ],
554                [
555                    "StartTag",
556                    "option",
557                    {}
558                ],
559                [
560                    "EndTag",
561                    "option"
562                ],
563                [
564                    "EndTag",
565                    "select"
566                ],
567                [
568                    "StartTag",
569                    "option",
570                    {}
571                ],
572                [
573                    "EndTag",
574                    "option"
575                ],
576                [
577                    "EndTag",
578                    "template"
579                ]
580            ]
581        },
582        {
583            "description": "<select><template></template><option></select>",
584            "input": "<select><template></template><option></select>",
585            "output": [
586                [
587                    "StartTag",
588                    "select",
589                    {}
590                ],
591                [
592                    "StartTag",
593                    "template",
594                    {}
595                ],
596                [
597                    "EndTag",
598                    "template"
599                ],
600                [
601                    "StartTag",
602                    "option",
603                    {}
604                ],
605                [
606                    "EndTag",
607                    "select"
608                ]
609            ]
610        },
611        {
612            "description": "<select><option><template></template></select>",
613            "input": "<select><option><template></template></select>",
614            "output": [
615                [
616                    "StartTag",
617                    "select",
618                    {}
619                ],
620                [
621                    "StartTag",
622                    "option",
623                    {}
624                ],
625                [
626                    "StartTag",
627                    "template",
628                    {}
629                ],
630                [
631                    "EndTag",
632                    "template"
633                ],
634                [
635                    "EndTag",
636                    "select"
637                ]
638            ]
639        },
640        {
641            "description": "<select><template>",
642            "input": "<select><template>",
643            "output": [
644                [
645                    "StartTag",
646                    "select",
647                    {}
648                ],
649                [
650                    "StartTag",
651                    "template",
652                    {}
653                ]
654            ]
655        },
656        {
657            "description": "<select><option></option><template>",
658            "input": "<select><option></option><template>",
659            "output": [
660                [
661                    "StartTag",
662                    "select",
663                    {}
664                ],
665                [
666                    "StartTag",
667                    "option",
668                    {}
669                ],
670                [
671                    "EndTag",
672                    "option"
673                ],
674                [
675                    "StartTag",
676                    "template",
677                    {}
678                ]
679            ]
680        },
681        {
682            "description": "<select><option></option><template><option>",
683            "input": "<select><option></option><template><option>",
684            "output": [
685                [
686                    "StartTag",
687                    "select",
688                    {}
689                ],
690                [
691                    "StartTag",
692                    "option",
693                    {}
694                ],
695                [
696                    "EndTag",
697                    "option"
698                ],
699                [
700                    "StartTag",
701                    "template",
702                    {}
703                ],
704                [
705                    "StartTag",
706                    "option",
707                    {}
708                ]
709            ]
710        },
711        {
712            "description": "<table><thead><template><td></template></table>",
713            "input": "<table><thead><template><td></template></table>",
714            "output": [
715                [
716                    "StartTag",
717                    "table",
718                    {}
719                ],
720                [
721                    "StartTag",
722                    "thead",
723                    {}
724                ],
725                [
726                    "StartTag",
727                    "template",
728                    {}
729                ],
730                [
731                    "StartTag",
732                    "td",
733                    {}
734                ],
735                [
736                    "EndTag",
737                    "template"
738                ],
739                [
740                    "EndTag",
741                    "table"
742                ]
743            ]
744        },
745        {
746            "description": "<table><template><thead></template></table>",
747            "input": "<table><template><thead></template></table>",
748            "output": [
749                [
750                    "StartTag",
751                    "table",
752                    {}
753                ],
754                [
755                    "StartTag",
756                    "template",
757                    {}
758                ],
759                [
760                    "StartTag",
761                    "thead",
762                    {}
763                ],
764                [
765                    "EndTag",
766                    "template"
767                ],
768                [
769                    "EndTag",
770                    "table"
771                ]
772            ]
773        },
774        {
775            "description": "<body><table><template><td></tr><div></template></table>",
776            "input": "<body><table><template><td></tr><div></template></table>",
777            "output": [
778                [
779                    "StartTag",
780                    "body",
781                    {}
782                ],
783                [
784                    "StartTag",
785                    "table",
786                    {}
787                ],
788                [
789                    "StartTag",
790                    "template",
791                    {}
792                ],
793                [
794                    "StartTag",
795                    "td",
796                    {}
797                ],
798                [
799                    "EndTag",
800                    "tr"
801                ],
802                [
803                    "StartTag",
804                    "div",
805                    {}
806                ],
807                [
808                    "EndTag",
809                    "template"
810                ],
811                [
812                    "EndTag",
813                    "table"
814                ]
815            ]
816        },
817        {
818            "description": "<table><template><thead></template></thead></table>",
819            "input": "<table><template><thead></template></thead></table>",
820            "output": [
821                [
822                    "StartTag",
823                    "table",
824                    {}
825                ],
826                [
827                    "StartTag",
828                    "template",
829                    {}
830                ],
831                [
832                    "StartTag",
833                    "thead",
834                    {}
835                ],
836                [
837                    "EndTag",
838                    "template"
839                ],
840                [
841                    "EndTag",
842                    "thead"
843                ],
844                [
845                    "EndTag",
846                    "table"
847                ]
848            ]
849        },
850        {
851            "description": "<table><thead><template><tr></template></table>",
852            "input": "<table><thead><template><tr></template></table>",
853            "output": [
854                [
855                    "StartTag",
856                    "table",
857                    {}
858                ],
859                [
860                    "StartTag",
861                    "thead",
862                    {}
863                ],
864                [
865                    "StartTag",
866                    "template",
867                    {}
868                ],
869                [
870                    "StartTag",
871                    "tr",
872                    {}
873                ],
874                [
875                    "EndTag",
876                    "template"
877                ],
878                [
879                    "EndTag",
880                    "table"
881                ]
882            ]
883        },
884        {
885            "description": "<table><template><tr></template></table>",
886            "input": "<table><template><tr></template></table>",
887            "output": [
888                [
889                    "StartTag",
890                    "table",
891                    {}
892                ],
893                [
894                    "StartTag",
895                    "template",
896                    {}
897                ],
898                [
899                    "StartTag",
900                    "tr",
901                    {}
902                ],
903                [
904                    "EndTag",
905                    "template"
906                ],
907                [
908                    "EndTag",
909                    "table"
910                ]
911            ]
912        },
913        {
914            "description": "<table><tr><template><td>",
915            "input": "<table><tr><template><td>",
916            "output": [
917                [
918                    "StartTag",
919                    "table",
920                    {}
921                ],
922                [
923                    "StartTag",
924                    "tr",
925                    {}
926                ],
927                [
928                    "StartTag",
929                    "template",
930                    {}
931                ],
932                [
933                    "StartTag",
934                    "td",
935                    {}
936                ]
937            ]
938        },
939        {
940            "description": "<table><template><tr><template><td></template></tr></template></table>",
941            "input": "<table><template><tr><template><td></template></tr></template></table>",
942            "output": [
943                [
944                    "StartTag",
945                    "table",
946                    {}
947                ],
948                [
949                    "StartTag",
950                    "template",
951                    {}
952                ],
953                [
954                    "StartTag",
955                    "tr",
956                    {}
957                ],
958                [
959                    "StartTag",
960                    "template",
961                    {}
962                ],
963                [
964                    "StartTag",
965                    "td",
966                    {}
967                ],
968                [
969                    "EndTag",
970                    "template"
971                ],
972                [
973                    "EndTag",
974                    "tr"
975                ],
976                [
977                    "EndTag",
978                    "template"
979                ],
980                [
981                    "EndTag",
982                    "table"
983                ]
984            ]
985        },
986        {
987            "description": "<table><template><tr><template><td></td></template></tr></template></table>",
988            "input": "<table><template><tr><template><td></td></template></tr></template></table>",
989            "output": [
990                [
991                    "StartTag",
992                    "table",
993                    {}
994                ],
995                [
996                    "StartTag",
997                    "template",
998                    {}
999                ],
1000                [
1001                    "StartTag",
1002                    "tr",
1003                    {}
1004                ],
1005                [
1006                    "StartTag",
1007                    "template",
1008                    {}
1009                ],
1010                [
1011                    "StartTag",
1012                    "td",
1013                    {}
1014                ],
1015                [
1016                    "EndTag",
1017                    "td"
1018                ],
1019                [
1020                    "EndTag",
1021                    "template"
1022                ],
1023                [
1024                    "EndTag",
1025                    "tr"
1026                ],
1027                [
1028                    "EndTag",
1029                    "template"
1030                ],
1031                [
1032                    "EndTag",
1033                    "table"
1034                ]
1035            ]
1036        },
1037        {
1038            "description": "<table><template><td></template>",
1039            "input": "<table><template><td></template>",
1040            "output": [
1041                [
1042                    "StartTag",
1043                    "table",
1044                    {}
1045                ],
1046                [
1047                    "StartTag",
1048                    "template",
1049                    {}
1050                ],
1051                [
1052                    "StartTag",
1053                    "td",
1054                    {}
1055                ],
1056                [
1057                    "EndTag",
1058                    "template"
1059                ]
1060            ]
1061        },
1062        {
1063            "description": "<body><template><td></td></template>",
1064            "input": "<body><template><td></td></template>",
1065            "output": [
1066                [
1067                    "StartTag",
1068                    "body",
1069                    {}
1070                ],
1071                [
1072                    "StartTag",
1073                    "template",
1074                    {}
1075                ],
1076                [
1077                    "StartTag",
1078                    "td",
1079                    {}
1080                ],
1081                [
1082                    "EndTag",
1083                    "td"
1084                ],
1085                [
1086                    "EndTag",
1087                    "template"
1088                ]
1089            ]
1090        },
1091        {
1092            "description": "<body><template><template><tr></tr></template><td></td></template>",
1093            "input": "<body><template><template><tr></tr></template><td></td></template>",
1094            "output": [
1095                [
1096                    "StartTag",
1097                    "body",
1098                    {}
1099                ],
1100                [
1101                    "StartTag",
1102                    "template",
1103                    {}
1104                ],
1105                [
1106                    "StartTag",
1107                    "template",
1108                    {}
1109                ],
1110                [
1111                    "StartTag",
1112                    "tr",
1113                    {}
1114                ],
1115                [
1116                    "EndTag",
1117                    "tr"
1118                ],
1119                [
1120                    "EndTag",
1121                    "template"
1122                ],
1123                [
1124                    "StartTag",
1125                    "td",
1126                    {}
1127                ],
1128                [
1129                    "EndTag",
1130                    "td"
1131                ],
1132                [
1133                    "EndTag",
1134                    "template"
1135                ]
1136            ]
1137        },
1138        {
1139            "description": "<table><colgroup><template><col>",
1140            "input": "<table><colgroup><template><col>",
1141            "output": [
1142                [
1143                    "StartTag",
1144                    "table",
1145                    {}
1146                ],
1147                [
1148                    "StartTag",
1149                    "colgroup",
1150                    {}
1151                ],
1152                [
1153                    "StartTag",
1154                    "template",
1155                    {}
1156                ],
1157                [
1158                    "StartTag",
1159                    "col",
1160                    {}
1161                ]
1162            ]
1163        },
1164        {
1165            "description": "<frameset><template><frame></frame></template></frameset>",
1166            "input": "<frameset><template><frame></frame></template></frameset>",
1167            "output": [
1168                [
1169                    "StartTag",
1170                    "frameset",
1171                    {}
1172                ],
1173                [
1174                    "StartTag",
1175                    "template",
1176                    {}
1177                ],
1178                [
1179                    "StartTag",
1180                    "frame",
1181                    {}
1182                ],
1183                [
1184                    "EndTag",
1185                    "frame"
1186                ],
1187                [
1188                    "EndTag",
1189                    "template"
1190                ],
1191                [
1192                    "EndTag",
1193                    "frameset"
1194                ]
1195            ]
1196        },
1197        {
1198            "description": "<template><frame></frame></frameset><frame></frame></template>",
1199            "input": "<template><frame></frame></frameset><frame></frame></template>",
1200            "output": [
1201                [
1202                    "StartTag",
1203                    "template",
1204                    {}
1205                ],
1206                [
1207                    "StartTag",
1208                    "frame",
1209                    {}
1210                ],
1211                [
1212                    "EndTag",
1213                    "frame"
1214                ],
1215                [
1216                    "EndTag",
1217                    "frameset"
1218                ],
1219                [
1220                    "StartTag",
1221                    "frame",
1222                    {}
1223                ],
1224                [
1225                    "EndTag",
1226                    "frame"
1227                ],
1228                [
1229                    "EndTag",
1230                    "template"
1231                ]
1232            ]
1233        },
1234        {
1235            "description": "<template><div><frameset><span></span></div><span></span></template>",
1236            "input": "<template><div><frameset><span></span></div><span></span></template>",
1237            "output": [
1238                [
1239                    "StartTag",
1240                    "template",
1241                    {}
1242                ],
1243                [
1244                    "StartTag",
1245                    "div",
1246                    {}
1247                ],
1248                [
1249                    "StartTag",
1250                    "frameset",
1251                    {}
1252                ],
1253                [
1254                    "StartTag",
1255                    "span",
1256                    {}
1257                ],
1258                [
1259                    "EndTag",
1260                    "span"
1261                ],
1262                [
1263                    "EndTag",
1264                    "div"
1265                ],
1266                [
1267                    "StartTag",
1268                    "span",
1269                    {}
1270                ],
1271                [
1272                    "EndTag",
1273                    "span"
1274                ],
1275                [
1276                    "EndTag",
1277                    "template"
1278                ]
1279            ]
1280        },
1281        {
1282            "description": "<body><template><div><frameset><span></span></div><span></span></template></body>",
1283            "input": "<body><template><div><frameset><span></span></div><span></span></template></body>",
1284            "output": [
1285                [
1286                    "StartTag",
1287                    "body",
1288                    {}
1289                ],
1290                [
1291                    "StartTag",
1292                    "template",
1293                    {}
1294                ],
1295                [
1296                    "StartTag",
1297                    "div",
1298                    {}
1299                ],
1300                [
1301                    "StartTag",
1302                    "frameset",
1303                    {}
1304                ],
1305                [
1306                    "StartTag",
1307                    "span",
1308                    {}
1309                ],
1310                [
1311                    "EndTag",
1312                    "span"
1313                ],
1314                [
1315                    "EndTag",
1316                    "div"
1317                ],
1318                [
1319                    "StartTag",
1320                    "span",
1321                    {}
1322                ],
1323                [
1324                    "EndTag",
1325                    "span"
1326                ],
1327                [
1328                    "EndTag",
1329                    "template"
1330                ],
1331                [
1332                    "EndTag",
1333                    "body"
1334                ]
1335            ]
1336        },
1337        {
1338            "description": "<body><template><script>var i = 1;</script><td></td></template>",
1339            "input": "<body><template><script>var i = 1;</script><td></td></template>",
1340            "output": [
1341                [
1342                    "StartTag",
1343                    "body",
1344                    {}
1345                ],
1346                [
1347                    "StartTag",
1348                    "template",
1349                    {}
1350                ],
1351                [
1352                    "StartTag",
1353                    "script",
1354                    {}
1355                ],
1356                [
1357                    "Character",
1358                    "var i = 1;"
1359                ],
1360                [
1361                    "EndTag",
1362                    "script"
1363                ],
1364                [
1365                    "StartTag",
1366                    "td",
1367                    {}
1368                ],
1369                [
1370                    "EndTag",
1371                    "td"
1372                ],
1373                [
1374                    "EndTag",
1375                    "template"
1376                ]
1377            ]
1378        },
1379        {
1380            "description": "<body><template><tr><div></div></tr></template>",
1381            "input": "<body><template><tr><div></div></tr></template>",
1382            "output": [
1383                [
1384                    "StartTag",
1385                    "body",
1386                    {}
1387                ],
1388                [
1389                    "StartTag",
1390                    "template",
1391                    {}
1392                ],
1393                [
1394                    "StartTag",
1395                    "tr",
1396                    {}
1397                ],
1398                [
1399                    "StartTag",
1400                    "div",
1401                    {}
1402                ],
1403                [
1404                    "EndTag",
1405                    "div"
1406                ],
1407                [
1408                    "EndTag",
1409                    "tr"
1410                ],
1411                [
1412                    "EndTag",
1413                    "template"
1414                ]
1415            ]
1416        },
1417        {
1418            "description": "<body><template><tr></tr><td></td></template>",
1419            "input": "<body><template><tr></tr><td></td></template>",
1420            "output": [
1421                [
1422                    "StartTag",
1423                    "body",
1424                    {}
1425                ],
1426                [
1427                    "StartTag",
1428                    "template",
1429                    {}
1430                ],
1431                [
1432                    "StartTag",
1433                    "tr",
1434                    {}
1435                ],
1436                [
1437                    "EndTag",
1438                    "tr"
1439                ],
1440                [
1441                    "StartTag",
1442                    "td",
1443                    {}
1444                ],
1445                [
1446                    "EndTag",
1447                    "td"
1448                ],
1449                [
1450                    "EndTag",
1451                    "template"
1452                ]
1453            ]
1454        },
1455        {
1456            "description": "<body><template><td></td></tr><td></td></template>",
1457            "input": "<body><template><td></td></tr><td></td></template>",
1458            "output": [
1459                [
1460                    "StartTag",
1461                    "body",
1462                    {}
1463                ],
1464                [
1465                    "StartTag",
1466                    "template",
1467                    {}
1468                ],
1469                [
1470                    "StartTag",
1471                    "td",
1472                    {}
1473                ],
1474                [
1475                    "EndTag",
1476                    "td"
1477                ],
1478                [
1479                    "EndTag",
1480                    "tr"
1481                ],
1482                [
1483                    "StartTag",
1484                    "td",
1485                    {}
1486                ],
1487                [
1488                    "EndTag",
1489                    "td"
1490                ],
1491                [
1492                    "EndTag",
1493                    "template"
1494                ]
1495            ]
1496        },
1497        {
1498            "description": "<body><template><td></td><tbody><td></td></template>",
1499            "input": "<body><template><td></td><tbody><td></td></template>",
1500            "output": [
1501                [
1502                    "StartTag",
1503                    "body",
1504                    {}
1505                ],
1506                [
1507                    "StartTag",
1508                    "template",
1509                    {}
1510                ],
1511                [
1512                    "StartTag",
1513                    "td",
1514                    {}
1515                ],
1516                [
1517                    "EndTag",
1518                    "td"
1519                ],
1520                [
1521                    "StartTag",
1522                    "tbody",
1523                    {}
1524                ],
1525                [
1526                    "StartTag",
1527                    "td",
1528                    {}
1529                ],
1530                [
1531                    "EndTag",
1532                    "td"
1533                ],
1534                [
1535                    "EndTag",
1536                    "template"
1537                ]
1538            ]
1539        },
1540        {
1541            "description": "<body><template><td></td><caption></caption><td></td></template>",
1542            "input": "<body><template><td></td><caption></caption><td></td></template>",
1543            "output": [
1544                [
1545                    "StartTag",
1546                    "body",
1547                    {}
1548                ],
1549                [
1550                    "StartTag",
1551                    "template",
1552                    {}
1553                ],
1554                [
1555                    "StartTag",
1556                    "td",
1557                    {}
1558                ],
1559                [
1560                    "EndTag",
1561                    "td"
1562                ],
1563                [
1564                    "StartTag",
1565                    "caption",
1566                    {}
1567                ],
1568                [
1569                    "EndTag",
1570                    "caption"
1571                ],
1572                [
1573                    "StartTag",
1574                    "td",
1575                    {}
1576                ],
1577                [
1578                    "EndTag",
1579                    "td"
1580                ],
1581                [
1582                    "EndTag",
1583                    "template"
1584                ]
1585            ]
1586        },
1587        {
1588            "description": "<body><template><td></td><colgroup></caption><td></td></template>",
1589            "input": "<body><template><td></td><colgroup></caption><td></td></template>",
1590            "output": [
1591                [
1592                    "StartTag",
1593                    "body",
1594                    {}
1595                ],
1596                [
1597                    "StartTag",
1598                    "template",
1599                    {}
1600                ],
1601                [
1602                    "StartTag",
1603                    "td",
1604                    {}
1605                ],
1606                [
1607                    "EndTag",
1608                    "td"
1609                ],
1610                [
1611                    "StartTag",
1612                    "colgroup",
1613                    {}
1614                ],
1615                [
1616                    "EndTag",
1617                    "caption"
1618                ],
1619                [
1620                    "StartTag",
1621                    "td",
1622                    {}
1623                ],
1624                [
1625                    "EndTag",
1626                    "td"
1627                ],
1628                [
1629                    "EndTag",
1630                    "template"
1631                ]
1632            ]
1633        },
1634        {
1635            "description": "<body><template><td></td></table><td></td></template>",
1636            "input": "<body><template><td></td></table><td></td></template>",
1637            "output": [
1638                [
1639                    "StartTag",
1640                    "body",
1641                    {}
1642                ],
1643                [
1644                    "StartTag",
1645                    "template",
1646                    {}
1647                ],
1648                [
1649                    "StartTag",
1650                    "td",
1651                    {}
1652                ],
1653                [
1654                    "EndTag",
1655                    "td"
1656                ],
1657                [
1658                    "EndTag",
1659                    "table"
1660                ],
1661                [
1662                    "StartTag",
1663                    "td",
1664                    {}
1665                ],
1666                [
1667                    "EndTag",
1668                    "td"
1669                ],
1670                [
1671                    "EndTag",
1672                    "template"
1673                ]
1674            ]
1675        },
1676        {
1677            "description": "<body><template><tr></tr><tbody><tr></tr></template>",
1678            "input": "<body><template><tr></tr><tbody><tr></tr></template>",
1679            "output": [
1680                [
1681                    "StartTag",
1682                    "body",
1683                    {}
1684                ],
1685                [
1686                    "StartTag",
1687                    "template",
1688                    {}
1689                ],
1690                [
1691                    "StartTag",
1692                    "tr",
1693                    {}
1694                ],
1695                [
1696                    "EndTag",
1697                    "tr"
1698                ],
1699                [
1700                    "StartTag",
1701                    "tbody",
1702                    {}
1703                ],
1704                [
1705                    "StartTag",
1706                    "tr",
1707                    {}
1708                ],
1709                [
1710                    "EndTag",
1711                    "tr"
1712                ],
1713                [
1714                    "EndTag",
1715                    "template"
1716                ]
1717            ]
1718        },
1719        {
1720            "description": "<body><template><tr></tr><caption><tr></tr></template>",
1721            "input": "<body><template><tr></tr><caption><tr></tr></template>",
1722            "output": [
1723                [
1724                    "StartTag",
1725                    "body",
1726                    {}
1727                ],
1728                [
1729                    "StartTag",
1730                    "template",
1731                    {}
1732                ],
1733                [
1734                    "StartTag",
1735                    "tr",
1736                    {}
1737                ],
1738                [
1739                    "EndTag",
1740                    "tr"
1741                ],
1742                [
1743                    "StartTag",
1744                    "caption",
1745                    {}
1746                ],
1747                [
1748                    "StartTag",
1749                    "tr",
1750                    {}
1751                ],
1752                [
1753                    "EndTag",
1754                    "tr"
1755                ],
1756                [
1757                    "EndTag",
1758                    "template"
1759                ]
1760            ]
1761        },
1762        {
1763            "description": "<body><template><tr></tr></table><tr></tr></template>",
1764            "input": "<body><template><tr></tr></table><tr></tr></template>",
1765            "output": [
1766                [
1767                    "StartTag",
1768                    "body",
1769                    {}
1770                ],
1771                [
1772                    "StartTag",
1773                    "template",
1774                    {}
1775                ],
1776                [
1777                    "StartTag",
1778                    "tr",
1779                    {}
1780                ],
1781                [
1782                    "EndTag",
1783                    "tr"
1784                ],
1785                [
1786                    "EndTag",
1787                    "table"
1788                ],
1789                [
1790                    "StartTag",
1791                    "tr",
1792                    {}
1793                ],
1794                [
1795                    "EndTag",
1796                    "tr"
1797                ],
1798                [
1799                    "EndTag",
1800                    "template"
1801                ]
1802            ]
1803        },
1804        {
1805            "description": "<body><template><thead></thead><caption></caption><tbody></tbody></template>",
1806            "input": "<body><template><thead></thead><caption></caption><tbody></tbody></template>",
1807            "output": [
1808                [
1809                    "StartTag",
1810                    "body",
1811                    {}
1812                ],
1813                [
1814                    "StartTag",
1815                    "template",
1816                    {}
1817                ],
1818                [
1819                    "StartTag",
1820                    "thead",
1821                    {}
1822                ],
1823                [
1824                    "EndTag",
1825                    "thead"
1826                ],
1827                [
1828                    "StartTag",
1829                    "caption",
1830                    {}
1831                ],
1832                [
1833                    "EndTag",
1834                    "caption"
1835                ],
1836                [
1837                    "StartTag",
1838                    "tbody",
1839                    {}
1840                ],
1841                [
1842                    "EndTag",
1843                    "tbody"
1844                ],
1845                [
1846                    "EndTag",
1847                    "template"
1848                ]
1849            ]
1850        },
1851        {
1852            "description": "<body><template><thead></thead></table><tbody></tbody></template></body>",
1853            "input": "<body><template><thead></thead></table><tbody></tbody></template></body>",
1854            "output": [
1855                [
1856                    "StartTag",
1857                    "body",
1858                    {}
1859                ],
1860                [
1861                    "StartTag",
1862                    "template",
1863                    {}
1864                ],
1865                [
1866                    "StartTag",
1867                    "thead",
1868                    {}
1869                ],
1870                [
1871                    "EndTag",
1872                    "thead"
1873                ],
1874                [
1875                    "EndTag",
1876                    "table"
1877                ],
1878                [
1879                    "StartTag",
1880                    "tbody",
1881                    {}
1882                ],
1883                [
1884                    "EndTag",
1885                    "tbody"
1886                ],
1887                [
1888                    "EndTag",
1889                    "template"
1890                ],
1891                [
1892                    "EndTag",
1893                    "body"
1894                ]
1895            ]
1896        },
1897        {
1898            "description": "<body><template><div><tr></tr></div></template>",
1899            "input": "<body><template><div><tr></tr></div></template>",
1900            "output": [
1901                [
1902                    "StartTag",
1903                    "body",
1904                    {}
1905                ],
1906                [
1907                    "StartTag",
1908                    "template",
1909                    {}
1910                ],
1911                [
1912                    "StartTag",
1913                    "div",
1914                    {}
1915                ],
1916                [
1917                    "StartTag",
1918                    "tr",
1919                    {}
1920                ],
1921                [
1922                    "EndTag",
1923                    "tr"
1924                ],
1925                [
1926                    "EndTag",
1927                    "div"
1928                ],
1929                [
1930                    "EndTag",
1931                    "template"
1932                ]
1933            ]
1934        },
1935        {
1936            "description": "<body><template><em>Hello</em></template>",
1937            "input": "<body><template><em>Hello</em></template>",
1938            "output": [
1939                [
1940                    "StartTag",
1941                    "body",
1942                    {}
1943                ],
1944                [
1945                    "StartTag",
1946                    "template",
1947                    {}
1948                ],
1949                [
1950                    "StartTag",
1951                    "em",
1952                    {}
1953                ],
1954                [
1955                    "Character",
1956                    "Hello"
1957                ],
1958                [
1959                    "EndTag",
1960                    "em"
1961                ],
1962                [
1963                    "EndTag",
1964                    "template"
1965                ]
1966            ]
1967        },
1968        {
1969            "description": "<body><template><!--comment--></template>",
1970            "input": "<body><template><!--comment--></template>",
1971            "output": [
1972                [
1973                    "StartTag",
1974                    "body",
1975                    {}
1976                ],
1977                [
1978                    "StartTag",
1979                    "template",
1980                    {}
1981                ],
1982                [
1983                    "Comment",
1984                    "comment"
1985                ],
1986                [
1987                    "EndTag",
1988                    "template"
1989                ]
1990            ]
1991        },
1992        {
1993            "description": "<body><template><style></style><td></td></template>",
1994            "input": "<body><template><style></style><td></td></template>",
1995            "output": [
1996                [
1997                    "StartTag",
1998                    "body",
1999                    {}
2000                ],
2001                [
2002                    "StartTag",
2003                    "template",
2004                    {}
2005                ],
2006                [
2007                    "StartTag",
2008                    "style",
2009                    {}
2010                ],
2011                [
2012                    "EndTag",
2013                    "style"
2014                ],
2015                [
2016                    "StartTag",
2017                    "td",
2018                    {}
2019                ],
2020                [
2021                    "EndTag",
2022                    "td"
2023                ],
2024                [
2025                    "EndTag",
2026                    "template"
2027                ]
2028            ]
2029        },
2030        {
2031            "description": "<body><template><meta><td></td></template>",
2032            "input": "<body><template><meta><td></td></template>",
2033            "output": [
2034                [
2035                    "StartTag",
2036                    "body",
2037                    {}
2038                ],
2039                [
2040                    "StartTag",
2041                    "template",
2042                    {}
2043                ],
2044                [
2045                    "StartTag",
2046                    "meta",
2047                    {}
2048                ],
2049                [
2050                    "StartTag",
2051                    "td",
2052                    {}
2053                ],
2054                [
2055                    "EndTag",
2056                    "td"
2057                ],
2058                [
2059                    "EndTag",
2060                    "template"
2061                ]
2062            ]
2063        },
2064        {
2065            "description": "<body><template><link><td></td></template>",
2066            "input": "<body><template><link><td></td></template>",
2067            "output": [
2068                [
2069                    "StartTag",
2070                    "body",
2071                    {}
2072                ],
2073                [
2074                    "StartTag",
2075                    "template",
2076                    {}
2077                ],
2078                [
2079                    "StartTag",
2080                    "link",
2081                    {}
2082                ],
2083                [
2084                    "StartTag",
2085                    "td",
2086                    {}
2087                ],
2088                [
2089                    "EndTag",
2090                    "td"
2091                ],
2092                [
2093                    "EndTag",
2094                    "template"
2095                ]
2096            ]
2097        },
2098        {
2099            "description": "<body><template><template><tr></tr></template><td></td></template>",
2100            "input": "<body><template><template><tr></tr></template><td></td></template>",
2101            "output": [
2102                [
2103                    "StartTag",
2104                    "body",
2105                    {}
2106                ],
2107                [
2108                    "StartTag",
2109                    "template",
2110                    {}
2111                ],
2112                [
2113                    "StartTag",
2114                    "template",
2115                    {}
2116                ],
2117                [
2118                    "StartTag",
2119                    "tr",
2120                    {}
2121                ],
2122                [
2123                    "EndTag",
2124                    "tr"
2125                ],
2126                [
2127                    "EndTag",
2128                    "template"
2129                ],
2130                [
2131                    "StartTag",
2132                    "td",
2133                    {}
2134                ],
2135                [
2136                    "EndTag",
2137                    "td"
2138                ],
2139                [
2140                    "EndTag",
2141                    "template"
2142                ]
2143            ]
2144        },
2145        {
2146            "description": "<body><table><colgroup><template><col></col></template></colgroup></table></body>",
2147            "input": "<body><table><colgroup><template><col></col></template></colgroup></table></body>",
2148            "output": [
2149                [
2150                    "StartTag",
2151                    "body",
2152                    {}
2153                ],
2154                [
2155                    "StartTag",
2156                    "table",
2157                    {}
2158                ],
2159                [
2160                    "StartTag",
2161                    "colgroup",
2162                    {}
2163                ],
2164                [
2165                    "StartTag",
2166                    "template",
2167                    {}
2168                ],
2169                [
2170                    "StartTag",
2171                    "col",
2172                    {}
2173                ],
2174                [
2175                    "EndTag",
2176                    "col"
2177                ],
2178                [
2179                    "EndTag",
2180                    "template"
2181                ],
2182                [
2183                    "EndTag",
2184                    "colgroup"
2185                ],
2186                [
2187                    "EndTag",
2188                    "table"
2189                ],
2190                [
2191                    "EndTag",
2192                    "body"
2193                ]
2194            ]
2195        },
2196        {
2197            "description": "<body a=b><template><div></div><body c=d><div></div></body></template></body>",
2198            "input": "<body a=b><template><div></div><body c=d><div></div></body></template></body>",
2199            "output": [
2200                [
2201                    "StartTag",
2202                    "body",
2203                    {
2204                        "a": "b"
2205                    }
2206                ],
2207                [
2208                    "StartTag",
2209                    "template",
2210                    {}
2211                ],
2212                [
2213                    "StartTag",
2214                    "div",
2215                    {}
2216                ],
2217                [
2218                    "EndTag",
2219                    "div"
2220                ],
2221                [
2222                    "StartTag",
2223                    "body",
2224                    {
2225                        "c": "d"
2226                    }
2227                ],
2228                [
2229                    "StartTag",
2230                    "div",
2231                    {}
2232                ],
2233                [
2234                    "EndTag",
2235                    "div"
2236                ],
2237                [
2238                    "EndTag",
2239                    "body"
2240                ],
2241                [
2242                    "EndTag",
2243                    "template"
2244                ],
2245                [
2246                    "EndTag",
2247                    "body"
2248                ]
2249            ]
2250        },
2251        {
2252            "description": "<html a=b><template><div><html b=c><span></template>",
2253            "input": "<html a=b><template><div><html b=c><span></template>",
2254            "output": [
2255                [
2256                    "StartTag",
2257                    "html",
2258                    {
2259                        "a": "b"
2260                    }
2261                ],
2262                [
2263                    "StartTag",
2264                    "template",
2265                    {}
2266                ],
2267                [
2268                    "StartTag",
2269                    "div",
2270                    {}
2271                ],
2272                [
2273                    "StartTag",
2274                    "html",
2275                    {
2276                        "b": "c"
2277                    }
2278                ],
2279                [
2280                    "StartTag",
2281                    "span",
2282                    {}
2283                ],
2284                [
2285                    "EndTag",
2286                    "template"
2287                ]
2288            ]
2289        },
2290        {
2291            "description": "<html a=b><template><col></col><html b=c><col></col></template>",
2292            "input": "<html a=b><template><col></col><html b=c><col></col></template>",
2293            "output": [
2294                [
2295                    "StartTag",
2296                    "html",
2297                    {
2298                        "a": "b"
2299                    }
2300                ],
2301                [
2302                    "StartTag",
2303                    "template",
2304                    {}
2305                ],
2306                [
2307                    "StartTag",
2308                    "col",
2309                    {}
2310                ],
2311                [
2312                    "EndTag",
2313                    "col"
2314                ],
2315                [
2316                    "StartTag",
2317                    "html",
2318                    {
2319                        "b": "c"
2320                    }
2321                ],
2322                [
2323                    "StartTag",
2324                    "col",
2325                    {}
2326                ],
2327                [
2328                    "EndTag",
2329                    "col"
2330                ],
2331                [
2332                    "EndTag",
2333                    "template"
2334                ]
2335            ]
2336        },
2337        {
2338            "description": "<html a=b><template><frame></frame><html b=c><frame></frame></template>",
2339            "input": "<html a=b><template><frame></frame><html b=c><frame></frame></template>",
2340            "output": [
2341                [
2342                    "StartTag",
2343                    "html",
2344                    {
2345                        "a": "b"
2346                    }
2347                ],
2348                [
2349                    "StartTag",
2350                    "template",
2351                    {}
2352                ],
2353                [
2354                    "StartTag",
2355                    "frame",
2356                    {}
2357                ],
2358                [
2359                    "EndTag",
2360                    "frame"
2361                ],
2362                [
2363                    "StartTag",
2364                    "html",
2365                    {
2366                        "b": "c"
2367                    }
2368                ],
2369                [
2370                    "StartTag",
2371                    "frame",
2372                    {}
2373                ],
2374                [
2375                    "EndTag",
2376                    "frame"
2377                ],
2378                [
2379                    "EndTag",
2380                    "template"
2381                ]
2382            ]
2383        },
2384        {
2385            "description": "<body><template><tr></tr><template></template><td></td></template>",
2386            "input": "<body><template><tr></tr><template></template><td></td></template>",
2387            "output": [
2388                [
2389                    "StartTag",
2390                    "body",
2391                    {}
2392                ],
2393                [
2394                    "StartTag",
2395                    "template",
2396                    {}
2397                ],
2398                [
2399                    "StartTag",
2400                    "tr",
2401                    {}
2402                ],
2403                [
2404                    "EndTag",
2405                    "tr"
2406                ],
2407                [
2408                    "StartTag",
2409                    "template",
2410                    {}
2411                ],
2412                [
2413                    "EndTag",
2414                    "template"
2415                ],
2416                [
2417                    "StartTag",
2418                    "td",
2419                    {}
2420                ],
2421                [
2422                    "EndTag",
2423                    "td"
2424                ],
2425                [
2426                    "EndTag",
2427                    "template"
2428                ]
2429            ]
2430        },
2431        {
2432            "description": "<body><template><thead></thead><template><tr></tr></template><tr></tr><tfoot></tfoot></template>",
2433            "input": "<body><template><thead></thead><template><tr></tr></template><tr></tr><tfoot></tfoot></template>",
2434            "output": [
2435                [
2436                    "StartTag",
2437                    "body",
2438                    {}
2439                ],
2440                [
2441                    "StartTag",
2442                    "template",
2443                    {}
2444                ],
2445                [
2446                    "StartTag",
2447                    "thead",
2448                    {}
2449                ],
2450                [
2451                    "EndTag",
2452                    "thead"
2453                ],
2454                [
2455                    "StartTag",
2456                    "template",
2457                    {}
2458                ],
2459                [
2460                    "StartTag",
2461                    "tr",
2462                    {}
2463                ],
2464                [
2465                    "EndTag",
2466                    "tr"
2467                ],
2468                [
2469                    "EndTag",
2470                    "template"
2471                ],
2472                [
2473                    "StartTag",
2474                    "tr",
2475                    {}
2476                ],
2477                [
2478                    "EndTag",
2479                    "tr"
2480                ],
2481                [
2482                    "StartTag",
2483                    "tfoot",
2484                    {}
2485                ],
2486                [
2487                    "EndTag",
2488                    "tfoot"
2489                ],
2490                [
2491                    "EndTag",
2492                    "template"
2493                ]
2494            ]
2495        },
2496        {
2497            "description": "<body><template><template><b><template></template></template>text</template>",
2498            "input": "<body><template><template><b><template></template></template>text</template>",
2499            "output": [
2500                [
2501                    "StartTag",
2502                    "body",
2503                    {}
2504                ],
2505                [
2506                    "StartTag",
2507                    "template",
2508                    {}
2509                ],
2510                [
2511                    "StartTag",
2512                    "template",
2513                    {}
2514                ],
2515                [
2516                    "StartTag",
2517                    "b",
2518                    {}
2519                ],
2520                [
2521                    "StartTag",
2522                    "template",
2523                    {}
2524                ],
2525                [
2526                    "EndTag",
2527                    "template"
2528                ],
2529                [
2530                    "EndTag",
2531                    "template"
2532                ],
2533                [
2534                    "Character",
2535                    "text"
2536                ],
2537                [
2538                    "EndTag",
2539                    "template"
2540                ]
2541            ]
2542        },
2543        {
2544            "description": "<body><template><col><colgroup>",
2545            "input": "<body><template><col><colgroup>",
2546            "output": [
2547                [
2548                    "StartTag",
2549                    "body",
2550                    {}
2551                ],
2552                [
2553                    "StartTag",
2554                    "template",
2555                    {}
2556                ],
2557                [
2558                    "StartTag",
2559                    "col",
2560                    {}
2561                ],
2562                [
2563                    "StartTag",
2564                    "colgroup",
2565                    {}
2566                ]
2567            ]
2568        },
2569        {
2570            "description": "<body><template><col></colgroup>",
2571            "input": "<body><template><col></colgroup>",
2572            "output": [
2573                [
2574                    "StartTag",
2575                    "body",
2576                    {}
2577                ],
2578                [
2579                    "StartTag",
2580                    "template",
2581                    {}
2582                ],
2583                [
2584                    "StartTag",
2585                    "col",
2586                    {}
2587                ],
2588                [
2589                    "EndTag",
2590                    "colgroup"
2591                ]
2592            ]
2593        },
2594        {
2595            "description": "<body><template><col><colgroup></template></body>",
2596            "input": "<body><template><col><colgroup></template></body>",
2597            "output": [
2598                [
2599                    "StartTag",
2600                    "body",
2601                    {}
2602                ],
2603                [
2604                    "StartTag",
2605                    "template",
2606                    {}
2607                ],
2608                [
2609                    "StartTag",
2610                    "col",
2611                    {}
2612                ],
2613                [
2614                    "StartTag",
2615                    "colgroup",
2616                    {}
2617                ],
2618                [
2619                    "EndTag",
2620                    "template"
2621                ],
2622                [
2623                    "EndTag",
2624                    "body"
2625                ]
2626            ]
2627        },
2628        {
2629            "description": "<body><template><col><div>",
2630            "input": "<body><template><col><div>",
2631            "output": [
2632                [
2633                    "StartTag",
2634                    "body",
2635                    {}
2636                ],
2637                [
2638                    "StartTag",
2639                    "template",
2640                    {}
2641                ],
2642                [
2643                    "StartTag",
2644                    "col",
2645                    {}
2646                ],
2647                [
2648                    "StartTag",
2649                    "div",
2650                    {}
2651                ]
2652            ]
2653        },
2654        {
2655            "description": "<body><template><col></div>",
2656            "input": "<body><template><col></div>",
2657            "output": [
2658                [
2659                    "StartTag",
2660                    "body",
2661                    {}
2662                ],
2663                [
2664                    "StartTag",
2665                    "template",
2666                    {}
2667                ],
2668                [
2669                    "StartTag",
2670                    "col",
2671                    {}
2672                ],
2673                [
2674                    "EndTag",
2675                    "div"
2676                ]
2677            ]
2678        },
2679        {
2680            "description": "<body><template><col>Hello",
2681            "input": "<body><template><col>Hello",
2682            "output": [
2683                [
2684                    "StartTag",
2685                    "body",
2686                    {}
2687                ],
2688                [
2689                    "StartTag",
2690                    "template",
2691                    {}
2692                ],
2693                [
2694                    "StartTag",
2695                    "col",
2696                    {}
2697                ],
2698                [
2699                    "Character",
2700                    "Hello"
2701                ]
2702            ]
2703        },
2704        {
2705            "description": "<body><template><i><menu>Foo</i>",
2706            "input": "<body><template><i><menu>Foo</i>",
2707            "output": [
2708                [
2709                    "StartTag",
2710                    "body",
2711                    {}
2712                ],
2713                [
2714                    "StartTag",
2715                    "template",
2716                    {}
2717                ],
2718                [
2719                    "StartTag",
2720                    "i",
2721                    {}
2722                ],
2723                [
2724                    "StartTag",
2725                    "menu",
2726                    {}
2727                ],
2728                [
2729                    "Character",
2730                    "Foo"
2731                ],
2732                [
2733                    "EndTag",
2734                    "i"
2735                ]
2736            ]
2737        },
2738        {
2739            "description": "<body><template></div><div>Foo</div><template></template><tr></tr>",
2740            "input": "<body><template></div><div>Foo</div><template></template><tr></tr>",
2741            "output": [
2742                [
2743                    "StartTag",
2744                    "body",
2745                    {}
2746                ],
2747                [
2748                    "StartTag",
2749                    "template",
2750                    {}
2751                ],
2752                [
2753                    "EndTag",
2754                    "div"
2755                ],
2756                [
2757                    "StartTag",
2758                    "div",
2759                    {}
2760                ],
2761                [
2762                    "Character",
2763                    "Foo"
2764                ],
2765                [
2766                    "EndTag",
2767                    "div"
2768                ],
2769                [
2770                    "StartTag",
2771                    "template",
2772                    {}
2773                ],
2774                [
2775                    "EndTag",
2776                    "template"
2777                ],
2778                [
2779                    "StartTag",
2780                    "tr",
2781                    {}
2782                ],
2783                [
2784                    "EndTag",
2785                    "tr"
2786                ]
2787            ]
2788        },
2789        {
2790            "description": "<body><div><template></div><tr><td>Foo</td></tr></template>",
2791            "input": "<body><div><template></div><tr><td>Foo</td></tr></template>",
2792            "output": [
2793                [
2794                    "StartTag",
2795                    "body",
2796                    {}
2797                ],
2798                [
2799                    "StartTag",
2800                    "div",
2801                    {}
2802                ],
2803                [
2804                    "StartTag",
2805                    "template",
2806                    {}
2807                ],
2808                [
2809                    "EndTag",
2810                    "div"
2811                ],
2812                [
2813                    "StartTag",
2814                    "tr",
2815                    {}
2816                ],
2817                [
2818                    "StartTag",
2819                    "td",
2820                    {}
2821                ],
2822                [
2823                    "Character",
2824                    "Foo"
2825                ],
2826                [
2827                    "EndTag",
2828                    "td"
2829                ],
2830                [
2831                    "EndTag",
2832                    "tr"
2833                ],
2834                [
2835                    "EndTag",
2836                    "template"
2837                ]
2838            ]
2839        },
2840        {
2841            "description": "<template></figcaption><sub><table></table>",
2842            "input": "<template></figcaption><sub><table></table>",
2843            "output": [
2844                [
2845                    "StartTag",
2846                    "template",
2847                    {}
2848                ],
2849                [
2850                    "EndTag",
2851                    "figcaption"
2852                ],
2853                [
2854                    "StartTag",
2855                    "sub",
2856                    {}
2857                ],
2858                [
2859                    "StartTag",
2860                    "table",
2861                    {}
2862                ],
2863                [
2864                    "EndTag",
2865                    "table"
2866                ]
2867            ]
2868        },
2869        {
2870            "description": "<template><template>",
2871            "input": "<template><template>",
2872            "output": [
2873                [
2874                    "StartTag",
2875                    "template",
2876                    {}
2877                ],
2878                [
2879                    "StartTag",
2880                    "template",
2881                    {}
2882                ]
2883            ]
2884        },
2885        {
2886            "description": "<template><div>",
2887            "input": "<template><div>",
2888            "output": [
2889                [
2890                    "StartTag",
2891                    "template",
2892                    {}
2893                ],
2894                [
2895                    "StartTag",
2896                    "div",
2897                    {}
2898                ]
2899            ]
2900        },
2901        {
2902            "description": "<template><template><div>",
2903            "input": "<template><template><div>",
2904            "output": [
2905                [
2906                    "StartTag",
2907                    "template",
2908                    {}
2909                ],
2910                [
2911                    "StartTag",
2912                    "template",
2913                    {}
2914                ],
2915                [
2916                    "StartTag",
2917                    "div",
2918                    {}
2919                ]
2920            ]
2921        },
2922        {
2923            "description": "<template><template><table>",
2924            "input": "<template><template><table>",
2925            "output": [
2926                [
2927                    "StartTag",
2928                    "template",
2929                    {}
2930                ],
2931                [
2932                    "StartTag",
2933                    "template",
2934                    {}
2935                ],
2936                [
2937                    "StartTag",
2938                    "table",
2939                    {}
2940                ]
2941            ]
2942        },
2943        {
2944            "description": "<template><template><tbody>",
2945            "input": "<template><template><tbody>",
2946            "output": [
2947                [
2948                    "StartTag",
2949                    "template",
2950                    {}
2951                ],
2952                [
2953                    "StartTag",
2954                    "template",
2955                    {}
2956                ],
2957                [
2958                    "StartTag",
2959                    "tbody",
2960                    {}
2961                ]
2962            ]
2963        },
2964        {
2965            "description": "<template><template><tr>",
2966            "input": "<template><template><tr>",
2967            "output": [
2968                [
2969                    "StartTag",
2970                    "template",
2971                    {}
2972                ],
2973                [
2974                    "StartTag",
2975                    "template",
2976                    {}
2977                ],
2978                [
2979                    "StartTag",
2980                    "tr",
2981                    {}
2982                ]
2983            ]
2984        },
2985        {
2986            "description": "<template><template><td>",
2987            "input": "<template><template><td>",
2988            "output": [
2989                [
2990                    "StartTag",
2991                    "template",
2992                    {}
2993                ],
2994                [
2995                    "StartTag",
2996                    "template",
2997                    {}
2998                ],
2999                [
3000                    "StartTag",
3001                    "td",
3002                    {}
3003                ]
3004            ]
3005        },
3006        {
3007            "description": "<template><template><caption>",
3008            "input": "<template><template><caption>",
3009            "output": [
3010                [
3011                    "StartTag",
3012                    "template",
3013                    {}
3014                ],
3015                [
3016                    "StartTag",
3017                    "template",
3018                    {}
3019                ],
3020                [
3021                    "StartTag",
3022                    "caption",
3023                    {}
3024                ]
3025            ]
3026        },
3027        {
3028            "description": "<template><template><colgroup>",
3029            "input": "<template><template><colgroup>",
3030            "output": [
3031                [
3032                    "StartTag",
3033                    "template",
3034                    {}
3035                ],
3036                [
3037                    "StartTag",
3038                    "template",
3039                    {}
3040                ],
3041                [
3042                    "StartTag",
3043                    "colgroup",
3044                    {}
3045                ]
3046            ]
3047        },
3048        {
3049            "description": "<template><template><col>",
3050            "input": "<template><template><col>",
3051            "output": [
3052                [
3053                    "StartTag",
3054                    "template",
3055                    {}
3056                ],
3057                [
3058                    "StartTag",
3059                    "template",
3060                    {}
3061                ],
3062                [
3063                    "StartTag",
3064                    "col",
3065                    {}
3066                ]
3067            ]
3068        },
3069        {
3070            "description": "<template><template><tbody><select>",
3071            "input": "<template><template><tbody><select>",
3072            "output": [
3073                [
3074                    "StartTag",
3075                    "template",
3076                    {}
3077                ],
3078                [
3079                    "StartTag",
3080                    "template",
3081                    {}
3082                ],
3083                [
3084                    "StartTag",
3085                    "tbody",
3086                    {}
3087                ],
3088                [
3089                    "StartTag",
3090                    "select",
3091                    {}
3092                ]
3093            ]
3094        },
3095        {
3096            "description": "<template><template><table>Foo",
3097            "input": "<template><template><table>Foo",
3098            "output": [
3099                [
3100                    "StartTag",
3101                    "template",
3102                    {}
3103                ],
3104                [
3105                    "StartTag",
3106                    "template",
3107                    {}
3108                ],
3109                [
3110                    "StartTag",
3111                    "table",
3112                    {}
3113                ],
3114                [
3115                    "Character",
3116                    "Foo"
3117                ]
3118            ]
3119        },
3120        {
3121            "description": "<template><template><frame>",
3122            "input": "<template><template><frame>",
3123            "output": [
3124                [
3125                    "StartTag",
3126                    "template",
3127                    {}
3128                ],
3129                [
3130                    "StartTag",
3131                    "template",
3132                    {}
3133                ],
3134                [
3135                    "StartTag",
3136                    "frame",
3137                    {}
3138                ]
3139            ]
3140        },
3141        {
3142            "description": "<template><template><script>var i",
3143            "input": "<template><template><script>var i",
3144            "output": [
3145                [
3146                    "StartTag",
3147                    "template",
3148                    {}
3149                ],
3150                [
3151                    "StartTag",
3152                    "template",
3153                    {}
3154                ],
3155                [
3156                    "StartTag",
3157                    "script",
3158                    {}
3159                ],
3160                [
3161                    "Character",
3162                    "var i"
3163                ]
3164            ]
3165        },
3166        {
3167            "description": "<template><template><style>var i",
3168            "input": "<template><template><style>var i",
3169            "output": [
3170                [
3171                    "StartTag",
3172                    "template",
3173                    {}
3174                ],
3175                [
3176                    "StartTag",
3177                    "template",
3178                    {}
3179                ],
3180                [
3181                    "StartTag",
3182                    "style",
3183                    {}
3184                ],
3185                [
3186                    "Character",
3187                    "var i"
3188                ]
3189            ]
3190        },
3191        {
3192            "description": "<template><table></template><body><span>Foo",
3193            "input": "<template><table></template><body><span>Foo",
3194            "output": [
3195                [
3196                    "StartTag",
3197                    "template",
3198                    {}
3199                ],
3200                [
3201                    "StartTag",
3202                    "table",
3203                    {}
3204                ],
3205                [
3206                    "EndTag",
3207                    "template"
3208                ],
3209                [
3210                    "StartTag",
3211                    "body",
3212                    {}
3213                ],
3214                [
3215                    "StartTag",
3216                    "span",
3217                    {}
3218                ],
3219                [
3220                    "Character",
3221                    "Foo"
3222                ]
3223            ]
3224        },
3225        {
3226            "description": "<template><td></template><body><span>Foo",
3227            "input": "<template><td></template><body><span>Foo",
3228            "output": [
3229                [
3230                    "StartTag",
3231                    "template",
3232                    {}
3233                ],
3234                [
3235                    "StartTag",
3236                    "td",
3237                    {}
3238                ],
3239                [
3240                    "EndTag",
3241                    "template"
3242                ],
3243                [
3244                    "StartTag",
3245                    "body",
3246                    {}
3247                ],
3248                [
3249                    "StartTag",
3250                    "span",
3251                    {}
3252                ],
3253                [
3254                    "Character",
3255                    "Foo"
3256                ]
3257            ]
3258        },
3259        {
3260            "description": "<template><object></template><body><span>Foo",
3261            "input": "<template><object></template><body><span>Foo",
3262            "output": [
3263                [
3264                    "StartTag",
3265                    "template",
3266                    {}
3267                ],
3268                [
3269                    "StartTag",
3270                    "object",
3271                    {}
3272                ],
3273                [
3274                    "EndTag",
3275                    "template"
3276                ],
3277                [
3278                    "StartTag",
3279                    "body",
3280                    {}
3281                ],
3282                [
3283                    "StartTag",
3284                    "span",
3285                    {}
3286                ],
3287                [
3288                    "Character",
3289                    "Foo"
3290                ]
3291            ]
3292        },
3293        {
3294            "description": "<template><svg><template>",
3295            "input": "<template><svg><template>",
3296            "output": [
3297                [
3298                    "StartTag",
3299                    "template",
3300                    {}
3301                ],
3302                [
3303                    "StartTag",
3304                    "svg",
3305                    {}
3306                ],
3307                [
3308                    "StartTag",
3309                    "template",
3310                    {}
3311                ]
3312            ]
3313        },
3314        {
3315            "description": "<template><svg><foo><template><foreignObject><div></template><div>",
3316            "input": "<template><svg><foo><template><foreignObject><div></template><div>",
3317            "output": [
3318                [
3319                    "StartTag",
3320                    "template",
3321                    {}
3322                ],
3323                [
3324                    "StartTag",
3325                    "svg",
3326                    {}
3327                ],
3328                [
3329                    "StartTag",
3330                    "foo",
3331                    {}
3332                ],
3333                [
3334                    "StartTag",
3335                    "template",
3336                    {}
3337                ],
3338                [
3339                    "StartTag",
3340                    "foreignObject",
3341                    {}
3342                ],
3343                [
3344                    "StartTag",
3345                    "div",
3346                    {}
3347                ],
3348                [
3349                    "EndTag",
3350                    "template"
3351                ],
3352                [
3353                    "StartTag",
3354                    "div",
3355                    {}
3356                ]
3357            ]
3358        },
3359        {
3360            "description": "<dummy><template><span></dummy>",
3361            "input": "<dummy><template><span></dummy>",
3362            "output": [
3363                [
3364                    "StartTag",
3365                    "dummy",
3366                    {}
3367                ],
3368                [
3369                    "StartTag",
3370                    "template",
3371                    {}
3372                ],
3373                [
3374                    "StartTag",
3375                    "span",
3376                    {}
3377                ],
3378                [
3379                    "EndTag",
3380                    "dummy"
3381                ]
3382            ]
3383        },
3384        {
3385            "description": "<body><table><tr><td><select><template>Foo</template><caption>A</table>",
3386            "input": "<body><table><tr><td><select><template>Foo</template><caption>A</table>",
3387            "output": [
3388                [
3389                    "StartTag",
3390                    "body",
3391                    {}
3392                ],
3393                [
3394                    "StartTag",
3395                    "table",
3396                    {}
3397                ],
3398                [
3399                    "StartTag",
3400                    "tr",
3401                    {}
3402                ],
3403                [
3404                    "StartTag",
3405                    "td",
3406                    {}
3407                ],
3408                [
3409                    "StartTag",
3410                    "select",
3411                    {}
3412                ],
3413                [
3414                    "StartTag",
3415                    "template",
3416                    {}
3417                ],
3418                [
3419                    "Character",
3420                    "Foo"
3421                ],
3422                [
3423                    "EndTag",
3424                    "template"
3425                ],
3426                [
3427                    "StartTag",
3428                    "caption",
3429                    {}
3430                ],
3431                [
3432                    "Character",
3433                    "A"
3434                ],
3435                [
3436                    "EndTag",
3437                    "table"
3438                ]
3439            ]
3440        },
3441        {
3442            "description": "<body></body><template>",
3443            "input": "<body></body><template>",
3444            "output": [
3445                [
3446                    "StartTag",
3447                    "body",
3448                    {}
3449                ],
3450                [
3451                    "EndTag",
3452                    "body"
3453                ],
3454                [
3455                    "StartTag",
3456                    "template",
3457                    {}
3458                ]
3459            ]
3460        },
3461        {
3462            "description": "<head></head><template>",
3463            "input": "<head></head><template>",
3464            "output": [
3465                [
3466                    "StartTag",
3467                    "head",
3468                    {}
3469                ],
3470                [
3471                    "EndTag",
3472                    "head"
3473                ],
3474                [
3475                    "StartTag",
3476                    "template",
3477                    {}
3478                ]
3479            ]
3480        },
3481        {
3482            "description": "<head></head><template>Foo</template>",
3483            "input": "<head></head><template>Foo</template>",
3484            "output": [
3485                [
3486                    "StartTag",
3487                    "head",
3488                    {}
3489                ],
3490                [
3491                    "EndTag",
3492                    "head"
3493                ],
3494                [
3495                    "StartTag",
3496                    "template",
3497                    {}
3498                ],
3499                [
3500                    "Character",
3501                    "Foo"
3502                ],
3503                [
3504                    "EndTag",
3505                    "template"
3506                ]
3507            ]
3508        },
3509        {
3510            "description": "<!DOCTYPE HTML><dummy><table><template><table><template><table><script>",
3511            "input": "<!DOCTYPE HTML><dummy><table><template><table><template><table><script>",
3512            "output": [
3513                [
3514                    "DOCTYPE",
3515                    "html",
3516                    null,
3517                    null,
3518                    true
3519                ],
3520                [
3521                    "StartTag",
3522                    "dummy",
3523                    {}
3524                ],
3525                [
3526                    "StartTag",
3527                    "table",
3528                    {}
3529                ],
3530                [
3531                    "StartTag",
3532                    "template",
3533                    {}
3534                ],
3535                [
3536                    "StartTag",
3537                    "table",
3538                    {}
3539                ],
3540                [
3541                    "StartTag",
3542                    "template",
3543                    {}
3544                ],
3545                [
3546                    "StartTag",
3547                    "table",
3548                    {}
3549                ],
3550                [
3551                    "StartTag",
3552                    "script",
3553                    {}
3554                ]
3555            ]
3556        },
3557        {
3558            "description": "<template><a><table><a>",
3559            "input": "<template><a><table><a>",
3560            "output": [
3561                [
3562                    "StartTag",
3563                    "template",
3564                    {}
3565                ],
3566                [
3567                    "StartTag",
3568                    "a",
3569                    {}
3570                ],
3571                [
3572                    "StartTag",
3573                    "table",
3574                    {}
3575                ],
3576                [
3577                    "StartTag",
3578                    "a",
3579                    {}
3580                ]
3581            ]
3582        }
3583    ]
3584}