| 1 |
{"tests": [ |
{"tests": [ |
| 2 |
|
|
| 3 |
{"description":"Doctype without a name", |
{"description":"DOCTYPE without name", |
| 4 |
"input":"<!DOCTYPE>", |
"input":"<!DOCTYPE>", |
| 5 |
"output":["ParseError", "ParseError", ["DOCTYPE", "", true]]}, |
"output":["ParseError", "ParseError", ["DOCTYPE", "", null, null, false]]}, |
| 6 |
|
|
| 7 |
{"description":"Correct doctype without a space before name", |
{"description":"DOCTYPE without space before name", |
| 8 |
"input":"<!DOCTYPEhtml>", |
"input":"<!DOCTYPEhtml>", |
| 9 |
"output":["ParseError", ["DOCTYPE", "HTML", false]]}, |
"output":["ParseError", ["DOCTYPE", "html", null, null, true]]}, |
| 10 |
|
|
| 11 |
{"description":"Incorrect doctype without a space before name", |
{"description":"Incorrect DOCTYPE without a space before name", |
| 12 |
"input":"<!DOCTYPEfoo>", |
"input":"<!DOCTYPEfoo>", |
| 13 |
"output":["ParseError", ["DOCTYPE", "FOO", true]]}, |
"output":["ParseError", ["DOCTYPE", "foo", null, null, true]]}, |
| 14 |
|
|
| 15 |
{"description":"Bogus doctype", |
{"description":"DOCTYPE with publicId", |
| 16 |
"input":"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML Transitional 4.01//EN\">", |
"input":"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML Transitional 4.01//EN\">", |
| 17 |
"output":["ParseError", ["DOCTYPE", "HTML", true]]}, |
"output":[["DOCTYPE", "html", "-//W3C//DTD HTML Transitional 4.01//EN", null, true]]}, |
| 18 |
|
|
| 19 |
|
{"description":"DOCTYPE with EOF after PUBLIC", |
| 20 |
|
"input":"<!DOCTYPE html PUBLIC", |
| 21 |
|
"output":["ParseError", ["DOCTYPE", "html", null, null, false]]}, |
| 22 |
|
|
| 23 |
|
{"description":"DOCTYPE with EOF after PUBLIC '", |
| 24 |
|
"input":"<!DOCTYPE html PUBLIC '", |
| 25 |
|
"output":["ParseError", ["DOCTYPE", "html", "", null, false]]}, |
| 26 |
|
|
| 27 |
|
{"description":"DOCTYPE with EOF after PUBLIC 'x", |
| 28 |
|
"input":"<!DOCTYPE html PUBLIC 'x", |
| 29 |
|
"output":["ParseError", ["DOCTYPE", "html", "x", null, false]]}, |
| 30 |
|
|
| 31 |
|
{"description":"DOCTYPE with systemId", |
| 32 |
|
"input":"<!DOCTYPE html SYSTEM \"-//W3C//DTD HTML Transitional 4.01//EN\">", |
| 33 |
|
"output":[["DOCTYPE", "html", null, "-//W3C//DTD HTML Transitional 4.01//EN", true]]}, |
| 34 |
|
|
| 35 |
|
{"description":"DOCTYPE with publicId and systemId", |
| 36 |
|
"input":"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML Transitional 4.01//EN\" \"-//W3C//DTD HTML Transitional 4.01//EN\">", |
| 37 |
|
"output":[["DOCTYPE", "html", "-//W3C//DTD HTML Transitional 4.01//EN", "-//W3C//DTD HTML Transitional 4.01//EN", true]]}, |
| 38 |
|
|
| 39 |
{"description":"Incomplete doctype", |
{"description":"Incomplete doctype", |
| 40 |
"input":"<!DOCTYPE html ", |
"input":"<!DOCTYPE html ", |
| 41 |
"output":["ParseError", ["DOCTYPE", "HTML", true]]}, |
"output":["ParseError", ["DOCTYPE", "html", null, null, false]]}, |
| 42 |
|
|
| 43 |
{"description":"Numeric entity representing the NUL character", |
{"description":"Numeric entity representing the NUL character", |
| 44 |
"input":"�", |
"input":"�", |
| 50 |
|
|
| 51 |
{"description":"Numeric entity representing a codepoint after 1114111 (U+10FFFF)", |
{"description":"Numeric entity representing a codepoint after 1114111 (U+10FFFF)", |
| 52 |
"input":"�", |
"input":"�", |
| 53 |
"output":["ParseError", ["Character", "\uFFFD"]]}, |
"output":[["Character", "\uFFFD"]]}, |
| 54 |
|
|
| 55 |
{"description":"Hexadecimal entity representing a codepoint after 1114111 (U+10FFFF)", |
{"description":"Hexadecimal entity representing a codepoint after 1114111 (U+10FFFF)", |
| 56 |
"input":"�", |
"input":"�", |
| 57 |
"output":["ParseError", ["Character", "\uFFFD"]]}, |
"output":[["Character", "\uFFFD"]]}, |
| 58 |
|
|
| 59 |
{"description":"Numeric entity representing a Windows-1252 'codepoint'", |
{"description":"Numeric entity representing a Windows-1252 'codepoint'", |
| 60 |
"input":"‰", |
"input":"‰", |
| 61 |
"output":[["Character", "\u2030"]]}, |
"output":["ParseError", ["Character", "\u2030"]]}, |
| 62 |
|
|
| 63 |
{"description":"Hexadecimal entity representing a Windows-1252 'codepoint'", |
{"description":"Hexadecimal entity representing a Windows-1252 'codepoint'", |
| 64 |
"input":"‰", |
"input":"‰", |
| 65 |
"output":[["Character", "\u2030"]]}, |
"output":["ParseError", ["Character", "\u2030"]]}, |
| 66 |
|
|
| 67 |
{"description":"Hexadecimal entity with mixed uppercase and lowercase", |
{"description":"Hexadecimal entity with mixed uppercase and lowercase", |
| 68 |
"input":"ꯍ", |
"input":"ꯍ", |
| 78 |
|
|
| 79 |
{"description":"StartTag containing <", |
{"description":"StartTag containing <", |
| 80 |
"input":"<a<b>", |
"input":"<a<b>", |
| 81 |
"output":["ParseError", ["StartTag", "a", { }], ["StartTag", "b", { }]]}, |
"output":[["StartTag", "a<b", { }]]}, |
| 82 |
|
|
| 83 |
{"description":"Non-void element containing trailing /", |
{"description":"Non-void element containing trailing /", |
| 84 |
"input":"<h/>", |
"input":"<h/>", |