1{ 2 "tests": [ 3 { 4 "description": "<!doctype html><body><title>X</title>", 5 "input": "<!doctype html><body><title>X</title>", 6 "output": [ 7 [ 8 "DOCTYPE", 9 "html", 10 null, 11 null, 12 true 13 ], 14 [ 15 "StartTag", 16 "body", 17 {} 18 ], 19 [ 20 "StartTag", 21 "title", 22 {} 23 ], 24 [ 25 "Character", 26 "X" 27 ], 28 [ 29 "EndTag", 30 "title" 31 ] 32 ] 33 }, 34 { 35 "description": "<!doctype html><table><title>X</title></table>", 36 "input": "<!doctype html><table><title>X</title></table>", 37 "output": [ 38 [ 39 "DOCTYPE", 40 "html", 41 null, 42 null, 43 true 44 ], 45 [ 46 "StartTag", 47 "table", 48 {} 49 ], 50 [ 51 "StartTag", 52 "title", 53 {} 54 ], 55 [ 56 "Character", 57 "X" 58 ], 59 [ 60 "EndTag", 61 "title" 62 ], 63 [ 64 "EndTag", 65 "table" 66 ] 67 ] 68 }, 69 { 70 "description": "<!doctype html><head></head><title>X</title>", 71 "input": "<!doctype html><head></head><title>X</title>", 72 "output": [ 73 [ 74 "DOCTYPE", 75 "html", 76 null, 77 null, 78 true 79 ], 80 [ 81 "StartTag", 82 "head", 83 {} 84 ], 85 [ 86 "EndTag", 87 "head" 88 ], 89 [ 90 "StartTag", 91 "title", 92 {} 93 ], 94 [ 95 "Character", 96 "X" 97 ], 98 [ 99 "EndTag", 100 "title" 101 ] 102 ] 103 }, 104 { 105 "description": "<!doctype html></head><title>X</title>", 106 "input": "<!doctype html></head><title>X</title>", 107 "output": [ 108 [ 109 "DOCTYPE", 110 "html", 111 null, 112 null, 113 true 114 ], 115 [ 116 "EndTag", 117 "head" 118 ], 119 [ 120 "StartTag", 121 "title", 122 {} 123 ], 124 [ 125 "Character", 126 "X" 127 ], 128 [ 129 "EndTag", 130 "title" 131 ] 132 ] 133 }, 134 { 135 "description": "<!doctype html><table><meta></table>", 136 "input": "<!doctype html><table><meta></table>", 137 "output": [ 138 [ 139 "DOCTYPE", 140 "html", 141 null, 142 null, 143 true 144 ], 145 [ 146 "StartTag", 147 "table", 148 {} 149 ], 150 [ 151 "StartTag", 152 "meta", 153 {} 154 ], 155 [ 156 "EndTag", 157 "table" 158 ] 159 ] 160 }, 161 { 162 "description": "<!doctype html><table>X<tr><td><table> <meta></table></table>", 163 "input": "<!doctype html><table>X<tr><td><table> <meta></table></table>", 164 "output": [ 165 [ 166 "DOCTYPE", 167 "html", 168 null, 169 null, 170 true 171 ], 172 [ 173 "StartTag", 174 "table", 175 {} 176 ], 177 [ 178 "Character", 179 "X" 180 ], 181 [ 182 "StartTag", 183 "tr", 184 {} 185 ], 186 [ 187 "StartTag", 188 "td", 189 {} 190 ], 191 [ 192 "StartTag", 193 "table", 194 {} 195 ], 196 [ 197 "Character", 198 " " 199 ], 200 [ 201 "StartTag", 202 "meta", 203 {} 204 ], 205 [ 206 "EndTag", 207 "table" 208 ], 209 [ 210 "EndTag", 211 "table" 212 ] 213 ] 214 }, 215 { 216 "description": "<!doctype html><html> <head>", 217 "input": "<!doctype html><html> <head>", 218 "output": [ 219 [ 220 "DOCTYPE", 221 "html", 222 null, 223 null, 224 true 225 ], 226 [ 227 "StartTag", 228 "html", 229 {} 230 ], 231 [ 232 "Character", 233 " " 234 ], 235 [ 236 "StartTag", 237 "head", 238 {} 239 ] 240 ] 241 }, 242 { 243 "description": "<!doctype html> <head>", 244 "input": "<!doctype html> <head>", 245 "output": [ 246 [ 247 "DOCTYPE", 248 "html", 249 null, 250 null, 251 true 252 ], 253 [ 254 "Character", 255 " " 256 ], 257 [ 258 "StartTag", 259 "head", 260 {} 261 ] 262 ] 263 }, 264 { 265 "description": "<!doctype html><table><style> <tr>x </style> </table>", 266 "input": "<!doctype html><table><style> <tr>x </style> </table>", 267 "output": [ 268 [ 269 "DOCTYPE", 270 "html", 271 null, 272 null, 273 true 274 ], 275 [ 276 "StartTag", 277 "table", 278 {} 279 ], 280 [ 281 "StartTag", 282 "style", 283 {} 284 ], 285 [ 286 "Character", 287 " <tr>x " 288 ], 289 [ 290 "EndTag", 291 "style" 292 ], 293 [ 294 "Character", 295 " " 296 ], 297 [ 298 "EndTag", 299 "table" 300 ] 301 ] 302 }, 303 { 304 "description": "<!doctype html><table><TBODY><script> <tr>x </script> </table>", 305 "input": "<!doctype html><table><TBODY><script> <tr>x </script> </table>", 306 "output": [ 307 [ 308 "DOCTYPE", 309 "html", 310 null, 311 null, 312 true 313 ], 314 [ 315 "StartTag", 316 "table", 317 {} 318 ], 319 [ 320 "StartTag", 321 "tbody", 322 {} 323 ], 324 [ 325 "StartTag", 326 "script", 327 {} 328 ], 329 [ 330 "Character", 331 " <tr>x " 332 ], 333 [ 334 "EndTag", 335 "script" 336 ], 337 [ 338 "Character", 339 " " 340 ], 341 [ 342 "EndTag", 343 "table" 344 ] 345 ] 346 }, 347 { 348 "description": "<!doctype html><p><applet><p>X</p></applet>", 349 "input": "<!doctype html><p><applet><p>X</p></applet>", 350 "output": [ 351 [ 352 "DOCTYPE", 353 "html", 354 null, 355 null, 356 true 357 ], 358 [ 359 "StartTag", 360 "p", 361 {} 362 ], 363 [ 364 "StartTag", 365 "applet", 366 {} 367 ], 368 [ 369 "StartTag", 370 "p", 371 {} 372 ], 373 [ 374 "Character", 375 "X" 376 ], 377 [ 378 "EndTag", 379 "p" 380 ], 381 [ 382 "EndTag", 383 "applet" 384 ] 385 ] 386 }, 387 { 388 "description": "<!doctype html><p><object type=\"application/x-non-existant-plugin\"><p>X</p></object>", 389 "input": "<!doctype html><p><object type=\"application/x-non-existant-plugin\"><p>X</p></object>", 390 "output": [ 391 [ 392 "DOCTYPE", 393 "html", 394 null, 395 null, 396 true 397 ], 398 [ 399 "StartTag", 400 "p", 401 {} 402 ], 403 [ 404 "StartTag", 405 "object", 406 { 407 "type": "application/x-non-existant-plugin" 408 } 409 ], 410 [ 411 "StartTag", 412 "p", 413 {} 414 ], 415 [ 416 "Character", 417 "X" 418 ], 419 [ 420 "EndTag", 421 "p" 422 ], 423 [ 424 "EndTag", 425 "object" 426 ] 427 ] 428 }, 429 { 430 "description": "<!doctype html><listing>\\r\\nX</listing>", 431 "input": "<!doctype html><listing>\r\nX</listing>", 432 "output": [ 433 [ 434 "DOCTYPE", 435 "html", 436 null, 437 null, 438 true 439 ], 440 [ 441 "StartTag", 442 "listing", 443 {} 444 ], 445 [ 446 "Character", 447 "X" 448 ], 449 [ 450 "EndTag", 451 "listing" 452 ] 453 ] 454 }, 455 { 456 "description": "<!doctype html><select><input>X", 457 "input": "<!doctype html><select><input>X", 458 "output": [ 459 [ 460 "DOCTYPE", 461 "html", 462 null, 463 null, 464 true 465 ], 466 [ 467 "StartTag", 468 "select", 469 {} 470 ], 471 [ 472 "StartTag", 473 "input", 474 {} 475 ], 476 [ 477 "Character", 478 "X" 479 ] 480 ] 481 }, 482 { 483 "description": "<!doctype html><select><select>X", 484 "input": "<!doctype html><select><select>X", 485 "output": [ 486 [ 487 "DOCTYPE", 488 "html", 489 null, 490 null, 491 true 492 ], 493 [ 494 "StartTag", 495 "select", 496 {} 497 ], 498 [ 499 "StartTag", 500 "select", 501 {} 502 ], 503 [ 504 "Character", 505 "X" 506 ] 507 ] 508 }, 509 { 510 "description": "<!doctype html><table><input type=hidDEN></table>", 511 "input": "<!doctype html><table><input type=hidDEN></table>", 512 "output": [ 513 [ 514 "DOCTYPE", 515 "html", 516 null, 517 null, 518 true 519 ], 520 [ 521 "StartTag", 522 "table", 523 {} 524 ], 525 [ 526 "StartTag", 527 "input", 528 { 529 "type": "hidDEN" 530 } 531 ], 532 [ 533 "EndTag", 534 "table" 535 ] 536 ] 537 }, 538 { 539 "description": "<!doctype html><table>X<input type=hidDEN></table>", 540 "input": "<!doctype html><table>X<input type=hidDEN></table>", 541 "output": [ 542 [ 543 "DOCTYPE", 544 "html", 545 null, 546 null, 547 true 548 ], 549 [ 550 "StartTag", 551 "table", 552 {} 553 ], 554 [ 555 "Character", 556 "X" 557 ], 558 [ 559 "StartTag", 560 "input", 561 { 562 "type": "hidDEN" 563 } 564 ], 565 [ 566 "EndTag", 567 "table" 568 ] 569 ] 570 }, 571 { 572 "description": "<!doctype html><table> <input type=hidDEN></table>", 573 "input": "<!doctype html><table> <input type=hidDEN></table>", 574 "output": [ 575 [ 576 "DOCTYPE", 577 "html", 578 null, 579 null, 580 true 581 ], 582 [ 583 "StartTag", 584 "table", 585 {} 586 ], 587 [ 588 "Character", 589 " " 590 ], 591 [ 592 "StartTag", 593 "input", 594 { 595 "type": "hidDEN" 596 } 597 ], 598 [ 599 "EndTag", 600 "table" 601 ] 602 ] 603 }, 604 { 605 "description": "<!doctype html><table> <input type='hidDEN'></table>", 606 "input": "<!doctype html><table> <input type='hidDEN'></table>", 607 "output": [ 608 [ 609 "DOCTYPE", 610 "html", 611 null, 612 null, 613 true 614 ], 615 [ 616 "StartTag", 617 "table", 618 {} 619 ], 620 [ 621 "Character", 622 " " 623 ], 624 [ 625 "StartTag", 626 "input", 627 { 628 "type": "hidDEN" 629 } 630 ], 631 [ 632 "EndTag", 633 "table" 634 ] 635 ] 636 }, 637 { 638 "description": "<!doctype html><table><input type=\" hidden\"><input type=hidDEN></table>", 639 "input": "<!doctype html><table><input type=\" hidden\"><input type=hidDEN></table>", 640 "output": [ 641 [ 642 "DOCTYPE", 643 "html", 644 null, 645 null, 646 true 647 ], 648 [ 649 "StartTag", 650 "table", 651 {} 652 ], 653 [ 654 "StartTag", 655 "input", 656 { 657 "type": " hidden" 658 } 659 ], 660 [ 661 "StartTag", 662 "input", 663 { 664 "type": "hidDEN" 665 } 666 ], 667 [ 668 "EndTag", 669 "table" 670 ] 671 ] 672 }, 673 { 674 "description": "<!doctype html><table><select>X<tr>", 675 "input": "<!doctype html><table><select>X<tr>", 676 "output": [ 677 [ 678 "DOCTYPE", 679 "html", 680 null, 681 null, 682 true 683 ], 684 [ 685 "StartTag", 686 "table", 687 {} 688 ], 689 [ 690 "StartTag", 691 "select", 692 {} 693 ], 694 [ 695 "Character", 696 "X" 697 ], 698 [ 699 "StartTag", 700 "tr", 701 {} 702 ] 703 ] 704 }, 705 { 706 "description": "<!doctype html><select>X</select>", 707 "input": "<!doctype html><select>X</select>", 708 "output": [ 709 [ 710 "DOCTYPE", 711 "html", 712 null, 713 null, 714 true 715 ], 716 [ 717 "StartTag", 718 "select", 719 {} 720 ], 721 [ 722 "Character", 723 "X" 724 ], 725 [ 726 "EndTag", 727 "select" 728 ] 729 ] 730 }, 731 { 732 "description": "<!DOCTYPE hTmL><html></html>", 733 "input": "<!DOCTYPE hTmL><html></html>", 734 "output": [ 735 [ 736 "DOCTYPE", 737 "html", 738 null, 739 null, 740 true 741 ], 742 [ 743 "StartTag", 744 "html", 745 {} 746 ], 747 [ 748 "EndTag", 749 "html" 750 ] 751 ] 752 }, 753 { 754 "description": "<!DOCTYPE HTML><html></html>", 755 "input": "<!DOCTYPE HTML><html></html>", 756 "output": [ 757 [ 758 "DOCTYPE", 759 "html", 760 null, 761 null, 762 true 763 ], 764 [ 765 "StartTag", 766 "html", 767 {} 768 ], 769 [ 770 "EndTag", 771 "html" 772 ] 773 ] 774 }, 775 { 776 "description": "<div><p>a</x> b", 777 "input": "<div><p>a</x> b", 778 "output": [ 779 [ 780 "StartTag", 781 "div", 782 {} 783 ], 784 [ 785 "StartTag", 786 "p", 787 {} 788 ], 789 [ 790 "Character", 791 "a" 792 ], 793 [ 794 "EndTag", 795 "x" 796 ], 797 [ 798 "Character", 799 " b" 800 ] 801 ] 802 }, 803 { 804 "description": "<table><tr><td><code></code> </table>", 805 "input": "<table><tr><td><code></code> </table>", 806 "output": [ 807 [ 808 "StartTag", 809 "table", 810 {} 811 ], 812 [ 813 "StartTag", 814 "tr", 815 {} 816 ], 817 [ 818 "StartTag", 819 "td", 820 {} 821 ], 822 [ 823 "StartTag", 824 "code", 825 {} 826 ], 827 [ 828 "EndTag", 829 "code" 830 ], 831 [ 832 "Character", 833 " " 834 ], 835 [ 836 "EndTag", 837 "table" 838 ] 839 ] 840 }, 841 { 842 "description": "<table><b><tr><td>aaa</td></tr>bbb</table>ccc", 843 "input": "<table><b><tr><td>aaa</td></tr>bbb</table>ccc", 844 "output": [ 845 [ 846 "StartTag", 847 "table", 848 {} 849 ], 850 [ 851 "StartTag", 852 "b", 853 {} 854 ], 855 [ 856 "StartTag", 857 "tr", 858 {} 859 ], 860 [ 861 "StartTag", 862 "td", 863 {} 864 ], 865 [ 866 "Character", 867 "aaa" 868 ], 869 [ 870 "EndTag", 871 "td" 872 ], 873 [ 874 "EndTag", 875 "tr" 876 ], 877 [ 878 "Character", 879 "bbb" 880 ], 881 [ 882 "EndTag", 883 "table" 884 ], 885 [ 886 "Character", 887 "ccc" 888 ] 889 ] 890 }, 891 { 892 "description": "A<table><tr> B</tr> B</table>", 893 "input": "A<table><tr> B</tr> B</table>", 894 "output": [ 895 [ 896 "Character", 897 "A" 898 ], 899 [ 900 "StartTag", 901 "table", 902 {} 903 ], 904 [ 905 "StartTag", 906 "tr", 907 {} 908 ], 909 [ 910 "Character", 911 " B" 912 ], 913 [ 914 "EndTag", 915 "tr" 916 ], 917 [ 918 "Character", 919 " B" 920 ], 921 [ 922 "EndTag", 923 "table" 924 ] 925 ] 926 }, 927 { 928 "description": "A<table><tr> B</tr> </em>C</table>", 929 "input": "A<table><tr> B</tr> </em>C</table>", 930 "output": [ 931 [ 932 "Character", 933 "A" 934 ], 935 [ 936 "StartTag", 937 "table", 938 {} 939 ], 940 [ 941 "StartTag", 942 "tr", 943 {} 944 ], 945 [ 946 "Character", 947 " B" 948 ], 949 [ 950 "EndTag", 951 "tr" 952 ], 953 [ 954 "Character", 955 " " 956 ], 957 [ 958 "EndTag", 959 "em" 960 ], 961 [ 962 "Character", 963 "C" 964 ], 965 [ 966 "EndTag", 967 "table" 968 ] 969 ] 970 }, 971 { 972 "description": "<select><keygen>", 973 "input": "<select><keygen>", 974 "output": [ 975 [ 976 "StartTag", 977 "select", 978 {} 979 ], 980 [ 981 "StartTag", 982 "keygen", 983 {} 984 ] 985 ] 986 } 987 ] 988}