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