1 |
wakaba |
1.1 |
{"tests": [ |
2 |
|
|
|
3 |
wakaba |
1.2 |
{"description":"DOCTYPE without name", |
4 |
wakaba |
1.1 |
"input":"<!DOCTYPE>", |
5 |
wakaba |
1.2 |
"output":["ParseError", "ParseError", ["DOCTYPE", "", null, null, false]]}, |
6 |
wakaba |
1.1 |
|
7 |
wakaba |
1.2 |
{"description":"DOCTYPE without space before name", |
8 |
wakaba |
1.1 |
"input":"<!DOCTYPEhtml>", |
9 |
wakaba |
1.2 |
"output":["ParseError", ["DOCTYPE", "html", null, null, true]]}, |
10 |
wakaba |
1.1 |
|
11 |
wakaba |
1.2 |
{"description":"Incorrect DOCTYPE without a space before name", |
12 |
wakaba |
1.1 |
"input":"<!DOCTYPEfoo>", |
13 |
wakaba |
1.2 |
"output":["ParseError", ["DOCTYPE", "foo", null, null, true]]}, |
14 |
wakaba |
1.1 |
|
15 |
wakaba |
1.2 |
{"description":"DOCTYPE with publicId", |
16 |
wakaba |
1.1 |
"input":"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML Transitional 4.01//EN\">", |
17 |
wakaba |
1.2 |
"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 |
wakaba |
1.1 |
|
39 |
|
|
{"description":"Incomplete doctype", |
40 |
|
|
"input":"<!DOCTYPE html ", |
41 |
wakaba |
1.2 |
"output":["ParseError", ["DOCTYPE", "html", null, null, false]]}, |
42 |
wakaba |
1.1 |
|
43 |
|
|
{"description":"Numeric entity representing the NUL character", |
44 |
|
|
"input":"�", |
45 |
|
|
"output":[["Character", "\uFFFD"]]}, |
46 |
|
|
|
47 |
|
|
{"description":"Hexadecimal entity representing the NUL character", |
48 |
|
|
"input":"�", |
49 |
|
|
"output":[["Character", "\uFFFD"]]}, |
50 |
|
|
|
51 |
|
|
{"description":"Numeric entity representing a codepoint after 1114111 (U+10FFFF)", |
52 |
|
|
"input":"�", |
53 |
wakaba |
1.2 |
"output":[["Character", "\uFFFD"]]}, |
54 |
wakaba |
1.1 |
|
55 |
|
|
{"description":"Hexadecimal entity representing a codepoint after 1114111 (U+10FFFF)", |
56 |
|
|
"input":"�", |
57 |
wakaba |
1.2 |
"output":[["Character", "\uFFFD"]]}, |
58 |
wakaba |
1.1 |
|
59 |
|
|
{"description":"Numeric entity representing a Windows-1252 'codepoint'", |
60 |
|
|
"input":"‰", |
61 |
wakaba |
1.2 |
"output":["ParseError", ["Character", "\u2030"]]}, |
62 |
wakaba |
1.1 |
|
63 |
|
|
{"description":"Hexadecimal entity representing a Windows-1252 'codepoint'", |
64 |
|
|
"input":"‰", |
65 |
wakaba |
1.2 |
"output":["ParseError", ["Character", "\u2030"]]}, |
66 |
wakaba |
1.1 |
|
67 |
|
|
{"description":"Hexadecimal entity with mixed uppercase and lowercase", |
68 |
|
|
"input":"ꯍ", |
69 |
|
|
"output":[["Character", "\uABCD"]]}, |
70 |
|
|
|
71 |
|
|
{"description":"Entity without a name", |
72 |
|
|
"input":"&;", |
73 |
|
|
"output":["ParseError", ["Character", "&;"]]}, |
74 |
|
|
|
75 |
|
|
{"description":"Unescaped ampersand in attribute value", |
76 |
|
|
"input":"<h a='&'>", |
77 |
|
|
"output":["ParseError", ["StartTag", "h", { "a":"&" }]]}, |
78 |
|
|
|
79 |
|
|
{"description":"StartTag containing <", |
80 |
|
|
"input":"<a<b>", |
81 |
wakaba |
1.2 |
"output":[["StartTag", "a<b", { }]]}, |
82 |
wakaba |
1.1 |
|
83 |
|
|
{"description":"Non-void element containing trailing /", |
84 |
|
|
"input":"<h/>", |
85 |
|
|
"output":["ParseError", ["StartTag", "h", { }]]}, |
86 |
|
|
|
87 |
|
|
{"description":"Void element with permitted slash", |
88 |
|
|
"input":"<br/>", |
89 |
|
|
"output":[["StartTag", "br", { }]]}, |
90 |
|
|
|
91 |
|
|
{"description":"StartTag containing /", |
92 |
|
|
"input":"<h/a='b'>", |
93 |
|
|
"output":["ParseError", ["StartTag", "h", { "a":"b" }]]}, |
94 |
|
|
|
95 |
|
|
{"description":"Double-quoted attribute value", |
96 |
|
|
"input":"<h a=\"b\">", |
97 |
|
|
"output":[["StartTag", "h", { "a":"b" }]]}, |
98 |
|
|
|
99 |
|
|
{"description":"Unescaped </", |
100 |
|
|
"input":"</", |
101 |
|
|
"output":["ParseError", ["Character", "</"]]}, |
102 |
|
|
|
103 |
|
|
{"description":"Illegal end tag name", |
104 |
|
|
"input":"</1>", |
105 |
|
|
"output":["ParseError", ["Comment", "1"]]}, |
106 |
|
|
|
107 |
|
|
{"description":"Simili processing instruction", |
108 |
|
|
"input":"<?namespace>", |
109 |
|
|
"output":["ParseError", ["Comment", "?namespace"]]}, |
110 |
|
|
|
111 |
|
|
{"description":"A bogus comment stops at >, even if preceeded by two dashes", |
112 |
|
|
"input":"<?foo-->", |
113 |
|
|
"output":["ParseError", ["Comment", "?foo--"]]}, |
114 |
|
|
|
115 |
|
|
{"description":"Unescaped <", |
116 |
|
|
"input":"foo < bar", |
117 |
|
|
"output":[["Character", "foo "], "ParseError", ["Character", "< bar"]]}, |
118 |
|
|
|
119 |
|
|
{"description":"Null Byte Replacement", |
120 |
|
|
"input":"\u0000", |
121 |
|
|
"output":[["Character", "\ufffd"]]} |
122 |
|
|
|
123 |
|
|
]} |
124 |
|
|
|
125 |
|
|
|