1 |
wakaba |
1.1 |
{"tests": [ |
2 |
|
|
|
3 |
wakaba |
1.3 |
{"description":"<!DOCTYPE", |
4 |
|
|
"input":"<!DOCTYPE", |
5 |
|
|
"output":["ParseError","ParseError",["DOCTYPE", "", true]]}, |
6 |
|
|
|
7 |
|
|
{"description":"<!DOCTYPE ", |
8 |
|
|
"input":"<!DOCTYPE ", |
9 |
|
|
"output":["ParseError",["DOCTYPE", "", true]]}, |
10 |
|
|
|
11 |
|
|
{"description":"<!DOCTYPE >", |
12 |
|
|
"input":"<!DOCTYPE >", |
13 |
|
|
"output":["ParseError",["DOCTYPE", "", true]]}, |
14 |
|
|
|
15 |
|
|
{"description":"<!DOCTYPE h", |
16 |
|
|
"input":"<!DOCTYPE h", |
17 |
|
|
"output":["ParseError",["DOCTYPE", "H", true]]}, |
18 |
|
|
|
19 |
|
|
{"description":"<!DOCTYPE H", |
20 |
|
|
"input":"<!DOCTYPE H", |
21 |
|
|
"output":["ParseError",["DOCTYPE", "H", true]]}, |
22 |
|
|
|
23 |
|
|
{"description":"<!DOCTYPE h>", |
24 |
|
|
"input":"<!DOCTYPE h>", |
25 |
|
|
"output":[["DOCTYPE", "H", true]]}, |
26 |
|
|
|
27 |
|
|
{"description":"<!DOCTYPE H>", |
28 |
|
|
"input":"<!DOCTYPE H>", |
29 |
|
|
"output":[["DOCTYPE", "H", true]]}, |
30 |
|
|
|
31 |
|
|
{"description":"<!DOCTYPE ht", |
32 |
|
|
"input":"<!DOCTYPE ht", |
33 |
|
|
"output":["ParseError",["DOCTYPE", "HT", true]]}, |
34 |
|
|
|
35 |
|
|
{"description":"<!DOCTYPE Ht", |
36 |
|
|
"input":"<!DOCTYPE Ht", |
37 |
|
|
"output":["ParseError",["DOCTYPE", "HT", true]]}, |
38 |
|
|
|
39 |
|
|
{"description":"<!DOCTYPE hT", |
40 |
|
|
"input":"<!DOCTYPE hT", |
41 |
|
|
"output":["ParseError",["DOCTYPE", "HT", true]]}, |
42 |
|
|
|
43 |
|
|
{"description":"<!DOCTYPE ht>", |
44 |
|
|
"input":"<!DOCTYPE ht>", |
45 |
|
|
"output":[["DOCTYPE", "HT", true]]}, |
46 |
|
|
|
47 |
|
|
{"description":"<!DOCTYPE Ht>", |
48 |
|
|
"input":"<!DOCTYPE Ht>", |
49 |
|
|
"output":[["DOCTYPE", "HT", true]]}, |
50 |
|
|
|
51 |
|
|
{"description":"<!DOCTYPE hT>", |
52 |
|
|
"input":"<!DOCTYPE hT>", |
53 |
|
|
"output":[["DOCTYPE", "HT", true]]}, |
54 |
|
|
|
55 |
|
|
{"description":"<!DOCTYPE hT>", |
56 |
|
|
"input":"<!DOCTYPE hT>", |
57 |
|
|
"output":[["DOCTYPE", "HT", true]]}, |
58 |
|
|
|
59 |
|
|
{"description":"<!DOCTYPE htm", |
60 |
|
|
"input":"<!DOCTYPE htm", |
61 |
|
|
"output":["ParseError",["DOCTYPE", "HTM", true]]}, |
62 |
|
|
|
63 |
|
|
{"description":"<!DOCTYPE Htm", |
64 |
|
|
"input":"<!DOCTYPE Htm", |
65 |
|
|
"output":["ParseError",["DOCTYPE", "HTM", true]]}, |
66 |
|
|
|
67 |
|
|
{"description":"<!DOCTYPE hTM", |
68 |
|
|
"input":"<!DOCTYPE hTM", |
69 |
|
|
"output":["ParseError",["DOCTYPE", "HTM", true]]}, |
70 |
|
|
|
71 |
|
|
{"description":"<!DOCTYPE htm>", |
72 |
|
|
"input":"<!DOCTYPE htm>", |
73 |
|
|
"output":[["DOCTYPE", "HTM", true]]}, |
74 |
|
|
|
75 |
|
|
{"description":"<!DOCTYPE Htm>", |
76 |
|
|
"input":"<!DOCTYPE Htm>", |
77 |
|
|
"output":[["DOCTYPE", "HTM", true]]}, |
78 |
|
|
|
79 |
|
|
{"description":"<!DOCTYPE hTM>", |
80 |
|
|
"input":"<!DOCTYPE hTM>", |
81 |
|
|
"output":[["DOCTYPE", "HTM", true]]}, |
82 |
|
|
|
83 |
|
|
{"description":"<!DOCTYPE html5", |
84 |
|
|
"input":"<!DOCTYPE html5", |
85 |
|
|
"output":["ParseError",["DOCTYPE", "HTML5", true]]}, |
86 |
|
|
|
87 |
|
|
{"description":"<!DOCTYPE html5>", |
88 |
|
|
"input":"<!DOCTYPE html5>", |
89 |
|
|
"output":[["DOCTYPE", "HTML5", true]]}, |
90 |
|
|
|
91 |
wakaba |
1.1 |
{"description":"non-PCDATA content model flag, start tag-like string", |
92 |
|
|
"contentModelFlags":["PLAINTEXT","RCDATA","CDATA"], |
93 |
|
|
"input":"<div>", |
94 |
wakaba |
1.2 |
"output":[["Character", "<div>"]]}, |
95 |
|
|
|
96 |
|
|
{"description":"end tag followed by character data", |
97 |
|
|
"contentModelFlags":["RCDATA","CDATA"], |
98 |
|
|
"lastStartTag":"xxx", |
99 |
|
|
"input":"AB</xxx>CD", |
100 |
wakaba |
1.4 |
"output":[["Character", "AB"],["EndTag", "xxx"],["Character", "CD"]]}, |
101 |
wakaba |
1.1 |
|
102 |
wakaba |
1.4 |
{"description":"c1 character references", |
103 |
|
|
"input":"€‚ƒ„…†‡", |
104 |
|
|
"output":[ |
105 |
|
|
"ParseError", ["Character", "\u20AC"], |
106 |
|
|
"ParseError", ["Character", "\uFFFD"], |
107 |
|
|
"ParseError", ["Character", "\u201A"], |
108 |
|
|
"ParseError", ["Character", "\u0192"], |
109 |
|
|
"ParseError", ["Character", "\u201E"], |
110 |
|
|
"ParseError", ["Character", "\u2026"], |
111 |
|
|
"ParseError", ["Character", "\u2020"], |
112 |
|
|
"ParseError", ["Character", "\u2021"] |
113 |
|
|
]}, |
114 |
|
|
{"description":"c1 character references", |
115 |
|
|
"input":"ˆ‰Š‹ŒŽ", |
116 |
|
|
"output":[ |
117 |
|
|
"ParseError", ["Character", "\u02C6"], |
118 |
|
|
"ParseError", ["Character", "\u2030"], |
119 |
|
|
"ParseError", ["Character", "\u0160"], |
120 |
|
|
"ParseError", ["Character", "\u2039"], |
121 |
|
|
"ParseError", ["Character", "\u0152"], |
122 |
|
|
"ParseError", ["Character", "\uFFFD"], |
123 |
|
|
"ParseError", ["Character", "\u017D"], |
124 |
|
|
"ParseError", ["Character", "\uFFFD"] |
125 |
|
|
]}, |
126 |
|
|
{"description":"c1 character references", |
127 |
|
|
"input":"‘’“”•–—", |
128 |
|
|
"output":[ |
129 |
|
|
"ParseError", ["Character", "\uFFFD"], |
130 |
|
|
"ParseError", ["Character", "\u2018"], |
131 |
|
|
"ParseError", ["Character", "\u2019"], |
132 |
|
|
"ParseError", ["Character", "\u201C"], |
133 |
|
|
"ParseError", ["Character", "\u201D"], |
134 |
|
|
"ParseError", ["Character", "\u2022"], |
135 |
|
|
"ParseError", ["Character", "\u2013"], |
136 |
|
|
"ParseError", ["Character", "\u2014"] |
137 |
|
|
]}, |
138 |
|
|
{"description":"c1 character references", |
139 |
|
|
"input":"˜™š›œžŸ", |
140 |
|
|
"output":[ |
141 |
|
|
"ParseError", ["Character", "\u02DC"], |
142 |
|
|
"ParseError", ["Character", "\u2122"], |
143 |
|
|
"ParseError", ["Character", "\u0161"], |
144 |
|
|
"ParseError", ["Character", "\u203A"], |
145 |
|
|
"ParseError", ["Character", "\u0153"], |
146 |
|
|
"ParseError", ["Character", "\uFFFD"], |
147 |
|
|
"ParseError", ["Character", "\u017E"], |
148 |
|
|
"ParseError", ["Character", "\u0178"] |
149 |
|
|
]}, |
150 |
|
|
|
151 |
|
|
{"description":"c1 character references", |
152 |
|
|
"input":"€‚ƒ„…†‡", |
153 |
|
|
"output":[ |
154 |
|
|
"ParseError", ["Character", "\u20AC"], |
155 |
|
|
"ParseError", ["Character", "\uFFFD"], |
156 |
|
|
"ParseError", ["Character", "\u201A"], |
157 |
|
|
"ParseError", ["Character", "\u0192"], |
158 |
|
|
"ParseError", ["Character", "\u201E"], |
159 |
|
|
"ParseError", ["Character", "\u2026"], |
160 |
|
|
"ParseError", ["Character", "\u2020"], |
161 |
|
|
"ParseError", ["Character", "\u2021"] |
162 |
|
|
]}, |
163 |
|
|
{"description":"c1 character references", |
164 |
|
|
"input":"ˆ‰Š‹ŒŽ", |
165 |
|
|
"output":[ |
166 |
|
|
"ParseError", ["Character", "\u02C6"], |
167 |
|
|
"ParseError", ["Character", "\u2030"], |
168 |
|
|
"ParseError", ["Character", "\u0160"], |
169 |
|
|
"ParseError", ["Character", "\u2039"], |
170 |
|
|
"ParseError", ["Character", "\u0152"], |
171 |
|
|
"ParseError", ["Character", "\uFFFD"], |
172 |
|
|
"ParseError", ["Character", "\u017D"], |
173 |
|
|
"ParseError", ["Character", "\uFFFD"] |
174 |
|
|
]}, |
175 |
|
|
{"description":"c1 character references", |
176 |
|
|
"input":"‘’“”•–—", |
177 |
|
|
"output":[ |
178 |
|
|
"ParseError", ["Character", "\uFFFD"], |
179 |
|
|
"ParseError", ["Character", "\u2018"], |
180 |
|
|
"ParseError", ["Character", "\u2019"], |
181 |
|
|
"ParseError", ["Character", "\u201C"], |
182 |
|
|
"ParseError", ["Character", "\u201D"], |
183 |
|
|
"ParseError", ["Character", "\u2022"], |
184 |
|
|
"ParseError", ["Character", "\u2013"], |
185 |
|
|
"ParseError", ["Character", "\u2014"] |
186 |
|
|
]}, |
187 |
|
|
{"description":"c1 character references", |
188 |
|
|
"input":"˜™š›œžŸ", |
189 |
|
|
"output":[ |
190 |
|
|
"ParseError", ["Character", "\u02DC"], |
191 |
|
|
"ParseError", ["Character", "\u2122"], |
192 |
|
|
"ParseError", ["Character", "\u0161"], |
193 |
|
|
"ParseError", ["Character", "\u203A"], |
194 |
|
|
"ParseError", ["Character", "\u0153"], |
195 |
|
|
"ParseError", ["Character", "\uFFFD"], |
196 |
|
|
"ParseError", ["Character", "\u017E"], |
197 |
|
|
"ParseError", ["Character", "\u0178"] |
198 |
wakaba |
1.5 |
]}, |
199 |
|
|
|
200 |
|
|
{"description":"NULL character", |
201 |
|
|
"input":"\u0000", |
202 |
wakaba |
1.6 |
"output":["ParseError",["Character", "\uFFFD"]]}, |
203 |
|
|
|
204 |
|
|
{"description":"™", |
205 |
|
|
"input":"™", |
206 |
wakaba |
1.7 |
"output":[["Character", "\u2122"]]}, |
207 |
|
|
|
208 |
|
|
{"description":"⟨", |
209 |
|
|
"input":"⟨", |
210 |
|
|
"output":[["Character", "\u3008"]]}, |
211 |
|
|
|
212 |
|
|
{"description":"⟩", |
213 |
|
|
"input":"⟩", |
214 |
|
|
"output":[["Character", "\u3009"]]}, |
215 |
|
|
|
216 |
|
|
{"description":"&;", |
217 |
|
|
"input":"&;", |
218 |
wakaba |
1.8 |
"output":[["Character", "&;"]]}, |
219 |
|
|
|
220 |
|
|
{"description":"cdata end tag containing <", |
221 |
|
|
"contentModelFlags":["RCDATA","CDATA"], |
222 |
|
|
"lastStartTag":"xxx", |
223 |
|
|
"input":"</xxx<div>", |
224 |
|
|
"output":[["Character", "</xxx<div"]]}, |
225 |
|
|
|
226 |
|
|
{"description":"< in tag name state", |
227 |
|
|
"input":"<p<div>", |
228 |
|
|
"output":[["StartTag", "p<div", {}]]}, |
229 |
|
|
|
230 |
|
|
{"description":"< in before attribute name state", |
231 |
|
|
"input":"<p <div>", |
232 |
|
|
"output":[["StartTag", "p", {"<div":""}]]}, |
233 |
|
|
|
234 |
|
|
{"description":"< in attribute name state", |
235 |
|
|
"input":"<p align<div>", |
236 |
|
|
"output":[["StartTag", "p", {"align<div":""}]]}, |
237 |
|
|
|
238 |
|
|
{"description":"< in after attribute name state", |
239 |
|
|
"input":"<p align <div>", |
240 |
|
|
"output":[["StartTag", "p", {"align":"","<div":""}]]}, |
241 |
|
|
|
242 |
|
|
{"description":"< in before attribute value state", |
243 |
|
|
"input":"<p align=<div>", |
244 |
|
|
"output":[["StartTag", "p", {"align":"<div"}]]}, |
245 |
|
|
|
246 |
|
|
{"description":"< in attribute value (unquoted) state", |
247 |
|
|
"input":"<p align=left<div>", |
248 |
|
|
"output":[["StartTag", "p", {"align":"left<div"}]]}, |
249 |
|
|
|
250 |
|
|
{"description":"< in attribute value (single-unquoted) state", |
251 |
|
|
"input":"<p align='left<div>", |
252 |
|
|
"output":["ParseError", ["StartTag", "p", {"align":"left<div>"}]]}, |
253 |
|
|
|
254 |
|
|
{"description":"< in attribute value (double-unquoted) state", |
255 |
|
|
"input":"<p align=\u0022left<div>", |
256 |
|
|
"output":["ParseError", ["StartTag", "p", {"align":"left<div>"}]]} |
257 |
wakaba |
1.4 |
|
258 |
|
|
]} |