JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
fix link, tweak text
[peach-html5-editor.git] / parser_tests.js
1 // Copyright (c) 2006-2015 Jason Woofenden, James Graham, Geoffrey Sneddon, and
2 // other contributors
3 //
4 // The values in the following data structure were extracted from the project at
5 // https://github.com/html5lib/html5lib-tests which has the following notice:
6 //
7 // Copyright (c) 2006-2013 James Graham, Geoffrey Sneddon, and
8 // other contributors
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining
11 // a copy of this software and associated documentation files (the
12 // "Software"), to deal in the Software without restriction, including
13 // without limitation the rights to use, copy, modify, merge, publish,
14 // distribute, sublicense, and/or sell copies of the Software, and to
15 // permit persons to whom the Software is furnished to do so, subject to
16 // the following conditions:
17 //
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
20 //
21 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
25 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 //
29 // The rest of this file was written by Jason Woofenden in 2015-2016, and is
30 // released under the terms of the CC0 license:
31 // http://creativecommons.org/publicdomain/zero/1.0/ and into the public domain
32
33 (function() {
34 var next_test, peach_parser, run_tests_and_breathe, serialize_els, test_parser, test_results, test_summary, tests;
35
36 tests = [
37         {
38                 name: "adoption01.dat #1",
39                 html: "<a><p></a></p>",
40                 errors: 2,
41                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|     <p>\n|       <a>\n"
42         }, {
43                 name: "adoption01.dat #2",
44                 html: "<a>1<p>2</a>3</p>",
45                 errors: 2,
46                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       \"1\"\n|     <p>\n|       <a>\n|         \"2\"\n|       \"3\"\n"
47         }, {
48                 name: "adoption01.dat #3",
49                 html: "<a>1<button>2</a>3</button>",
50                 errors: 2,
51                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       \"1\"\n|     <button>\n|       <a>\n|         \"2\"\n|       \"3\"\n"
52         }, {
53                 name: "adoption01.dat #4",
54                 html: "<a>1<b>2</a>3</b>",
55                 errors: 2,
56                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       \"1\"\n|       <b>\n|         \"2\"\n|     <b>\n|       \"3\"\n"
57         }, {
58                 name: "adoption01.dat #5",
59                 html: "<a>1<div>2<div>3</a>4</div>5</div>",
60                 errors: 3,
61                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       \"1\"\n|     <div>\n|       <a>\n|         \"2\"\n|       <div>\n|         <a>\n|           \"3\"\n|         \"4\"\n|       \"5\"\n"
62         }, {
63                 name: "adoption01.dat #6",
64                 html: "<table><a>1<p>2</a>3</p>",
65                 errors: 10,
66                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       \"1\"\n|     <p>\n|       <a>\n|         \"2\"\n|       \"3\"\n|     <table>\n"
67         }, {
68                 name: "adoption01.dat #7",
69                 html: "<b><b><a><p></a>",
70                 errors: 3,
71                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <b>\n|         <a>\n|         <p>\n|           <a>\n"
72         }, {
73                 name: "adoption01.dat #8",
74                 html: "<b><a><b><p></a>",
75                 errors: 3,
76                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <a>\n|         <b>\n|       <b>\n|         <p>\n|           <a>\n"
77         }, {
78                 name: "adoption01.dat #9",
79                 html: "<a><b><b><p></a>",
80                 errors: 3,
81                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       <b>\n|         <b>\n|     <b>\n|       <b>\n|         <p>\n|           <a>\n"
82         }, {
83                 name: "adoption01.dat #10",
84                 html: "<p>1<s id=\"A\">2<b id=\"B\">3</p>4</s>5</b>",
85                 errors: 3,
86                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       \"1\"\n|       <s>\n|         id=\"A\"\n|         \"2\"\n|         <b>\n|           id=\"B\"\n|           \"3\"\n|     <s>\n|       id=\"A\"\n|       <b>\n|         id=\"B\"\n|         \"4\"\n|     <b>\n|       id=\"B\"\n|       \"5\"\n"
87         }, {
88                 name: "adoption01.dat #11",
89                 html: "<table><a>1<td>2</td>3</table>",
90                 errors: 5,
91                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       \"1\"\n|     <a>\n|       \"3\"\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             \"2\"\n"
92         }, {
93                 name: "adoption01.dat #12",
94                 html: "<table>A<td>B</td>C</table>",
95                 errors: 4,
96                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"AC\"\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             \"B\"\n"
97         }, {
98                 name: "adoption01.dat #13",
99                 html: "<a><svg><tr><input></a>",
100                 errors: 3,
101                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       <svg svg>\n|         <svg tr>\n|           <svg input>\n"
102         }, {
103                 name: "adoption01.dat #14",
104                 html: "<div><a><b><div><div><div><div><div><div><div><div><div><div></a>",
105                 errors: 10,
106                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <a>\n|         <b>\n|       <b>\n|         <div>\n|           <a>\n|           <div>\n|             <a>\n|             <div>\n|               <a>\n|               <div>\n|                 <a>\n|                 <div>\n|                   <a>\n|                   <div>\n|                     <a>\n|                     <div>\n|                       <a>\n|                       <div>\n|                         <a>\n|                           <div>\n|                             <div>\n"
107         }, {
108                 name: "adoption01.dat #15",
109                 html: "<div><a><b><u><i><code><div></a>",
110                 errors: 3,
111                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <a>\n|         <b>\n|           <u>\n|             <i>\n|               <code>\n|       <u>\n|         <i>\n|           <code>\n|             <div>\n|               <a>\n"
112         }, {
113                 name: "adoption01.dat #16",
114                 html: "<b><b><b><b>x</b></b></b></b>y",
115                 errors: 1,
116                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <b>\n|         <b>\n|           <b>\n|             \"x\"\n|     \"y\"\n"
117         }, {
118                 name: "adoption01.dat #17",
119                 html: "<p><b><b><b><b><p>x",
120                 errors: 3,
121                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <b>\n|         <b>\n|           <b>\n|             <b>\n|     <p>\n|       <b>\n|         <b>\n|           <b>\n|             \"x\"\n"
122         }, {
123                 name: "adoption02.dat #1",
124                 html: "<b>1<i>2<p>3</b>4",
125                 errors: 3,
126                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       \"1\"\n|       <i>\n|         \"2\"\n|     <i>\n|       <p>\n|         <b>\n|           \"3\"\n|         \"4\"\n"
127         }, {
128                 name: "adoption02.dat #2",
129                 html: "<a><div><style></style><address><a>",
130                 errors: 5,
131                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|     <div>\n|       <a>\n|         <style>\n|       <address>\n|         <a>\n|         <a>\n"
132         }, {
133                 name: "comments01.dat #1",
134                 html: "FOO<!-- BAR -->BAZ",
135                 errors: 1,
136                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <!--  BAR  -->\n|     \"BAZ\"\n"
137         }, {
138                 name: "comments01.dat #2",
139                 html: "FOO<!-- BAR --!>BAZ",
140                 errors: 2,
141                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <!--  BAR  -->\n|     \"BAZ\"\n"
142         }, {
143                 name: "comments01.dat #3",
144                 html: "FOO<!-- BAR --   >BAZ",
145                 errors: 3,
146                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <!--  BAR --   >BAZ -->\n"
147         }, {
148                 name: "comments01.dat #4",
149                 html: "FOO<!-- BAR -- <QUX> -- MUX -->BAZ",
150                 errors: 3,
151                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <!--  BAR -- <QUX> -- MUX  -->\n|     \"BAZ\"\n"
152         }, {
153                 name: "comments01.dat #5",
154                 html: "FOO<!-- BAR -- <QUX> -- MUX --!>BAZ",
155                 errors: 4,
156                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <!--  BAR -- <QUX> -- MUX  -->\n|     \"BAZ\"\n"
157         }, {
158                 name: "comments01.dat #6",
159                 html: "FOO<!-- BAR -- <QUX> -- MUX -- >BAZ",
160                 errors: 5,
161                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <!--  BAR -- <QUX> -- MUX -- >BAZ -->\n"
162         }, {
163                 name: "comments01.dat #7",
164                 html: "FOO<!---->BAZ",
165                 errors: 1,
166                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <!--  -->\n|     \"BAZ\"\n"
167         }, {
168                 name: "comments01.dat #8",
169                 html: "FOO<!--->BAZ",
170                 errors: 2,
171                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <!--  -->\n|     \"BAZ\"\n"
172         }, {
173                 name: "comments01.dat #9",
174                 html: "FOO<!-->BAZ",
175                 errors: 2,
176                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <!--  -->\n|     \"BAZ\"\n"
177         }, {
178                 name: "comments01.dat #10",
179                 html: "<?xml version=\"1.0\">Hi",
180                 errors: 2,
181                 expected: "| <!-- ?xml version=\"1.0\" -->\n| <html>\n|   <head>\n|   <body>\n|     \"Hi\"\n"
182         }, {
183                 name: "comments01.dat #11",
184                 html: "<?xml version=\"1.0\">",
185                 errors: 2,
186                 expected: "| <!-- ?xml version=\"1.0\" -->\n| <html>\n|   <head>\n|   <body>\n"
187         }, {
188                 name: "comments01.dat #12",
189                 html: "<?xml version",
190                 errors: 2,
191                 expected: "| <!-- ?xml version -->\n| <html>\n|   <head>\n|   <body>\n"
192         }, {
193                 name: "comments01.dat #13",
194                 html: "FOO<!----->BAZ",
195                 errors: 2,
196                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <!-- - -->\n|     \"BAZ\"\n"
197         }, {
198                 name: "comments01.dat #14",
199                 html: "<html><!-- comment --><title>Comment before head</title>",
200                 errors: 1,
201                 expected: "| <html>\n|   <!--  comment  -->\n|   <head>\n|     <title>\n|       \"Comment before head\"\n|   <body>\n"
202         }, {
203                 name: "doctype01.dat #1",
204                 html: "<!DOCTYPE html>Hello",
205                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
206         }, {
207                 name: "doctype01.dat #2",
208                 html: "<!dOctYpE HtMl>Hello",
209                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
210         }, {
211                 name: "doctype01.dat #3",
212                 html: "<!DOCTYPEhtml>Hello",
213                 errors: 1,
214                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
215         }, {
216                 name: "doctype01.dat #4",
217                 html: "<!DOCTYPE>Hello",
218                 errors: 3,
219                 expected: "| <!DOCTYPE >\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
220         }, {
221                 name: "doctype01.dat #5",
222                 html: "<!DOCTYPE >Hello",
223                 errors: 2,
224                 expected: "| <!DOCTYPE >\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
225         }, {
226                 name: "doctype01.dat #6",
227                 html: "<!DOCTYPE potato>Hello",
228                 errors: 1,
229                 expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
230         }, {
231                 name: "doctype01.dat #7",
232                 html: "<!DOCTYPE potato >Hello",
233                 errors: 1,
234                 expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
235         }, {
236                 name: "doctype01.dat #8",
237                 html: "<!DOCTYPE potato taco>Hello",
238                 errors: 2,
239                 expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
240         }, {
241                 name: "doctype01.dat #9",
242                 html: "<!DOCTYPE potato taco \"ddd>Hello",
243                 errors: 2,
244                 expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
245         }, {
246                 name: "doctype01.dat #10",
247                 html: "<!DOCTYPE potato sYstEM>Hello",
248                 errors: 2,
249                 expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
250         }, {
251                 name: "doctype01.dat #11",
252                 html: "<!DOCTYPE potato sYstEM    >Hello",
253                 errors: 2,
254                 expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
255         }, {
256                 name: "doctype01.dat #12",
257                 html: "<!DOCTYPE   potato       sYstEM  ggg>Hello",
258                 errors: 2,
259                 expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
260         }, {
261                 name: "doctype01.dat #13",
262                 html: "<!DOCTYPE potato SYSTEM taco  >Hello",
263                 errors: 2,
264                 expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
265         }, {
266                 name: "doctype01.dat #14",
267                 html: "<!DOCTYPE potato SYSTEM 'taco\"'>Hello",
268                 errors: 1,
269                 expected: "| <!DOCTYPE potato \"\" \"taco\"\">\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
270         }, {
271                 name: "doctype01.dat #15",
272                 html: "<!DOCTYPE potato SYSTEM \"taco\">Hello",
273                 errors: 1,
274                 expected: "| <!DOCTYPE potato \"\" \"taco\">\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
275         }, {
276                 name: "doctype01.dat #16",
277                 html: "<!DOCTYPE potato SYSTEM \"tai'co\">Hello",
278                 errors: 1,
279                 expected: "| <!DOCTYPE potato \"\" \"tai'co\">\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
280         }, {
281                 name: "doctype01.dat #17",
282                 html: "<!DOCTYPE potato SYSTEMtaco \"ddd\">Hello",
283                 errors: 2,
284                 expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
285         }, {
286                 name: "doctype01.dat #18",
287                 html: "<!DOCTYPE potato grass SYSTEM taco>Hello",
288                 errors: 2,
289                 expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
290         }, {
291                 name: "doctype01.dat #19",
292                 html: "<!DOCTYPE potato pUbLIc>Hello",
293                 errors: 2,
294                 expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
295         }, {
296                 name: "doctype01.dat #20",
297                 html: "<!DOCTYPE potato pUbLIc >Hello",
298                 errors: 2,
299                 expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
300         }, {
301                 name: "doctype01.dat #21",
302                 html: "<!DOCTYPE potato pUbLIcgoof>Hello",
303                 errors: 2,
304                 expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
305         }, {
306                 name: "doctype01.dat #22",
307                 html: "<!DOCTYPE potato PUBLIC goof>Hello",
308                 errors: 2,
309                 expected: "| <!DOCTYPE potato>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
310         }, {
311                 name: "doctype01.dat #23",
312                 html: "<!DOCTYPE potato PUBLIC \"go'of\">Hello",
313                 errors: 1,
314                 expected: "| <!DOCTYPE potato \"go'of\" \"\">\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
315         }, {
316                 name: "doctype01.dat #24",
317                 html: "<!DOCTYPE potato PUBLIC 'go'of'>Hello",
318                 errors: 2,
319                 expected: "| <!DOCTYPE potato \"go\" \"\">\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
320         }, {
321                 name: "doctype01.dat #25",
322                 html: "<!DOCTYPE potato PUBLIC 'go:hh   of' >Hello",
323                 errors: 1,
324                 expected: "| <!DOCTYPE potato \"go:hh   of\" \"\">\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
325         }, {
326                 name: "doctype01.dat #26",
327                 html: "<!DOCTYPE potato PUBLIC \"W3C-//dfdf\" SYSTEM ggg>Hello",
328                 errors: 2,
329                 expected: "| <!DOCTYPE potato \"W3C-//dfdf\" \"\">\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
330         }, {
331                 name: "doctype01.dat #27",
332                 html: "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\n   \"http://www.w3.org/TR/html4/strict.dtd\">Hello",
333                 expected: "| <!DOCTYPE html \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
334         }, {
335                 name: "doctype01.dat #28",
336                 html: "<!DOCTYPE ...>Hello",
337                 errors: 1,
338                 expected: "| <!DOCTYPE ...>\n| <html>\n|   <head>\n|   <body>\n|     \"Hello\"\n"
339         }, {
340                 name: "doctype01.dat #29",
341                 html: "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">",
342                 errors: 1,
343                 expected: "| <!DOCTYPE html \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n| <html>\n|   <head>\n|   <body>\n"
344         }, {
345                 name: "doctype01.dat #30",
346                 html: "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\"\n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">",
347                 errors: 1,
348                 expected: "| <!DOCTYPE html \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">\n| <html>\n|   <head>\n|   <body>\n"
349         }, {
350                 name: "doctype01.dat #31",
351                 html: "<!DOCTYPE root-element [SYSTEM OR PUBLIC FPI] \"uri\" [ \n<!-- internal declarations -->\n]>",
352                 errors: 2,
353                 expected: "| <!DOCTYPE root-element>\n| <html>\n|   <head>\n|   <body>\n|     \"]>\"\n"
354         }, {
355                 name: "doctype01.dat #32",
356                 html: "<!DOCTYPE html PUBLIC\n  \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\n    \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">",
357                 errors: 1,
358                 expected: "| <!DOCTYPE html \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">\n| <html>\n|   <head>\n|   <body>\n"
359         }, {
360                 name: "doctype01.dat #33",
361                 html: "<!DOCTYPE HTML SYSTEM \"http://www.w3.org/DTD/HTML4-strict.dtd\"><body><b>Mine!</b></body>",
362                 errors: 1,
363                 expected: "| <!DOCTYPE html \"\" \"http://www.w3.org/DTD/HTML4-strict.dtd\">\n| <html>\n|   <head>\n|   <body>\n|     <b>\n|       \"Mine!\"\n"
364         }, {
365                 name: "doctype01.dat #34",
366                 html: "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\"http://www.w3.org/TR/html4/strict.dtd\">",
367                 errors: 1,
368                 expected: "| <!DOCTYPE html \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n| <html>\n|   <head>\n|   <body>\n"
369         }, {
370                 name: "doctype01.dat #35",
371                 html: "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"'http://www.w3.org/TR/html4/strict.dtd'>",
372                 errors: 1,
373                 expected: "| <!DOCTYPE html \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n| <html>\n|   <head>\n|   <body>\n"
374         }, {
375                 name: "doctype01.dat #36",
376                 html: "<!DOCTYPE HTML PUBLIC\"-//W3C//DTD HTML 4.01//EN\"'http://www.w3.org/TR/html4/strict.dtd'>",
377                 errors: 2,
378                 expected: "| <!DOCTYPE html \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n| <html>\n|   <head>\n|   <body>\n"
379         }, {
380                 name: "doctype01.dat #37",
381                 html: "<!DOCTYPE HTML PUBLIC'-//W3C//DTD HTML 4.01//EN''http://www.w3.org/TR/html4/strict.dtd'>",
382                 errors: 2,
383                 expected: "| <!DOCTYPE html \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n| <html>\n|   <head>\n|   <body>\n"
384         }, {
385                 name: "domjs-unsafe.dat #1",
386                 html: "<svg><![CDATA[foo\nbar]]>",
387                 errors: 2,
388                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"foo\nbar\"\n"
389         }, {
390                 name: "domjs-unsafe.dat #2",
391                 html: "<svg><![CDATA[foo\rbar]]>",
392                 errors: 2,
393                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"foo\nbar\"\n"
394         }, {
395                 name: "domjs-unsafe.dat #3",
396                 html: "<svg><![CDATA[foo\r\nbar]]>",
397                 errors: 2,
398                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"foo\nbar\"\n"
399         }, {
400                 name: "domjs-unsafe.dat #4",
401                 html: "<script>a='\u0000'</script>",
402                 errors: 2,
403                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"a='�'\"\n|   <body>\n"
404         }, {
405                 name: "domjs-unsafe.dat #5",
406                 html: "<script type=\"data\"><!--\u0000</script>",
407                 errors: 2,
408                 expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--�\"\n|   <body>\n"
409         }, {
410                 name: "domjs-unsafe.dat #6",
411                 html: "<script type=\"data\"><!--foo\u0000</script>",
412                 errors: 2,
413                 expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--foo�\"\n|   <body>\n"
414         }, {
415                 name: "domjs-unsafe.dat #7",
416                 html: "<script type=\"data\"><!-- foo-\u0000</script>",
417                 errors: 2,
418                 expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!-- foo-�\"\n|   <body>\n"
419         }, {
420                 name: "domjs-unsafe.dat #8",
421                 html: "<script type=\"data\"><!-- foo--\u0000</script>",
422                 errors: 2,
423                 expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!-- foo--�\"\n|   <body>\n"
424         }, {
425                 name: "domjs-unsafe.dat #9",
426                 html: "<script type=\"data\"><!-- foo-",
427                 errors: 3,
428                 expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!-- foo-\"\n|   <body>\n"
429         }, {
430                 name: "domjs-unsafe.dat #10",
431                 html: "<script type=\"data\"><!-- foo-<</script>",
432                 errors: 1,
433                 expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!-- foo-<\"\n|   <body>\n"
434         }, {
435                 name: "domjs-unsafe.dat #11",
436                 html: "<script type=\"data\"><!-- foo-<S",
437                 errors: 3,
438                 expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!-- foo-<S\"\n|   <body>\n"
439         }, {
440                 name: "domjs-unsafe.dat #12",
441                 html: "<script type=\"data\"><!-- foo-</SCRIPT>",
442                 errors: 1,
443                 expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!-- foo-\"\n|   <body>\n"
444         }, {
445                 name: "domjs-unsafe.dat #13",
446                 html: "<script type=\"data\"><!--<p></script>",
447                 errors: 1,
448                 expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--<p>\"\n|   <body>\n"
449         }, {
450                 name: "domjs-unsafe.dat #14",
451                 html: "<script type=\"data\"><!--<script></script></script>",
452                 errors: 1,
453                 expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--<script></script>\"\n|   <body>\n"
454         }, {
455                 name: "domjs-unsafe.dat #15",
456                 html: "<script type=\"data\"><!--<script>\u0000</script></script>",
457                 errors: 2,
458                 expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--<script>�</script>\"\n|   <body>\n"
459         }, {
460                 name: "domjs-unsafe.dat #16",
461                 html: "<script type=\"data\"><!--<script>-\u0000</script></script>",
462                 errors: 2,
463                 expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--<script>-�</script>\"\n|   <body>\n"
464         }, {
465                 name: "domjs-unsafe.dat #17",
466                 html: "<script type=\"data\"><!--<script>--\u0000</script></script>",
467                 errors: 2,
468                 expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--<script>--�</script>\"\n|   <body>\n"
469         }, {
470                 name: "domjs-unsafe.dat #18",
471                 html: "<script type=\"data\"><!--<script>---</script></script>",
472                 errors: 1,
473                 expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--<script>---</script>\"\n|   <body>\n"
474         }, {
475                 name: "domjs-unsafe.dat #19",
476                 html: "<script type=\"data\"><!--<script></scrip></SCRIPT></script>",
477                 errors: 1,
478                 expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--<script></scrip></SCRIPT>\"\n|   <body>\n"
479         }, {
480                 name: "domjs-unsafe.dat #20",
481                 html: "<script type=\"data\"><!--<script></scrip </SCRIPT></script>",
482                 errors: 1,
483                 expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--<script></scrip </SCRIPT>\"\n|   <body>\n"
484         }, {
485                 name: "domjs-unsafe.dat #21",
486                 html: "<script type=\"data\"><!--<script></scrip/</SCRIPT></script>",
487                 errors: 1,
488                 expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--<script></scrip/</SCRIPT>\"\n|   <body>\n"
489         }, {
490                 name: "domjs-unsafe.dat #22",
491                 html: "<script type=\"data\"></scrip/></script>",
492                 errors: 1,
493                 expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"</scrip/>\"\n|   <body>\n"
494         }, {
495                 name: "domjs-unsafe.dat #23",
496                 html: "<script type=\"data\"></scrip ></script>",
497                 errors: 1,
498                 expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"</scrip >\"\n|   <body>\n"
499         }, {
500                 name: "domjs-unsafe.dat #24",
501                 html: "<script type=\"data\"><!--</scrip></script>",
502                 errors: 1,
503                 expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--</scrip>\"\n|   <body>\n"
504         }, {
505                 name: "domjs-unsafe.dat #25",
506                 html: "<script type=\"data\"><!--</scrip </script>",
507                 errors: 1,
508                 expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--</scrip \"\n|   <body>\n"
509         }, {
510                 name: "domjs-unsafe.dat #26",
511                 html: "<script type=\"data\"><!--</scrip/</script>",
512                 errors: 1,
513                 expected: "| <html>\n|   <head>\n|     <script>\n|       type=\"data\"\n|       \"<!--</scrip/\"\n|   <body>\n"
514         }, {
515                 name: "domjs-unsafe.dat #27",
516                 html: "<!DOCTYPE html><!DOCTYPE html>",
517                 errors: 1,
518                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n"
519         }, {
520                 name: "domjs-unsafe.dat #28",
521                 html: "<html><!DOCTYPE html>",
522                 errors: 2,
523                 expected: "| <html>\n|   <head>\n|   <body>\n"
524         }, {
525                 name: "domjs-unsafe.dat #29",
526                 html: "<html><head><!DOCTYPE html></head>",
527                 errors: 2,
528                 expected: "| <html>\n|   <head>\n|   <body>\n"
529         }, {
530                 name: "domjs-unsafe.dat #30",
531                 html: "<html><head></head><!DOCTYPE html>",
532                 errors: 2,
533                 expected: "| <html>\n|   <head>\n|   <body>\n"
534         }, {
535                 name: "domjs-unsafe.dat #31",
536                 html: "<body></body><!DOCTYPE html>",
537                 errors: 2,
538                 expected: "| <html>\n|   <head>\n|   <body>\n"
539         }, {
540                 name: "domjs-unsafe.dat #32",
541                 html: "<table><!DOCTYPE html></table>",
542                 errors: 2,
543                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n"
544         }, {
545                 name: "domjs-unsafe.dat #33",
546                 html: "<select><!DOCTYPE html></select>",
547                 errors: 2,
548                 expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n"
549         }, {
550                 name: "domjs-unsafe.dat #34",
551                 html: "<table><colgroup><!DOCTYPE html></colgroup></table>",
552                 errors: 2,
553                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <colgroup>\n"
554         }, {
555                 name: "domjs-unsafe.dat #35",
556                 html: "<table><colgroup><!--test--></colgroup></table>",
557                 errors: 1,
558                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <colgroup>\n|         <!-- test -->\n"
559         }, {
560                 name: "domjs-unsafe.dat #36",
561                 html: "<table><colgroup><html></colgroup></table>",
562                 errors: 2,
563                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <colgroup>\n"
564         }, {
565                 name: "domjs-unsafe.dat #37",
566                 html: "<table><colgroup> foo</colgroup></table>",
567                 errors: 5,
568                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"foo\"\n|     <table>\n|       <colgroup>\n|         \" \"\n"
569         }, {
570                 name: "domjs-unsafe.dat #38",
571                 html: "<select><!--test--></select>",
572                 errors: 1,
573                 expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <!-- test -->\n"
574         }, {
575                 name: "domjs-unsafe.dat #39",
576                 html: "<select><html></select>",
577                 errors: 2,
578                 expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n"
579         }, {
580                 name: "domjs-unsafe.dat #40",
581                 html: "<frameset><html></frameset>",
582                 errors: 2,
583                 expected: "| <html>\n|   <head>\n|   <frameset>\n"
584         }, {
585                 name: "domjs-unsafe.dat #41",
586                 html: "<frameset></frameset><html>",
587                 errors: 2,
588                 expected: "| <html>\n|   <head>\n|   <frameset>\n"
589         }, {
590                 name: "domjs-unsafe.dat #42",
591                 html: "<frameset></frameset><!DOCTYPE html>",
592                 errors: 2,
593                 expected: "| <html>\n|   <head>\n|   <frameset>\n"
594         }, {
595                 name: "domjs-unsafe.dat #43",
596                 html: "<html><body></body></html><!DOCTYPE html>",
597                 errors: 2,
598                 expected: "| <html>\n|   <head>\n|   <body>\n"
599         }, {
600                 name: "domjs-unsafe.dat #44",
601                 html: "<svg><!DOCTYPE html></svg>",
602                 errors: 2,
603                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n"
604         }, {
605                 name: "domjs-unsafe.dat #45",
606                 html: "<svg><font></font></svg>",
607                 errors: 1,
608                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg font>\n"
609         }, {
610                 name: "domjs-unsafe.dat #46",
611                 html: "<svg><font id=foo></font></svg>",
612                 errors: 1,
613                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg font>\n|         id=\"foo\"\n"
614         }, {
615                 name: "domjs-unsafe.dat #47",
616                 html: "<svg><font size=4></font></svg>",
617                 errors: 3,
618                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|     <font>\n|       size=\"4\"\n"
619         }, {
620                 name: "domjs-unsafe.dat #48",
621                 html: "<svg><font color=red></font></svg>",
622                 errors: 3,
623                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|     <font>\n|       color=\"red\"\n"
624         }, {
625                 name: "domjs-unsafe.dat #49",
626                 html: "<svg><font font=sans></font></svg>",
627                 errors: 1,
628                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg font>\n|         font=\"sans\"\n"
629         }, {
630                 name: "entities01.dat #1",
631                 html: "FOO&gt;BAR",
632                 errors: 1,
633                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO>BAR\"\n"
634         }, {
635                 name: "entities01.dat #2",
636                 html: "FOO&gtBAR",
637                 errors: 2,
638                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO>BAR\"\n"
639         }, {
640                 name: "entities01.dat #3",
641                 html: "FOO&gt BAR",
642                 errors: 2,
643                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO> BAR\"\n"
644         }, {
645                 name: "entities01.dat #4",
646                 html: "FOO&gt;;;BAR",
647                 errors: 1,
648                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO>;;BAR\"\n"
649         }, {
650                 name: "entities01.dat #5",
651                 html: "I'm &notit; I tell you",
652                 errors: 2,
653                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"I'm ¬it; I tell you\"\n"
654         }, {
655                 name: "entities01.dat #6",
656                 html: "I'm &notin; I tell you",
657                 errors: 1,
658                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"I'm ∉ I tell you\"\n"
659         }, {
660                 name: "entities01.dat #7",
661                 html: "FOO& BAR",
662                 errors: 1,
663                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO& BAR\"\n"
664         }, {
665                 name: "entities01.dat #8",
666                 html: "FOO&<BAR>",
667                 errors: 2,
668                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO&\"\n|     <bar>\n"
669         }, {
670                 name: "entities01.dat #9",
671                 html: "FOO&&&&gt;BAR",
672                 errors: 1,
673                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO&&&>BAR\"\n"
674         }, {
675                 name: "entities01.dat #10",
676                 html: "FOO&#41;BAR",
677                 errors: 1,
678                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO)BAR\"\n"
679         }, {
680                 name: "entities01.dat #11",
681                 html: "FOO&#x41;BAR",
682                 errors: 1,
683                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOABAR\"\n"
684         }, {
685                 name: "entities01.dat #12",
686                 html: "FOO&#X41;BAR",
687                 errors: 1,
688                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOABAR\"\n"
689         }, {
690                 name: "entities01.dat #13",
691                 html: "FOO&#BAR",
692                 errors: 2,
693                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO&#BAR\"\n"
694         }, {
695                 name: "entities01.dat #14",
696                 html: "FOO&#ZOO",
697                 errors: 2,
698                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO&#ZOO\"\n"
699         }, {
700                 name: "entities01.dat #15",
701                 html: "FOO&#xBAR",
702                 errors: 2,
703                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOºR\"\n"
704         }, {
705                 name: "entities01.dat #16",
706                 html: "FOO&#xZOO",
707                 errors: 2,
708                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO&#xZOO\"\n"
709         }, {
710                 name: "entities01.dat #17",
711                 html: "FOO&#XZOO",
712                 errors: 2,
713                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO&#XZOO\"\n"
714         }, {
715                 name: "entities01.dat #18",
716                 html: "FOO&#41BAR",
717                 errors: 2,
718                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO)BAR\"\n"
719         }, {
720                 name: "entities01.dat #19",
721                 html: "FOO&#x41BAR",
722                 errors: 2,
723                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO䆺R\"\n"
724         }, {
725                 name: "entities01.dat #20",
726                 html: "FOO&#x41ZOO",
727                 errors: 2,
728                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOAZOO\"\n"
729         }, {
730                 name: "entities01.dat #21",
731                 html: "FOO&#x0000;ZOO",
732                 errors: 2,
733                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�ZOO\"\n"
734         }, {
735                 name: "entities01.dat #22",
736                 html: "FOO&#x0078;ZOO",
737                 errors: 1,
738                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOxZOO\"\n"
739         }, {
740                 name: "entities01.dat #23",
741                 html: "FOO&#x0079;ZOO",
742                 errors: 1,
743                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOyZOO\"\n"
744         }, {
745                 name: "entities01.dat #24",
746                 html: "FOO&#x0080;ZOO",
747                 errors: 2,
748                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO€ZOO\"\n"
749         }, {
750                 name: "entities01.dat #25",
751                 html: "FOO&#x0081;ZOO",
752                 errors: 2,
753                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\81ZOO\"\n"
754         }, {
755                 name: "entities01.dat #26",
756                 html: "FOO&#x0082;ZOO",
757                 errors: 2,
758                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO‚ZOO\"\n"
759         }, {
760                 name: "entities01.dat #27",
761                 html: "FOO&#x0083;ZOO",
762                 errors: 2,
763                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOƒZOO\"\n"
764         }, {
765                 name: "entities01.dat #28",
766                 html: "FOO&#x0084;ZOO",
767                 errors: 2,
768                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO„ZOO\"\n"
769         }, {
770                 name: "entities01.dat #29",
771                 html: "FOO&#x0085;ZOO",
772                 errors: 2,
773                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO…ZOO\"\n"
774         }, {
775                 name: "entities01.dat #30",
776                 html: "FOO&#x0086;ZOO",
777                 errors: 2,
778                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO†ZOO\"\n"
779         }, {
780                 name: "entities01.dat #31",
781                 html: "FOO&#x0087;ZOO",
782                 errors: 2,
783                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO‡ZOO\"\n"
784         }, {
785                 name: "entities01.dat #32",
786                 html: "FOO&#x0088;ZOO",
787                 errors: 2,
788                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOˆZOO\"\n"
789         }, {
790                 name: "entities01.dat #33",
791                 html: "FOO&#x0089;ZOO",
792                 errors: 2,
793                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO‰ZOO\"\n"
794         }, {
795                 name: "entities01.dat #34",
796                 html: "FOO&#x008A;ZOO",
797                 errors: 2,
798                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOŠZOO\"\n"
799         }, {
800                 name: "entities01.dat #35",
801                 html: "FOO&#x008B;ZOO",
802                 errors: 2,
803                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO‹ZOO\"\n"
804         }, {
805                 name: "entities01.dat #36",
806                 html: "FOO&#x008C;ZOO",
807                 errors: 2,
808                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOŒZOO\"\n"
809         }, {
810                 name: "entities01.dat #37",
811                 html: "FOO&#x008D;ZOO",
812                 errors: 2,
813                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\8dZOO\"\n"
814         }, {
815                 name: "entities01.dat #38",
816                 html: "FOO&#x008E;ZOO",
817                 errors: 2,
818                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOŽZOO\"\n"
819         }, {
820                 name: "entities01.dat #39",
821                 html: "FOO&#x008F;ZOO",
822                 errors: 2,
823                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\8fZOO\"\n"
824         }, {
825                 name: "entities01.dat #40",
826                 html: "FOO&#x0090;ZOO",
827                 errors: 2,
828                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\90ZOO\"\n"
829         }, {
830                 name: "entities01.dat #41",
831                 html: "FOO&#x0091;ZOO",
832                 errors: 2,
833                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO‘ZOO\"\n"
834         }, {
835                 name: "entities01.dat #42",
836                 html: "FOO&#x0092;ZOO",
837                 errors: 2,
838                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO’ZOO\"\n"
839         }, {
840                 name: "entities01.dat #43",
841                 html: "FOO&#x0093;ZOO",
842                 errors: 2,
843                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO“ZOO\"\n"
844         }, {
845                 name: "entities01.dat #44",
846                 html: "FOO&#x0094;ZOO",
847                 errors: 2,
848                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO”ZOO\"\n"
849         }, {
850                 name: "entities01.dat #45",
851                 html: "FOO&#x0095;ZOO",
852                 errors: 2,
853                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO•ZOO\"\n"
854         }, {
855                 name: "entities01.dat #46",
856                 html: "FOO&#x0096;ZOO",
857                 errors: 2,
858                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO–ZOO\"\n"
859         }, {
860                 name: "entities01.dat #47",
861                 html: "FOO&#x0097;ZOO",
862                 errors: 2,
863                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO—ZOO\"\n"
864         }, {
865                 name: "entities01.dat #48",
866                 html: "FOO&#x0098;ZOO",
867                 errors: 2,
868                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO˜ZOO\"\n"
869         }, {
870                 name: "entities01.dat #49",
871                 html: "FOO&#x0099;ZOO",
872                 errors: 2,
873                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO™ZOO\"\n"
874         }, {
875                 name: "entities01.dat #50",
876                 html: "FOO&#x009A;ZOO",
877                 errors: 2,
878                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOšZOO\"\n"
879         }, {
880                 name: "entities01.dat #51",
881                 html: "FOO&#x009B;ZOO",
882                 errors: 2,
883                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO›ZOO\"\n"
884         }, {
885                 name: "entities01.dat #52",
886                 html: "FOO&#x009C;ZOO",
887                 errors: 2,
888                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOœZOO\"\n"
889         }, {
890                 name: "entities01.dat #53",
891                 html: "FOO&#x009D;ZOO",
892                 errors: 2,
893                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\9dZOO\"\n"
894         }, {
895                 name: "entities01.dat #54",
896                 html: "FOO&#x009E;ZOO",
897                 errors: 2,
898                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOžZOO\"\n"
899         }, {
900                 name: "entities01.dat #55",
901                 html: "FOO&#x009F;ZOO",
902                 errors: 2,
903                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOŸZOO\"\n"
904         }, {
905                 name: "entities01.dat #56",
906                 html: "FOO&#x00A0;ZOO",
907                 errors: 1,
908                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO ZOO\"\n"
909         }, {
910                 name: "entities01.dat #57",
911                 html: "FOO&#xD7FF;ZOO",
912                 errors: 1,
913                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO퟿ZOO\"\n"
914         }, {
915                 name: "entities01.dat #58",
916                 html: "FOO&#xD800;ZOO",
917                 errors: 2,
918                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�ZOO\"\n"
919         }, {
920                 name: "entities01.dat #59",
921                 html: "FOO&#xD801;ZOO",
922                 errors: 2,
923                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�ZOO\"\n"
924         }, {
925                 name: "entities01.dat #60",
926                 html: "FOO&#xDFFE;ZOO",
927                 errors: 2,
928                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�ZOO\"\n"
929         }, {
930                 name: "entities01.dat #61",
931                 html: "FOO&#xDFFF;ZOO",
932                 errors: 2,
933                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�ZOO\"\n"
934         }, {
935                 name: "entities01.dat #62",
936                 html: "FOO&#xE000;ZOO",
937                 errors: 1,
938                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOOZOO\"\n"
939         }, {
940                 name: "entities01.dat #63",
941                 html: "FOO&#x10FFFE;ZOO",
942                 errors: 2,
943                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO􏿾ZOO\"\n"
944         }, {
945                 name: "entities01.dat #64",
946                 html: "FOO&#x1087D4;ZOO",
947                 errors: 1,
948                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO􈟔ZOO\"\n"
949         }, {
950                 name: "entities01.dat #65",
951                 html: "FOO&#x10FFFF;ZOO",
952                 errors: 2,
953                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO􏿿ZOO\"\n"
954         }, {
955                 name: "entities01.dat #66",
956                 html: "FOO&#x110000;ZOO",
957                 errors: 2,
958                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�ZOO\"\n"
959         }, {
960                 name: "entities01.dat #67",
961                 html: "FOO&#xFFFFFF;ZOO",
962                 errors: 2,
963                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�ZOO\"\n"
964         }, {
965                 name: "entities01.dat #68",
966                 html: "FOO&#11111111111",
967                 errors: 3,
968                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�\"\n"
969         }, {
970                 name: "entities01.dat #69",
971                 html: "FOO&#1111111111",
972                 errors: 3,
973                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�\"\n"
974         }, {
975                 name: "entities01.dat #70",
976                 html: "FOO&#111111111111",
977                 errors: 3,
978                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�\"\n"
979         }, {
980                 name: "entities01.dat #71",
981                 html: "FOO&#11111111111ZOO",
982                 errors: 2,
983                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�ZOO\"\n"
984         }, {
985                 name: "entities01.dat #72",
986                 html: "FOO&#1111111111ZOO",
987                 errors: 2,
988                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�ZOO\"\n"
989         }, {
990                 name: "entities01.dat #73",
991                 html: "FOO&#111111111111ZOO",
992                 errors: 2,
993                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO�ZOO\"\n"
994         }, {
995                 name: "entities02.dat #1",
996                 html: "<div bar=\"ZZ&gt;YY\"></div>",
997                 errors: 1,
998                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ>YY\"\n"
999         }, {
1000                 name: "entities02.dat #2",
1001                 html: "<div bar=\"ZZ&\"></div>",
1002                 errors: 1,
1003                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ&\"\n"
1004         }, {
1005                 name: "entities02.dat #3",
1006                 html: "<div bar='ZZ&'></div>",
1007                 errors: 1,
1008                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ&\"\n"
1009         }, {
1010                 name: "entities02.dat #4",
1011                 html: "<div bar=ZZ&></div>",
1012                 errors: 1,
1013                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ&\"\n"
1014         }, {
1015                 name: "entities02.dat #5",
1016                 html: "<div bar=\"ZZ&gt=YY\"></div>",
1017                 errors: 2,
1018                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ&gt=YY\"\n"
1019         }, {
1020                 name: "entities02.dat #6",
1021                 html: "<div bar=\"ZZ&gt0YY\"></div>",
1022                 errors: 1,
1023                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ&gt0YY\"\n"
1024         }, {
1025                 name: "entities02.dat #7",
1026                 html: "<div bar=\"ZZ&gt9YY\"></div>",
1027                 errors: 1,
1028                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ&gt9YY\"\n"
1029         }, {
1030                 name: "entities02.dat #8",
1031                 html: "<div bar=\"ZZ&gtaYY\"></div>",
1032                 errors: 1,
1033                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ&gtaYY\"\n"
1034         }, {
1035                 name: "entities02.dat #9",
1036                 html: "<div bar=\"ZZ&gtZYY\"></div>",
1037                 errors: 1,
1038                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ&gtZYY\"\n"
1039         }, {
1040                 name: "entities02.dat #10",
1041                 html: "<div bar=\"ZZ&gt YY\"></div>",
1042                 errors: 2,
1043                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ> YY\"\n"
1044         }, {
1045                 name: "entities02.dat #11",
1046                 html: "<div bar=\"ZZ&gt\"></div>",
1047                 errors: 2,
1048                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ>\"\n"
1049         }, {
1050                 name: "entities02.dat #12",
1051                 html: "<div bar='ZZ&gt'></div>",
1052                 errors: 2,
1053                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ>\"\n"
1054         }, {
1055                 name: "entities02.dat #13",
1056                 html: "<div bar=ZZ&gt></div>",
1057                 errors: 2,
1058                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ>\"\n"
1059         }, {
1060                 name: "entities02.dat #14",
1061                 html: "<div bar=\"ZZ&pound_id=23\"></div>",
1062                 errors: 2,
1063                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ£_id=23\"\n"
1064         }, {
1065                 name: "entities02.dat #15",
1066                 html: "<div bar=\"ZZ&prod_id=23\"></div>",
1067                 errors: 1,
1068                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ&prod_id=23\"\n"
1069         }, {
1070                 name: "entities02.dat #16",
1071                 html: "<div bar=\"ZZ&pound;_id=23\"></div>",
1072                 errors: 1,
1073                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ£_id=23\"\n"
1074         }, {
1075                 name: "entities02.dat #17",
1076                 html: "<div bar=\"ZZ&prod;_id=23\"></div>",
1077                 errors: 1,
1078                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ∏_id=23\"\n"
1079         }, {
1080                 name: "entities02.dat #18",
1081                 html: "<div bar=\"ZZ&pound=23\"></div>",
1082                 errors: 2,
1083                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ&pound=23\"\n"
1084         }, {
1085                 name: "entities02.dat #19",
1086                 html: "<div bar=\"ZZ&prod=23\"></div>",
1087                 errors: 1,
1088                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       bar=\"ZZ&prod=23\"\n"
1089         }, {
1090                 name: "entities02.dat #20",
1091                 html: "<div>ZZ&pound_id=23</div>",
1092                 errors: 2,
1093                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"ZZ£_id=23\"\n"
1094         }, {
1095                 name: "entities02.dat #21",
1096                 html: "<div>ZZ&prod_id=23</div>",
1097                 errors: 1,
1098                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"ZZ&prod_id=23\"\n"
1099         }, {
1100                 name: "entities02.dat #22",
1101                 html: "<div>ZZ&pound;_id=23</div>",
1102                 errors: 1,
1103                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"ZZ£_id=23\"\n"
1104         }, {
1105                 name: "entities02.dat #23",
1106                 html: "<div>ZZ&prod;_id=23</div>",
1107                 errors: 1,
1108                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"ZZ∏_id=23\"\n"
1109         }, {
1110                 name: "entities02.dat #24",
1111                 html: "<div>ZZ&pound=23</div>",
1112                 errors: 2,
1113                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"ZZ£=23\"\n"
1114         }, {
1115                 name: "entities02.dat #25",
1116                 html: "<div>ZZ&prod=23</div>",
1117                 errors: 1,
1118                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"ZZ&prod=23\"\n"
1119         }, {
1120                 name: "entities02.dat #26",
1121                 html: "<div>ZZ&AElig=</div>",
1122                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"ZZÆ=\"\n"
1123         }, {
1124                 name: "foreign-fragment.dat #1",
1125                 html: "<nobr>X",
1126                 errors: 3,
1127                 fragment: "svg path",
1128                 expected: "| <svg nobr>\n|   \"X\"\n"
1129         }, {
1130                 name: "foreign-fragment.dat #2",
1131                 html: "<font color></font>X",
1132                 errors: 1,
1133                 fragment: "svg path",
1134                 expected: "| <svg font>\n|   color=\"\"\n| \"X\"\n"
1135         }, {
1136                 name: "foreign-fragment.dat #3",
1137                 html: "<font></font>X",
1138                 fragment: "svg path",
1139                 expected: "| <svg font>\n| \"X\"\n"
1140         }, {
1141                 name: "foreign-fragment.dat #4",
1142                 html: "<g></path>X",
1143                 errors: 3,
1144                 fragment: "svg path",
1145                 expected: "| <svg g>\n|   \"X\"\n"
1146         }, {
1147                 name: "foreign-fragment.dat #5",
1148                 html: "</path>X",
1149                 errors: 1,
1150                 fragment: "svg path",
1151                 expected: "| \"X\"\n"
1152         }, {
1153                 name: "foreign-fragment.dat #6",
1154                 html: "</foreignObject>X",
1155                 errors: 1,
1156                 fragment: "svg foreignObject",
1157                 expected: "| \"X\"\n"
1158         }, {
1159                 name: "foreign-fragment.dat #7",
1160                 html: "</desc>X",
1161                 errors: 1,
1162                 fragment: "svg desc",
1163                 expected: "| \"X\"\n"
1164         }, {
1165                 name: "foreign-fragment.dat #8",
1166                 html: "</title>X",
1167                 errors: 1,
1168                 fragment: "svg title",
1169                 expected: "| \"X\"\n"
1170         }, {
1171                 name: "foreign-fragment.dat #9",
1172                 html: "</svg>X",
1173                 errors: 1,
1174                 fragment: "svg svg",
1175                 expected: "| \"X\"\n"
1176         }, {
1177                 name: "foreign-fragment.dat #10",
1178                 html: "</mfenced>X",
1179                 errors: 1,
1180                 fragment: "math mfenced",
1181                 expected: "| \"X\"\n"
1182         }, {
1183                 name: "foreign-fragment.dat #11",
1184                 html: "</malignmark>X",
1185                 errors: 1,
1186                 fragment: "math malignmark",
1187                 expected: "| \"X\"\n"
1188         }, {
1189                 name: "foreign-fragment.dat #12",
1190                 html: "</math>X",
1191                 errors: 1,
1192                 fragment: "math math",
1193                 expected: "| \"X\"\n"
1194         }, {
1195                 name: "foreign-fragment.dat #13",
1196                 html: "</annotation-xml>X",
1197                 errors: 1,
1198                 fragment: "math annotation-xml",
1199                 expected: "| \"X\"\n"
1200         }, {
1201                 name: "foreign-fragment.dat #14",
1202                 html: "</mtext>X",
1203                 errors: 1,
1204                 fragment: "math mtext",
1205                 expected: "| \"X\"\n"
1206         }, {
1207                 name: "foreign-fragment.dat #15",
1208                 html: "</mi>X",
1209                 errors: 1,
1210                 fragment: "math mi",
1211                 expected: "| \"X\"\n"
1212         }, {
1213                 name: "foreign-fragment.dat #16",
1214                 html: "</mo>X",
1215                 errors: 1,
1216                 fragment: "math mo",
1217                 expected: "| \"X\"\n"
1218         }, {
1219                 name: "foreign-fragment.dat #17",
1220                 html: "</mn>X",
1221                 errors: 1,
1222                 fragment: "math mn",
1223                 expected: "| \"X\"\n"
1224         }, {
1225                 name: "foreign-fragment.dat #18",
1226                 html: "</ms>X",
1227                 errors: 1,
1228                 fragment: "math ms",
1229                 expected: "| \"X\"\n"
1230         }, {
1231                 name: "foreign-fragment.dat #19",
1232                 html: "<b></b><mglyph/><i></i><malignmark/><u></u><ms/>X",
1233                 errors: 3,
1234                 fragment: "math ms",
1235                 expected: "| <b>\n| <math mglyph>\n| <i>\n| <math malignmark>\n| <u>\n| <ms>\n|   \"X\"\n"
1236         }, {
1237                 name: "foreign-fragment.dat #20",
1238                 html: "<malignmark></malignmark>",
1239                 fragment: "math ms",
1240                 expected: "| <math malignmark>\n"
1241         }, {
1242                 name: "foreign-fragment.dat #21",
1243                 html: "<div></div>",
1244                 fragment: "math ms",
1245                 expected: "| <div>\n"
1246         }, {
1247                 name: "foreign-fragment.dat #22",
1248                 html: "<figure></figure>",
1249                 fragment: "math ms",
1250                 expected: "| <figure>\n"
1251         }, {
1252                 name: "foreign-fragment.dat #23",
1253                 html: "<b></b><mglyph/><i></i><malignmark/><u></u><mn/>X",
1254                 errors: 3,
1255                 fragment: "math mn",
1256                 expected: "| <b>\n| <math mglyph>\n| <i>\n| <math malignmark>\n| <u>\n| <mn>\n|   \"X\"\n"
1257         }, {
1258                 name: "foreign-fragment.dat #24",
1259                 html: "<malignmark></malignmark>",
1260                 fragment: "math mn",
1261                 expected: "| <math malignmark>\n"
1262         }, {
1263                 name: "foreign-fragment.dat #25",
1264                 html: "<div></div>",
1265                 fragment: "math mn",
1266                 expected: "| <div>\n"
1267         }, {
1268                 name: "foreign-fragment.dat #26",
1269                 html: "<figure></figure>",
1270                 fragment: "math mn",
1271                 expected: "| <figure>\n"
1272         }, {
1273                 name: "foreign-fragment.dat #27",
1274                 html: "<b></b><mglyph/><i></i><malignmark/><u></u><mo/>X",
1275                 errors: 3,
1276                 fragment: "math mo",
1277                 expected: "| <b>\n| <math mglyph>\n| <i>\n| <math malignmark>\n| <u>\n| <mo>\n|   \"X\"\n"
1278         }, {
1279                 name: "foreign-fragment.dat #28",
1280                 html: "<malignmark></malignmark>",
1281                 fragment: "math mo",
1282                 expected: "| <math malignmark>\n"
1283         }, {
1284                 name: "foreign-fragment.dat #29",
1285                 html: "<div></div>",
1286                 fragment: "math mo",
1287                 expected: "| <div>\n"
1288         }, {
1289                 name: "foreign-fragment.dat #30",
1290                 html: "<figure></figure>",
1291                 fragment: "math mo",
1292                 expected: "| <figure>\n"
1293         }, {
1294                 name: "foreign-fragment.dat #31",
1295                 html: "<b></b><mglyph/><i></i><malignmark/><u></u><mi/>X",
1296                 errors: 3,
1297                 fragment: "math mi",
1298                 expected: "| <b>\n| <math mglyph>\n| <i>\n| <math malignmark>\n| <u>\n| <mi>\n|   \"X\"\n"
1299         }, {
1300                 name: "foreign-fragment.dat #32",
1301                 html: "<malignmark></malignmark>",
1302                 fragment: "math mi",
1303                 expected: "| <math malignmark>\n"
1304         }, {
1305                 name: "foreign-fragment.dat #33",
1306                 html: "<div></div>",
1307                 fragment: "math mi",
1308                 expected: "| <div>\n"
1309         }, {
1310                 name: "foreign-fragment.dat #34",
1311                 html: "<figure></figure>",
1312                 fragment: "math mi",
1313                 expected: "| <figure>\n"
1314         }, {
1315                 name: "foreign-fragment.dat #35",
1316                 html: "<b></b><mglyph/><i></i><malignmark/><u></u><mtext/>X",
1317                 errors: 3,
1318                 fragment: "math mtext",
1319                 expected: "| <b>\n| <math mglyph>\n| <i>\n| <math malignmark>\n| <u>\n| <mtext>\n|   \"X\"\n"
1320         }, {
1321                 name: "foreign-fragment.dat #36",
1322                 html: "<malignmark></malignmark>",
1323                 fragment: "math mtext",
1324                 expected: "| <math malignmark>\n"
1325         }, {
1326                 name: "foreign-fragment.dat #37",
1327                 html: "<div></div>",
1328                 fragment: "math mtext",
1329                 expected: "| <div>\n"
1330         }, {
1331                 name: "foreign-fragment.dat #38",
1332                 html: "<figure></figure>",
1333                 fragment: "math mtext",
1334                 expected: "| <figure>\n"
1335         }, {
1336                 name: "foreign-fragment.dat #39",
1337                 html: "<div></div>",
1338                 errors: 1,
1339                 fragment: "math annotation-xml",
1340                 expected: "| <math div>\n"
1341         }, {
1342                 name: "foreign-fragment.dat #40",
1343                 html: "<figure></figure>",
1344                 fragment: "math annotation-xml",
1345                 expected: "| <math figure>\n"
1346         }, {
1347                 name: "foreign-fragment.dat #41",
1348                 html: "<div></div>",
1349                 errors: 1,
1350                 fragment: "math math",
1351                 expected: "| <math div>\n"
1352         }, {
1353                 name: "foreign-fragment.dat #42",
1354                 html: "<figure></figure>",
1355                 fragment: "math math",
1356                 expected: "| <math figure>\n"
1357         }, {
1358                 name: "foreign-fragment.dat #43",
1359                 html: "<div></div>",
1360                 fragment: "svg foreignObject",
1361                 expected: "| <div>\n"
1362         }, {
1363                 name: "foreign-fragment.dat #44",
1364                 html: "<figure></figure>",
1365                 fragment: "svg foreignObject",
1366                 expected: "| <figure>\n"
1367         }, {
1368                 name: "foreign-fragment.dat #45",
1369                 html: "<div></div>",
1370                 fragment: "svg title",
1371                 expected: "| <div>\n"
1372         }, {
1373                 name: "foreign-fragment.dat #46",
1374                 html: "<figure></figure>",
1375                 fragment: "svg title",
1376                 expected: "| <figure>\n"
1377         }, {
1378                 name: "foreign-fragment.dat #47",
1379                 html: "<figure></figure>",
1380                 fragment: "svg desc",
1381                 expected: "| <figure>\n"
1382         }, {
1383                 name: "foreign-fragment.dat #48",
1384                 html: "<div><h1>X</h1></div>",
1385                 errors: 2,
1386                 fragment: "svg svg",
1387                 expected: "| <svg div>\n|   <svg h1>\n|     \"X\"\n"
1388         }, {
1389                 name: "foreign-fragment.dat #49",
1390                 html: "<div></div>",
1391                 errors: 1,
1392                 fragment: "svg svg",
1393                 expected: "| <svg div>\n"
1394         }, {
1395                 name: "foreign-fragment.dat #50",
1396                 html: "<div></div>",
1397                 fragment: "svg desc",
1398                 expected: "| <div>\n"
1399         }, {
1400                 name: "foreign-fragment.dat #51",
1401                 html: "<figure></figure>",
1402                 fragment: "svg desc",
1403                 expected: "| <figure>\n"
1404         }, {
1405                 name: "foreign-fragment.dat #52",
1406                 html: "<plaintext><foo>",
1407                 errors: 2,
1408                 fragment: "svg desc",
1409                 expected: "| <plaintext>\n|   \"<foo>\"\n"
1410         }, {
1411                 name: "foreign-fragment.dat #53",
1412                 html: "<frameset>X",
1413                 errors: 1,
1414                 fragment: "svg desc",
1415                 expected: "| \"X\"\n"
1416         }, {
1417                 name: "foreign-fragment.dat #54",
1418                 html: "<head>X",
1419                 errors: 1,
1420                 fragment: "svg desc",
1421                 expected: "| \"X\"\n"
1422         }, {
1423                 name: "foreign-fragment.dat #55",
1424                 html: "<body>X",
1425                 errors: 1,
1426                 fragment: "svg desc",
1427                 expected: "| \"X\"\n"
1428         }, {
1429                 name: "foreign-fragment.dat #56",
1430                 html: "<html>X",
1431                 errors: 1,
1432                 fragment: "svg desc",
1433                 expected: "| \"X\"\n"
1434         }, {
1435                 name: "foreign-fragment.dat #57",
1436                 html: "<html class=\"foo\">X",
1437                 errors: 1,
1438                 fragment: "svg desc",
1439                 expected: "| \"X\"\n"
1440         }, {
1441                 name: "foreign-fragment.dat #58",
1442                 html: "<body class=\"foo\">X",
1443                 errors: 1,
1444                 fragment: "svg desc",
1445                 expected: "| \"X\"\n"
1446         }, {
1447                 name: "html5test-com.dat #1",
1448                 html: "<div<div>",
1449                 errors: 2,
1450                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div<div>\n"
1451         }, {
1452                 name: "html5test-com.dat #2",
1453                 html: "<div foo<bar=''>",
1454                 errors: 3,
1455                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       foo<bar=\"\"\n"
1456         }, {
1457                 name: "html5test-com.dat #3",
1458                 html: "<div foo=`bar`>",
1459                 errors: 4,
1460                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       foo=\"`bar`\"\n"
1461         }, {
1462                 name: "html5test-com.dat #4",
1463                 html: "<div \\\"foo=''>",
1464                 errors: 3,
1465                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \\\"foo=\"\"\n"
1466         }, {
1467                 name: "html5test-com.dat #5",
1468                 html: "<a href='\\nbar'></a>",
1469                 errors: 1,
1470                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       href=\"\\nbar\"\n"
1471         }, {
1472                 name: "html5test-com.dat #6",
1473                 html: "<!DOCTYPE html>",
1474                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n"
1475         }, {
1476                 name: "html5test-com.dat #7",
1477                 html: "&lang;&rang;",
1478                 errors: 1,
1479                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"⟨⟩\"\n"
1480         }, {
1481                 name: "html5test-com.dat #8",
1482                 html: "&apos;",
1483                 errors: 1,
1484                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"'\"\n"
1485         }, {
1486                 name: "html5test-com.dat #9",
1487                 html: "&ImaginaryI;",
1488                 errors: 1,
1489                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"ⅈ\"\n"
1490         }, {
1491                 name: "html5test-com.dat #10",
1492                 html: "&Kopf;",
1493                 errors: 1,
1494                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"𝕂\"\n"
1495         }, {
1496                 name: "html5test-com.dat #11",
1497                 html: "&notinva;",
1498                 errors: 1,
1499                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"∉\"\n"
1500         }, {
1501                 name: "html5test-com.dat #12",
1502                 html: "<?import namespace=\"foo\" implementation=\"#bar\">",
1503                 errors: 2,
1504                 expected: "| <!-- ?import namespace=\"foo\" implementation=\"#bar\" -->\n| <html>\n|   <head>\n|   <body>\n"
1505         }, {
1506                 name: "html5test-com.dat #13",
1507                 html: "<!--foo--bar-->",
1508                 errors: 2,
1509                 expected: "| <!-- foo--bar -->\n| <html>\n|   <head>\n|   <body>\n"
1510         }, {
1511                 name: "html5test-com.dat #14",
1512                 html: "<![CDATA[x]]>",
1513                 errors: 2,
1514                 expected: "| <!-- [CDATA[x]] -->\n| <html>\n|   <head>\n|   <body>\n"
1515         }, {
1516                 name: "html5test-com.dat #15",
1517                 html: "<textarea><!--</textarea>--></textarea>",
1518                 errors: 2,
1519                 expected: "| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"<!--\"\n|     \"-->\"\n"
1520         }, {
1521                 name: "html5test-com.dat #16",
1522                 html: "<textarea><!--</textarea>-->",
1523                 errors: 1,
1524                 expected: "| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"<!--\"\n|     \"-->\"\n"
1525         }, {
1526                 name: "html5test-com.dat #17",
1527                 html: "<style><!--</style>--></style>",
1528                 errors: 2,
1529                 expected: "| <html>\n|   <head>\n|     <style>\n|       \"<!--\"\n|   <body>\n|     \"-->\"\n"
1530         }, {
1531                 name: "html5test-com.dat #18",
1532                 html: "<style><!--</style>-->",
1533                 errors: 1,
1534                 expected: "| <html>\n|   <head>\n|     <style>\n|       \"<!--\"\n|   <body>\n|     \"-->\"\n"
1535         }, {
1536                 name: "html5test-com.dat #19",
1537                 html: "<ul><li>A </li> <li>B</li></ul>",
1538                 errors: 1,
1539                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ul>\n|       <li>\n|         \"A \"\n|       \" \"\n|       <li>\n|         \"B\"\n"
1540         }, {
1541                 name: "html5test-com.dat #20",
1542                 html: "<table><form><input type=hidden><input></form><div></div></table>",
1543                 errors: 8,
1544                 expected: "| <html>\n|   <head>\n|   <body>\n|     <input>\n|     <div>\n|     <table>\n|       <form>\n|       <input>\n|         type=\"hidden\"\n"
1545         }, {
1546                 name: "html5test-com.dat #21",
1547                 html: "<i>A<b>B<p></i>C</b>D",
1548                 errors: 3,
1549                 expected: "| <html>\n|   <head>\n|   <body>\n|     <i>\n|       \"A\"\n|       <b>\n|         \"B\"\n|     <b>\n|     <p>\n|       <b>\n|         <i>\n|         \"C\"\n|       \"D\"\n"
1550         }, {
1551                 name: "html5test-com.dat #22",
1552                 html: "<div></div>",
1553                 errors: 1,
1554                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n"
1555         }, {
1556                 name: "html5test-com.dat #23",
1557                 html: "<svg></svg>",
1558                 errors: 1,
1559                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n"
1560         }, {
1561                 name: "html5test-com.dat #24",
1562                 html: "<math></math>",
1563                 errors: 1,
1564                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n"
1565         }, {
1566                 name: "inbody01.dat #1",
1567                 html: "<button>1</foo>",
1568                 errors: 3,
1569                 expected: "| <html>\n|   <head>\n|   <body>\n|     <button>\n|       \"1\"\n"
1570         }, {
1571                 name: "inbody01.dat #2",
1572                 html: "<foo>1<p>2</foo>",
1573                 errors: 3,
1574                 expected: "| <html>\n|   <head>\n|   <body>\n|     <foo>\n|       \"1\"\n|       <p>\n|         \"2\"\n"
1575         }, {
1576                 name: "inbody01.dat #3",
1577                 html: "<dd>1</foo>",
1578                 errors: 2,
1579                 expected: "| <html>\n|   <head>\n|   <body>\n|     <dd>\n|       \"1\"\n"
1580         }, {
1581                 name: "inbody01.dat #4",
1582                 html: "<foo>1<dd>2</foo>",
1583                 errors: 3,
1584                 expected: "| <html>\n|   <head>\n|   <body>\n|     <foo>\n|       \"1\"\n|       <dd>\n|         \"2\"\n"
1585         }, {
1586                 name: "isindex.dat #1",
1587                 html: "<isindex>",
1588                 errors: 2,
1589                 expected: "| <html>\n|   <head>\n|   <body>\n|     <form>\n|       <hr>\n|       <label>\n|         \"This is a searchable index. Enter search keywords: \"\n|         <input>\n|           name=\"isindex\"\n|       <hr>\n"
1590         }, {
1591                 name: "isindex.dat #2",
1592                 html: "<isindex name=\"A\" action=\"B\" prompt=\"C\" foo=\"D\">",
1593                 errors: 2,
1594                 expected: "| <html>\n|   <head>\n|   <body>\n|     <form>\n|       action=\"B\"\n|       <hr>\n|       <label>\n|         \"C\"\n|         <input>\n|           foo=\"D\"\n|           name=\"isindex\"\n|       <hr>\n"
1595         }, {
1596                 name: "isindex.dat #3",
1597                 html: "<form><isindex>",
1598                 errors: 3,
1599                 expected: "| <html>\n|   <head>\n|   <body>\n|     <form>\n"
1600         }, {
1601                 name: "main-element.dat #1",
1602                 html: "<!doctype html><p>foo<main>bar<p>baz",
1603                 errors: 1,
1604                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       \"foo\"\n|     <main>\n|       \"bar\"\n|       <p>\n|         \"baz\"\n"
1605         }, {
1606                 name: "main-element.dat #2",
1607                 html: "<!doctype html><main><p>foo</main>bar",
1608                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <main>\n|       <p>\n|         \"foo\"\n|     \"bar\"\n"
1609         }, {
1610                 name: "main-element.dat #3",
1611                 html: "<!DOCTYPE html>xxx<svg><x><g><a><main><b>",
1612                 errors: 2,
1613                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"xxx\"\n|     <svg svg>\n|       <svg x>\n|         <svg g>\n|           <svg a>\n|     <main>\n|       <b>\n"
1614         }, {
1615                 name: "math.dat #1",
1616                 html: "<math><tr><td><mo><tr>",
1617                 fragment: "td",
1618                 expected: "| <math math>\n|   <math tr>\n|     <math td>\n|       <math mo>\n"
1619         }, {
1620                 name: "math.dat #2",
1621                 html: "<math><tr><td><mo><tr>",
1622                 fragment: "tr",
1623                 expected: "| <math math>\n|   <math tr>\n|     <math td>\n|       <math mo>\n"
1624         }, {
1625                 name: "math.dat #3",
1626                 html: "<math><thead><mo><tbody>",
1627                 fragment: "thead",
1628                 expected: "| <math math>\n|   <math thead>\n|     <math mo>\n"
1629         }, {
1630                 name: "math.dat #4",
1631                 html: "<math><tfoot><mo><tbody>",
1632                 fragment: "tfoot",
1633                 expected: "| <math math>\n|   <math tfoot>\n|     <math mo>\n"
1634         }, {
1635                 name: "math.dat #5",
1636                 html: "<math><tbody><mo><tfoot>",
1637                 fragment: "tbody",
1638                 expected: "| <math math>\n|   <math tbody>\n|     <math mo>\n"
1639         }, {
1640                 name: "math.dat #6",
1641                 html: "<math><tbody><mo></table>",
1642                 fragment: "tbody",
1643                 expected: "| <math math>\n|   <math tbody>\n|     <math mo>\n"
1644         }, {
1645                 name: "math.dat #7",
1646                 html: "<math><thead><mo></table>",
1647                 fragment: "tbody",
1648                 expected: "| <math math>\n|   <math thead>\n|     <math mo>\n"
1649         }, {
1650                 name: "math.dat #8",
1651                 html: "<math><tfoot><mo></table>",
1652                 fragment: "tbody",
1653                 expected: "| <math math>\n|   <math tfoot>\n|     <math mo>\n"
1654         }, {
1655                 name: "namespace-sensitivity.dat #1",
1656                 html: "<body><table><tr><td><svg><td><foreignObject><span></td>Foo",
1657                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"Foo\"\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <svg svg>\n|               <svg td>\n|                 <svg foreignObject>\n|                   <span>\n"
1658         }, {
1659                 name: "pending-spec-changes.dat #1",
1660                 html: "<input type=\"hidden\"><frameset>",
1661                 errors: 3,
1662                 expected: "| <html>\n|   <head>\n|   <frameset>\n"
1663         }, {
1664                 name: "pending-spec-changes.dat #2",
1665                 html: "<!DOCTYPE html><table><caption><svg>foo</table>bar",
1666                 errors: 2,
1667                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <svg svg>\n|           \"foo\"\n|     \"bar\"\n"
1668         }, {
1669                 name: "pending-spec-changes.dat #3",
1670                 html: "<table><tr><td><svg><desc><td></desc><circle>",
1671                 errors: 4,
1672                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <svg svg>\n|               <svg desc>\n|           <td>\n|             <circle>\n"
1673         }, {
1674                 name: "pending-spec-changes-plain-text-unsafe.dat #1",
1675                 html: "<body><table>\u0000filler\u0000text\u0000",
1676                 errors: 18,
1677                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"fillertext\"\n|     <table>\n"
1678         }, {
1679                 name: "plain-text-unsafe.dat #1",
1680                 html: "FOO&#x000D;ZOO",
1681                 errors: 2,
1682                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\rZOO\"\n"
1683         }, {
1684                 name: "plain-text-unsafe.dat #2",
1685                 html: "<html>\u0000<frameset></frameset>",
1686                 errors: 4,
1687                 expected: "| <html>\n|   <head>\n|   <frameset>\n"
1688         }, {
1689                 name: "plain-text-unsafe.dat #3",
1690                 html: "<html> \u0000 <frameset></frameset>",
1691                 errors: 4,
1692                 expected: "| <html>\n|   <head>\n|   <frameset>\n"
1693         }, {
1694                 name: "plain-text-unsafe.dat #4",
1695                 html: "<html>a\u0000a<frameset></frameset>",
1696                 errors: 5,
1697                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"aa\"\n"
1698         }, {
1699                 name: "plain-text-unsafe.dat #5",
1700                 html: "<html>\u0000\u0000<frameset></frameset>",
1701                 errors: 6,
1702                 expected: "| <html>\n|   <head>\n|   <frameset>\n"
1703         }, {
1704                 name: "plain-text-unsafe.dat #6",
1705                 html: "<html>\u0000\n <frameset></frameset>",
1706                 errors: 4,
1707                 expected: "| <html>\n|   <head>\n|   <frameset>\n"
1708         }, {
1709                 name: "plain-text-unsafe.dat #7",
1710                 html: "<html><select>\u0000",
1711                 errors: 4,
1712                 expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n"
1713         }, {
1714                 name: "plain-text-unsafe.dat #8",
1715                 html: "\u0000",
1716                 errors: 3,
1717                 expected: "| <html>\n|   <head>\n|   <body>\n"
1718         }, {
1719                 name: "plain-text-unsafe.dat #9",
1720                 html: "<body>\u0000",
1721                 errors: 3,
1722                 expected: "| <html>\n|   <head>\n|   <body>\n"
1723         }, {
1724                 name: "plain-text-unsafe.dat #10",
1725                 html: "<plaintext>\u0000filler\u0000text\u0000",
1726                 errors: 5,
1727                 expected: "| <html>\n|   <head>\n|   <body>\n|     <plaintext>\n|       \"�filler�text�\"\n"
1728         }, {
1729                 name: "plain-text-unsafe.dat #11",
1730                 html: "<svg><![CDATA[\u0000filler\u0000text\u0000]]>",
1731                 errors: 5,
1732                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"�filler�text�\"\n"
1733         }, {
1734                 name: "plain-text-unsafe.dat #12",
1735                 html: "<body><!\u0000>",
1736                 errors: 2,
1737                 expected: "| <html>\n|   <head>\n|   <body>\n|     <!-- � -->\n"
1738         }, {
1739                 name: "plain-text-unsafe.dat #13",
1740                 html: "<body><!\u0000filler\u0000text>",
1741                 errors: 2,
1742                 expected: "| <html>\n|   <head>\n|   <body>\n|     <!-- �filler�text -->\n"
1743         }, {
1744                 name: "plain-text-unsafe.dat #14",
1745                 html: "<body><svg><foreignObject>\u0000filler\u0000text",
1746                 errors: 6,
1747                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg foreignObject>\n|         \"fillertext\"\n"
1748         }, {
1749                 name: "plain-text-unsafe.dat #15",
1750                 html: "<svg>\u0000filler\u0000text",
1751                 errors: 6,
1752                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"�filler�text\"\n"
1753         }, {
1754                 name: "plain-text-unsafe.dat #16",
1755                 html: "<svg>\u0000<frameset>",
1756                 errors: 4,
1757                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"�\"\n|       <svg frameset>\n"
1758         }, {
1759                 name: "plain-text-unsafe.dat #17",
1760                 html: "<svg>\u0000 <frameset>",
1761                 errors: 4,
1762                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"� \"\n|       <svg frameset>\n"
1763         }, {
1764                 name: "plain-text-unsafe.dat #18",
1765                 html: "<svg>\u0000a<frameset>",
1766                 errors: 4,
1767                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"�a\"\n|       <svg frameset>\n"
1768         }, {
1769                 name: "plain-text-unsafe.dat #19",
1770                 html: "<svg>\u0000</svg><frameset>",
1771                 errors: 5,
1772                 expected: "| <html>\n|   <head>\n|   <frameset>\n"
1773         }, {
1774                 name: "plain-text-unsafe.dat #20",
1775                 html: "<svg>\u0000 </svg><frameset>",
1776                 errors: 5,
1777                 expected: "| <html>\n|   <head>\n|   <frameset>\n"
1778         }, {
1779                 name: "plain-text-unsafe.dat #21",
1780                 html: "<svg>\u0000a</svg><frameset>",
1781                 errors: 4,
1782                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"�a\"\n"
1783         }, {
1784                 name: "plain-text-unsafe.dat #22",
1785                 html: "<svg><path></path></svg><frameset>",
1786                 errors: 3,
1787                 expected: "| <html>\n|   <head>\n|   <frameset>\n"
1788         }, {
1789                 name: "plain-text-unsafe.dat #23",
1790                 html: "<svg><p><frameset>",
1791                 errors: 4,
1792                 expected: "| <html>\n|   <head>\n|   <frameset>\n"
1793         }, {
1794                 name: "plain-text-unsafe.dat #24",
1795                 html: "<!DOCTYPE html><pre>\r\n\r\nA</pre>",
1796                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n|       \"\nA\"\n"
1797         }, {
1798                 name: "plain-text-unsafe.dat #25",
1799                 html: "<!DOCTYPE html><pre>\r\rA</pre>",
1800                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n|       \"\nA\"\n"
1801         }, {
1802                 name: "plain-text-unsafe.dat #26",
1803                 html: "<!DOCTYPE html><pre>\rA</pre>",
1804                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n|       \"A\"\n"
1805         }, {
1806                 name: "plain-text-unsafe.dat #27",
1807                 html: "<!DOCTYPE html><table><tr><td><math><mtext>\u0000a",
1808                 errors: 3,
1809                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <math math>\n|               <math mtext>\n|                 \"a\"\n"
1810         }, {
1811                 name: "plain-text-unsafe.dat #28",
1812                 html: "<!DOCTYPE html><table><tr><td><svg><foreignObject>\u0000a",
1813                 errors: 3,
1814                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <svg svg>\n|               <svg foreignObject>\n|                 \"a\"\n"
1815         }, {
1816                 name: "plain-text-unsafe.dat #29",
1817                 html: "<!DOCTYPE html><math><mi>a\u0000b",
1818                 errors: 3,
1819                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         \"ab\"\n"
1820         }, {
1821                 name: "plain-text-unsafe.dat #30",
1822                 html: "<!DOCTYPE html><math><mo>a\u0000b",
1823                 errors: 3,
1824                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mo>\n|         \"ab\"\n"
1825         }, {
1826                 name: "plain-text-unsafe.dat #31",
1827                 html: "<!DOCTYPE html><math><mn>a\u0000b",
1828                 errors: 3,
1829                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mn>\n|         \"ab\"\n"
1830         }, {
1831                 name: "plain-text-unsafe.dat #32",
1832                 html: "<!DOCTYPE html><math><ms>a\u0000b",
1833                 errors: 3,
1834                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math ms>\n|         \"ab\"\n"
1835         }, {
1836                 name: "plain-text-unsafe.dat #33",
1837                 html: "<!DOCTYPE html><math><mtext>a\u0000b",
1838                 errors: 3,
1839                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mtext>\n|         \"ab\"\n"
1840         }, {
1841                 name: "ruby.dat #1",
1842                 html: "<html><ruby>a<rb>b<rb></ruby></html>",
1843                 errors: 1,
1844                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rb>\n|         \"b\"\n|       <rb>\n"
1845         }, {
1846                 name: "ruby.dat #2",
1847                 html: "<html><ruby>a<rb>b<rt></ruby></html>",
1848                 errors: 1,
1849                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rb>\n|         \"b\"\n|       <rt>\n"
1850         }, {
1851                 name: "ruby.dat #3",
1852                 html: "<html><ruby>a<rb>b<rtc></ruby></html>",
1853                 errors: 1,
1854                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rb>\n|         \"b\"\n|       <rtc>\n"
1855         }, {
1856                 name: "ruby.dat #4",
1857                 html: "<html><ruby>a<rb>b<rp></ruby></html>",
1858                 errors: 1,
1859                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rb>\n|         \"b\"\n|       <rp>\n"
1860         }, {
1861                 name: "ruby.dat #5",
1862                 html: "<html><ruby>a<rb>b<span></ruby></html>",
1863                 errors: 1,
1864                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rb>\n|         \"b\"\n|         <span>\n"
1865         }, {
1866                 name: "ruby.dat #6",
1867                 html: "<html><ruby>a<rt>b<rb></ruby></html>",
1868                 errors: 1,
1869                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rt>\n|         \"b\"\n|       <rb>\n"
1870         }, {
1871                 name: "ruby.dat #7",
1872                 html: "<html><ruby>a<rt>b<rt></ruby></html>",
1873                 errors: 1,
1874                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rt>\n|         \"b\"\n|       <rt>\n"
1875         }, {
1876                 name: "ruby.dat #8",
1877                 html: "<html><ruby>a<rt>b<rtc></ruby></html>",
1878                 errors: 1,
1879                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rt>\n|         \"b\"\n|       <rtc>\n"
1880         }, {
1881                 name: "ruby.dat #9",
1882                 html: "<html><ruby>a<rt>b<rp></ruby></html>",
1883                 errors: 1,
1884                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rt>\n|         \"b\"\n|       <rp>\n"
1885         }, {
1886                 name: "ruby.dat #10",
1887                 html: "<html><ruby>a<rt>b<span></ruby></html>",
1888                 errors: 1,
1889                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rt>\n|         \"b\"\n|         <span>\n"
1890         }, {
1891                 name: "ruby.dat #11",
1892                 html: "<html><ruby>a<rtc>b<rb></ruby></html>",
1893                 errors: 1,
1894                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rtc>\n|         \"b\"\n|       <rb>\n"
1895         }, {
1896                 name: "ruby.dat #12",
1897                 html: "<html><ruby>a<rtc>b<rt>c<rt>d</ruby></html>",
1898                 errors: 1,
1899                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rtc>\n|         \"b\"\n|         <rt>\n|           \"c\"\n|         <rt>\n|           \"d\"\n"
1900         }, {
1901                 name: "ruby.dat #13",
1902                 html: "<html><ruby>a<rtc>b<rtc></ruby></html>",
1903                 errors: 1,
1904                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rtc>\n|         \"b\"\n|       <rtc>\n"
1905         }, {
1906                 name: "ruby.dat #14",
1907                 html: "<html><ruby>a<rtc>b<rp></ruby></html>",
1908                 errors: 1,
1909                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rtc>\n|         \"b\"\n|         <rp>\n"
1910         }, {
1911                 name: "ruby.dat #15",
1912                 html: "<html><ruby>a<rtc>b<span></ruby></html>",
1913                 errors: 1,
1914                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rtc>\n|         \"b\"\n|         <span>\n"
1915         }, {
1916                 name: "ruby.dat #16",
1917                 html: "<html><ruby>a<rp>b<rb></ruby></html>",
1918                 errors: 1,
1919                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rp>\n|         \"b\"\n|       <rb>\n"
1920         }, {
1921                 name: "ruby.dat #17",
1922                 html: "<html><ruby>a<rp>b<rt></ruby></html>",
1923                 errors: 1,
1924                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rp>\n|         \"b\"\n|       <rt>\n"
1925         }, {
1926                 name: "ruby.dat #18",
1927                 html: "<html><ruby>a<rp>b<rtc></ruby></html>",
1928                 errors: 1,
1929                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rp>\n|         \"b\"\n|       <rtc>\n"
1930         }, {
1931                 name: "ruby.dat #19",
1932                 html: "<html><ruby>a<rp>b<rp></ruby></html>",
1933                 errors: 1,
1934                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rp>\n|         \"b\"\n|       <rp>\n"
1935         }, {
1936                 name: "ruby.dat #20",
1937                 html: "<html><ruby>a<rp>b<span></ruby></html>",
1938                 errors: 1,
1939                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rp>\n|         \"b\"\n|         <span>\n"
1940         }, {
1941                 name: "ruby.dat #21",
1942                 html: "<html><ruby><rtc><ruby>a<rb>b<rt></ruby></ruby></html>",
1943                 errors: 1,
1944                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       <rtc>\n|         <ruby>\n|           \"a\"\n|           <rb>\n|             \"b\"\n|           <rt>\n"
1945         }, {
1946                 name: "scriptdata01.dat #1",
1947                 html: "FOO<script>'Hello'</script>BAR",
1948                 errors: 1,
1949                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"'Hello'\"\n|     \"BAR\"\n"
1950         }, {
1951                 name: "scriptdata01.dat #2",
1952                 html: "FOO<script></script>BAR",
1953                 errors: 1,
1954                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|     \"BAR\"\n"
1955         }, {
1956                 name: "scriptdata01.dat #3",
1957                 html: "FOO<script></script >BAR",
1958                 errors: 1,
1959                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|     \"BAR\"\n"
1960         }, {
1961                 name: "scriptdata01.dat #4",
1962                 html: "FOO<script></script/>BAR",
1963                 errors: 2,
1964                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|     \"BAR\"\n"
1965         }, {
1966                 name: "scriptdata01.dat #5",
1967                 html: "FOO<script></script/ >BAR",
1968                 errors: 2,
1969                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|     \"BAR\"\n"
1970         }, {
1971                 name: "scriptdata01.dat #6",
1972                 html: "FOO<script type=\"text/plain\"></scriptx>BAR",
1973                 errors: 2,
1974                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       type=\"text/plain\"\n|       \"</scriptx>BAR\"\n"
1975         }, {
1976                 name: "scriptdata01.dat #7",
1977                 html: "FOO<script></script foo=\">\" dd>BAR",
1978                 errors: 2,
1979                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|     \"BAR\"\n"
1980         }, {
1981                 name: "scriptdata01.dat #8",
1982                 html: "FOO<script>'<'</script>BAR",
1983                 errors: 1,
1984                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"'<'\"\n|     \"BAR\"\n"
1985         }, {
1986                 name: "scriptdata01.dat #9",
1987                 html: "FOO<script>'<!'</script>BAR",
1988                 errors: 1,
1989                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"'<!'\"\n|     \"BAR\"\n"
1990         }, {
1991                 name: "scriptdata01.dat #10",
1992                 html: "FOO<script>'<!-'</script>BAR",
1993                 errors: 1,
1994                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"'<!-'\"\n|     \"BAR\"\n"
1995         }, {
1996                 name: "scriptdata01.dat #11",
1997                 html: "FOO<script>'<!--'</script>BAR",
1998                 errors: 1,
1999                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"'<!--'\"\n|     \"BAR\"\n"
2000         }, {
2001                 name: "scriptdata01.dat #12",
2002                 html: "FOO<script>'<!---'</script>BAR",
2003                 errors: 1,
2004                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"'<!---'\"\n|     \"BAR\"\n"
2005         }, {
2006                 name: "scriptdata01.dat #13",
2007                 html: "FOO<script>'<!-->'</script>BAR",
2008                 errors: 1,
2009                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"'<!-->'\"\n|     \"BAR\"\n"
2010         }, {
2011                 name: "scriptdata01.dat #14",
2012                 html: "FOO<script>'<!-->'</script>BAR",
2013                 errors: 1,
2014                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"'<!-->'\"\n|     \"BAR\"\n"
2015         }, {
2016                 name: "scriptdata01.dat #15",
2017                 html: "FOO<script>'<!-- potato'</script>BAR",
2018                 errors: 1,
2019                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"'<!-- potato'\"\n|     \"BAR\"\n"
2020         }, {
2021                 name: "scriptdata01.dat #16",
2022                 html: "FOO<script>'<!-- <sCrIpt'</script>BAR",
2023                 errors: 1,
2024                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"'<!-- <sCrIpt'\"\n|     \"BAR\"\n"
2025         }, {
2026                 name: "scriptdata01.dat #17",
2027                 html: "FOO<script type=\"text/plain\">'<!-- <sCrIpt>'</script>BAR",
2028                 errors: 3,
2029                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       type=\"text/plain\"\n|       \"'<!-- <sCrIpt>'</script>BAR\"\n"
2030         }, {
2031                 name: "scriptdata01.dat #18",
2032                 html: "FOO<script type=\"text/plain\">'<!-- <sCrIpt> -'</script>BAR",
2033                 errors: 3,
2034                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       type=\"text/plain\"\n|       \"'<!-- <sCrIpt> -'</script>BAR\"\n"
2035         }, {
2036                 name: "scriptdata01.dat #19",
2037                 html: "FOO<script type=\"text/plain\">'<!-- <sCrIpt> --'</script>BAR",
2038                 errors: 3,
2039                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       type=\"text/plain\"\n|       \"'<!-- <sCrIpt> --'</script>BAR\"\n"
2040         }, {
2041                 name: "scriptdata01.dat #20",
2042                 html: "FOO<script>'<!-- <sCrIpt> -->'</script>BAR",
2043                 errors: 1,
2044                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"'<!-- <sCrIpt> -->'\"\n|     \"BAR\"\n"
2045         }, {
2046                 name: "scriptdata01.dat #21",
2047                 html: "FOO<script type=\"text/plain\">'<!-- <sCrIpt> --!>'</script>BAR",
2048                 errors: 3,
2049                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       type=\"text/plain\"\n|       \"'<!-- <sCrIpt> --!>'</script>BAR\"\n"
2050         }, {
2051                 name: "scriptdata01.dat #22",
2052                 html: "FOO<script type=\"text/plain\">'<!-- <sCrIpt> -- >'</script>BAR",
2053                 errors: 3,
2054                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       type=\"text/plain\"\n|       \"'<!-- <sCrIpt> -- >'</script>BAR\"\n"
2055         }, {
2056                 name: "scriptdata01.dat #23",
2057                 html: "FOO<script type=\"text/plain\">'<!-- <sCrIpt '</script>BAR",
2058                 errors: 3,
2059                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       type=\"text/plain\"\n|       \"'<!-- <sCrIpt '</script>BAR\"\n"
2060         }, {
2061                 name: "scriptdata01.dat #24",
2062                 html: "FOO<script type=\"text/plain\">'<!-- <sCrIpt/'</script>BAR",
2063                 errors: 3,
2064                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       type=\"text/plain\"\n|       \"'<!-- <sCrIpt/'</script>BAR\"\n"
2065         }, {
2066                 name: "scriptdata01.dat #25",
2067                 html: "FOO<script type=\"text/plain\">'<!-- <sCrIpt\\'</script>BAR",
2068                 errors: 1,
2069                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       type=\"text/plain\"\n|       \"'<!-- <sCrIpt\\'\"\n|     \"BAR\"\n"
2070         }, {
2071                 name: "scriptdata01.dat #26",
2072                 html: "FOO<script type=\"text/plain\">'<!-- <sCrIpt/'</script>BAR</script>QUX",
2073                 errors: 1,
2074                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       type=\"text/plain\"\n|       \"'<!-- <sCrIpt/'</script>BAR\"\n|     \"QUX\"\n"
2075         }, {
2076                 name: "scriptdata01.dat #27",
2077                 html: "FOO<script><!--<script>-></script>--></script>QUX",
2078                 errors: 1,
2079                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"FOO\"\n|     <script>\n|       \"<!--<script>-></script>-->\"\n|     \"QUX\"\n"
2080         }, {
2081                 name: "tables01.dat #1",
2082                 html: "<table><th>",
2083                 errors: 3,
2084                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <th>\n"
2085         }, {
2086                 name: "tables01.dat #2",
2087                 html: "<table><td>",
2088                 errors: 3,
2089                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n"
2090         }, {
2091                 name: "tables01.dat #3",
2092                 html: "<table><col foo='bar'>",
2093                 errors: 2,
2094                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <colgroup>\n|         <col>\n|           foo=\"bar\"\n"
2095         }, {
2096                 name: "tables01.dat #4",
2097                 html: "<table><colgroup></html>foo",
2098                 errors: 6,
2099                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"foo\"\n|     <table>\n|       <colgroup>\n"
2100         }, {
2101                 name: "tables01.dat #5",
2102                 html: "<table></table><p>foo",
2103                 errors: 1,
2104                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|     <p>\n|       \"foo\"\n"
2105         }, {
2106                 name: "tables01.dat #6",
2107                 html: "<table></body></caption></col></colgroup></html></tbody></td></tfoot></th></thead></tr><td>",
2108                 errors: 14,
2109                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n"
2110         }, {
2111                 name: "tables01.dat #7",
2112                 html: "<table><select><option>3</select></table>",
2113                 errors: 2,
2114                 expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n|         \"3\"\n|     <table>\n"
2115         }, {
2116                 name: "tables01.dat #8",
2117                 html: "<table><select><table></table></select></table>",
2118                 errors: 6,
2119                 expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|     <table>\n|     <table>\n"
2120         }, {
2121                 name: "tables01.dat #9",
2122                 html: "<table><select></table>",
2123                 errors: 3,
2124                 expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|     <table>\n"
2125         }, {
2126                 name: "tables01.dat #10",
2127                 html: "<table><select><option>A<tr><td>B</td></tr></table>",
2128                 errors: 3,
2129                 expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n|         \"A\"\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             \"B\"\n"
2130         }, {
2131                 name: "tables01.dat #11",
2132                 html: "<table><td></body></caption></col></colgroup></html>foo",
2133                 errors: 8,
2134                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             \"foo\"\n"
2135         }, {
2136                 name: "tables01.dat #12",
2137                 html: "<table><td>A</table>B",
2138                 errors: 2,
2139                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             \"A\"\n|     \"B\"\n"
2140         }, {
2141                 name: "tables01.dat #13",
2142                 html: "<table><tr><caption>",
2143                 errors: 2,
2144                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|       <caption>\n"
2145         }, {
2146                 name: "tables01.dat #14",
2147                 html: "<table><tr></body></caption></col></colgroup></html></td></th><td>foo",
2148                 errors: 9,
2149                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             \"foo\"\n"
2150         }, {
2151                 name: "tables01.dat #15",
2152                 html: "<table><td><tr>",
2153                 errors: 3,
2154                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|         <tr>\n"
2155         }, {
2156                 name: "tables01.dat #16",
2157                 html: "<table><td><button><td>",
2158                 errors: 4,
2159                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <button>\n|           <td>\n"
2160         }, {
2161                 name: "tables01.dat #17",
2162                 html: "<table><tr><td><svg><desc><td>",
2163                 errors: 3,
2164                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <svg svg>\n|               <svg desc>\n|           <td>\n"
2165         }, {
2166                 name: "template.dat #1",
2167                 html: "<body><template>Hello</template>",
2168                 errors: 1,
2169                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         \"Hello\"\n"
2170         }, {
2171                 name: "template.dat #2",
2172                 html: "<template>Hello</template>",
2173                 errors: 1,
2174                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         \"Hello\"\n|   <body>\n"
2175         }, {
2176                 name: "template.dat #3",
2177                 html: "<template></template><div></div>",
2178                 errors: 1,
2179                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|   <body>\n|     <div>\n"
2180         }, {
2181                 name: "template.dat #4",
2182                 html: "<html><template>Hello</template>",
2183                 errors: 1,
2184                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         \"Hello\"\n|   <body>\n"
2185         }, {
2186                 name: "template.dat #5",
2187                 html: "<head><template><div></div></template></head>",
2188                 errors: 1,
2189                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <div>\n|   <body>\n"
2190         }, {
2191                 name: "template.dat #6",
2192                 html: "<div><template><div><span></template><b>",
2193                 errors: 3,
2194                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <template>\n|         content\n|           <div>\n|             <span>\n|       <b>\n"
2195         }, {
2196                 name: "template.dat #7",
2197                 html: "<div><template></div>Hello",
2198                 errors: 4,
2199                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <template>\n|         content\n|           \"Hello\"\n"
2200         }, {
2201                 name: "template.dat #8",
2202                 html: "<div></template></div>",
2203                 errors: 2,
2204                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n"
2205         }, {
2206                 name: "template.dat #9",
2207                 html: "<table><template></template></table>",
2208                 errors: 1,
2209                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <template>\n|         content\n"
2210         }, {
2211                 name: "template.dat #10",
2212                 html: "<table><template></template></div>",
2213                 errors: 4,
2214                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <template>\n|         content\n"
2215         }, {
2216                 name: "template.dat #11",
2217                 html: "<table><div><template></template></div>",
2218                 errors: 4,
2219                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <template>\n|         content\n|     <table>\n"
2220         }, {
2221                 name: "template.dat #12",
2222                 html: "<table><template></template><div></div>",
2223                 errors: 4,
2224                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|     <table>\n|       <template>\n|         content\n"
2225         }, {
2226                 name: "template.dat #13",
2227                 html: "<table>   <template></template></table>",
2228                 errors: 1,
2229                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       \"   \"\n|       <template>\n|         content\n"
2230         }, {
2231                 name: "template.dat #14",
2232                 html: "<table><tbody><template></template></tbody>",
2233                 errors: 2,
2234                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <template>\n|           content\n"
2235         }, {
2236                 name: "template.dat #15",
2237                 html: "<table><tbody><template></tbody></template>",
2238                 errors: 3,
2239                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <template>\n|           content\n"
2240         }, {
2241                 name: "template.dat #16",
2242                 html: "<table><tbody><template></template></tbody></table>",
2243                 errors: 1,
2244                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <template>\n|           content\n"
2245         }, {
2246                 name: "template.dat #17",
2247                 html: "<table><thead><template></template></thead>",
2248                 errors: 2,
2249                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <thead>\n|         <template>\n|           content\n"
2250         }, {
2251                 name: "template.dat #18",
2252                 html: "<table><tfoot><template></template></tfoot>",
2253                 errors: 2,
2254                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tfoot>\n|         <template>\n|           content\n"
2255         }, {
2256                 name: "template.dat #19",
2257                 html: "<select><template></template></select>",
2258                 errors: 1,
2259                 expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <template>\n|         content\n"
2260         }, {
2261                 name: "template.dat #20",
2262                 html: "<select><template><option></option></template></select>",
2263                 errors: 1,
2264                 expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <template>\n|         content\n|           <option>\n"
2265         }, {
2266                 name: "template.dat #21",
2267                 html: "<template><option></option></select><option></option></template>",
2268                 errors: 2,
2269                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <option>\n|         <option>\n|   <body>\n"
2270         }, {
2271                 name: "template.dat #22",
2272                 html: "<select><template></template><option></select>",
2273                 errors: 1,
2274                 expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <template>\n|         content\n|       <option>\n"
2275         }, {
2276                 name: "template.dat #23",
2277                 html: "<select><option><template></template></select>",
2278                 errors: 1,
2279                 expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n|         <template>\n|           content\n"
2280         }, {
2281                 name: "template.dat #24",
2282                 html: "<select><template>",
2283                 errors: 3,
2284                 expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <template>\n|         content\n"
2285         }, {
2286                 name: "template.dat #25",
2287                 html: "<select><option></option><template>",
2288                 errors: 3,
2289                 expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n|       <template>\n|         content\n"
2290         }, {
2291                 name: "template.dat #26",
2292                 html: "<select><option></option><template><option>",
2293                 errors: 3,
2294                 expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n|       <template>\n|         content\n|           <option>\n"
2295         }, {
2296                 name: "template.dat #27",
2297                 html: "<table><thead><template><td></template></table>",
2298                 errors: 1,
2299                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <thead>\n|         <template>\n|           content\n|             <td>\n"
2300         }, {
2301                 name: "template.dat #28",
2302                 html: "<table><template><thead></template></table>",
2303                 errors: 1,
2304                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <template>\n|         content\n|           <thead>\n"
2305         }, {
2306                 name: "template.dat #29",
2307                 html: "<body><table><template><td></tr><div></template></table>",
2308                 errors: 3,
2309                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <template>\n|         content\n|           <td>\n|             <div>\n"
2310         }, {
2311                 name: "template.dat #30",
2312                 html: "<table><template><thead></template></thead></table>",
2313                 errors: 2,
2314                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <template>\n|         content\n|           <thead>\n"
2315         }, {
2316                 name: "template.dat #31",
2317                 html: "<table><thead><template><tr></template></table>",
2318                 errors: 1,
2319                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <thead>\n|         <template>\n|           content\n|             <tr>\n"
2320         }, {
2321                 name: "template.dat #32",
2322                 html: "<table><template><tr></template></table>",
2323                 errors: 1,
2324                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <template>\n|         content\n|           <tr>\n"
2325         }, {
2326                 name: "template.dat #33",
2327                 html: "<table><tr><template><td>",
2328                 errors: 3,
2329                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <template>\n|             content\n|               <td>\n"
2330         }, {
2331                 name: "template.dat #34",
2332                 html: "<table><template><tr><template><td></template></tr></template></table>",
2333                 errors: 1,
2334                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <template>\n|         content\n|           <tr>\n|             <template>\n|               content\n|                 <td>\n"
2335         }, {
2336                 name: "template.dat #35",
2337                 html: "<table><template><tr><template><td></td></template></tr></template></table>",
2338                 errors: 1,
2339                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <template>\n|         content\n|           <tr>\n|             <template>\n|               content\n|                 <td>\n"
2340         }, {
2341                 name: "template.dat #36",
2342                 html: "<table><template><td></template>",
2343                 errors: 2,
2344                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <template>\n|         content\n|           <td>\n"
2345         }, {
2346                 name: "template.dat #37",
2347                 html: "<body><template><td></td></template>",
2348                 errors: 1,
2349                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <td>\n"
2350         }, {
2351                 name: "template.dat #38",
2352                 html: "<body><template><template><tr></tr></template><td></td></template>",
2353                 errors: 1,
2354                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <tr>\n|         <td>\n"
2355         }, {
2356                 name: "template.dat #39",
2357                 html: "<table><colgroup><template><col>",
2358                 errors: 3,
2359                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <colgroup>\n|         <template>\n|           content\n|             <col>\n"
2360         }, {
2361                 name: "template.dat #40",
2362                 html: "<frameset><template><frame></frame></template></frameset>",
2363                 errors: 4,
2364                 expected: "| <html>\n|   <head>\n|   <frameset>\n|     <frame>\n"
2365         }, {
2366                 name: "template.dat #41",
2367                 html: "<template><frame></frame></frameset><frame></frame></template>",
2368                 errors: 6,
2369                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|   <body>\n"
2370         }, {
2371                 name: "template.dat #42",
2372                 html: "<template><div><frameset><span></span></div><span></span></template>",
2373                 errors: 2,
2374                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <div>\n|           <span>\n|         <span>\n|   <body>\n"
2375         }, {
2376                 name: "template.dat #43",
2377                 html: "<body><template><div><frameset><span></span></div><span></span></template></body>",
2378                 errors: 2,
2379                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <div>\n|           <span>\n|         <span>\n"
2380         }, {
2381                 name: "template.dat #44",
2382                 html: "<body><template><script>var i = 1;</script><td></td></template>",
2383                 errors: 1,
2384                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <script>\n|           \"var i = 1;\"\n|         <td>\n"
2385         }, {
2386                 name: "template.dat #45",
2387                 html: "<body><template><tr><div></div></tr></template>",
2388                 errors: 3,
2389                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <tr>\n|         <div>\n"
2390         }, {
2391                 name: "template.dat #46",
2392                 html: "<body><template><tr></tr><td></td></template>",
2393                 errors: 2,
2394                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <tr>\n|         <tr>\n|           <td>\n"
2395         }, {
2396                 name: "template.dat #47",
2397                 html: "<body><template><td></td></tr><td></td></template>",
2398                 errors: 2,
2399                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <td>\n|         <td>\n"
2400         }, {
2401                 name: "template.dat #48",
2402                 html: "<body><template><td></td><tbody><td></td></template>",
2403                 errors: 2,
2404                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <td>\n|         <td>\n"
2405         }, {
2406                 name: "template.dat #49",
2407                 html: "<body><template><td></td><caption></caption><td></td></template>",
2408                 errors: 3,
2409                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <td>\n|         <td>\n"
2410         }, {
2411                 name: "template.dat #50",
2412                 html: "<body><template><td></td><colgroup></caption><td></td></template>",
2413                 errors: 3,
2414                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <td>\n|         <td>\n"
2415         }, {
2416                 name: "template.dat #51",
2417                 html: "<body><template><td></td></table><td></td></template>",
2418                 errors: 2,
2419                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <td>\n|         <td>\n"
2420         }, {
2421                 name: "template.dat #52",
2422                 html: "<body><template><tr></tr><tbody><tr></tr></template>",
2423                 errors: 2,
2424                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <tr>\n|         <tr>\n"
2425         }, {
2426                 name: "template.dat #53",
2427                 html: "<body><template><tr></tr><caption><tr></tr></template>",
2428                 errors: 2,
2429                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <tr>\n|         <tr>\n"
2430         }, {
2431                 name: "template.dat #54",
2432                 html: "<body><template><tr></tr></table><tr></tr></template>",
2433                 errors: 2,
2434                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <tr>\n|         <tr>\n"
2435         }, {
2436                 name: "template.dat #55",
2437                 html: "<body><template><thead></thead><caption></caption><tbody></tbody></template>",
2438                 errors: 1,
2439                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <thead>\n|         <caption>\n|         <tbody>\n"
2440         }, {
2441                 name: "template.dat #56",
2442                 html: "<body><template><thead></thead></table><tbody></tbody></template></body>",
2443                 errors: 2,
2444                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <thead>\n|         <tbody>\n"
2445         }, {
2446                 name: "template.dat #57",
2447                 html: "<body><template><div><tr></tr></div></template>",
2448                 errors: 3,
2449                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <div>\n"
2450         }, {
2451                 name: "template.dat #58",
2452                 html: "<body><template><em>Hello</em></template>",
2453                 errors: 1,
2454                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <em>\n|           \"Hello\"\n"
2455         }, {
2456                 name: "template.dat #59",
2457                 html: "<body><template><!--comment--></template>",
2458                 errors: 1,
2459                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <!-- comment -->\n"
2460         }, {
2461                 name: "template.dat #60",
2462                 html: "<body><template><style></style><td></td></template>",
2463                 errors: 1,
2464                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <style>\n|         <td>\n"
2465         }, {
2466                 name: "template.dat #61",
2467                 html: "<body><template><meta><td></td></template>",
2468                 errors: 1,
2469                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <meta>\n|         <td>\n"
2470         }, {
2471                 name: "template.dat #62",
2472                 html: "<body><template><link><td></td></template>",
2473                 errors: 1,
2474                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <link>\n|         <td>\n"
2475         }, {
2476                 name: "template.dat #63",
2477                 html: "<body><template><template><tr></tr></template><td></td></template>",
2478                 errors: 1,
2479                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <tr>\n|         <td>\n"
2480         }, {
2481                 name: "template.dat #64",
2482                 html: "<body><table><colgroup><template><col></col></template></colgroup></table></body>",
2483                 errors: 2,
2484                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <colgroup>\n|         <template>\n|           content\n|             <col>\n"
2485         }, {
2486                 name: "template.dat #65",
2487                 html: "<body a=b><template><div></div><body c=d><div></div></body></template></body>",
2488                 errors: 3,
2489                 expected: "| <html>\n|   <head>\n|   <body>\n|     a=\"b\"\n|     <template>\n|       content\n|         <div>\n|         <div>\n"
2490         }, {
2491                 name: "template.dat #66",
2492                 html: "<html a=b><template><div><html b=c><span></template>",
2493                 errors: 3,
2494                 expected: "| <html>\n|   a=\"b\"\n|   <head>\n|     <template>\n|       content\n|         <div>\n|           <span>\n|   <body>\n"
2495         }, {
2496                 name: "template.dat #67",
2497                 html: "<html a=b><template><col></col><html b=c><col></col></template>",
2498                 errors: 4,
2499                 expected: "| <html>\n|   a=\"b\"\n|   <head>\n|     <template>\n|       content\n|         <col>\n|         <col>\n|   <body>\n"
2500         }, {
2501                 name: "template.dat #68",
2502                 html: "<html a=b><template><frame></frame><html b=c><frame></frame></template>",
2503                 errors: 6,
2504                 expected: "| <html>\n|   a=\"b\"\n|   <head>\n|     <template>\n|       content\n|   <body>\n"
2505         }, {
2506                 name: "template.dat #69",
2507                 html: "<body><template><tr></tr><template></template><td></td></template>",
2508                 errors: 2,
2509                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <tr>\n|         <template>\n|           content\n|         <tr>\n|           <td>\n"
2510         }, {
2511                 name: "template.dat #70",
2512                 html: "<body><template><thead></thead><template><tr></tr></template><tr></tr><tfoot></tfoot></template>",
2513                 errors: 1,
2514                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <thead>\n|         <template>\n|           content\n|             <tr>\n|         <tbody>\n|           <tr>\n|         <tfoot>\n"
2515         }, {
2516                 name: "template.dat #71",
2517                 html: "<body><template><template><b><template></template></template>text</template>",
2518                 errors: 2,
2519                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <b>\n|               <template>\n|                 content\n|         \"text\"\n"
2520         }, {
2521                 name: "template.dat #72",
2522                 html: "<body><template><col><colgroup>",
2523                 errors: 3,
2524                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <col>\n"
2525         }, {
2526                 name: "template.dat #73",
2527                 html: "<body><template><col></colgroup>",
2528                 errors: 3,
2529                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <col>\n"
2530         }, {
2531                 name: "template.dat #74",
2532                 html: "<body><template><col><colgroup></template></body>",
2533                 errors: 2,
2534                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <col>\n"
2535         }, {
2536                 name: "template.dat #75",
2537                 html: "<body><template><col><div>",
2538                 errors: 3,
2539                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <col>\n"
2540         }, {
2541                 name: "template.dat #76",
2542                 html: "<body><template><col></div>",
2543                 errors: 3,
2544                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <col>\n"
2545         }, {
2546                 name: "template.dat #77",
2547                 html: "<body><template><col>Hello",
2548                 errors: 3,
2549                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <col>\n"
2550         }, {
2551                 name: "template.dat #78",
2552                 html: "<body><template><i><menu>Foo</i>",
2553                 errors: 3,
2554                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <i>\n|         <menu>\n|           <i>\n|             \"Foo\"\n"
2555         }, {
2556                 name: "template.dat #79",
2557                 html: "<body><template></div><div>Foo</div><template></template><tr></tr>",
2558                 errors: 5,
2559                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n|         <div>\n|           \"Foo\"\n|         <template>\n|           content\n"
2560         }, {
2561                 name: "template.dat #80",
2562                 html: "<body><div><template></div><tr><td>Foo</td></tr></template>",
2563                 errors: 3,
2564                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <template>\n|         content\n|           <tr>\n|             <td>\n|               \"Foo\"\n"
2565         }, {
2566                 name: "template.dat #81",
2567                 html: "<template></figcaption><sub><table></table>",
2568                 errors: 3,
2569                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <sub>\n|           <table>\n|   <body>\n"
2570         }, {
2571                 name: "template.dat #82",
2572                 html: "<template><template>",
2573                 errors: 3,
2574                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|   <body>\n"
2575         }, {
2576                 name: "template.dat #83",
2577                 html: "<template><div>",
2578                 errors: 2,
2579                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <div>\n|   <body>\n"
2580         }, {
2581                 name: "template.dat #84",
2582                 html: "<template><template><div>",
2583                 errors: 3,
2584                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <div>\n|   <body>\n"
2585         }, {
2586                 name: "template.dat #85",
2587                 html: "<template><template><table>",
2588                 errors: 3,
2589                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <table>\n|   <body>\n"
2590         }, {
2591                 name: "template.dat #86",
2592                 html: "<template><template><tbody>",
2593                 errors: 3,
2594                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <tbody>\n|   <body>\n"
2595         }, {
2596                 name: "template.dat #87",
2597                 html: "<template><template><tr>",
2598                 errors: 3,
2599                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <tr>\n|   <body>\n"
2600         }, {
2601                 name: "template.dat #88",
2602                 html: "<template><template><td>",
2603                 errors: 3,
2604                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <td>\n|   <body>\n"
2605         }, {
2606                 name: "template.dat #89",
2607                 html: "<template><template><caption>",
2608                 errors: 3,
2609                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <caption>\n|   <body>\n"
2610         }, {
2611                 name: "template.dat #90",
2612                 html: "<template><template><colgroup>",
2613                 errors: 3,
2614                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <colgroup>\n|   <body>\n"
2615         }, {
2616                 name: "template.dat #91",
2617                 html: "<template><template><col>",
2618                 errors: 3,
2619                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <col>\n|   <body>\n"
2620         }, {
2621                 name: "template.dat #92",
2622                 html: "<template><template><tbody><select>",
2623                 errors: 4,
2624                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <tbody>\n|             <select>\n|   <body>\n"
2625         }, {
2626                 name: "template.dat #93",
2627                 html: "<template><template><table>Foo",
2628                 errors: 6,
2629                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             \"Foo\"\n|             <table>\n|   <body>\n"
2630         }, {
2631                 name: "template.dat #94",
2632                 html: "<template><template><frame>",
2633                 errors: 4,
2634                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|   <body>\n"
2635         }, {
2636                 name: "template.dat #95",
2637                 html: "<template><template><script>var i",
2638                 errors: 4,
2639                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <script>\n|               \"var i\"\n|   <body>\n"
2640         }, {
2641                 name: "template.dat #96",
2642                 html: "<template><template><style>var i",
2643                 errors: 4,
2644                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <template>\n|           content\n|             <style>\n|               \"var i\"\n|   <body>\n"
2645         }, {
2646                 name: "template.dat #97",
2647                 html: "<template><table></template><body><span>Foo",
2648                 errors: 3,
2649                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <table>\n|   <body>\n|     <span>\n|       \"Foo\"\n"
2650         }, {
2651                 name: "template.dat #98",
2652                 html: "<template><td></template><body><span>Foo",
2653                 errors: 2,
2654                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <td>\n|   <body>\n|     <span>\n|       \"Foo\"\n"
2655         }, {
2656                 name: "template.dat #99",
2657                 html: "<template><object></template><body><span>Foo",
2658                 errors: 3,
2659                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <object>\n|   <body>\n|     <span>\n|       \"Foo\"\n"
2660         }, {
2661                 name: "template.dat #100",
2662                 html: "<template><svg><template>",
2663                 errors: 2,
2664                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <svg svg>\n|           <svg template>\n|   <body>\n"
2665         }, {
2666                 name: "template.dat #101",
2667                 html: "<template><svg><foo><template><foreignObject><div></template><div>",
2668                 errors: 3,
2669                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <svg svg>\n|           <svg foo>\n|             <svg template>\n|               <svg foreignObject>\n|                 <div>\n|   <body>\n|     <div>\n"
2670         }, {
2671                 name: "template.dat #102",
2672                 html: "<dummy><template><span></dummy>",
2673                 errors: 4,
2674                 expected: "| <html>\n|   <head>\n|   <body>\n|     <dummy>\n|       <template>\n|         content\n|           <span>\n"
2675         }, {
2676                 name: "template.dat #103",
2677                 html: "<body><table><tr><td><select><template>Foo</template><caption>A</table>",
2678                 errors: 2,
2679                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <select>\n|               <template>\n|                 content\n|                   \"Foo\"\n|       <caption>\n|         \"A\"\n"
2680         }, {
2681                 name: "template.dat #104",
2682                 html: "<body></body><template>",
2683                 errors: 3,
2684                 expected: "| <html>\n|   <head>\n|   <body>\n|     <template>\n|       content\n"
2685         }, {
2686                 name: "template.dat #105",
2687                 html: "<head></head><template>",
2688                 errors: 3,
2689                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|   <body>\n"
2690         }, {
2691                 name: "template.dat #106",
2692                 html: "<head></head><template>Foo</template>",
2693                 errors: 2,
2694                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         \"Foo\"\n|   <body>\n"
2695         }, {
2696                 name: "template.dat #107",
2697                 html: "<!DOCTYPE HTML><dummy><table><template><table><template><table><script>",
2698                 errors: 4,
2699                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <dummy>\n|       <table>\n|         <template>\n|           content\n|             <table>\n|               <template>\n|                 content\n|                   <table>\n|                     <script>\n"
2700         }, {
2701                 name: "template.dat #108",
2702                 html: "<template><a><table><a>",
2703                 expected: "| <html>\n|   <head>\n|     <template>\n|       content\n|         <a>\n|           <a>\n|           <table>\n|   <body>\n"
2704         }, {
2705                 name: "tests10.dat #1",
2706                 html: "<!DOCTYPE html><svg></svg>",
2707                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n"
2708         }, {
2709                 name: "tests10.dat #2",
2710                 html: "<!DOCTYPE html><svg></svg><![CDATA[a]]>",
2711                 errors: 1,
2712                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|     <!-- [CDATA[a]] -->\n"
2713         }, {
2714                 name: "tests10.dat #3",
2715                 html: "<!DOCTYPE html><body><svg></svg>",
2716                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n"
2717         }, {
2718                 name: "tests10.dat #4",
2719                 html: "<!DOCTYPE html><body><select><svg></svg></select>",
2720                 errors: 2,
2721                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n"
2722         }, {
2723                 name: "tests10.dat #5",
2724                 html: "<!DOCTYPE html><body><select><option><svg></svg></option></select>",
2725                 errors: 2,
2726                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n"
2727         }, {
2728                 name: "tests10.dat #6",
2729                 html: "<!DOCTYPE html><body><table><svg></svg></table>",
2730                 errors: 1,
2731                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|     <table>\n"
2732         }, {
2733                 name: "tests10.dat #7",
2734                 html: "<!DOCTYPE html><body><table><svg><g>foo</g></svg></table>",
2735                 errors: 1,
2736                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg g>\n|         \"foo\"\n|     <table>\n"
2737         }, {
2738                 name: "tests10.dat #8",
2739                 html: "<!DOCTYPE html><body><table><svg><g>foo</g><g>bar</g></svg></table>",
2740                 errors: 1,
2741                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg g>\n|         \"foo\"\n|       <svg g>\n|         \"bar\"\n|     <table>\n"
2742         }, {
2743                 name: "tests10.dat #9",
2744                 html: "<!DOCTYPE html><body><table><tbody><svg><g>foo</g><g>bar</g></svg></tbody></table>",
2745                 errors: 1,
2746                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg g>\n|         \"foo\"\n|       <svg g>\n|         \"bar\"\n|     <table>\n|       <tbody>\n"
2747         }, {
2748                 name: "tests10.dat #10",
2749                 html: "<!DOCTYPE html><body><table><tbody><tr><svg><g>foo</g><g>bar</g></svg></tr></tbody></table>",
2750                 errors: 1,
2751                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg g>\n|         \"foo\"\n|       <svg g>\n|         \"bar\"\n|     <table>\n|       <tbody>\n|         <tr>\n"
2752         }, {
2753                 name: "tests10.dat #11",
2754                 html: "<!DOCTYPE html><body><table><tbody><tr><td><svg><g>foo</g><g>bar</g></svg></td></tr></tbody></table>",
2755                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <svg svg>\n|               <svg g>\n|                 \"foo\"\n|               <svg g>\n|                 \"bar\"\n"
2756         }, {
2757                 name: "tests10.dat #12",
2758                 html: "<!DOCTYPE html><body><table><tbody><tr><td><svg><g>foo</g><g>bar</g></svg><p>baz</td></tr></tbody></table>",
2759                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <svg svg>\n|               <svg g>\n|                 \"foo\"\n|               <svg g>\n|                 \"bar\"\n|             <p>\n|               \"baz\"\n"
2760         }, {
2761                 name: "tests10.dat #13",
2762                 html: "<!DOCTYPE html><body><table><caption><svg><g>foo</g><g>bar</g></svg><p>baz</caption></table>",
2763                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <svg svg>\n|           <svg g>\n|             \"foo\"\n|           <svg g>\n|             \"bar\"\n|         <p>\n|           \"baz\"\n"
2764         }, {
2765                 name: "tests10.dat #14",
2766                 html: "<!DOCTYPE html><body><table><caption><svg><g>foo</g><g>bar</g><p>baz</table><p>quux",
2767                 errors: 1,
2768                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <svg svg>\n|           <svg g>\n|             \"foo\"\n|           <svg g>\n|             \"bar\"\n|         <p>\n|           \"baz\"\n|     <p>\n|       \"quux\"\n"
2769         }, {
2770                 name: "tests10.dat #15",
2771                 html: "<!DOCTYPE html><body><table><caption><svg><g>foo</g><g>bar</g>baz</table><p>quux",
2772                 errors: 2,
2773                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <svg svg>\n|           <svg g>\n|             \"foo\"\n|           <svg g>\n|             \"bar\"\n|           \"baz\"\n|     <p>\n|       \"quux\"\n"
2774         }, {
2775                 name: "tests10.dat #16",
2776                 html: "<!DOCTYPE html><body><table><colgroup><svg><g>foo</g><g>bar</g><p>baz</table><p>quux",
2777                 errors: 6,
2778                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg g>\n|         \"foo\"\n|       <svg g>\n|         \"bar\"\n|     <p>\n|       \"baz\"\n|     <table>\n|       <colgroup>\n|     <p>\n|       \"quux\"\n"
2779         }, {
2780                 name: "tests10.dat #17",
2781                 html: "<!DOCTYPE html><body><table><tr><td><select><svg><g>foo</g><g>bar</g><p>baz</table><p>quux",
2782                 errors: 7,
2783                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <select>\n|               \"foobarbaz\"\n|     <p>\n|       \"quux\"\n"
2784         }, {
2785                 name: "tests10.dat #18",
2786                 html: "<!DOCTYPE html><body><table><select><svg><g>foo</g><g>bar</g><p>baz</table><p>quux",
2787                 errors: 8,
2788                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       \"foobarbaz\"\n|     <table>\n|     <p>\n|       \"quux\"\n"
2789         }, {
2790                 name: "tests10.dat #19",
2791                 html: "<!DOCTYPE html><body></body></html><svg><g>foo</g><g>bar</g><p>baz",
2792                 errors: 2,
2793                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg g>\n|         \"foo\"\n|       <svg g>\n|         \"bar\"\n|     <p>\n|       \"baz\"\n"
2794         }, {
2795                 name: "tests10.dat #20",
2796                 html: "<!DOCTYPE html><body></body><svg><g>foo</g><g>bar</g><p>baz",
2797                 errors: 2,
2798                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg g>\n|         \"foo\"\n|       <svg g>\n|         \"bar\"\n|     <p>\n|       \"baz\"\n"
2799         }, {
2800                 name: "tests10.dat #21",
2801                 html: "<!DOCTYPE html><frameset><svg><g></g><g></g><p><span>",
2802                 errors: 8,
2803                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
2804         }, {
2805                 name: "tests10.dat #22",
2806                 html: "<!DOCTYPE html><frameset></frameset><svg><g></g><g></g><p><span>",
2807                 errors: 7,
2808                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
2809         }, {
2810                 name: "tests10.dat #23",
2811                 html: "<!DOCTYPE html><body xlink:href=foo><svg xlink:href=foo></svg>",
2812                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     xlink:href=\"foo\"\n|     <svg svg>\n|       xlink href=\"foo\"\n"
2813         }, {
2814                 name: "tests10.dat #24",
2815                 html: "<!DOCTYPE html><body xlink:href=foo xml:lang=en><svg><g xml:lang=en xlink:href=foo></g></svg>",
2816                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     xlink:href=\"foo\"\n|     xml:lang=\"en\"\n|     <svg svg>\n|       <svg g>\n|         xlink href=\"foo\"\n|         xml lang=\"en\"\n"
2817         }, {
2818                 name: "tests10.dat #25",
2819                 html: "<!DOCTYPE html><body xlink:href=foo xml:lang=en><svg><g xml:lang=en xlink:href=foo /></svg>",
2820                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     xlink:href=\"foo\"\n|     xml:lang=\"en\"\n|     <svg svg>\n|       <svg g>\n|         xlink href=\"foo\"\n|         xml lang=\"en\"\n"
2821         }, {
2822                 name: "tests10.dat #26",
2823                 html: "<!DOCTYPE html><body xlink:href=foo xml:lang=en><svg><g xml:lang=en xlink:href=foo />bar</svg>",
2824                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     xlink:href=\"foo\"\n|     xml:lang=\"en\"\n|     <svg svg>\n|       <svg g>\n|         xlink href=\"foo\"\n|         xml lang=\"en\"\n|       \"bar\"\n"
2825         }, {
2826                 name: "tests10.dat #27",
2827                 html: "<svg></path>",
2828                 errors: 4,
2829                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n"
2830         }, {
2831                 name: "tests10.dat #28",
2832                 html: "<div><svg></div>a",
2833                 errors: 3,
2834                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <svg svg>\n|     \"a\"\n"
2835         }, {
2836                 name: "tests10.dat #29",
2837                 html: "<div><svg><path></div>a",
2838                 errors: 3,
2839                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <svg svg>\n|         <svg path>\n|     \"a\"\n"
2840         }, {
2841                 name: "tests10.dat #30",
2842                 html: "<div><svg><path></svg><path>",
2843                 errors: 3,
2844                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <svg svg>\n|         <svg path>\n|       <path>\n"
2845         }, {
2846                 name: "tests10.dat #31",
2847                 html: "<div><svg><path><foreignObject><math></div>a",
2848                 errors: 4,
2849                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <svg svg>\n|         <svg path>\n|           <svg foreignObject>\n|             <math math>\n|               \"a\"\n"
2850         }, {
2851                 name: "tests10.dat #32",
2852                 html: "<div><svg><path><foreignObject><p></div>a",
2853                 errors: 3,
2854                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <svg svg>\n|         <svg path>\n|           <svg foreignObject>\n|             <p>\n|               \"a\"\n"
2855         }, {
2856                 name: "tests10.dat #33",
2857                 html: "<!DOCTYPE html><svg><desc><div><svg><ul>a",
2858                 errors: 2,
2859                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg desc>\n|         <div>\n|           <svg svg>\n|           <ul>\n|             \"a\"\n"
2860         }, {
2861                 name: "tests10.dat #34",
2862                 html: "<!DOCTYPE html><svg><desc><svg><ul>a",
2863                 errors: 2,
2864                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg desc>\n|         <svg svg>\n|         <ul>\n|           \"a\"\n"
2865         }, {
2866                 name: "tests10.dat #35",
2867                 html: "<!DOCTYPE html><p><svg><desc><p>",
2868                 errors: 1,
2869                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <svg svg>\n|         <svg desc>\n|           <p>\n"
2870         }, {
2871                 name: "tests10.dat #36",
2872                 html: "<!DOCTYPE html><p><svg><title><p>",
2873                 errors: 1,
2874                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <svg svg>\n|         <svg title>\n|           <p>\n"
2875         }, {
2876                 name: "tests10.dat #37",
2877                 html: "<div><svg><path><foreignObject><p></foreignObject><p>",
2878                 errors: 3,
2879                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <svg svg>\n|         <svg path>\n|           <svg foreignObject>\n|             <p>\n|             <p>\n"
2880         }, {
2881                 name: "tests10.dat #38",
2882                 html: "<math><mi><div><object><div><span></span></div></object></div></mi><mi>",
2883                 errors: 2,
2884                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         <div>\n|           <object>\n|             <div>\n|               <span>\n|       <math mi>\n"
2885         }, {
2886                 name: "tests10.dat #39",
2887                 html: "<math><mi><svg><foreignObject><div><div></div></div></foreignObject></svg></mi><mi>",
2888                 errors: 2,
2889                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         <svg svg>\n|           <svg foreignObject>\n|             <div>\n|               <div>\n|       <math mi>\n"
2890         }, {
2891                 name: "tests10.dat #40",
2892                 html: "<svg><script></script><path>",
2893                 errors: 2,
2894                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg script>\n|       <svg path>\n"
2895         }, {
2896                 name: "tests10.dat #41",
2897                 html: "<table><svg></svg><tr>",
2898                 errors: 3,
2899                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|     <table>\n|       <tbody>\n|         <tr>\n"
2900         }, {
2901                 name: "tests10.dat #42",
2902                 html: "<math><mi><mglyph>",
2903                 errors: 2,
2904                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         <math mglyph>\n"
2905         }, {
2906                 name: "tests10.dat #43",
2907                 html: "<math><mi><malignmark>",
2908                 errors: 2,
2909                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         <math malignmark>\n"
2910         }, {
2911                 name: "tests10.dat #44",
2912                 html: "<math><mo><mglyph>",
2913                 errors: 2,
2914                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mo>\n|         <math mglyph>\n"
2915         }, {
2916                 name: "tests10.dat #45",
2917                 html: "<math><mo><malignmark>",
2918                 errors: 2,
2919                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mo>\n|         <math malignmark>\n"
2920         }, {
2921                 name: "tests10.dat #46",
2922                 html: "<math><mn><mglyph>",
2923                 errors: 2,
2924                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mn>\n|         <math mglyph>\n"
2925         }, {
2926                 name: "tests10.dat #47",
2927                 html: "<math><mn><malignmark>",
2928                 errors: 2,
2929                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mn>\n|         <math malignmark>\n"
2930         }, {
2931                 name: "tests10.dat #48",
2932                 html: "<math><ms><mglyph>",
2933                 errors: 2,
2934                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math ms>\n|         <math mglyph>\n"
2935         }, {
2936                 name: "tests10.dat #49",
2937                 html: "<math><ms><malignmark>",
2938                 errors: 2,
2939                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math ms>\n|         <math malignmark>\n"
2940         }, {
2941                 name: "tests10.dat #50",
2942                 html: "<math><mtext><mglyph>",
2943                 errors: 2,
2944                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mtext>\n|         <math mglyph>\n"
2945         }, {
2946                 name: "tests10.dat #51",
2947                 html: "<math><mtext><malignmark>",
2948                 errors: 2,
2949                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mtext>\n|         <math malignmark>\n"
2950         }, {
2951                 name: "tests10.dat #52",
2952                 html: "<math><annotation-xml><svg></svg></annotation-xml><mi>",
2953                 errors: 2,
2954                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math annotation-xml>\n|         <svg svg>\n|       <math mi>\n"
2955         }, {
2956                 name: "tests10.dat #53",
2957                 html: "<math><annotation-xml><svg><foreignObject><div><math><mi></mi></math><span></span></div></foreignObject><path></path></svg></annotation-xml><mi>",
2958                 errors: 2,
2959                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math annotation-xml>\n|         <svg svg>\n|           <svg foreignObject>\n|             <div>\n|               <math math>\n|                 <math mi>\n|               <span>\n|           <svg path>\n|       <math mi>\n"
2960         }, {
2961                 name: "tests10.dat #54",
2962                 html: "<math><annotation-xml><svg><foreignObject><math><mi><svg></svg></mi><mo></mo></math><span></span></foreignObject><path></path></svg></annotation-xml><mi>",
2963                 errors: 2,
2964                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math annotation-xml>\n|         <svg svg>\n|           <svg foreignObject>\n|             <math math>\n|               <math mi>\n|                 <svg svg>\n|               <math mo>\n|             <span>\n|           <svg path>\n|       <math mi>\n"
2965         }, {
2966                 name: "tests11.dat #1",
2967                 html: "<!DOCTYPE html><body><svg attributeName='' attributeType='' baseFrequency='' baseProfile='' calcMode='' clipPathUnits='' diffuseConstant='' edgeMode='' filterUnits='' glyphRef='' gradientTransform='' gradientUnits='' kernelMatrix='' kernelUnitLength='' keyPoints='' keySplines='' keyTimes='' lengthAdjust='' limitingConeAngle='' markerHeight='' markerUnits='' markerWidth='' maskContentUnits='' maskUnits='' numOctaves='' pathLength='' patternContentUnits='' patternTransform='' patternUnits='' pointsAtX='' pointsAtY='' pointsAtZ='' preserveAlpha='' preserveAspectRatio='' primitiveUnits='' refX='' refY='' repeatCount='' repeatDur='' requiredExtensions='' requiredFeatures='' specularConstant='' specularExponent='' spreadMethod='' startOffset='' stdDeviation='' stitchTiles='' surfaceScale='' systemLanguage='' tableValues='' targetX='' targetY='' textLength='' viewBox='' viewTarget='' xChannelSelector='' yChannelSelector='' zoomAndPan=''></svg>",
2968                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       attributeName=\"\"\n|       attributeType=\"\"\n|       baseFrequency=\"\"\n|       baseProfile=\"\"\n|       calcMode=\"\"\n|       clipPathUnits=\"\"\n|       diffuseConstant=\"\"\n|       edgeMode=\"\"\n|       filterUnits=\"\"\n|       glyphRef=\"\"\n|       gradientTransform=\"\"\n|       gradientUnits=\"\"\n|       kernelMatrix=\"\"\n|       kernelUnitLength=\"\"\n|       keyPoints=\"\"\n|       keySplines=\"\"\n|       keyTimes=\"\"\n|       lengthAdjust=\"\"\n|       limitingConeAngle=\"\"\n|       markerHeight=\"\"\n|       markerUnits=\"\"\n|       markerWidth=\"\"\n|       maskContentUnits=\"\"\n|       maskUnits=\"\"\n|       numOctaves=\"\"\n|       pathLength=\"\"\n|       patternContentUnits=\"\"\n|       patternTransform=\"\"\n|       patternUnits=\"\"\n|       pointsAtX=\"\"\n|       pointsAtY=\"\"\n|       pointsAtZ=\"\"\n|       preserveAlpha=\"\"\n|       preserveAspectRatio=\"\"\n|       primitiveUnits=\"\"\n|       refX=\"\"\n|       refY=\"\"\n|       repeatCount=\"\"\n|       repeatDur=\"\"\n|       requiredExtensions=\"\"\n|       requiredFeatures=\"\"\n|       specularConstant=\"\"\n|       specularExponent=\"\"\n|       spreadMethod=\"\"\n|       startOffset=\"\"\n|       stdDeviation=\"\"\n|       stitchTiles=\"\"\n|       surfaceScale=\"\"\n|       systemLanguage=\"\"\n|       tableValues=\"\"\n|       targetX=\"\"\n|       targetY=\"\"\n|       textLength=\"\"\n|       viewBox=\"\"\n|       viewTarget=\"\"\n|       xChannelSelector=\"\"\n|       yChannelSelector=\"\"\n|       zoomAndPan=\"\"\n"
2969         }, {
2970                 name: "tests11.dat #2",
2971                 html: "<!DOCTYPE html><BODY><SVG ATTRIBUTENAME='' ATTRIBUTETYPE='' BASEFREQUENCY='' BASEPROFILE='' CALCMODE='' CLIPPATHUNITS='' DIFFUSECONSTANT='' EDGEMODE='' FILTERUNITS='' GLYPHREF='' GRADIENTTRANSFORM='' GRADIENTUNITS='' KERNELMATRIX='' KERNELUNITLENGTH='' KEYPOINTS='' KEYSPLINES='' KEYTIMES='' LENGTHADJUST='' LIMITINGCONEANGLE='' MARKERHEIGHT='' MARKERUNITS='' MARKERWIDTH='' MASKCONTENTUNITS='' MASKUNITS='' NUMOCTAVES='' PATHLENGTH='' PATTERNCONTENTUNITS='' PATTERNTRANSFORM='' PATTERNUNITS='' POINTSATX='' POINTSATY='' POINTSATZ='' PRESERVEALPHA='' PRESERVEASPECTRATIO='' PRIMITIVEUNITS='' REFX='' REFY='' REPEATCOUNT='' REPEATDUR='' REQUIREDEXTENSIONS='' REQUIREDFEATURES='' SPECULARCONSTANT='' SPECULAREXPONENT='' SPREADMETHOD='' STARTOFFSET='' STDDEVIATION='' STITCHTILES='' SURFACESCALE='' SYSTEMLANGUAGE='' TABLEVALUES='' TARGETX='' TARGETY='' TEXTLENGTH='' VIEWBOX='' VIEWTARGET='' XCHANNELSELECTOR='' YCHANNELSELECTOR='' ZOOMANDPAN=''></SVG>",
2972                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       attributeName=\"\"\n|       attributeType=\"\"\n|       baseFrequency=\"\"\n|       baseProfile=\"\"\n|       calcMode=\"\"\n|       clipPathUnits=\"\"\n|       diffuseConstant=\"\"\n|       edgeMode=\"\"\n|       filterUnits=\"\"\n|       glyphRef=\"\"\n|       gradientTransform=\"\"\n|       gradientUnits=\"\"\n|       kernelMatrix=\"\"\n|       kernelUnitLength=\"\"\n|       keyPoints=\"\"\n|       keySplines=\"\"\n|       keyTimes=\"\"\n|       lengthAdjust=\"\"\n|       limitingConeAngle=\"\"\n|       markerHeight=\"\"\n|       markerUnits=\"\"\n|       markerWidth=\"\"\n|       maskContentUnits=\"\"\n|       maskUnits=\"\"\n|       numOctaves=\"\"\n|       pathLength=\"\"\n|       patternContentUnits=\"\"\n|       patternTransform=\"\"\n|       patternUnits=\"\"\n|       pointsAtX=\"\"\n|       pointsAtY=\"\"\n|       pointsAtZ=\"\"\n|       preserveAlpha=\"\"\n|       preserveAspectRatio=\"\"\n|       primitiveUnits=\"\"\n|       refX=\"\"\n|       refY=\"\"\n|       repeatCount=\"\"\n|       repeatDur=\"\"\n|       requiredExtensions=\"\"\n|       requiredFeatures=\"\"\n|       specularConstant=\"\"\n|       specularExponent=\"\"\n|       spreadMethod=\"\"\n|       startOffset=\"\"\n|       stdDeviation=\"\"\n|       stitchTiles=\"\"\n|       surfaceScale=\"\"\n|       systemLanguage=\"\"\n|       tableValues=\"\"\n|       targetX=\"\"\n|       targetY=\"\"\n|       textLength=\"\"\n|       viewBox=\"\"\n|       viewTarget=\"\"\n|       xChannelSelector=\"\"\n|       yChannelSelector=\"\"\n|       zoomAndPan=\"\"\n"
2973         }, {
2974                 name: "tests11.dat #3",
2975                 html: "<!DOCTYPE html><body><svg attributename='' attributetype='' basefrequency='' baseprofile='' calcmode='' clippathunits='' diffuseconstant='' edgemode='' filterunits='' filterres='' glyphref='' gradienttransform='' gradientunits='' kernelmatrix='' kernelunitlength='' keypoints='' keysplines='' keytimes='' lengthadjust='' limitingconeangle='' markerheight='' markerunits='' markerwidth='' maskcontentunits='' maskunits='' numoctaves='' pathlength='' patterncontentunits='' patterntransform='' patternunits='' pointsatx='' pointsaty='' pointsatz='' preservealpha='' preserveaspectratio='' primitiveunits='' refx='' refy='' repeatcount='' repeatdur='' requiredextensions='' requiredfeatures='' specularconstant='' specularexponent='' spreadmethod='' startoffset='' stddeviation='' stitchtiles='' surfacescale='' systemlanguage='' tablevalues='' targetx='' targety='' textlength='' viewbox='' viewtarget='' xchannelselector='' ychannelselector='' zoomandpan=''></svg>",
2976                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       attributeName=\"\"\n|       attributeType=\"\"\n|       baseFrequency=\"\"\n|       baseProfile=\"\"\n|       calcMode=\"\"\n|       clipPathUnits=\"\"\n|       diffuseConstant=\"\"\n|       edgeMode=\"\"\n|       filterUnits=\"\"\n|       filterres=\"\"\n|       glyphRef=\"\"\n|       gradientTransform=\"\"\n|       gradientUnits=\"\"\n|       kernelMatrix=\"\"\n|       kernelUnitLength=\"\"\n|       keyPoints=\"\"\n|       keySplines=\"\"\n|       keyTimes=\"\"\n|       lengthAdjust=\"\"\n|       limitingConeAngle=\"\"\n|       markerHeight=\"\"\n|       markerUnits=\"\"\n|       markerWidth=\"\"\n|       maskContentUnits=\"\"\n|       maskUnits=\"\"\n|       numOctaves=\"\"\n|       pathLength=\"\"\n|       patternContentUnits=\"\"\n|       patternTransform=\"\"\n|       patternUnits=\"\"\n|       pointsAtX=\"\"\n|       pointsAtY=\"\"\n|       pointsAtZ=\"\"\n|       preserveAlpha=\"\"\n|       preserveAspectRatio=\"\"\n|       primitiveUnits=\"\"\n|       refX=\"\"\n|       refY=\"\"\n|       repeatCount=\"\"\n|       repeatDur=\"\"\n|       requiredExtensions=\"\"\n|       requiredFeatures=\"\"\n|       specularConstant=\"\"\n|       specularExponent=\"\"\n|       spreadMethod=\"\"\n|       startOffset=\"\"\n|       stdDeviation=\"\"\n|       stitchTiles=\"\"\n|       surfaceScale=\"\"\n|       systemLanguage=\"\"\n|       tableValues=\"\"\n|       targetX=\"\"\n|       targetY=\"\"\n|       textLength=\"\"\n|       viewBox=\"\"\n|       viewTarget=\"\"\n|       xChannelSelector=\"\"\n|       yChannelSelector=\"\"\n|       zoomAndPan=\"\"\n"
2977         }, {
2978                 name: "tests11.dat #4",
2979                 html: "<!DOCTYPE html><body><math attributeName='' attributeType='' baseFrequency='' baseProfile='' calcMode='' clipPathUnits='' diffuseConstant='' edgeMode='' filterUnits='' glyphRef='' gradientTransform='' gradientUnits='' kernelMatrix='' kernelUnitLength='' keyPoints='' keySplines='' keyTimes='' lengthAdjust='' limitingConeAngle='' markerHeight='' markerUnits='' markerWidth='' maskContentUnits='' maskUnits='' numOctaves='' pathLength='' patternContentUnits='' patternTransform='' patternUnits='' pointsAtX='' pointsAtY='' pointsAtZ='' preserveAlpha='' preserveAspectRatio='' primitiveUnits='' refX='' refY='' repeatCount='' repeatDur='' requiredExtensions='' requiredFeatures='' specularConstant='' specularExponent='' spreadMethod='' startOffset='' stdDeviation='' stitchTiles='' surfaceScale='' systemLanguage='' tableValues='' targetX='' targetY='' textLength='' viewBox='' viewTarget='' xChannelSelector='' yChannelSelector='' zoomAndPan=''></math>",
2980                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       attributename=\"\"\n|       attributetype=\"\"\n|       basefrequency=\"\"\n|       baseprofile=\"\"\n|       calcmode=\"\"\n|       clippathunits=\"\"\n|       diffuseconstant=\"\"\n|       edgemode=\"\"\n|       filterunits=\"\"\n|       glyphref=\"\"\n|       gradienttransform=\"\"\n|       gradientunits=\"\"\n|       kernelmatrix=\"\"\n|       kernelunitlength=\"\"\n|       keypoints=\"\"\n|       keysplines=\"\"\n|       keytimes=\"\"\n|       lengthadjust=\"\"\n|       limitingconeangle=\"\"\n|       markerheight=\"\"\n|       markerunits=\"\"\n|       markerwidth=\"\"\n|       maskcontentunits=\"\"\n|       maskunits=\"\"\n|       numoctaves=\"\"\n|       pathlength=\"\"\n|       patterncontentunits=\"\"\n|       patterntransform=\"\"\n|       patternunits=\"\"\n|       pointsatx=\"\"\n|       pointsaty=\"\"\n|       pointsatz=\"\"\n|       preservealpha=\"\"\n|       preserveaspectratio=\"\"\n|       primitiveunits=\"\"\n|       refx=\"\"\n|       refy=\"\"\n|       repeatcount=\"\"\n|       repeatdur=\"\"\n|       requiredextensions=\"\"\n|       requiredfeatures=\"\"\n|       specularconstant=\"\"\n|       specularexponent=\"\"\n|       spreadmethod=\"\"\n|       startoffset=\"\"\n|       stddeviation=\"\"\n|       stitchtiles=\"\"\n|       surfacescale=\"\"\n|       systemlanguage=\"\"\n|       tablevalues=\"\"\n|       targetx=\"\"\n|       targety=\"\"\n|       textlength=\"\"\n|       viewbox=\"\"\n|       viewtarget=\"\"\n|       xchannelselector=\"\"\n|       ychannelselector=\"\"\n|       zoomandpan=\"\"\n"
2981         }, {
2982                 name: "tests11.dat #5",
2983                 html: "<!DOCTYPE html><body><svg><altGlyph /><altGlyphDef /><altGlyphItem /><animateColor /><animateMotion /><animateTransform /><clipPath /><feBlend /><feColorMatrix /><feComponentTransfer /><feComposite /><feConvolveMatrix /><feDiffuseLighting /><feDisplacementMap /><feDistantLight /><feFlood /><feFuncA /><feFuncB /><feFuncG /><feFuncR /><feGaussianBlur /><feImage /><feMerge /><feMergeNode /><feMorphology /><feOffset /><fePointLight /><feSpecularLighting /><feSpotLight /><feTile /><feTurbulence /><foreignObject /><glyphRef /><linearGradient /><radialGradient /><textPath /></svg>",
2984                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg altGlyph>\n|       <svg altGlyphDef>\n|       <svg altGlyphItem>\n|       <svg animateColor>\n|       <svg animateMotion>\n|       <svg animateTransform>\n|       <svg clipPath>\n|       <svg feBlend>\n|       <svg feColorMatrix>\n|       <svg feComponentTransfer>\n|       <svg feComposite>\n|       <svg feConvolveMatrix>\n|       <svg feDiffuseLighting>\n|       <svg feDisplacementMap>\n|       <svg feDistantLight>\n|       <svg feFlood>\n|       <svg feFuncA>\n|       <svg feFuncB>\n|       <svg feFuncG>\n|       <svg feFuncR>\n|       <svg feGaussianBlur>\n|       <svg feImage>\n|       <svg feMerge>\n|       <svg feMergeNode>\n|       <svg feMorphology>\n|       <svg feOffset>\n|       <svg fePointLight>\n|       <svg feSpecularLighting>\n|       <svg feSpotLight>\n|       <svg feTile>\n|       <svg feTurbulence>\n|       <svg foreignObject>\n|       <svg glyphRef>\n|       <svg linearGradient>\n|       <svg radialGradient>\n|       <svg textPath>\n"
2985         }, {
2986                 name: "tests11.dat #6",
2987                 html: "<!DOCTYPE html><body><svg><altglyph /><altglyphdef /><altglyphitem /><animatecolor /><animatemotion /><animatetransform /><clippath /><feblend /><fecolormatrix /><fecomponenttransfer /><fecomposite /><feconvolvematrix /><fediffuselighting /><fedisplacementmap /><fedistantlight /><feflood /><fefunca /><fefuncb /><fefuncg /><fefuncr /><fegaussianblur /><feimage /><femerge /><femergenode /><femorphology /><feoffset /><fepointlight /><fespecularlighting /><fespotlight /><fetile /><feturbulence /><foreignobject /><glyphref /><lineargradient /><radialgradient /><textpath /></svg>",
2988                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg altGlyph>\n|       <svg altGlyphDef>\n|       <svg altGlyphItem>\n|       <svg animateColor>\n|       <svg animateMotion>\n|       <svg animateTransform>\n|       <svg clipPath>\n|       <svg feBlend>\n|       <svg feColorMatrix>\n|       <svg feComponentTransfer>\n|       <svg feComposite>\n|       <svg feConvolveMatrix>\n|       <svg feDiffuseLighting>\n|       <svg feDisplacementMap>\n|       <svg feDistantLight>\n|       <svg feFlood>\n|       <svg feFuncA>\n|       <svg feFuncB>\n|       <svg feFuncG>\n|       <svg feFuncR>\n|       <svg feGaussianBlur>\n|       <svg feImage>\n|       <svg feMerge>\n|       <svg feMergeNode>\n|       <svg feMorphology>\n|       <svg feOffset>\n|       <svg fePointLight>\n|       <svg feSpecularLighting>\n|       <svg feSpotLight>\n|       <svg feTile>\n|       <svg feTurbulence>\n|       <svg foreignObject>\n|       <svg glyphRef>\n|       <svg linearGradient>\n|       <svg radialGradient>\n|       <svg textPath>\n"
2989         }, {
2990                 name: "tests11.dat #7",
2991                 html: "<!DOCTYPE html><BODY><SVG><ALTGLYPH /><ALTGLYPHDEF /><ALTGLYPHITEM /><ANIMATECOLOR /><ANIMATEMOTION /><ANIMATETRANSFORM /><CLIPPATH /><FEBLEND /><FECOLORMATRIX /><FECOMPONENTTRANSFER /><FECOMPOSITE /><FECONVOLVEMATRIX /><FEDIFFUSELIGHTING /><FEDISPLACEMENTMAP /><FEDISTANTLIGHT /><FEFLOOD /><FEFUNCA /><FEFUNCB /><FEFUNCG /><FEFUNCR /><FEGAUSSIANBLUR /><FEIMAGE /><FEMERGE /><FEMERGENODE /><FEMORPHOLOGY /><FEOFFSET /><FEPOINTLIGHT /><FESPECULARLIGHTING /><FESPOTLIGHT /><FETILE /><FETURBULENCE /><FOREIGNOBJECT /><GLYPHREF /><LINEARGRADIENT /><RADIALGRADIENT /><TEXTPATH /></SVG>",
2992                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg altGlyph>\n|       <svg altGlyphDef>\n|       <svg altGlyphItem>\n|       <svg animateColor>\n|       <svg animateMotion>\n|       <svg animateTransform>\n|       <svg clipPath>\n|       <svg feBlend>\n|       <svg feColorMatrix>\n|       <svg feComponentTransfer>\n|       <svg feComposite>\n|       <svg feConvolveMatrix>\n|       <svg feDiffuseLighting>\n|       <svg feDisplacementMap>\n|       <svg feDistantLight>\n|       <svg feFlood>\n|       <svg feFuncA>\n|       <svg feFuncB>\n|       <svg feFuncG>\n|       <svg feFuncR>\n|       <svg feGaussianBlur>\n|       <svg feImage>\n|       <svg feMerge>\n|       <svg feMergeNode>\n|       <svg feMorphology>\n|       <svg feOffset>\n|       <svg fePointLight>\n|       <svg feSpecularLighting>\n|       <svg feSpotLight>\n|       <svg feTile>\n|       <svg feTurbulence>\n|       <svg foreignObject>\n|       <svg glyphRef>\n|       <svg linearGradient>\n|       <svg radialGradient>\n|       <svg textPath>\n"
2993         }, {
2994                 name: "tests11.dat #8",
2995                 html: "<!DOCTYPE html><body><math><altGlyph /><altGlyphDef /><altGlyphItem /><animateColor /><animateMotion /><animateTransform /><clipPath /><feBlend /><feColorMatrix /><feComponentTransfer /><feComposite /><feConvolveMatrix /><feDiffuseLighting /><feDisplacementMap /><feDistantLight /><feFlood /><feFuncA /><feFuncB /><feFuncG /><feFuncR /><feGaussianBlur /><feImage /><feMerge /><feMergeNode /><feMorphology /><feOffset /><fePointLight /><feSpecularLighting /><feSpotLight /><feTile /><feTurbulence /><foreignObject /><glyphRef /><linearGradient /><radialGradient /><textPath /></math>",
2996                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math altglyph>\n|       <math altglyphdef>\n|       <math altglyphitem>\n|       <math animatecolor>\n|       <math animatemotion>\n|       <math animatetransform>\n|       <math clippath>\n|       <math feblend>\n|       <math fecolormatrix>\n|       <math fecomponenttransfer>\n|       <math fecomposite>\n|       <math feconvolvematrix>\n|       <math fediffuselighting>\n|       <math fedisplacementmap>\n|       <math fedistantlight>\n|       <math feflood>\n|       <math fefunca>\n|       <math fefuncb>\n|       <math fefuncg>\n|       <math fefuncr>\n|       <math fegaussianblur>\n|       <math feimage>\n|       <math femerge>\n|       <math femergenode>\n|       <math femorphology>\n|       <math feoffset>\n|       <math fepointlight>\n|       <math fespecularlighting>\n|       <math fespotlight>\n|       <math fetile>\n|       <math feturbulence>\n|       <math foreignobject>\n|       <math glyphref>\n|       <math lineargradient>\n|       <math radialgradient>\n|       <math textpath>\n"
2997         }, {
2998                 name: "tests11.dat #9",
2999                 html: "<!DOCTYPE html><body><svg><solidColor /></svg>",
3000                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg solidcolor>\n"
3001         }, {
3002                 name: "tests12.dat #1",
3003                 html: "<!DOCTYPE html><body><p>foo<math><mtext><i>baz</i></mtext><annotation-xml><svg><desc><b>eggs</b></desc><g><foreignObject><P>spam<TABLE><tr><td><img></td></table></foreignObject></g><g>quux</g></svg></annotation-xml></math>bar",
3004                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       \"foo\"\n|       <math math>\n|         <math mtext>\n|           <i>\n|             \"baz\"\n|         <math annotation-xml>\n|           <svg svg>\n|             <svg desc>\n|               <b>\n|                 \"eggs\"\n|             <svg g>\n|               <svg foreignObject>\n|                 <p>\n|                   \"spam\"\n|                 <table>\n|                   <tbody>\n|                     <tr>\n|                       <td>\n|                         <img>\n|             <svg g>\n|               \"quux\"\n|       \"bar\"\n"
3005         }, {
3006                 name: "tests12.dat #2",
3007                 html: "<!DOCTYPE html><body>foo<math><mtext><i>baz</i></mtext><annotation-xml><svg><desc><b>eggs</b></desc><g><foreignObject><P>spam<TABLE><tr><td><img></td></table></foreignObject></g><g>quux</g></svg></annotation-xml></math>bar",
3008                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"foo\"\n|     <math math>\n|       <math mtext>\n|         <i>\n|           \"baz\"\n|       <math annotation-xml>\n|         <svg svg>\n|           <svg desc>\n|             <b>\n|               \"eggs\"\n|           <svg g>\n|             <svg foreignObject>\n|               <p>\n|                 \"spam\"\n|               <table>\n|                 <tbody>\n|                   <tr>\n|                     <td>\n|                       <img>\n|           <svg g>\n|             \"quux\"\n|     \"bar\"\n"
3009         }, {
3010                 name: "tests14.dat #1",
3011                 html: "<!DOCTYPE html><html><body><xyz:abc></xyz:abc>",
3012                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <xyz:abc>\n"
3013         }, {
3014                 name: "tests14.dat #2",
3015                 html: "<!DOCTYPE html><html><body><xyz:abc></xyz:abc><span></span>",
3016                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <xyz:abc>\n|     <span>\n"
3017         }, {
3018                 name: "tests14.dat #3",
3019                 html: "<!DOCTYPE html><html><html abc:def=gh><xyz:abc></xyz:abc>",
3020                 errors: 1,
3021                 expected: "| <!DOCTYPE html>\n| <html>\n|   abc:def=\"gh\"\n|   <head>\n|   <body>\n|     <xyz:abc>\n"
3022         }, {
3023                 name: "tests14.dat #4",
3024                 html: "<!DOCTYPE html><html xml:lang=bar><html xml:lang=foo>",
3025                 errors: 1,
3026                 expected: "| <!DOCTYPE html>\n| <html>\n|   xml:lang=\"bar\"\n|   <head>\n|   <body>\n"
3027         }, {
3028                 name: "tests14.dat #5",
3029                 html: "<!DOCTYPE html><html 123=456>",
3030                 expected: "| <!DOCTYPE html>\n| <html>\n|   123=\"456\"\n|   <head>\n|   <body>\n"
3031         }, {
3032                 name: "tests14.dat #6",
3033                 html: "<!DOCTYPE html><html 123=456><html 789=012>",
3034                 errors: 1,
3035                 expected: "| <!DOCTYPE html>\n| <html>\n|   123=\"456\"\n|   789=\"012\"\n|   <head>\n|   <body>\n"
3036         }, {
3037                 name: "tests14.dat #7",
3038                 html: "<!DOCTYPE html><html><body 789=012>",
3039                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     789=\"012\"\n"
3040         }, {
3041                 name: "tests15.dat #1",
3042                 html: "<!DOCTYPE html><p><b><i><u></p> <p>X",
3043                 errors: 2,
3044                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <b>\n|         <i>\n|           <u>\n|     <b>\n|       <i>\n|         <u>\n|           \" \"\n|           <p>\n|             \"X\"\n"
3045         }, {
3046                 name: "tests15.dat #2",
3047                 html: "<p><b><i><u></p>\n<p>X",
3048                 errors: 3,
3049                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <b>\n|         <i>\n|           <u>\n|     <b>\n|       <i>\n|         <u>\n|           \"\n\"\n|           <p>\n|             \"X\"\n"
3050         }, {
3051                 name: "tests15.dat #3",
3052                 html: "<!doctype html></html> <head>",
3053                 errors: 2,
3054                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \" \"\n"
3055         }, {
3056                 name: "tests15.dat #4",
3057                 html: "<!doctype html></body><meta>",
3058                 errors: 1,
3059                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <meta>\n"
3060         }, {
3061                 name: "tests15.dat #5",
3062                 html: "<html></html><!-- foo -->",
3063                 errors: 1,
3064                 expected: "| <html>\n|   <head>\n|   <body>\n| <!--  foo  -->\n"
3065         }, {
3066                 name: "tests15.dat #6",
3067                 html: "<!doctype html></body><title>X</title>",
3068                 errors: 1,
3069                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <title>\n|       \"X\"\n"
3070         }, {
3071                 name: "tests15.dat #7",
3072                 html: "<!doctype html><table> X<meta></table>",
3073                 errors: 3,
3074                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \" X\"\n|     <meta>\n|     <table>\n"
3075         }, {
3076                 name: "tests15.dat #8",
3077                 html: "<!doctype html><table> x</table>",
3078                 errors: 2,
3079                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \" x\"\n|     <table>\n"
3080         }, {
3081                 name: "tests15.dat #9",
3082                 html: "<!doctype html><table> x </table>",
3083                 errors: 3,
3084                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \" x \"\n|     <table>\n"
3085         }, {
3086                 name: "tests15.dat #10",
3087                 html: "<!doctype html><table><tr> x</table>",
3088                 errors: 2,
3089                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \" x\"\n|     <table>\n|       <tbody>\n|         <tr>\n"
3090         }, {
3091                 name: "tests15.dat #11",
3092                 html: "<!doctype html><table>X<style> <tr>x </style> </table>",
3093                 errors: 1,
3094                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"X\"\n|     <table>\n|       <style>\n|         \" <tr>x \"\n|       \" \"\n"
3095         }, {
3096                 name: "tests15.dat #12",
3097                 html: "<!doctype html><div><table><a>foo</a> <tr><td>bar</td> </tr></table></div>",
3098                 errors: 5,
3099                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <a>\n|         \"foo\"\n|       <table>\n|         \" \"\n|         <tbody>\n|           <tr>\n|             <td>\n|               \"bar\"\n|             \" \"\n"
3100         }, {
3101                 name: "tests15.dat #13",
3102                 html: "<frame></frame></frame><frameset><frame><frameset><frame></frameset><noframes></frameset><noframes>",
3103                 errors: 7,
3104                 expected: "| <html>\n|   <head>\n|   <frameset>\n|     <frame>\n|     <frameset>\n|       <frame>\n|     <noframes>\n|       \"</frameset><noframes>\"\n"
3105         }, {
3106                 name: "tests15.dat #14",
3107                 html: "<!DOCTYPE html><object></html>",
3108                 errors: 2,
3109                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <object>\n"
3110         }, {
3111                 name: "tests16.dat #1",
3112                 html: "<!doctype html><script>",
3113                 errors: 1,
3114                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|   <body>\n"
3115         }, {
3116                 name: "tests16.dat #2",
3117                 html: "<!doctype html><script>a",
3118                 errors: 1,
3119                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"a\"\n|   <body>\n"
3120         }, {
3121                 name: "tests16.dat #3",
3122                 html: "<!doctype html><script><",
3123                 errors: 1,
3124                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<\"\n|   <body>\n"
3125         }, {
3126                 name: "tests16.dat #4",
3127                 html: "<!doctype html><script></",
3128                 errors: 1,
3129                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</\"\n|   <body>\n"
3130         }, {
3131                 name: "tests16.dat #5",
3132                 html: "<!doctype html><script></S",
3133                 errors: 1,
3134                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</S\"\n|   <body>\n"
3135         }, {
3136                 name: "tests16.dat #6",
3137                 html: "<!doctype html><script></SC",
3138                 errors: 1,
3139                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</SC\"\n|   <body>\n"
3140         }, {
3141                 name: "tests16.dat #7",
3142                 html: "<!doctype html><script></SCR",
3143                 errors: 1,
3144                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</SCR\"\n|   <body>\n"
3145         }, {
3146                 name: "tests16.dat #8",
3147                 html: "<!doctype html><script></SCRI",
3148                 errors: 1,
3149                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</SCRI\"\n|   <body>\n"
3150         }, {
3151                 name: "tests16.dat #9",
3152                 html: "<!doctype html><script></SCRIP",
3153                 errors: 1,
3154                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</SCRIP\"\n|   <body>\n"
3155         }, {
3156                 name: "tests16.dat #10",
3157                 html: "<!doctype html><script></SCRIPT",
3158                 errors: 1,
3159                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</SCRIPT\"\n|   <body>\n"
3160         }, {
3161                 name: "tests16.dat #11",
3162                 html: "<!doctype html><script></SCRIPT ",
3163                 errors: 2,
3164                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|   <body>\n"
3165         }, {
3166                 name: "tests16.dat #12",
3167                 html: "<!doctype html><script></s",
3168                 errors: 1,
3169                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</s\"\n|   <body>\n"
3170         }, {
3171                 name: "tests16.dat #13",
3172                 html: "<!doctype html><script></sc",
3173                 errors: 1,
3174                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</sc\"\n|   <body>\n"
3175         }, {
3176                 name: "tests16.dat #14",
3177                 html: "<!doctype html><script></scr",
3178                 errors: 1,
3179                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</scr\"\n|   <body>\n"
3180         }, {
3181                 name: "tests16.dat #15",
3182                 html: "<!doctype html><script></scri",
3183                 errors: 1,
3184                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</scri\"\n|   <body>\n"
3185         }, {
3186                 name: "tests16.dat #16",
3187                 html: "<!doctype html><script></scrip",
3188                 errors: 1,
3189                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</scrip\"\n|   <body>\n"
3190         }, {
3191                 name: "tests16.dat #17",
3192                 html: "<!doctype html><script></script",
3193                 errors: 1,
3194                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"</script\"\n|   <body>\n"
3195         }, {
3196                 name: "tests16.dat #18",
3197                 html: "<!doctype html><script></script ",
3198                 errors: 2,
3199                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|   <body>\n"
3200         }, {
3201                 name: "tests16.dat #19",
3202                 html: "<!doctype html><script><!",
3203                 errors: 1,
3204                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!\"\n|   <body>\n"
3205         }, {
3206                 name: "tests16.dat #20",
3207                 html: "<!doctype html><script><!a",
3208                 errors: 1,
3209                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!a\"\n|   <body>\n"
3210         }, {
3211                 name: "tests16.dat #21",
3212                 html: "<!doctype html><script><!-",
3213                 errors: 1,
3214                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!-\"\n|   <body>\n"
3215         }, {
3216                 name: "tests16.dat #22",
3217                 html: "<!doctype html><script><!-a",
3218                 errors: 1,
3219                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!-a\"\n|   <body>\n"
3220         }, {
3221                 name: "tests16.dat #23",
3222                 html: "<!doctype html><script><!--",
3223                 errors: 2,
3224                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--\"\n|   <body>\n"
3225         }, {
3226                 name: "tests16.dat #24",
3227                 html: "<!doctype html><script><!--a",
3228                 errors: 2,
3229                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--a\"\n|   <body>\n"
3230         }, {
3231                 name: "tests16.dat #25",
3232                 html: "<!doctype html><script><!--<",
3233                 errors: 2,
3234                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<\"\n|   <body>\n"
3235         }, {
3236                 name: "tests16.dat #26",
3237                 html: "<!doctype html><script><!--<a",
3238                 errors: 2,
3239                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<a\"\n|   <body>\n"
3240         }, {
3241                 name: "tests16.dat #27",
3242                 html: "<!doctype html><script><!--</",
3243                 errors: 2,
3244                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--</\"\n|   <body>\n"
3245         }, {
3246                 name: "tests16.dat #28",
3247                 html: "<!doctype html><script><!--</script",
3248                 errors: 2,
3249                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--</script\"\n|   <body>\n"
3250         }, {
3251                 name: "tests16.dat #29",
3252                 html: "<!doctype html><script><!--</script ",
3253                 errors: 2,
3254                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--\"\n|   <body>\n"
3255         }, {
3256                 name: "tests16.dat #30",
3257                 html: "<!doctype html><script><!--<s",
3258                 errors: 2,
3259                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<s\"\n|   <body>\n"
3260         }, {
3261                 name: "tests16.dat #31",
3262                 html: "<!doctype html><script><!--<script",
3263                 errors: 2,
3264                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script\"\n|   <body>\n"
3265         }, {
3266                 name: "tests16.dat #32",
3267                 html: "<!doctype html><script><!--<script ",
3268                 errors: 2,
3269                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script \"\n|   <body>\n"
3270         }, {
3271                 name: "tests16.dat #33",
3272                 html: "<!doctype html><script><!--<script <",
3273                 errors: 2,
3274                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script <\"\n|   <body>\n"
3275         }, {
3276                 name: "tests16.dat #34",
3277                 html: "<!doctype html><script><!--<script <a",
3278                 errors: 2,
3279                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script <a\"\n|   <body>\n"
3280         }, {
3281                 name: "tests16.dat #35",
3282                 html: "<!doctype html><script><!--<script </",
3283                 errors: 2,
3284                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </\"\n|   <body>\n"
3285         }, {
3286                 name: "tests16.dat #36",
3287                 html: "<!doctype html><script><!--<script </s",
3288                 errors: 2,
3289                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </s\"\n|   <body>\n"
3290         }, {
3291                 name: "tests16.dat #37",
3292                 html: "<!doctype html><script><!--<script </script",
3293                 errors: 2,
3294                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script\"\n|   <body>\n"
3295         }, {
3296                 name: "tests16.dat #38",
3297                 html: "<!doctype html><script><!--<script </scripta",
3298                 errors: 2,
3299                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </scripta\"\n|   <body>\n"
3300         }, {
3301                 name: "tests16.dat #39",
3302                 html: "<!doctype html><script><!--<script </script ",
3303                 errors: 2,
3304                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script \"\n|   <body>\n"
3305         }, {
3306                 name: "tests16.dat #40",
3307                 html: "<!doctype html><script><!--<script </script>",
3308                 errors: 2,
3309                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script>\"\n|   <body>\n"
3310         }, {
3311                 name: "tests16.dat #41",
3312                 html: "<!doctype html><script><!--<script </script/",
3313                 errors: 2,
3314                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script/\"\n|   <body>\n"
3315         }, {
3316                 name: "tests16.dat #42",
3317                 html: "<!doctype html><script><!--<script </script <",
3318                 errors: 2,
3319                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script <\"\n|   <body>\n"
3320         }, {
3321                 name: "tests16.dat #43",
3322                 html: "<!doctype html><script><!--<script </script <a",
3323                 errors: 2,
3324                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script <a\"\n|   <body>\n"
3325         }, {
3326                 name: "tests16.dat #44",
3327                 html: "<!doctype html><script><!--<script </script </",
3328                 errors: 2,
3329                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script </\"\n|   <body>\n"
3330         }, {
3331                 name: "tests16.dat #45",
3332                 html: "<!doctype html><script><!--<script </script </script",
3333                 errors: 2,
3334                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script </script\"\n|   <body>\n"
3335         }, {
3336                 name: "tests16.dat #46",
3337                 html: "<!doctype html><script><!--<script </script </script ",
3338                 errors: 2,
3339                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script \"\n|   <body>\n"
3340         }, {
3341                 name: "tests16.dat #47",
3342                 html: "<!doctype html><script><!--<script </script </script/",
3343                 errors: 2,
3344                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script \"\n|   <body>\n"
3345         }, {
3346                 name: "tests16.dat #48",
3347                 html: "<!doctype html><script><!--<script </script </script>",
3348                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script \"\n|   <body>\n"
3349         }, {
3350                 name: "tests16.dat #49",
3351                 html: "<!doctype html><script><!--<script -",
3352                 errors: 2,
3353                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -\"\n|   <body>\n"
3354         }, {
3355                 name: "tests16.dat #50",
3356                 html: "<!doctype html><script><!--<script -a",
3357                 errors: 2,
3358                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -a\"\n|   <body>\n"
3359         }, {
3360                 name: "tests16.dat #51",
3361                 html: "<!doctype html><script><!--<script -<",
3362                 errors: 2,
3363                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -<\"\n|   <body>\n"
3364         }, {
3365                 name: "tests16.dat #52",
3366                 html: "<!doctype html><script><!--<script --",
3367                 errors: 2,
3368                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script --\"\n|   <body>\n"
3369         }, {
3370                 name: "tests16.dat #53",
3371                 html: "<!doctype html><script><!--<script --a",
3372                 errors: 2,
3373                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script --a\"\n|   <body>\n"
3374         }, {
3375                 name: "tests16.dat #54",
3376                 html: "<!doctype html><script><!--<script --<",
3377                 errors: 2,
3378                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script --<\"\n|   <body>\n"
3379         }, {
3380                 name: "tests16.dat #55",
3381                 html: "<!doctype html><script><!--<script -->",
3382                 errors: 1,
3383                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -->\"\n|   <body>\n"
3384         }, {
3385                 name: "tests16.dat #56",
3386                 html: "<!doctype html><script><!--<script --><",
3387                 errors: 1,
3388                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script --><\"\n|   <body>\n"
3389         }, {
3390                 name: "tests16.dat #57",
3391                 html: "<!doctype html><script><!--<script --></",
3392                 errors: 1,
3393                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script --></\"\n|   <body>\n"
3394         }, {
3395                 name: "tests16.dat #58",
3396                 html: "<!doctype html><script><!--<script --></script",
3397                 errors: 1,
3398                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script --></script\"\n|   <body>\n"
3399         }, {
3400                 name: "tests16.dat #59",
3401                 html: "<!doctype html><script><!--<script --></script ",
3402                 errors: 2,
3403                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -->\"\n|   <body>\n"
3404         }, {
3405                 name: "tests16.dat #60",
3406                 html: "<!doctype html><script><!--<script --></script/",
3407                 errors: 2,
3408                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -->\"\n|   <body>\n"
3409         }, {
3410                 name: "tests16.dat #61",
3411                 html: "<!doctype html><script><!--<script --></script>",
3412                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -->\"\n|   <body>\n"
3413         }, {
3414                 name: "tests16.dat #62",
3415                 html: "<!doctype html><script><!--<script><\\/script>--></script>",
3416                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script><\\/script>-->\"\n|   <body>\n"
3417         }, {
3418                 name: "tests16.dat #63",
3419                 html: "<!doctype html><script><!--<script></scr'+'ipt>--></script>",
3420                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></scr'+'ipt>-->\"\n|   <body>\n"
3421         }, {
3422                 name: "tests16.dat #64",
3423                 html: "<!doctype html><script><!--<script></script><script></script></script>",
3424                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>\"\n|   <body>\n"
3425         }, {
3426                 name: "tests16.dat #65",
3427                 html: "<!doctype html><script><!--<script></script><script></script>--><!--</script>",
3428                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>--><!--\"\n|   <body>\n"
3429         }, {
3430                 name: "tests16.dat #66",
3431                 html: "<!doctype html><script><!--<script></script><script></script>-- ></script>",
3432                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>-- >\"\n|   <body>\n"
3433         }, {
3434                 name: "tests16.dat #67",
3435                 html: "<!doctype html><script><!--<script></script><script></script>- -></script>",
3436                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>- ->\"\n|   <body>\n"
3437         }, {
3438                 name: "tests16.dat #68",
3439                 html: "<!doctype html><script><!--<script></script><script></script>- - ></script>",
3440                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>- - >\"\n|   <body>\n"
3441         }, {
3442                 name: "tests16.dat #69",
3443                 html: "<!doctype html><script><!--<script></script><script></script>-></script>",
3444                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>->\"\n|   <body>\n"
3445         }, {
3446                 name: "tests16.dat #70",
3447                 html: "<!doctype html><script><!--<script>--!></script>X",
3448                 errors: 2,
3449                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script>--!></script>X\"\n|   <body>\n"
3450         }, {
3451                 name: "tests16.dat #71",
3452                 html: "<!doctype html><script><!--<scr'+'ipt></script>--></script>",
3453                 errors: 1,
3454                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<scr'+'ipt>\"\n|   <body>\n|     \"-->\"\n"
3455         }, {
3456                 name: "tests16.dat #72",
3457                 html: "<!doctype html><script><!--<script></scr'+'ipt></script>X",
3458                 errors: 2,
3459                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></scr'+'ipt></script>X\"\n|   <body>\n"
3460         }, {
3461                 name: "tests16.dat #73",
3462                 html: "<!doctype html><style><!--<style></style>--></style>",
3463                 errors: 1,
3464                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <style>\n|       \"<!--<style>\"\n|   <body>\n|     \"-->\"\n"
3465         }, {
3466                 name: "tests16.dat #74",
3467                 html: "<!doctype html><style><!--</style>X",
3468                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <style>\n|       \"<!--\"\n|   <body>\n|     \"X\"\n"
3469         }, {
3470                 name: "tests16.dat #75",
3471                 html: "<!doctype html><style><!--...</style>...--></style>",
3472                 errors: 1,
3473                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <style>\n|       \"<!--...\"\n|   <body>\n|     \"...-->\"\n"
3474         }, {
3475                 name: "tests16.dat #76",
3476                 html: "<!doctype html><style><!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style></style>X",
3477                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <style>\n|       \"<!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style>\"\n|   <body>\n|     \"X\"\n"
3478         }, {
3479                 name: "tests16.dat #77",
3480                 html: "<!doctype html><style><!--...<style><!--...--!></style>--></style>",
3481                 errors: 1,
3482                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <style>\n|       \"<!--...<style><!--...--!>\"\n|   <body>\n|     \"-->\"\n"
3483         }, {
3484                 name: "tests16.dat #78",
3485                 html: "<!doctype html><style><!--...</style><!-- --><style>@import ...</style>",
3486                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <style>\n|       \"<!--...\"\n|     <!--   -->\n|     <style>\n|       \"@import ...\"\n|   <body>\n"
3487         }, {
3488                 name: "tests16.dat #79",
3489                 html: "<!doctype html><style>...<style><!--...</style><!-- --></style>",
3490                 errors: 1,
3491                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <style>\n|       \"...<style><!--...\"\n|     <!--   -->\n|   <body>\n"
3492         }, {
3493                 name: "tests16.dat #80",
3494                 html: "<!doctype html><style>...<!--[if IE]><style>...</style>X",
3495                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <style>\n|       \"...<!--[if IE]><style>...\"\n|   <body>\n|     \"X\"\n"
3496         }, {
3497                 name: "tests16.dat #81",
3498                 html: "<!doctype html><title><!--<title></title>--></title>",
3499                 errors: 1,
3500                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <title>\n|       \"<!--<title>\"\n|   <body>\n|     \"-->\"\n"
3501         }, {
3502                 name: "tests16.dat #82",
3503                 html: "<!doctype html><title>&lt;/title></title>",
3504                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <title>\n|       \"</title>\"\n|   <body>\n"
3505         }, {
3506                 name: "tests16.dat #83",
3507                 html: "<!doctype html><title>foo/title><link></head><body>X",
3508                 errors: 1,
3509                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <title>\n|       \"foo/title><link></head><body>X\"\n|   <body>\n"
3510         }, {
3511                 name: "tests16.dat #84",
3512                 html: "<!doctype html><noscript><!--<noscript></noscript>--></noscript>",
3513                 scripting: true,
3514                 errors: 1,
3515                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <noscript>\n|       \"<!--<noscript>\"\n|   <body>\n|     \"-->\"\n"
3516         }, {
3517                 name: "tests16.dat #85",
3518                 html: "<!doctype html><noscript><!--<noscript></noscript>--></noscript>",
3519                 scripting: false,
3520                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <noscript>\n|       <!-- <noscript></noscript> -->\n|   <body>\n"
3521         }, {
3522                 name: "tests16.dat #86",
3523                 html: "<!doctype html><noscript><!--</noscript>X<noscript>--></noscript>",
3524                 scripting: true,
3525                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <noscript>\n|       \"<!--\"\n|   <body>\n|     \"X\"\n|     <noscript>\n|       \"-->\"\n"
3526         }, {
3527                 name: "tests16.dat #87",
3528                 html: "<!doctype html><noscript><!--</noscript>X<noscript>--></noscript>",
3529                 scripting: false,
3530                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <noscript>\n|       <!-- </noscript>X<noscript> -->\n|   <body>\n"
3531         }, {
3532                 name: "tests16.dat #88",
3533                 html: "<!doctype html><noscript><iframe></noscript>X",
3534                 scripting: true,
3535                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <noscript>\n|       \"<iframe>\"\n|   <body>\n|     \"X\"\n"
3536         }, {
3537                 name: "tests16.dat #89",
3538                 html: "<!doctype html><noscript><iframe></noscript>X",
3539                 scripting: false,
3540                 errors: 2,
3541                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <noscript>\n|   <body>\n|     <iframe>\n|       \"</noscript>X\"\n"
3542         }, {
3543                 name: "tests16.dat #90",
3544                 html: "<!doctype html><noframes><!--<noframes></noframes>--></noframes>",
3545                 errors: 1,
3546                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <noframes>\n|       \"<!--<noframes>\"\n|   <body>\n|     \"-->\"\n"
3547         }, {
3548                 name: "tests16.dat #91",
3549                 html: "<!doctype html><noframes><body><script><!--...</script></body></noframes></html>",
3550                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <noframes>\n|       \"<body><script><!--...</script></body>\"\n|   <body>\n"
3551         }, {
3552                 name: "tests16.dat #92",
3553                 html: "<!doctype html><textarea><!--<textarea></textarea>--></textarea>",
3554                 errors: 1,
3555                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"<!--<textarea>\"\n|     \"-->\"\n"
3556         }, {
3557                 name: "tests16.dat #93",
3558                 html: "<!doctype html><textarea>&lt;/textarea></textarea>",
3559                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"</textarea>\"\n"
3560         }, {
3561                 name: "tests16.dat #94",
3562                 html: "<!doctype html><textarea>&lt;</textarea>",
3563                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"<\"\n"
3564         }, {
3565                 name: "tests16.dat #95",
3566                 html: "<!doctype html><textarea>a&lt;b</textarea>",
3567                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"a<b\"\n"
3568         }, {
3569                 name: "tests16.dat #96",
3570                 html: "<!doctype html><iframe><!--<iframe></iframe>--></iframe>",
3571                 errors: 1,
3572                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <iframe>\n|       \"<!--<iframe>\"\n|     \"-->\"\n"
3573         }, {
3574                 name: "tests16.dat #97",
3575                 html: "<!doctype html><iframe>...<!--X->...<!--/X->...</iframe>",
3576                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <iframe>\n|       \"...<!--X->...<!--/X->...\"\n"
3577         }, {
3578                 name: "tests16.dat #98",
3579                 html: "<!doctype html><xmp><!--<xmp></xmp>--></xmp>",
3580                 errors: 1,
3581                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <xmp>\n|       \"<!--<xmp>\"\n|     \"-->\"\n"
3582         }, {
3583                 name: "tests16.dat #99",
3584                 html: "<!doctype html><noembed><!--<noembed></noembed>--></noembed>",
3585                 errors: 1,
3586                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <noembed>\n|       \"<!--<noembed>\"\n|     \"-->\"\n"
3587         }, {
3588                 name: "tests16.dat #100",
3589                 html: "<script>",
3590                 errors: 2,
3591                 expected: "| <html>\n|   <head>\n|     <script>\n|   <body>\n"
3592         }, {
3593                 name: "tests16.dat #101",
3594                 html: "<script>a",
3595                 errors: 2,
3596                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"a\"\n|   <body>\n"
3597         }, {
3598                 name: "tests16.dat #102",
3599                 html: "<script><",
3600                 errors: 2,
3601                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<\"\n|   <body>\n"
3602         }, {
3603                 name: "tests16.dat #103",
3604                 html: "<script></",
3605                 errors: 2,
3606                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"</\"\n|   <body>\n"
3607         }, {
3608                 name: "tests16.dat #104",
3609                 html: "<script></S",
3610                 errors: 2,
3611                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"</S\"\n|   <body>\n"
3612         }, {
3613                 name: "tests16.dat #105",
3614                 html: "<script></SC",
3615                 errors: 2,
3616                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"</SC\"\n|   <body>\n"
3617         }, {
3618                 name: "tests16.dat #106",
3619                 html: "<script></SCR",
3620                 errors: 2,
3621                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"</SCR\"\n|   <body>\n"
3622         }, {
3623                 name: "tests16.dat #107",
3624                 html: "<script></SCRI",
3625                 errors: 2,
3626                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"</SCRI\"\n|   <body>\n"
3627         }, {
3628                 name: "tests16.dat #108",
3629                 html: "<script></SCRIP",
3630                 errors: 2,
3631                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"</SCRIP\"\n|   <body>\n"
3632         }, {
3633                 name: "tests16.dat #109",
3634                 html: "<script></SCRIPT",
3635                 errors: 2,
3636                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"</SCRIPT\"\n|   <body>\n"
3637         }, {
3638                 name: "tests16.dat #110",
3639                 html: "<script></SCRIPT ",
3640                 errors: 3,
3641                 expected: "| <html>\n|   <head>\n|     <script>\n|   <body>\n"
3642         }, {
3643                 name: "tests16.dat #111",
3644                 html: "<script></s",
3645                 errors: 2,
3646                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"</s\"\n|   <body>\n"
3647         }, {
3648                 name: "tests16.dat #112",
3649                 html: "<script></sc",
3650                 errors: 2,
3651                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"</sc\"\n|   <body>\n"
3652         }, {
3653                 name: "tests16.dat #113",
3654                 html: "<script></scr",
3655                 errors: 2,
3656                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"</scr\"\n|   <body>\n"
3657         }, {
3658                 name: "tests16.dat #114",
3659                 html: "<script></scri",
3660                 errors: 2,
3661                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"</scri\"\n|   <body>\n"
3662         }, {
3663                 name: "tests16.dat #115",
3664                 html: "<script></scrip",
3665                 errors: 2,
3666                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"</scrip\"\n|   <body>\n"
3667         }, {
3668                 name: "tests16.dat #116",
3669                 html: "<script></script",
3670                 errors: 2,
3671                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"</script\"\n|   <body>\n"
3672         }, {
3673                 name: "tests16.dat #117",
3674                 html: "<script></script ",
3675                 errors: 3,
3676                 expected: "| <html>\n|   <head>\n|     <script>\n|   <body>\n"
3677         }, {
3678                 name: "tests16.dat #118",
3679                 html: "<script><!",
3680                 errors: 2,
3681                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!\"\n|   <body>\n"
3682         }, {
3683                 name: "tests16.dat #119",
3684                 html: "<script><!a",
3685                 errors: 2,
3686                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!a\"\n|   <body>\n"
3687         }, {
3688                 name: "tests16.dat #120",
3689                 html: "<script><!-",
3690                 errors: 2,
3691                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!-\"\n|   <body>\n"
3692         }, {
3693                 name: "tests16.dat #121",
3694                 html: "<script><!-a",
3695                 errors: 2,
3696                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!-a\"\n|   <body>\n"
3697         }, {
3698                 name: "tests16.dat #122",
3699                 html: "<script><!--",
3700                 errors: 3,
3701                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--\"\n|   <body>\n"
3702         }, {
3703                 name: "tests16.dat #123",
3704                 html: "<script><!--a",
3705                 errors: 3,
3706                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--a\"\n|   <body>\n"
3707         }, {
3708                 name: "tests16.dat #124",
3709                 html: "<script><!--<",
3710                 errors: 3,
3711                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<\"\n|   <body>\n"
3712         }, {
3713                 name: "tests16.dat #125",
3714                 html: "<script><!--<a",
3715                 errors: 3,
3716                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<a\"\n|   <body>\n"
3717         }, {
3718                 name: "tests16.dat #126",
3719                 html: "<script><!--</",
3720                 errors: 3,
3721                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--</\"\n|   <body>\n"
3722         }, {
3723                 name: "tests16.dat #127",
3724                 html: "<script><!--</script",
3725                 errors: 3,
3726                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--</script\"\n|   <body>\n"
3727         }, {
3728                 name: "tests16.dat #128",
3729                 html: "<script><!--</script ",
3730                 errors: 3,
3731                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--\"\n|   <body>\n"
3732         }, {
3733                 name: "tests16.dat #129",
3734                 html: "<script><!--<s",
3735                 errors: 3,
3736                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<s\"\n|   <body>\n"
3737         }, {
3738                 name: "tests16.dat #130",
3739                 html: "<script><!--<script",
3740                 errors: 3,
3741                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script\"\n|   <body>\n"
3742         }, {
3743                 name: "tests16.dat #131",
3744                 html: "<script><!--<script ",
3745                 errors: 3,
3746                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script \"\n|   <body>\n"
3747         }, {
3748                 name: "tests16.dat #132",
3749                 html: "<script><!--<script <",
3750                 errors: 3,
3751                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script <\"\n|   <body>\n"
3752         }, {
3753                 name: "tests16.dat #133",
3754                 html: "<script><!--<script <a",
3755                 errors: 3,
3756                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script <a\"\n|   <body>\n"
3757         }, {
3758                 name: "tests16.dat #134",
3759                 html: "<script><!--<script </",
3760                 errors: 3,
3761                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </\"\n|   <body>\n"
3762         }, {
3763                 name: "tests16.dat #135",
3764                 html: "<script><!--<script </s",
3765                 errors: 3,
3766                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </s\"\n|   <body>\n"
3767         }, {
3768                 name: "tests16.dat #136",
3769                 html: "<script><!--<script </script",
3770                 errors: 3,
3771                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script\"\n|   <body>\n"
3772         }, {
3773                 name: "tests16.dat #137",
3774                 html: "<script><!--<script </scripta",
3775                 errors: 3,
3776                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </scripta\"\n|   <body>\n"
3777         }, {
3778                 name: "tests16.dat #138",
3779                 html: "<script><!--<script </script ",
3780                 errors: 3,
3781                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script \"\n|   <body>\n"
3782         }, {
3783                 name: "tests16.dat #139",
3784                 html: "<script><!--<script </script>",
3785                 errors: 3,
3786                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script>\"\n|   <body>\n"
3787         }, {
3788                 name: "tests16.dat #140",
3789                 html: "<script><!--<script </script/",
3790                 errors: 3,
3791                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script/\"\n|   <body>\n"
3792         }, {
3793                 name: "tests16.dat #141",
3794                 html: "<script><!--<script </script <",
3795                 errors: 3,
3796                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script <\"\n|   <body>\n"
3797         }, {
3798                 name: "tests16.dat #142",
3799                 html: "<script><!--<script </script <a",
3800                 errors: 3,
3801                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script <a\"\n|   <body>\n"
3802         }, {
3803                 name: "tests16.dat #143",
3804                 html: "<script><!--<script </script </",
3805                 errors: 3,
3806                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script </\"\n|   <body>\n"
3807         }, {
3808                 name: "tests16.dat #144",
3809                 html: "<script><!--<script </script </script",
3810                 errors: 3,
3811                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script </script\"\n|   <body>\n"
3812         }, {
3813                 name: "tests16.dat #145",
3814                 html: "<script><!--<script </script </script ",
3815                 errors: 3,
3816                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script \"\n|   <body>\n"
3817         }, {
3818                 name: "tests16.dat #146",
3819                 html: "<script><!--<script </script </script/",
3820                 errors: 3,
3821                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script \"\n|   <body>\n"
3822         }, {
3823                 name: "tests16.dat #147",
3824                 html: "<script><!--<script </script </script>",
3825                 errors: 1,
3826                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script </script \"\n|   <body>\n"
3827         }, {
3828                 name: "tests16.dat #148",
3829                 html: "<script><!--<script -",
3830                 errors: 3,
3831                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -\"\n|   <body>\n"
3832         }, {
3833                 name: "tests16.dat #149",
3834                 html: "<script><!--<script -a",
3835                 errors: 3,
3836                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -a\"\n|   <body>\n"
3837         }, {
3838                 name: "tests16.dat #150",
3839                 html: "<script><!--<script --",
3840                 errors: 3,
3841                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script --\"\n|   <body>\n"
3842         }, {
3843                 name: "tests16.dat #151",
3844                 html: "<script><!--<script --a",
3845                 errors: 3,
3846                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script --a\"\n|   <body>\n"
3847         }, {
3848                 name: "tests16.dat #152",
3849                 html: "<script><!--<script -->",
3850                 errors: 2,
3851                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -->\"\n|   <body>\n"
3852         }, {
3853                 name: "tests16.dat #153",
3854                 html: "<script><!--<script --><",
3855                 errors: 2,
3856                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script --><\"\n|   <body>\n"
3857         }, {
3858                 name: "tests16.dat #154",
3859                 html: "<script><!--<script --></",
3860                 errors: 2,
3861                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script --></\"\n|   <body>\n"
3862         }, {
3863                 name: "tests16.dat #155",
3864                 html: "<script><!--<script --></script",
3865                 errors: 2,
3866                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script --></script\"\n|   <body>\n"
3867         }, {
3868                 name: "tests16.dat #156",
3869                 html: "<script><!--<script --></script ",
3870                 errors: 3,
3871                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -->\"\n|   <body>\n"
3872         }, {
3873                 name: "tests16.dat #157",
3874                 html: "<script><!--<script --></script/",
3875                 errors: 3,
3876                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -->\"\n|   <body>\n"
3877         }, {
3878                 name: "tests16.dat #158",
3879                 html: "<script><!--<script --></script>",
3880                 errors: 1,
3881                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script -->\"\n|   <body>\n"
3882         }, {
3883                 name: "tests16.dat #159",
3884                 html: "<script><!--<script><\\/script>--></script>",
3885                 errors: 1,
3886                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script><\\/script>-->\"\n|   <body>\n"
3887         }, {
3888                 name: "tests16.dat #160",
3889                 html: "<script><!--<script></scr'+'ipt>--></script>",
3890                 errors: 1,
3891                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></scr'+'ipt>-->\"\n|   <body>\n"
3892         }, {
3893                 name: "tests16.dat #161",
3894                 html: "<script><!--<script></script><script></script></script>",
3895                 errors: 1,
3896                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>\"\n|   <body>\n"
3897         }, {
3898                 name: "tests16.dat #162",
3899                 html: "<script><!--<script></script><script></script>--><!--</script>",
3900                 errors: 1,
3901                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>--><!--\"\n|   <body>\n"
3902         }, {
3903                 name: "tests16.dat #163",
3904                 html: "<script><!--<script></script><script></script>-- ></script>",
3905                 errors: 1,
3906                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>-- >\"\n|   <body>\n"
3907         }, {
3908                 name: "tests16.dat #164",
3909                 html: "<script><!--<script></script><script></script>- -></script>",
3910                 errors: 1,
3911                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>- ->\"\n|   <body>\n"
3912         }, {
3913                 name: "tests16.dat #165",
3914                 html: "<script><!--<script></script><script></script>- - ></script>",
3915                 errors: 1,
3916                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>- - >\"\n|   <body>\n"
3917         }, {
3918                 name: "tests16.dat #166",
3919                 html: "<script><!--<script></script><script></script>-></script>",
3920                 errors: 1,
3921                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></script><script></script>->\"\n|   <body>\n"
3922         }, {
3923                 name: "tests16.dat #167",
3924                 html: "<script><!--<script>--!></script>X",
3925                 errors: 3,
3926                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script>--!></script>X\"\n|   <body>\n"
3927         }, {
3928                 name: "tests16.dat #168",
3929                 html: "<script><!--<scr'+'ipt></script>--></script>",
3930                 errors: 2,
3931                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<scr'+'ipt>\"\n|   <body>\n|     \"-->\"\n"
3932         }, {
3933                 name: "tests16.dat #169",
3934                 html: "<script><!--<script></scr'+'ipt></script>X",
3935                 errors: 3,
3936                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<!--<script></scr'+'ipt></script>X\"\n|   <body>\n"
3937         }, {
3938                 name: "tests16.dat #170",
3939                 html: "<style><!--<style></style>--></style>",
3940                 errors: 2,
3941                 expected: "| <html>\n|   <head>\n|     <style>\n|       \"<!--<style>\"\n|   <body>\n|     \"-->\"\n"
3942         }, {
3943                 name: "tests16.dat #171",
3944                 html: "<style><!--</style>X",
3945                 errors: 1,
3946                 expected: "| <html>\n|   <head>\n|     <style>\n|       \"<!--\"\n|   <body>\n|     \"X\"\n"
3947         }, {
3948                 name: "tests16.dat #172",
3949                 html: "<style><!--...</style>...--></style>",
3950                 errors: 2,
3951                 expected: "| <html>\n|   <head>\n|     <style>\n|       \"<!--...\"\n|   <body>\n|     \"...-->\"\n"
3952         }, {
3953                 name: "tests16.dat #173",
3954                 html: "<style><!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style></style>X",
3955                 errors: 1,
3956                 expected: "| <html>\n|   <head>\n|     <style>\n|       \"<!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style>\"\n|   <body>\n|     \"X\"\n"
3957         }, {
3958                 name: "tests16.dat #174",
3959                 html: "<style><!--...<style><!--...--!></style>--></style>",
3960                 errors: 2,
3961                 expected: "| <html>\n|   <head>\n|     <style>\n|       \"<!--...<style><!--...--!>\"\n|   <body>\n|     \"-->\"\n"
3962         }, {
3963                 name: "tests16.dat #175",
3964                 html: "<style><!--...</style><!-- --><style>@import ...</style>",
3965                 errors: 1,
3966                 expected: "| <html>\n|   <head>\n|     <style>\n|       \"<!--...\"\n|     <!--   -->\n|     <style>\n|       \"@import ...\"\n|   <body>\n"
3967         }, {
3968                 name: "tests16.dat #176",
3969                 html: "<style>...<style><!--...</style><!-- --></style>",
3970                 errors: 2,
3971                 expected: "| <html>\n|   <head>\n|     <style>\n|       \"...<style><!--...\"\n|     <!--   -->\n|   <body>\n"
3972         }, {
3973                 name: "tests16.dat #177",
3974                 html: "<style>...<!--[if IE]><style>...</style>X",
3975                 errors: 1,
3976                 expected: "| <html>\n|   <head>\n|     <style>\n|       \"...<!--[if IE]><style>...\"\n|   <body>\n|     \"X\"\n"
3977         }, {
3978                 name: "tests16.dat #178",
3979                 html: "<title><!--<title></title>--></title>",
3980                 errors: 2,
3981                 expected: "| <html>\n|   <head>\n|     <title>\n|       \"<!--<title>\"\n|   <body>\n|     \"-->\"\n"
3982         }, {
3983                 name: "tests16.dat #179",
3984                 html: "<title>&lt;/title></title>",
3985                 errors: 1,
3986                 expected: "| <html>\n|   <head>\n|     <title>\n|       \"</title>\"\n|   <body>\n"
3987         }, {
3988                 name: "tests16.dat #180",
3989                 html: "<title>foo/title><link></head><body>X",
3990                 errors: 2,
3991                 expected: "| <html>\n|   <head>\n|     <title>\n|       \"foo/title><link></head><body>X\"\n|   <body>\n"
3992         }, {
3993                 name: "tests16.dat #181",
3994                 html: "<noscript><!--<noscript></noscript>--></noscript>",
3995                 scripting: true,
3996                 errors: 2,
3997                 expected: "| <html>\n|   <head>\n|     <noscript>\n|       \"<!--<noscript>\"\n|   <body>\n|     \"-->\"\n"
3998         }, {
3999                 name: "tests16.dat #182",
4000                 html: "<noscript><!--<noscript></noscript>--></noscript>",
4001                 scripting: false,
4002                 errors: 1,
4003                 expected: "| <html>\n|   <head>\n|     <noscript>\n|       <!-- <noscript></noscript> -->\n|   <body>\n"
4004         }, {
4005                 name: "tests16.dat #183",
4006                 html: "<noscript><!--</noscript>X<noscript>--></noscript>",
4007                 scripting: true,
4008                 errors: 1,
4009                 expected: "| <html>\n|   <head>\n|     <noscript>\n|       \"<!--\"\n|   <body>\n|     \"X\"\n|     <noscript>\n|       \"-->\"\n"
4010         }, {
4011                 name: "tests16.dat #184",
4012                 html: "<noscript><!--</noscript>X<noscript>--></noscript>",
4013                 scripting: false,
4014                 errors: 1,
4015                 expected: "| <html>\n|   <head>\n|     <noscript>\n|       <!-- </noscript>X<noscript> -->\n|   <body>\n"
4016         }, {
4017                 name: "tests16.dat #185",
4018                 html: "<noscript><iframe></noscript>X",
4019                 scripting: true,
4020                 errors: 1,
4021                 expected: "| <html>\n|   <head>\n|     <noscript>\n|       \"<iframe>\"\n|   <body>\n|     \"X\"\n"
4022         }, {
4023                 name: "tests16.dat #186",
4024                 html: "<noscript><iframe></noscript>X",
4025                 scripting: false,
4026                 errors: 3,
4027                 expected: "| <html>\n|   <head>\n|     <noscript>\n|   <body>\n|     <iframe>\n|       \"</noscript>X\"\n"
4028         }, {
4029                 name: "tests16.dat #187",
4030                 html: "<noframes><!--<noframes></noframes>--></noframes>",
4031                 errors: 2,
4032                 expected: "| <html>\n|   <head>\n|     <noframes>\n|       \"<!--<noframes>\"\n|   <body>\n|     \"-->\"\n"
4033         }, {
4034                 name: "tests16.dat #188",
4035                 html: "<noframes><body><script><!--...</script></body></noframes></html>",
4036                 errors: 1,
4037                 expected: "| <html>\n|   <head>\n|     <noframes>\n|       \"<body><script><!--...</script></body>\"\n|   <body>\n"
4038         }, {
4039                 name: "tests16.dat #189",
4040                 html: "<textarea><!--<textarea></textarea>--></textarea>",
4041                 errors: 2,
4042                 expected: "| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"<!--<textarea>\"\n|     \"-->\"\n"
4043         }, {
4044                 name: "tests16.dat #190",
4045                 html: "<textarea>&lt;/textarea></textarea>",
4046                 errors: 1,
4047                 expected: "| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"</textarea>\"\n"
4048         }, {
4049                 name: "tests16.dat #191",
4050                 html: "<iframe><!--<iframe></iframe>--></iframe>",
4051                 errors: 2,
4052                 expected: "| <html>\n|   <head>\n|   <body>\n|     <iframe>\n|       \"<!--<iframe>\"\n|     \"-->\"\n"
4053         }, {
4054                 name: "tests16.dat #192",
4055                 html: "<iframe>...<!--X->...<!--/X->...</iframe>",
4056                 errors: 1,
4057                 expected: "| <html>\n|   <head>\n|   <body>\n|     <iframe>\n|       \"...<!--X->...<!--/X->...\"\n"
4058         }, {
4059                 name: "tests16.dat #193",
4060                 html: "<xmp><!--<xmp></xmp>--></xmp>",
4061                 errors: 2,
4062                 expected: "| <html>\n|   <head>\n|   <body>\n|     <xmp>\n|       \"<!--<xmp>\"\n|     \"-->\"\n"
4063         }, {
4064                 name: "tests16.dat #194",
4065                 html: "<noembed><!--<noembed></noembed>--></noembed>",
4066                 errors: 2,
4067                 expected: "| <html>\n|   <head>\n|   <body>\n|     <noembed>\n|       \"<!--<noembed>\"\n|     \"-->\"\n"
4068         }, {
4069                 name: "tests16.dat #195",
4070                 html: "<!doctype html><table>\n",
4071                 errors: 1,
4072                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       \"\n\"\n"
4073         }, {
4074                 name: "tests16.dat #196",
4075                 html: "<!doctype html><table><td><span><font></span><span>",
4076                 errors: 3,
4077                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <span>\n|               <font>\n|             <font>\n|               <span>\n"
4078         }, {
4079                 name: "tests16.dat #197",
4080                 html: "<!doctype html><form><table></form><form></table></form>",
4081                 errors: 5,
4082                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <form>\n|       <table>\n|         <form>\n"
4083         }, {
4084                 name: "tests17.dat #1",
4085                 html: "<!doctype html><table><tbody><select><tr>",
4086                 errors: 3,
4087                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|     <table>\n|       <tbody>\n|         <tr>\n"
4088         }, {
4089                 name: "tests17.dat #2",
4090                 html: "<!doctype html><table><tr><select><td>",
4091                 errors: 3,
4092                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n"
4093         }, {
4094                 name: "tests17.dat #3",
4095                 html: "<!doctype html><table><tr><td><select><td>",
4096                 errors: 2,
4097                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <select>\n|           <td>\n"
4098         }, {
4099                 name: "tests17.dat #4",
4100                 html: "<!doctype html><table><tr><th><select><td>",
4101                 errors: 2,
4102                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <th>\n|             <select>\n|           <td>\n"
4103         }, {
4104                 name: "tests17.dat #5",
4105                 html: "<!doctype html><table><caption><select><tr>",
4106                 errors: 2,
4107                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <select>\n|       <tbody>\n|         <tr>\n"
4108         }, {
4109                 name: "tests17.dat #6",
4110                 html: "<!doctype html><select><tr>",
4111                 errors: 2,
4112                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n"
4113         }, {
4114                 name: "tests17.dat #7",
4115                 html: "<!doctype html><select><td>",
4116                 errors: 2,
4117                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n"
4118         }, {
4119                 name: "tests17.dat #8",
4120                 html: "<!doctype html><select><th>",
4121                 errors: 2,
4122                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n"
4123         }, {
4124                 name: "tests17.dat #9",
4125                 html: "<!doctype html><select><tbody>",
4126                 errors: 2,
4127                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n"
4128         }, {
4129                 name: "tests17.dat #10",
4130                 html: "<!doctype html><select><thead>",
4131                 errors: 2,
4132                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n"
4133         }, {
4134                 name: "tests17.dat #11",
4135                 html: "<!doctype html><select><tfoot>",
4136                 errors: 2,
4137                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n"
4138         }, {
4139                 name: "tests17.dat #12",
4140                 html: "<!doctype html><select><caption>",
4141                 errors: 2,
4142                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n"
4143         }, {
4144                 name: "tests17.dat #13",
4145                 html: "<!doctype html><table><tr></table>a",
4146                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|     \"a\"\n"
4147         }, {
4148                 name: "tests18.dat #1",
4149                 html: "<!doctype html><plaintext></plaintext>",
4150                 errors: 1,
4151                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <plaintext>\n|       \"</plaintext>\"\n"
4152         }, {
4153                 name: "tests18.dat #2",
4154                 html: "<!doctype html><table><plaintext></plaintext>",
4155                 errors: 14,
4156                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <plaintext>\n|       \"</plaintext>\"\n|     <table>\n"
4157         }, {
4158                 name: "tests18.dat #3",
4159                 html: "<!doctype html><table><tbody><plaintext></plaintext>",
4160                 errors: 14,
4161                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <plaintext>\n|       \"</plaintext>\"\n|     <table>\n|       <tbody>\n"
4162         }, {
4163                 name: "tests18.dat #4",
4164                 html: "<!doctype html><table><tbody><tr><plaintext></plaintext>",
4165                 errors: 14,
4166                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <plaintext>\n|       \"</plaintext>\"\n|     <table>\n|       <tbody>\n|         <tr>\n"
4167         }, {
4168                 name: "tests18.dat #5",
4169                 html: "<!doctype html><table><td><plaintext></plaintext>",
4170                 errors: 2,
4171                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <plaintext>\n|               \"</plaintext>\"\n"
4172         }, {
4173                 name: "tests18.dat #6",
4174                 html: "<!doctype html><table><caption><plaintext></plaintext>",
4175                 errors: 1,
4176                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <plaintext>\n|           \"</plaintext>\"\n"
4177         }, {
4178                 name: "tests18.dat #7",
4179                 html: "<!doctype html><table><tr><style></script></style>abc",
4180                 errors: 4,
4181                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"abc\"\n|     <table>\n|       <tbody>\n|         <tr>\n|           <style>\n|             \"</script>\"\n"
4182         }, {
4183                 name: "tests18.dat #8",
4184                 html: "<!doctype html><table><tr><script></style></script>abc",
4185                 errors: 4,
4186                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"abc\"\n|     <table>\n|       <tbody>\n|         <tr>\n|           <script>\n|             \"</style>\"\n"
4187         }, {
4188                 name: "tests18.dat #9",
4189                 html: "<!doctype html><table><caption><style></script></style>abc",
4190                 errors: 1,
4191                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <style>\n|           \"</script>\"\n|         \"abc\"\n"
4192         }, {
4193                 name: "tests18.dat #10",
4194                 html: "<!doctype html><table><td><style></script></style>abc",
4195                 errors: 2,
4196                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <style>\n|               \"</script>\"\n|             \"abc\"\n"
4197         }, {
4198                 name: "tests18.dat #11",
4199                 html: "<!doctype html><select><script></style></script>abc",
4200                 errors: 1,
4201                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <script>\n|         \"</style>\"\n|       \"abc\"\n"
4202         }, {
4203                 name: "tests18.dat #12",
4204                 html: "<!doctype html><table><select><script></style></script>abc",
4205                 errors: 2,
4206                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <script>\n|         \"</style>\"\n|       \"abc\"\n|     <table>\n"
4207         }, {
4208                 name: "tests18.dat #13",
4209                 html: "<!doctype html><table><tr><select><script></style></script>abc",
4210                 errors: 2,
4211                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <script>\n|         \"</style>\"\n|       \"abc\"\n|     <table>\n|       <tbody>\n|         <tr>\n"
4212         }, {
4213                 name: "tests18.dat #14",
4214                 html: "<!doctype html><frameset></frameset><noframes>abc",
4215                 errors: 1,
4216                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|   <noframes>\n|     \"abc\"\n"
4217         }, {
4218                 name: "tests18.dat #15",
4219                 html: "<!doctype html><frameset></frameset><noframes>abc</noframes><!--abc-->",
4220                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|   <noframes>\n|     \"abc\"\n|   <!-- abc -->\n"
4221         }, {
4222                 name: "tests18.dat #16",
4223                 html: "<!doctype html><frameset></frameset></html><noframes>abc",
4224                 errors: 1,
4225                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|   <noframes>\n|     \"abc\"\n"
4226         }, {
4227                 name: "tests18.dat #17",
4228                 html: "<!doctype html><frameset></frameset></html><noframes>abc</noframes><!--abc-->",
4229                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|   <noframes>\n|     \"abc\"\n| <!-- abc -->\n"
4230         }, {
4231                 name: "tests18.dat #18",
4232                 html: "<!doctype html><table><tr></tbody><tfoot>",
4233                 errors: 1,
4234                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|       <tfoot>\n"
4235         }, {
4236                 name: "tests18.dat #19",
4237                 html: "<!doctype html><table><td><svg></svg>abc<td>",
4238                 errors: 2,
4239                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <svg svg>\n|             \"abc\"\n|           <td>\n"
4240         }, {
4241                 name: "tests19.dat #1",
4242                 html: "<!doctype html><math><mn DefinitionUrl=\"foo\">",
4243                 errors: 1,
4244                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mn>\n|         definitionURL=\"foo\"\n"
4245         }, {
4246                 name: "tests19.dat #2",
4247                 html: "<!doctype html><html></p><!--foo-->",
4248                 errors: 1,
4249                 expected: "| <!DOCTYPE html>\n| <html>\n|   <!-- foo -->\n|   <head>\n|   <body>\n"
4250         }, {
4251                 name: "tests19.dat #3",
4252                 html: "<!doctype html><head></head></p><!--foo-->",
4253                 errors: 1,
4254                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <!-- foo -->\n|   <body>\n"
4255         }, {
4256                 name: "tests19.dat #4",
4257                 html: "<!doctype html><body><p><pre>",
4258                 errors: 1,
4259                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <pre>\n"
4260         }, {
4261                 name: "tests19.dat #5",
4262                 html: "<!doctype html><body><p><listing>",
4263                 errors: 1,
4264                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <listing>\n"
4265         }, {
4266                 name: "tests19.dat #6",
4267                 html: "<!doctype html><p><plaintext>",
4268                 errors: 1,
4269                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <plaintext>\n"
4270         }, {
4271                 name: "tests19.dat #7",
4272                 html: "<!doctype html><p><h1>",
4273                 errors: 1,
4274                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <h1>\n"
4275         }, {
4276                 name: "tests19.dat #8",
4277                 html: "<!doctype html><form><isindex>",
4278                 errors: 2,
4279                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <form>\n"
4280         }, {
4281                 name: "tests19.dat #9",
4282                 html: "<!doctype html><isindex action=\"POST\">",
4283                 errors: 1,
4284                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <form>\n|       action=\"POST\"\n|       <hr>\n|       <label>\n|         \"This is a searchable index. Enter search keywords: \"\n|         <input>\n|           name=\"isindex\"\n|       <hr>\n"
4285         }, {
4286                 name: "tests19.dat #10",
4287                 html: "<!doctype html><isindex prompt=\"this is isindex\">",
4288                 errors: 1,
4289                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <form>\n|       <hr>\n|       <label>\n|         \"this is isindex\"\n|         <input>\n|           name=\"isindex\"\n|       <hr>\n"
4290         }, {
4291                 name: "tests19.dat #11",
4292                 html: "<!doctype html><isindex type=\"hidden\">",
4293                 errors: 1,
4294                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <form>\n|       <hr>\n|       <label>\n|         \"This is a searchable index. Enter search keywords: \"\n|         <input>\n|           name=\"isindex\"\n|           type=\"hidden\"\n|       <hr>\n"
4295         }, {
4296                 name: "tests19.dat #12",
4297                 html: "<!doctype html><isindex name=\"foo\">",
4298                 errors: 1,
4299                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <form>\n|       <hr>\n|       <label>\n|         \"This is a searchable index. Enter search keywords: \"\n|         <input>\n|           name=\"isindex\"\n|       <hr>\n"
4300         }, {
4301                 name: "tests19.dat #13",
4302                 html: "<!doctype html><ruby><p><rp>",
4303                 errors: 1,
4304                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       <p>\n|       <rp>\n"
4305         }, {
4306                 name: "tests19.dat #14",
4307                 html: "<!doctype html><ruby><div><span><rp>",
4308                 errors: 2,
4309                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       <div>\n|         <span>\n|           <rp>\n"
4310         }, {
4311                 name: "tests19.dat #15",
4312                 html: "<!doctype html><ruby><div><p><rp>",
4313                 errors: 2,
4314                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       <div>\n|         <p>\n|         <rp>\n"
4315         }, {
4316                 name: "tests19.dat #16",
4317                 html: "<!doctype html><ruby><p><rt>",
4318                 errors: 1,
4319                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       <p>\n|       <rt>\n"
4320         }, {
4321                 name: "tests19.dat #17",
4322                 html: "<!doctype html><ruby><div><span><rt>",
4323                 errors: 2,
4324                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       <div>\n|         <span>\n|           <rt>\n"
4325         }, {
4326                 name: "tests19.dat #18",
4327                 html: "<!doctype html><ruby><div><p><rt>",
4328                 errors: 2,
4329                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       <div>\n|         <p>\n|         <rt>\n"
4330         }, {
4331                 name: "tests19.dat #19",
4332                 html: "<html><ruby>a<rb>b<rt></ruby></html>",
4333                 errors: 1,
4334                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rb>\n|         \"b\"\n|       <rt>\n"
4335         }, {
4336                 name: "tests19.dat #20",
4337                 html: "<html><ruby>a<rp>b<rt></ruby></html>",
4338                 errors: 1,
4339                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rp>\n|         \"b\"\n|       <rt>\n"
4340         }, {
4341                 name: "tests19.dat #21",
4342                 html: "<html><ruby>a<rt>b<rt></ruby></html>",
4343                 errors: 1,
4344                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rt>\n|         \"b\"\n|       <rt>\n"
4345         }, {
4346                 name: "tests19.dat #22",
4347                 html: "<html><ruby>a<rtc>b<rt>c<rb>d</ruby></html>",
4348                 errors: 1,
4349                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       \"a\"\n|       <rtc>\n|         \"b\"\n|         <rt>\n|           \"c\"\n|       <rb>\n|         \"d\"\n"
4350         }, {
4351                 name: "tests19.dat #23",
4352                 html: "<!doctype html><math/><foo>",
4353                 errors: 1,
4354                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|     <foo>\n"
4355         }, {
4356                 name: "tests19.dat #24",
4357                 html: "<!doctype html><svg/><foo>",
4358                 errors: 1,
4359                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|     <foo>\n"
4360         }, {
4361                 name: "tests19.dat #25",
4362                 html: "<!doctype html><div></body><!--foo-->",
4363                 errors: 1,
4364                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <div>\n|   <!-- foo -->\n"
4365         }, {
4366                 name: "tests19.dat #26",
4367                 html: "<!doctype html><h1><div><h3><span></h1>foo",
4368                 errors: 2,
4369                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <h1>\n|       <div>\n|         <h3>\n|           <span>\n|         \"foo\"\n"
4370         }, {
4371                 name: "tests19.dat #27",
4372                 html: "<!doctype html><p></h3>foo",
4373                 errors: 1,
4374                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       \"foo\"\n"
4375         }, {
4376                 name: "tests19.dat #28",
4377                 html: "<!doctype html><h3><li>abc</h2>foo",
4378                 errors: 1,
4379                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <h3>\n|       <li>\n|         \"abc\"\n|     \"foo\"\n"
4380         }, {
4381                 name: "tests19.dat #29",
4382                 html: "<!doctype html><table>abc<!--foo-->",
4383                 errors: 4,
4384                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"abc\"\n|     <table>\n|       <!-- foo -->\n"
4385         }, {
4386                 name: "tests19.dat #30",
4387                 html: "<!doctype html><table>  <!--foo-->",
4388                 errors: 1,
4389                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       \"  \"\n|       <!-- foo -->\n"
4390         }, {
4391                 name: "tests19.dat #31",
4392                 html: "<!doctype html><table> b <!--foo-->",
4393                 errors: 4,
4394                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \" b \"\n|     <table>\n|       <!-- foo -->\n"
4395         }, {
4396                 name: "tests19.dat #32",
4397                 html: "<!doctype html><select><option><option>",
4398                 errors: 1,
4399                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n|       <option>\n"
4400         }, {
4401                 name: "tests19.dat #33",
4402                 html: "<!doctype html><select><option></optgroup>",
4403                 errors: 2,
4404                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n"
4405         }, {
4406                 name: "tests19.dat #34",
4407                 html: "<!doctype html><select><option></optgroup>",
4408                 errors: 2,
4409                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n"
4410         }, {
4411                 name: "tests19.dat #35",
4412                 html: "<!doctype html><dd><optgroup><dd>",
4413                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <dd>\n|       <optgroup>\n|     <dd>\n"
4414         }, {
4415                 name: "tests19.dat #36",
4416                 html: "<!doctype html><p><math><mi><p><h1>",
4417                 errors: 1,
4418                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <math math>\n|         <math mi>\n|           <p>\n|           <h1>\n"
4419         }, {
4420                 name: "tests19.dat #37",
4421                 html: "<!doctype html><p><math><mo><p><h1>",
4422                 errors: 1,
4423                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <math math>\n|         <math mo>\n|           <p>\n|           <h1>\n"
4424         }, {
4425                 name: "tests19.dat #38",
4426                 html: "<!doctype html><p><math><mn><p><h1>",
4427                 errors: 1,
4428                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <math math>\n|         <math mn>\n|           <p>\n|           <h1>\n"
4429         }, {
4430                 name: "tests19.dat #39",
4431                 html: "<!doctype html><p><math><ms><p><h1>",
4432                 errors: 1,
4433                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <math math>\n|         <math ms>\n|           <p>\n|           <h1>\n"
4434         }, {
4435                 name: "tests19.dat #40",
4436                 html: "<!doctype html><p><math><mtext><p><h1>",
4437                 errors: 1,
4438                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <math math>\n|         <math mtext>\n|           <p>\n|           <h1>\n"
4439         }, {
4440                 name: "tests19.dat #41",
4441                 html: "<!doctype html><frameset></noframes>",
4442                 errors: 2,
4443                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
4444         }, {
4445                 name: "tests19.dat #42",
4446                 html: "<!doctype html><html c=d><body></html><html a=b>",
4447                 errors: 1,
4448                 expected: "| <!DOCTYPE html>\n| <html>\n|   a=\"b\"\n|   c=\"d\"\n|   <head>\n|   <body>\n"
4449         }, {
4450                 name: "tests19.dat #43",
4451                 html: "<!doctype html><html c=d><frameset></frameset></html><html a=b>",
4452                 errors: 1,
4453                 expected: "| <!DOCTYPE html>\n| <html>\n|   a=\"b\"\n|   c=\"d\"\n|   <head>\n|   <frameset>\n"
4454         }, {
4455                 name: "tests19.dat #44",
4456                 html: "<!doctype html><html><frameset></frameset></html><!--foo-->",
4457                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n| <!-- foo -->\n"
4458         }, {
4459                 name: "tests19.dat #45",
4460                 html: "<!doctype html><html><frameset></frameset></html>  ",
4461                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|   \"  \"\n"
4462         }, {
4463                 name: "tests19.dat #46",
4464                 html: "<!doctype html><html><frameset></frameset></html>abc",
4465                 errors: 3,
4466                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
4467         }, {
4468                 name: "tests19.dat #47",
4469                 html: "<!doctype html><html><frameset></frameset></html><p>",
4470                 errors: 1,
4471                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
4472         }, {
4473                 name: "tests19.dat #48",
4474                 html: "<!doctype html><html><frameset></frameset></html></p>",
4475                 errors: 1,
4476                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
4477         }, {
4478                 name: "tests19.dat #49",
4479                 html: "<html><frameset></frameset></html><!doctype html>",
4480                 errors: 2,
4481                 expected: "| <html>\n|   <head>\n|   <frameset>\n"
4482         }, {
4483                 name: "tests19.dat #50",
4484                 html: "<!doctype html><body><frameset>",
4485                 errors: 1,
4486                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n"
4487         }, {
4488                 name: "tests19.dat #51",
4489                 html: "<!doctype html><p><frameset><frame>",
4490                 errors: 2,
4491                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|     <frame>\n"
4492         }, {
4493                 name: "tests19.dat #52",
4494                 html: "<!doctype html><p>a<frameset>",
4495                 errors: 1,
4496                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       \"a\"\n"
4497         }, {
4498                 name: "tests19.dat #53",
4499                 html: "<!doctype html><p> <frameset><frame>",
4500                 errors: 2,
4501                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|     <frame>\n"
4502         }, {
4503                 name: "tests19.dat #54",
4504                 html: "<!doctype html><pre><frameset>",
4505                 errors: 2,
4506                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n"
4507         }, {
4508                 name: "tests19.dat #55",
4509                 html: "<!doctype html><listing><frameset>",
4510                 errors: 2,
4511                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <listing>\n"
4512         }, {
4513                 name: "tests19.dat #56",
4514                 html: "<!doctype html><li><frameset>",
4515                 errors: 1,
4516                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <li>\n"
4517         }, {
4518                 name: "tests19.dat #57",
4519                 html: "<!doctype html><dd><frameset>",
4520                 errors: 1,
4521                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <dd>\n"
4522         }, {
4523                 name: "tests19.dat #58",
4524                 html: "<!doctype html><dt><frameset>",
4525                 errors: 1,
4526                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <dt>\n"
4527         }, {
4528                 name: "tests19.dat #59",
4529                 html: "<!doctype html><button><frameset>",
4530                 errors: 2,
4531                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <button>\n"
4532         }, {
4533                 name: "tests19.dat #60",
4534                 html: "<!doctype html><applet><frameset>",
4535                 errors: 2,
4536                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <applet>\n"
4537         }, {
4538                 name: "tests19.dat #61",
4539                 html: "<!doctype html><marquee><frameset>",
4540                 errors: 2,
4541                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <marquee>\n"
4542         }, {
4543                 name: "tests19.dat #62",
4544                 html: "<!doctype html><object><frameset>",
4545                 errors: 2,
4546                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <object>\n"
4547         }, {
4548                 name: "tests19.dat #63",
4549                 html: "<!doctype html><table><frameset>",
4550                 errors: 3,
4551                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n"
4552         }, {
4553                 name: "tests19.dat #64",
4554                 html: "<!doctype html><area><frameset>",
4555                 errors: 1,
4556                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <area>\n"
4557         }, {
4558                 name: "tests19.dat #65",
4559                 html: "<!doctype html><basefont><frameset>",
4560                 errors: 1,
4561                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <basefont>\n|   <frameset>\n"
4562         }, {
4563                 name: "tests19.dat #66",
4564                 html: "<!doctype html><bgsound><frameset>",
4565                 errors: 1,
4566                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <bgsound>\n|   <frameset>\n"
4567         }, {
4568                 name: "tests19.dat #67",
4569                 html: "<!doctype html><br><frameset>",
4570                 errors: 1,
4571                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <br>\n"
4572         }, {
4573                 name: "tests19.dat #68",
4574                 html: "<!doctype html><embed><frameset>",
4575                 errors: 1,
4576                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <embed>\n"
4577         }, {
4578                 name: "tests19.dat #69",
4579                 html: "<!doctype html><img><frameset>",
4580                 errors: 1,
4581                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <img>\n"
4582         }, {
4583                 name: "tests19.dat #70",
4584                 html: "<!doctype html><input><frameset>",
4585                 errors: 1,
4586                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <input>\n"
4587         }, {
4588                 name: "tests19.dat #71",
4589                 html: "<!doctype html><keygen><frameset>",
4590                 errors: 1,
4591                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <keygen>\n"
4592         }, {
4593                 name: "tests19.dat #72",
4594                 html: "<!doctype html><wbr><frameset>",
4595                 errors: 1,
4596                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <wbr>\n"
4597         }, {
4598                 name: "tests19.dat #73",
4599                 html: "<!doctype html><hr><frameset>",
4600                 errors: 1,
4601                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <hr>\n"
4602         }, {
4603                 name: "tests19.dat #74",
4604                 html: "<!doctype html><textarea></textarea><frameset>",
4605                 errors: 1,
4606                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <textarea>\n"
4607         }, {
4608                 name: "tests19.dat #75",
4609                 html: "<!doctype html><xmp></xmp><frameset>",
4610                 errors: 1,
4611                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <xmp>\n"
4612         }, {
4613                 name: "tests19.dat #76",
4614                 html: "<!doctype html><iframe></iframe><frameset>",
4615                 errors: 1,
4616                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <iframe>\n"
4617         }, {
4618                 name: "tests19.dat #77",
4619                 html: "<!doctype html><select></select><frameset>",
4620                 errors: 1,
4621                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n"
4622         }, {
4623                 name: "tests19.dat #78",
4624                 html: "<!doctype html><svg></svg><frameset><frame>",
4625                 errors: 2,
4626                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|     <frame>\n"
4627         }, {
4628                 name: "tests19.dat #79",
4629                 html: "<!doctype html><math></math><frameset><frame>",
4630                 errors: 2,
4631                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|     <frame>\n"
4632         }, {
4633                 name: "tests19.dat #80",
4634                 html: "<!doctype html><svg><foreignObject><div> <frameset><frame>",
4635                 errors: 2,
4636                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|     <frame>\n"
4637         }, {
4638                 name: "tests19.dat #81",
4639                 html: "<!doctype html><svg>a</svg><frameset><frame>",
4640                 errors: 2,
4641                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"a\"\n"
4642         }, {
4643                 name: "tests19.dat #82",
4644                 html: "<!doctype html><svg> </svg><frameset><frame>",
4645                 errors: 2,
4646                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|     <frame>\n"
4647         }, {
4648                 name: "tests19.dat #83",
4649                 html: "<html>aaa<frameset></frameset>",
4650                 errors: 3,
4651                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"aaa\"\n"
4652         }, {
4653                 name: "tests19.dat #84",
4654                 html: "<html> a <frameset></frameset>",
4655                 errors: 3,
4656                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"a \"\n"
4657         }, {
4658                 name: "tests19.dat #85",
4659                 html: "<!doctype html><div><frameset>",
4660                 errors: 2,
4661                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
4662         }, {
4663                 name: "tests19.dat #86",
4664                 html: "<!doctype html><div><body><frameset>",
4665                 errors: 3,
4666                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <div>\n"
4667         }, {
4668                 name: "tests19.dat #87",
4669                 html: "<!doctype html><p><math></p>a",
4670                 errors: 2,
4671                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <math math>\n|     \"a\"\n"
4672         }, {
4673                 name: "tests19.dat #88",
4674                 html: "<!doctype html><p><math><mn><span></p>a",
4675                 errors: 2,
4676                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <math math>\n|         <math mn>\n|           <span>\n|             <p>\n|             \"a\"\n"
4677         }, {
4678                 name: "tests19.dat #89",
4679                 html: "<!doctype html><math></html>",
4680                 errors: 3,
4681                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n"
4682         }, {
4683                 name: "tests19.dat #90",
4684                 html: "<!doctype html><meta charset=\"ascii\">",
4685                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <meta>\n|       charset=\"ascii\"\n|   <body>\n"
4686         }, {
4687                 name: "tests19.dat #91",
4688                 html: "<!doctype html><meta http-equiv=\"content-type\" content=\"text/html;charset=ascii\">",
4689                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <meta>\n|       content=\"text/html;charset=ascii\"\n|       http-equiv=\"content-type\"\n|   <body>\n"
4690         }, {
4691                 name: "tests19.dat #92",
4692                 html: "<!doctype html><head><!--aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--><meta charset=\"utf8\">",
4693                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <!-- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -->\n|     <meta>\n|       charset=\"utf8\"\n|   <body>\n"
4694         }, {
4695                 name: "tests19.dat #93",
4696                 html: "<!doctype html><html a=b><head></head><html c=d>",
4697                 errors: 1,
4698                 expected: "| <!DOCTYPE html>\n| <html>\n|   a=\"b\"\n|   c=\"d\"\n|   <head>\n|   <body>\n"
4699         }, {
4700                 name: "tests19.dat #94",
4701                 html: "<!doctype html><image/>",
4702                 errors: 1,
4703                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <img>\n"
4704         }, {
4705                 name: "tests19.dat #95",
4706                 html: "<!doctype html>a<i>b<table>c<b>d</i>e</b>f",
4707                 errors: 9,
4708                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"a\"\n|     <i>\n|       \"bc\"\n|       <b>\n|         \"de\"\n|       \"f\"\n|       <table>\n"
4709         }, {
4710                 name: "tests19.dat #96",
4711                 html: "<!doctype html><table><i>a<b>b<div>c<a>d</i>e</b>f",
4712                 errors: 17,
4713                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <i>\n|       \"a\"\n|       <b>\n|         \"b\"\n|     <b>\n|     <div>\n|       <b>\n|         <i>\n|           \"c\"\n|           <a>\n|             \"d\"\n|         <a>\n|           \"e\"\n|       <a>\n|         \"f\"\n|     <table>\n"
4714         }, {
4715                 name: "tests19.dat #97",
4716                 html: "<!doctype html><i>a<b>b<div>c<a>d</i>e</b>f",
4717                 errors: 5,
4718                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <i>\n|       \"a\"\n|       <b>\n|         \"b\"\n|     <b>\n|     <div>\n|       <b>\n|         <i>\n|           \"c\"\n|           <a>\n|             \"d\"\n|         <a>\n|           \"e\"\n|       <a>\n|         \"f\"\n"
4719         }, {
4720                 name: "tests19.dat #98",
4721                 html: "<!doctype html><table><i>a<b>b<div>c</i>",
4722                 errors: 9,
4723                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <i>\n|       \"a\"\n|       <b>\n|         \"b\"\n|     <b>\n|       <div>\n|         <i>\n|           \"c\"\n|     <table>\n"
4724         }, {
4725                 name: "tests19.dat #99",
4726                 html: "<!doctype html><table><i>a<b>b<div>c<a>d</i>e</b>f",
4727                 errors: 17,
4728                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <i>\n|       \"a\"\n|       <b>\n|         \"b\"\n|     <b>\n|     <div>\n|       <b>\n|         <i>\n|           \"c\"\n|           <a>\n|             \"d\"\n|         <a>\n|           \"e\"\n|       <a>\n|         \"f\"\n|     <table>\n"
4729         }, {
4730                 name: "tests19.dat #100",
4731                 html: "<!doctype html><table><i>a<div>b<tr>c<b>d</i>e",
4732                 errors: 11,
4733                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <i>\n|       \"a\"\n|       <div>\n|         \"b\"\n|     <i>\n|       \"c\"\n|       <b>\n|         \"d\"\n|     <b>\n|       \"e\"\n|     <table>\n|       <tbody>\n|         <tr>\n"
4734         }, {
4735                 name: "tests19.dat #101",
4736                 html: "<!doctype html><table><td><table><i>a<div>b<b>c</i>d",
4737                 errors: 12,
4738                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <i>\n|               \"a\"\n|             <div>\n|               <i>\n|                 \"b\"\n|                 <b>\n|                   \"c\"\n|               <b>\n|                 \"d\"\n|             <table>\n"
4739         }, {
4740                 name: "tests19.dat #102",
4741                 html: "<!doctype html><body><bgsound>",
4742                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <bgsound>\n"
4743         }, {
4744                 name: "tests19.dat #103",
4745                 html: "<!doctype html><body><basefont>",
4746                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <basefont>\n"
4747         }, {
4748                 name: "tests19.dat #104",
4749                 html: "<!doctype html><a><b></a><basefont>",
4750                 errors: 1,
4751                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <a>\n|       <b>\n|     <basefont>\n"
4752         }, {
4753                 name: "tests19.dat #105",
4754                 html: "<!doctype html><a><b></a><bgsound>",
4755                 errors: 1,
4756                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <a>\n|       <b>\n|     <bgsound>\n"
4757         }, {
4758                 name: "tests19.dat #106",
4759                 html: "<!doctype html><figcaption><article></figcaption>a",
4760                 errors: 1,
4761                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <figcaption>\n|       <article>\n|     \"a\"\n"
4762         }, {
4763                 name: "tests19.dat #107",
4764                 html: "<!doctype html><summary><article></summary>a",
4765                 errors: 1,
4766                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <summary>\n|       <article>\n|     \"a\"\n"
4767         }, {
4768                 name: "tests19.dat #108",
4769                 html: "<!doctype html><p><a><plaintext>b",
4770                 errors: 2,
4771                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <a>\n|     <plaintext>\n|       <a>\n|         \"b\"\n"
4772         }, {
4773                 name: "tests19.dat #109",
4774                 html: "<!DOCTYPE html><div>a<a></div>b<p>c</p>d",
4775                 errors: 2,
4776                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"a\"\n|       <a>\n|     <a>\n|       \"b\"\n|       <p>\n|         \"c\"\n|       \"d\"\n"
4777         }, {
4778                 name: "tests1.dat #1",
4779                 html: "Test",
4780                 errors: 1,
4781                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"Test\"\n"
4782         }, {
4783                 name: "tests1.dat #2",
4784                 html: "<p>One<p>Two",
4785                 errors: 1,
4786                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       \"One\"\n|     <p>\n|       \"Two\"\n"
4787         }, {
4788                 name: "tests1.dat #3",
4789                 html: "Line1<br>Line2<br>Line3<br>Line4",
4790                 errors: 1,
4791                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"Line1\"\n|     <br>\n|     \"Line2\"\n|     <br>\n|     \"Line3\"\n|     <br>\n|     \"Line4\"\n"
4792         }, {
4793                 name: "tests1.dat #4",
4794                 html: "<html>",
4795                 errors: 1,
4796                 expected: "| <html>\n|   <head>\n|   <body>\n"
4797         }, {
4798                 name: "tests1.dat #5",
4799                 html: "<head>",
4800                 errors: 1,
4801                 expected: "| <html>\n|   <head>\n|   <body>\n"
4802         }, {
4803                 name: "tests1.dat #6",
4804                 html: "<body>",
4805                 errors: 1,
4806                 expected: "| <html>\n|   <head>\n|   <body>\n"
4807         }, {
4808                 name: "tests1.dat #7",
4809                 html: "<html><head>",
4810                 errors: 1,
4811                 expected: "| <html>\n|   <head>\n|   <body>\n"
4812         }, {
4813                 name: "tests1.dat #8",
4814                 html: "<html><head></head>",
4815                 errors: 1,
4816                 expected: "| <html>\n|   <head>\n|   <body>\n"
4817         }, {
4818                 name: "tests1.dat #9",
4819                 html: "<html><head></head><body>",
4820                 errors: 1,
4821                 expected: "| <html>\n|   <head>\n|   <body>\n"
4822         }, {
4823                 name: "tests1.dat #10",
4824                 html: "<html><head></head><body></body>",
4825                 errors: 1,
4826                 expected: "| <html>\n|   <head>\n|   <body>\n"
4827         }, {
4828                 name: "tests1.dat #11",
4829                 html: "<html><head><body></body></html>",
4830                 errors: 1,
4831                 expected: "| <html>\n|   <head>\n|   <body>\n"
4832         }, {
4833                 name: "tests1.dat #12",
4834                 html: "<html><head></body></html>",
4835                 errors: 1,
4836                 expected: "| <html>\n|   <head>\n|   <body>\n"
4837         }, {
4838                 name: "tests1.dat #13",
4839                 html: "<html><head><body></html>",
4840                 errors: 1,
4841                 expected: "| <html>\n|   <head>\n|   <body>\n"
4842         }, {
4843                 name: "tests1.dat #14",
4844                 html: "<html><body></html>",
4845                 errors: 1,
4846                 expected: "| <html>\n|   <head>\n|   <body>\n"
4847         }, {
4848                 name: "tests1.dat #15",
4849                 html: "<body></html>",
4850                 errors: 1,
4851                 expected: "| <html>\n|   <head>\n|   <body>\n"
4852         }, {
4853                 name: "tests1.dat #16",
4854                 html: "<head></html>",
4855                 errors: 1,
4856                 expected: "| <html>\n|   <head>\n|   <body>\n"
4857         }, {
4858                 name: "tests1.dat #17",
4859                 html: "</head>",
4860                 errors: 1,
4861                 expected: "| <html>\n|   <head>\n|   <body>\n"
4862         }, {
4863                 name: "tests1.dat #18",
4864                 html: "</body>",
4865                 errors: 1,
4866                 expected: "| <html>\n|   <head>\n|   <body>\n"
4867         }, {
4868                 name: "tests1.dat #19",
4869                 html: "</html>",
4870                 errors: 1,
4871                 expected: "| <html>\n|   <head>\n|   <body>\n"
4872         }, {
4873                 name: "tests1.dat #20",
4874                 html: "<b><table><td><i></table>",
4875                 errors: 4,
4876                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <table>\n|         <tbody>\n|           <tr>\n|             <td>\n|               <i>\n"
4877         }, {
4878                 name: "tests1.dat #21",
4879                 html: "<b><table><td></b><i></table>X",
4880                 errors: 5,
4881                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <table>\n|         <tbody>\n|           <tr>\n|             <td>\n|               <i>\n|       \"X\"\n"
4882         }, {
4883                 name: "tests1.dat #22",
4884                 html: "<h1>Hello<h2>World",
4885                 errors: 3,
4886                 expected: "| <html>\n|   <head>\n|   <body>\n|     <h1>\n|       \"Hello\"\n|     <h2>\n|       \"World\"\n"
4887         }, {
4888                 name: "tests1.dat #23",
4889                 html: "<a><p>X<a>Y</a>Z</p></a>",
4890                 errors: 4,
4891                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|     <p>\n|       <a>\n|         \"X\"\n|       <a>\n|         \"Y\"\n|       \"Z\"\n"
4892         }, {
4893                 name: "tests1.dat #24",
4894                 html: "<b><button>foo</b>bar",
4895                 errors: 3,
4896                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|     <button>\n|       <b>\n|         \"foo\"\n|       \"bar\"\n"
4897         }, {
4898                 name: "tests1.dat #25",
4899                 html: "<!DOCTYPE html><span><button>foo</span>bar",
4900                 errors: 2,
4901                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <span>\n|       <button>\n|         \"foobar\"\n"
4902         }, {
4903                 name: "tests1.dat #26",
4904                 html: "<p><b><div><marquee></p></b></div>X",
4905                 errors: 6,
4906                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <b>\n|     <div>\n|       <b>\n|         <marquee>\n|           <p>\n|           \"X\"\n"
4907         }, {
4908                 name: "tests1.dat #27",
4909                 html: "<script><div></script></div><title><p></title><p><p>",
4910                 errors: 2,
4911                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"<div>\"\n|     <title>\n|       \"<p>\"\n|   <body>\n|     <p>\n|     <p>\n"
4912         }, {
4913                 name: "tests1.dat #28",
4914                 html: "<!--><div>--<!-->",
4915                 errors: 4,
4916                 expected: "| <!--  -->\n| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"--\"\n|       <!--  -->\n"
4917         }, {
4918                 name: "tests1.dat #29",
4919                 html: "<p><hr></p>",
4920                 errors: 2,
4921                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <hr>\n|     <p>\n"
4922         }, {
4923                 name: "tests1.dat #30",
4924                 html: "<select><b><option><select><option></b></select>X",
4925                 errors: 6,
4926                 expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n|     <option>\n|       \"X\"\n"
4927         }, {
4928                 name: "tests1.dat #31",
4929                 html: "<a><table><td><a><table></table><a></tr><a></table><b>X</b>C<a>Y",
4930                 errors: 9,
4931                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       <a>\n|       <table>\n|         <tbody>\n|           <tr>\n|             <td>\n|               <a>\n|                 <table>\n|               <a>\n|     <a>\n|       <b>\n|         \"X\"\n|       \"C\"\n|     <a>\n|       \"Y\"\n"
4932         }, {
4933                 name: "tests1.dat #32",
4934                 html: "<a X>0<b>1<a Y>2",
4935                 errors: 4,
4936                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       x=\"\"\n|       \"0\"\n|       <b>\n|         \"1\"\n|     <b>\n|       <a>\n|         y=\"\"\n|         \"2\"\n"
4937         }, {
4938                 name: "tests1.dat #33",
4939                 html: "<!-----><font><div>hello<table>excite!<b>me!<th><i>please!</tr><!--X-->",
4940                 errors: 16,
4941                 expected: "| <!-- - -->\n| <html>\n|   <head>\n|   <body>\n|     <font>\n|       <div>\n|         \"helloexcite!\"\n|         <b>\n|           \"me!\"\n|         <table>\n|           <tbody>\n|             <tr>\n|               <th>\n|                 <i>\n|                   \"please!\"\n|             <!-- X -->\n"
4942         }, {
4943                 name: "tests1.dat #34",
4944                 html: "<!DOCTYPE html><li>hello<li>world<ul>how<li>do</ul>you</body><!--do-->",
4945                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <li>\n|       \"hello\"\n|     <li>\n|       \"world\"\n|       <ul>\n|         \"how\"\n|         <li>\n|           \"do\"\n|       \"you\"\n|   <!-- do -->\n"
4946         }, {
4947                 name: "tests1.dat #35",
4948                 html: "<!DOCTYPE html>A<option>B<optgroup>C<select>D</option>E",
4949                 errors: 2,
4950                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"A\"\n|     <option>\n|       \"B\"\n|     <optgroup>\n|       \"C\"\n|       <select>\n|         \"DE\"\n"
4951         }, {
4952                 name: "tests1.dat #36",
4953                 html: "<",
4954                 errors: 2,
4955                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"<\"\n"
4956         }, {
4957                 name: "tests1.dat #37",
4958                 html: "<#",
4959                 errors: 2,
4960                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"<#\"\n"
4961         }, {
4962                 name: "tests1.dat #38",
4963                 html: "</",
4964                 errors: 2,
4965                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"</\"\n"
4966         }, {
4967                 name: "tests1.dat #39",
4968                 html: "</#",
4969                 errors: 2,
4970                 expected: "| <!-- # -->\n| <html>\n|   <head>\n|   <body>\n"
4971         }, {
4972                 name: "tests1.dat #40",
4973                 html: "<?",
4974                 errors: 2,
4975                 expected: "| <!-- ? -->\n| <html>\n|   <head>\n|   <body>\n"
4976         }, {
4977                 name: "tests1.dat #41",
4978                 html: "<?#",
4979                 errors: 2,
4980                 expected: "| <!-- ?# -->\n| <html>\n|   <head>\n|   <body>\n"
4981         }, {
4982                 name: "tests1.dat #42",
4983                 html: "<!",
4984                 errors: 2,
4985                 expected: "| <!--  -->\n| <html>\n|   <head>\n|   <body>\n"
4986         }, {
4987                 name: "tests1.dat #43",
4988                 html: "<!#",
4989                 errors: 2,
4990                 expected: "| <!-- # -->\n| <html>\n|   <head>\n|   <body>\n"
4991         }, {
4992                 name: "tests1.dat #44",
4993                 html: "<?COMMENT?>",
4994                 errors: 2,
4995                 expected: "| <!-- ?COMMENT? -->\n| <html>\n|   <head>\n|   <body>\n"
4996         }, {
4997                 name: "tests1.dat #45",
4998                 html: "<!COMMENT>",
4999                 errors: 2,
5000                 expected: "| <!-- COMMENT -->\n| <html>\n|   <head>\n|   <body>\n"
5001         }, {
5002                 name: "tests1.dat #46",
5003                 html: "</ COMMENT >",
5004                 errors: 2,
5005                 expected: "| <!--  COMMENT  -->\n| <html>\n|   <head>\n|   <body>\n"
5006         }, {
5007                 name: "tests1.dat #47",
5008                 html: "<?COM--MENT?>",
5009                 errors: 2,
5010                 expected: "| <!-- ?COM--MENT? -->\n| <html>\n|   <head>\n|   <body>\n"
5011         }, {
5012                 name: "tests1.dat #48",
5013                 html: "<!COM--MENT>",
5014                 errors: 2,
5015                 expected: "| <!-- COM--MENT -->\n| <html>\n|   <head>\n|   <body>\n"
5016         }, {
5017                 name: "tests1.dat #49",
5018                 html: "</ COM--MENT >",
5019                 errors: 2,
5020                 expected: "| <!--  COM--MENT  -->\n| <html>\n|   <head>\n|   <body>\n"
5021         }, {
5022                 name: "tests1.dat #50",
5023                 html: "<!DOCTYPE html><style> EOF",
5024                 errors: 1,
5025                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <style>\n|       \" EOF\"\n|   <body>\n"
5026         }, {
5027                 name: "tests1.dat #51",
5028                 html: "<!DOCTYPE html><script> <!-- </script> --> </script> EOF",
5029                 errors: 1,
5030                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \" <!-- \"\n|     \" \"\n|   <body>\n|     \"-->  EOF\"\n"
5031         }, {
5032                 name: "tests1.dat #52",
5033                 html: "<b><p></b>TEST",
5034                 errors: 2,
5035                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|     <p>\n|       <b>\n|       \"TEST\"\n"
5036         }, {
5037                 name: "tests1.dat #53",
5038                 html: "<p id=a><b><p id=b></b>TEST",
5039                 errors: 3,
5040                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       id=\"a\"\n|       <b>\n|     <p>\n|       id=\"b\"\n|       \"TEST\"\n"
5041         }, {
5042                 name: "tests1.dat #54",
5043                 html: "<b id=a><p><b id=b></p></b>TEST",
5044                 errors: 4,
5045                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       id=\"a\"\n|       <p>\n|         <b>\n|           id=\"b\"\n|       \"TEST\"\n"
5046         }, {
5047                 name: "tests1.dat #55",
5048                 html: "<!DOCTYPE html><title>U-test</title><body><div><p>Test<u></p></div></body>",
5049                 errors: 1,
5050                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <title>\n|       \"U-test\"\n|   <body>\n|     <div>\n|       <p>\n|         \"Test\"\n|         <u>\n"
5051         }, {
5052                 name: "tests1.dat #56",
5053                 html: "<!DOCTYPE html><font><table></font></table></font>",
5054                 errors: 2,
5055                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <font>\n|       <table>\n"
5056         }, {
5057                 name: "tests1.dat #57",
5058                 html: "<font><p>hello<b>cruel</font>world",
5059                 errors: 4,
5060                 expected: "| <html>\n|   <head>\n|   <body>\n|     <font>\n|     <p>\n|       <font>\n|         \"hello\"\n|         <b>\n|           \"cruel\"\n|       <b>\n|         \"world\"\n"
5061         }, {
5062                 name: "tests1.dat #58",
5063                 html: "<b>Test</i>Test",
5064                 errors: 3,
5065                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       \"TestTest\"\n"
5066         }, {
5067                 name: "tests1.dat #59",
5068                 html: "<b>A<cite>B<div>C",
5069                 errors: 2,
5070                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       \"A\"\n|       <cite>\n|         \"B\"\n|         <div>\n|           \"C\"\n"
5071         }, {
5072                 name: "tests1.dat #60",
5073                 html: "<b>A<cite>B<div>C</cite>D",
5074                 errors: 3,
5075                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       \"A\"\n|       <cite>\n|         \"B\"\n|         <div>\n|           \"CD\"\n"
5076         }, {
5077                 name: "tests1.dat #61",
5078                 html: "<b>A<cite>B<div>C</b>D",
5079                 errors: 3,
5080                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       \"A\"\n|       <cite>\n|         \"B\"\n|     <div>\n|       <b>\n|         \"C\"\n|       \"D\"\n"
5081         }, {
5082                 name: "tests1.dat #62",
5083                 html: "",
5084                 errors: 1,
5085                 expected: "| <html>\n|   <head>\n|   <body>\n"
5086         }, {
5087                 name: "tests1.dat #63",
5088                 html: "<DIV>",
5089                 errors: 2,
5090                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n"
5091         }, {
5092                 name: "tests1.dat #64",
5093                 html: "<DIV> abc",
5094                 errors: 2,
5095                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc\"\n"
5096         }, {
5097                 name: "tests1.dat #65",
5098                 html: "<DIV> abc <B>",
5099                 errors: 2,
5100                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n"
5101         }, {
5102                 name: "tests1.dat #66",
5103                 html: "<DIV> abc <B> def",
5104                 errors: 2,
5105                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n|         \" def\"\n"
5106         }, {
5107                 name: "tests1.dat #67",
5108                 html: "<DIV> abc <B> def <I>",
5109                 errors: 2,
5110                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n|         \" def \"\n|         <i>\n"
5111         }, {
5112                 name: "tests1.dat #68",
5113                 html: "<DIV> abc <B> def <I> ghi",
5114                 errors: 2,
5115                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n|         \" def \"\n|         <i>\n|           \" ghi\"\n"
5116         }, {
5117                 name: "tests1.dat #69",
5118                 html: "<DIV> abc <B> def <I> ghi <P>",
5119                 errors: 2,
5120                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n|         \" def \"\n|         <i>\n|           \" ghi \"\n|           <p>\n"
5121         }, {
5122                 name: "tests1.dat #70",
5123                 html: "<DIV> abc <B> def <I> ghi <P> jkl",
5124                 errors: 2,
5125                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n|         \" def \"\n|         <i>\n|           \" ghi \"\n|           <p>\n|             \" jkl\"\n"
5126         }, {
5127                 name: "tests1.dat #71",
5128                 html: "<DIV> abc <B> def <I> ghi <P> jkl </B>",
5129                 errors: 3,
5130                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n|         \" def \"\n|         <i>\n|           \" ghi \"\n|       <i>\n|         <p>\n|           <b>\n|             \" jkl \"\n"
5131         }, {
5132                 name: "tests1.dat #72",
5133                 html: "<DIV> abc <B> def <I> ghi <P> jkl </B> mno",
5134                 errors: 3,
5135                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n|         \" def \"\n|         <i>\n|           \" ghi \"\n|       <i>\n|         <p>\n|           <b>\n|             \" jkl \"\n|           \" mno\"\n"
5136         }, {
5137                 name: "tests1.dat #73",
5138                 html: "<DIV> abc <B> def <I> ghi <P> jkl </B> mno </I>",
5139                 errors: 4,
5140                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n|         \" def \"\n|         <i>\n|           \" ghi \"\n|       <i>\n|       <p>\n|         <i>\n|           <b>\n|             \" jkl \"\n|           \" mno \"\n"
5141         }, {
5142                 name: "tests1.dat #74",
5143                 html: "<DIV> abc <B> def <I> ghi <P> jkl </B> mno </I> pqr",
5144                 errors: 4,
5145                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n|         \" def \"\n|         <i>\n|           \" ghi \"\n|       <i>\n|       <p>\n|         <i>\n|           <b>\n|             \" jkl \"\n|           \" mno \"\n|         \" pqr\"\n"
5146         }, {
5147                 name: "tests1.dat #75",
5148                 html: "<DIV> abc <B> def <I> ghi <P> jkl </B> mno </I> pqr </P>",
5149                 errors: 4,
5150                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n|         \" def \"\n|         <i>\n|           \" ghi \"\n|       <i>\n|       <p>\n|         <i>\n|           <b>\n|             \" jkl \"\n|           \" mno \"\n|         \" pqr \"\n"
5151         }, {
5152                 name: "tests1.dat #76",
5153                 html: "<DIV> abc <B> def <I> ghi <P> jkl </B> mno </I> pqr </P> stu",
5154                 errors: 4,
5155                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \" abc \"\n|       <b>\n|         \" def \"\n|         <i>\n|           \" ghi \"\n|       <i>\n|       <p>\n|         <i>\n|           <b>\n|             \" jkl \"\n|           \" mno \"\n|         \" pqr \"\n|       \" stu\"\n"
5156         }, {
5157                 name: "tests1.dat #77",
5158                 html: "<test attribute---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->",
5159                 errors: 2,
5160                 expected: "| <html>\n|   <head>\n|   <body>\n|     <test>\n|       attribute----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------=\"\"\n"
5161         }, {
5162                 name: "tests1.dat #78",
5163                 html: "<a href=\"blah\">aba<table><a href=\"foo\">br<tr><td></td></tr>x</table>aoe",
5164                 errors: 8,
5165                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       href=\"blah\"\n|       \"aba\"\n|       <a>\n|         href=\"foo\"\n|         \"br\"\n|       <a>\n|         href=\"foo\"\n|         \"x\"\n|       <table>\n|         <tbody>\n|           <tr>\n|             <td>\n|     <a>\n|       href=\"foo\"\n|       \"aoe\"\n"
5166         }, {
5167                 name: "tests1.dat #79",
5168                 html: "<a href=\"blah\">aba<table><tr><td><a href=\"foo\">br</td></tr>x</table>aoe",
5169                 errors: 4,
5170                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       href=\"blah\"\n|       \"abax\"\n|       <table>\n|         <tbody>\n|           <tr>\n|             <td>\n|               <a>\n|                 href=\"foo\"\n|                 \"br\"\n|       \"aoe\"\n"
5171         }, {
5172                 name: "tests1.dat #80",
5173                 html: "<table><a href=\"blah\">aba<tr><td><a href=\"foo\">br</td></tr>x</table>aoe",
5174                 errors: 8,
5175                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       href=\"blah\"\n|       \"aba\"\n|     <a>\n|       href=\"blah\"\n|       \"x\"\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <a>\n|               href=\"foo\"\n|               \"br\"\n|     <a>\n|       href=\"blah\"\n|       \"aoe\"\n"
5176         }, {
5177                 name: "tests1.dat #81",
5178                 html: "<a href=a>aa<marquee>aa<a href=b>bb</marquee>aa",
5179                 errors: 3,
5180                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       href=\"a\"\n|       \"aa\"\n|       <marquee>\n|         \"aa\"\n|         <a>\n|           href=\"b\"\n|           \"bb\"\n|       \"aa\"\n"
5181         }, {
5182                 name: "tests1.dat #82",
5183                 html: "<wbr><strike><code></strike><code><strike></code>",
5184                 errors: 4,
5185                 expected: "| <html>\n|   <head>\n|   <body>\n|     <wbr>\n|     <strike>\n|       <code>\n|     <code>\n|       <code>\n|         <strike>\n"
5186         }, {
5187                 name: "tests1.dat #83",
5188                 html: "<!DOCTYPE html><spacer>foo",
5189                 errors: 1,
5190                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <spacer>\n|       \"foo\"\n"
5191         }, {
5192                 name: "tests1.dat #84",
5193                 html: "<title><meta></title><link><title><meta></title>",
5194                 errors: 1,
5195                 expected: "| <html>\n|   <head>\n|     <title>\n|       \"<meta>\"\n|     <link>\n|     <title>\n|       \"<meta>\"\n|   <body>\n"
5196         }, {
5197                 name: "tests1.dat #85",
5198                 html: "<style><!--</style><meta><script>--><link></script>",
5199                 errors: 1,
5200                 expected: "| <html>\n|   <head>\n|     <style>\n|       \"<!--\"\n|     <meta>\n|     <script>\n|       \"--><link>\"\n|   <body>\n"
5201         }, {
5202                 name: "tests1.dat #86",
5203                 html: "<head><meta></head><link>",
5204                 errors: 2,
5205                 expected: "| <html>\n|   <head>\n|     <meta>\n|     <link>\n|   <body>\n"
5206         }, {
5207                 name: "tests1.dat #87",
5208                 html: "<table><tr><tr><td><td><span><th><span>X</table>",
5209                 errors: 3,
5210                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|         <tr>\n|           <td>\n|           <td>\n|             <span>\n|           <th>\n|             <span>\n|               \"X\"\n"
5211         }, {
5212                 name: "tests1.dat #88",
5213                 html: "<body><body><base><link><meta><title><p></title><body><p></body>",
5214                 errors: 3,
5215                 expected: "| <html>\n|   <head>\n|   <body>\n|     <base>\n|     <link>\n|     <meta>\n|     <title>\n|       \"<p>\"\n|     <p>\n"
5216         }, {
5217                 name: "tests1.dat #89",
5218                 html: "<textarea><p></textarea>",
5219                 errors: 1,
5220                 expected: "| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"<p>\"\n"
5221         }, {
5222                 name: "tests1.dat #90",
5223                 html: "<p><image></p>",
5224                 errors: 2,
5225                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <img>\n"
5226         }, {
5227                 name: "tests1.dat #91",
5228                 html: "<a><table><a></table><p><a><div><a>",
5229                 errors: 10,
5230                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       <a>\n|       <table>\n|     <p>\n|       <a>\n|     <div>\n|       <a>\n"
5231         }, {
5232                 name: "tests1.dat #92",
5233                 html: "<head></p><meta><p>",
5234                 errors: 2,
5235                 expected: "| <html>\n|   <head>\n|     <meta>\n|   <body>\n|     <p>\n"
5236         }, {
5237                 name: "tests1.dat #93",
5238                 html: "<head></html><meta><p>",
5239                 errors: 2,
5240                 expected: "| <html>\n|   <head>\n|   <body>\n|     <meta>\n|     <p>\n"
5241         }, {
5242                 name: "tests1.dat #94",
5243                 html: "<b><table><td><i></table>",
5244                 errors: 4,
5245                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <table>\n|         <tbody>\n|           <tr>\n|             <td>\n|               <i>\n"
5246         }, {
5247                 name: "tests1.dat #95",
5248                 html: "<b><table><td></b><i></table>",
5249                 errors: 5,
5250                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <table>\n|         <tbody>\n|           <tr>\n|             <td>\n|               <i>\n"
5251         }, {
5252                 name: "tests1.dat #96",
5253                 html: "<h1><h2>",
5254                 errors: 3,
5255                 expected: "| <html>\n|   <head>\n|   <body>\n|     <h1>\n|     <h2>\n"
5256         }, {
5257                 name: "tests1.dat #97",
5258                 html: "<a><p><a></a></p></a>",
5259                 errors: 4,
5260                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|     <p>\n|       <a>\n|       <a>\n"
5261         }, {
5262                 name: "tests1.dat #98",
5263                 html: "<b><button></b></button></b>",
5264                 errors: 3,
5265                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|     <button>\n|       <b>\n"
5266         }, {
5267                 name: "tests1.dat #99",
5268                 html: "<p><b><div><marquee></p></b></div>",
5269                 errors: 6,
5270                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <b>\n|     <div>\n|       <b>\n|         <marquee>\n|           <p>\n"
5271         }, {
5272                 name: "tests1.dat #100",
5273                 html: "<script></script></div><title></title><p><p>",
5274                 errors: 2,
5275                 expected: "| <html>\n|   <head>\n|     <script>\n|     <title>\n|   <body>\n|     <p>\n|     <p>\n"
5276         }, {
5277                 name: "tests1.dat #101",
5278                 html: "<p><hr></p>",
5279                 errors: 2,
5280                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <hr>\n|     <p>\n"
5281         }, {
5282                 name: "tests1.dat #102",
5283                 html: "<select><b><option><select><option></b></select>",
5284                 errors: 6,
5285                 expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n|     <option>\n"
5286         }, {
5287                 name: "tests1.dat #103",
5288                 html: "<html><head><title></title><body></body></html>",
5289                 errors: 1,
5290                 expected: "| <html>\n|   <head>\n|     <title>\n|   <body>\n"
5291         }, {
5292                 name: "tests1.dat #104",
5293                 html: "<a><table><td><a><table></table><a></tr><a></table><a>",
5294                 errors: 10,
5295                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       <a>\n|       <table>\n|         <tbody>\n|           <tr>\n|             <td>\n|               <a>\n|                 <table>\n|               <a>\n|     <a>\n"
5296         }, {
5297                 name: "tests1.dat #105",
5298                 html: "<ul><li></li><div><li></div><li><li><div><li><address><li><b><em></b><li></ul>",
5299                 errors: 4,
5300                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ul>\n|       <li>\n|       <div>\n|         <li>\n|       <li>\n|       <li>\n|         <div>\n|       <li>\n|         <address>\n|       <li>\n|         <b>\n|           <em>\n|       <li>\n"
5301         }, {
5302                 name: "tests1.dat #106",
5303                 html: "<ul><li><ul></li><li>a</li></ul></li></ul>",
5304                 errors: 2,
5305                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ul>\n|       <li>\n|         <ul>\n|           <li>\n|             \"a\"\n"
5306         }, {
5307                 name: "tests1.dat #107",
5308                 html: "<frameset><frame><frameset><frame></frameset><noframes></noframes></frameset>",
5309                 errors: 1,
5310                 expected: "| <html>\n|   <head>\n|   <frameset>\n|     <frame>\n|     <frameset>\n|       <frame>\n|     <noframes>\n"
5311         }, {
5312                 name: "tests1.dat #108",
5313                 html: "<h1><table><td><h3></table><h3></h1>",
5314                 errors: 5,
5315                 expected: "| <html>\n|   <head>\n|   <body>\n|     <h1>\n|       <table>\n|         <tbody>\n|           <tr>\n|             <td>\n|               <h3>\n|     <h3>\n"
5316         }, {
5317                 name: "tests1.dat #109",
5318                 html: "<table><colgroup><col><colgroup><col><col><col><colgroup><col><col><thead><tr><td></table>",
5319                 errors: 1,
5320                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <colgroup>\n|         <col>\n|       <colgroup>\n|         <col>\n|         <col>\n|         <col>\n|       <colgroup>\n|         <col>\n|         <col>\n|       <thead>\n|         <tr>\n|           <td>\n"
5321         }, {
5322                 name: "tests1.dat #110",
5323                 html: "<table><col><tbody><col><tr><col><td><col></table><col>",
5324                 errors: 3,
5325                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <colgroup>\n|         <col>\n|       <tbody>\n|       <colgroup>\n|         <col>\n|       <tbody>\n|         <tr>\n|       <colgroup>\n|         <col>\n|       <tbody>\n|         <tr>\n|           <td>\n|       <colgroup>\n|         <col>\n"
5326         }, {
5327                 name: "tests1.dat #111",
5328                 html: "<table><colgroup><tbody><colgroup><tr><colgroup><td><colgroup></table><colgroup>",
5329                 errors: 3,
5330                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <colgroup>\n|       <tbody>\n|       <colgroup>\n|       <tbody>\n|         <tr>\n|       <colgroup>\n|       <tbody>\n|         <tr>\n|           <td>\n|       <colgroup>\n"
5331         }, {
5332                 name: "tests1.dat #112",
5333                 html: "</strong></b></em></i></u></strike></s></blink></tt></pre></big></small></font></select></h1></h2></h3></h4></h5></h6></body></br></a></img></title></span></style></script></table></th></td></tr></frame></area></link></param></hr></input></col></base></meta></basefont></bgsound></embed></spacer></p></dd></dt></caption></colgroup></tbody></tfoot></thead></address></blockquote></center></dir></div></dl></fieldset></listing></menu></ol></ul></li></nobr></wbr></form></button></marquee></object></html></frameset></head></iframe></image></isindex></noembed></noframes></noscript></optgroup></option></plaintext></textarea>",
5334                 errors: 85,
5335                 expected: "| <html>\n|   <head>\n|   <body>\n|     <br>\n|     <p>\n"
5336         }, {
5337                 name: "tests1.dat #113",
5338                 html: "<table><tr></strong></b></em></i></u></strike></s></blink></tt></pre></big></small></font></select></h1></h2></h3></h4></h5></h6></body></br></a></img></title></span></style></script></table></th></td></tr></frame></area></link></param></hr></input></col></base></meta></basefont></bgsound></embed></spacer></p></dd></dt></caption></colgroup></tbody></tfoot></thead></address></blockquote></center></dir></div></dl></fieldset></listing></menu></ol></ul></li></nobr></wbr></form></button></marquee></object></html></frameset></head></iframe></image></isindex></noembed></noframes></noscript></optgroup></option></plaintext></textarea>",
5339                 errors: 111,
5340                 expected: "| <html>\n|   <head>\n|   <body>\n|     <br>\n|     <table>\n|       <tbody>\n|         <tr>\n|     <p>\n"
5341         }, {
5342                 name: "tests1.dat #114",
5343                 html: "<frameset>",
5344                 errors: 2,
5345                 expected: "| <html>\n|   <head>\n|   <frameset>\n"
5346         }, {
5347                 name: "tests20.dat #1",
5348                 html: "<!doctype html><p><button><button>",
5349                 errors: 2,
5350                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|       <button>\n"
5351         }, {
5352                 name: "tests20.dat #2",
5353                 html: "<!doctype html><p><button><address>",
5354                 errors: 1,
5355                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <address>\n"
5356         }, {
5357                 name: "tests20.dat #3",
5358                 html: "<!doctype html><p><button><blockquote>",
5359                 errors: 1,
5360                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <blockquote>\n"
5361         }, {
5362                 name: "tests20.dat #4",
5363                 html: "<!doctype html><p><button><menu>",
5364                 errors: 1,
5365                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <menu>\n"
5366         }, {
5367                 name: "tests20.dat #5",
5368                 html: "<!doctype html><p><button><p>",
5369                 errors: 1,
5370                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <p>\n"
5371         }, {
5372                 name: "tests20.dat #6",
5373                 html: "<!doctype html><p><button><ul>",
5374                 errors: 1,
5375                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <ul>\n"
5376         }, {
5377                 name: "tests20.dat #7",
5378                 html: "<!doctype html><p><button><h1>",
5379                 errors: 1,
5380                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <h1>\n"
5381         }, {
5382                 name: "tests20.dat #8",
5383                 html: "<!doctype html><p><button><h6>",
5384                 errors: 1,
5385                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <h6>\n"
5386         }, {
5387                 name: "tests20.dat #9",
5388                 html: "<!doctype html><p><button><listing>",
5389                 errors: 1,
5390                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <listing>\n"
5391         }, {
5392                 name: "tests20.dat #10",
5393                 html: "<!doctype html><p><button><pre>",
5394                 errors: 1,
5395                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <pre>\n"
5396         }, {
5397                 name: "tests20.dat #11",
5398                 html: "<!doctype html><p><button><form>",
5399                 errors: 1,
5400                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <form>\n"
5401         }, {
5402                 name: "tests20.dat #12",
5403                 html: "<!doctype html><p><button><li>",
5404                 errors: 1,
5405                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <li>\n"
5406         }, {
5407                 name: "tests20.dat #13",
5408                 html: "<!doctype html><p><button><dd>",
5409                 errors: 1,
5410                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <dd>\n"
5411         }, {
5412                 name: "tests20.dat #14",
5413                 html: "<!doctype html><p><button><dt>",
5414                 errors: 1,
5415                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <dt>\n"
5416         }, {
5417                 name: "tests20.dat #15",
5418                 html: "<!doctype html><p><button><plaintext>",
5419                 errors: 1,
5420                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <plaintext>\n"
5421         }, {
5422                 name: "tests20.dat #16",
5423                 html: "<!doctype html><p><button><table>",
5424                 errors: 1,
5425                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <table>\n"
5426         }, {
5427                 name: "tests20.dat #17",
5428                 html: "<!doctype html><p><button><hr>",
5429                 errors: 1,
5430                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <hr>\n"
5431         }, {
5432                 name: "tests20.dat #18",
5433                 html: "<!doctype html><p><button><xmp>",
5434                 errors: 2,
5435                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <xmp>\n"
5436         }, {
5437                 name: "tests20.dat #19",
5438                 html: "<!doctype html><p><button></p>",
5439                 errors: 2,
5440                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <button>\n|         <p>\n"
5441         }, {
5442                 name: "tests20.dat #20",
5443                 html: "<!doctype html><address><button></address>a",
5444                 errors: 1,
5445                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <address>\n|       <button>\n|     \"a\"\n"
5446         }, {
5447                 name: "tests20.dat #21",
5448                 html: "<!doctype html><address><button></address>a",
5449                 errors: 1,
5450                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <address>\n|       <button>\n|     \"a\"\n"
5451         }, {
5452                 name: "tests20.dat #22",
5453                 html: "<p><table></p>",
5454                 errors: 4,
5455                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <p>\n|       <table>\n"
5456         }, {
5457                 name: "tests20.dat #23",
5458                 html: "<!doctype html><svg>",
5459                 errors: 1,
5460                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n"
5461         }, {
5462                 name: "tests20.dat #24",
5463                 html: "<!doctype html><p><figcaption>",
5464                 errors: 1,
5465                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <figcaption>\n"
5466         }, {
5467                 name: "tests20.dat #25",
5468                 html: "<!doctype html><p><summary>",
5469                 errors: 1,
5470                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <summary>\n"
5471         }, {
5472                 name: "tests20.dat #26",
5473                 html: "<!doctype html><form><table><form>",
5474                 errors: 2,
5475                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <form>\n|       <table>\n"
5476         }, {
5477                 name: "tests20.dat #27",
5478                 html: "<!doctype html><table><form><form>",
5479                 errors: 3,
5480                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <form>\n"
5481         }, {
5482                 name: "tests20.dat #28",
5483                 html: "<!doctype html><table><form></table><form>",
5484                 errors: 2,
5485                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <form>\n"
5486         }, {
5487                 name: "tests20.dat #29",
5488                 html: "<!doctype html><svg><foreignObject><p>",
5489                 errors: 1,
5490                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg foreignObject>\n|         <p>\n"
5491         }, {
5492                 name: "tests20.dat #30",
5493                 html: "<!doctype html><svg><title>abc",
5494                 errors: 1,
5495                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg title>\n|         \"abc\"\n"
5496         }, {
5497                 name: "tests20.dat #31",
5498                 html: "<option><span><option>",
5499                 errors: 2,
5500                 expected: "| <html>\n|   <head>\n|   <body>\n|     <option>\n|       <span>\n|         <option>\n"
5501         }, {
5502                 name: "tests20.dat #32",
5503                 html: "<option><option>",
5504                 errors: 2,
5505                 expected: "| <html>\n|   <head>\n|   <body>\n|     <option>\n|     <option>\n"
5506         }, {
5507                 name: "tests20.dat #33",
5508                 html: "<math><annotation-xml><div>",
5509                 errors: 3,
5510                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math annotation-xml>\n|     <div>\n"
5511         }, {
5512                 name: "tests20.dat #34",
5513                 html: "<math><annotation-xml encoding=\"application/svg+xml\"><div>",
5514                 errors: 3,
5515                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math annotation-xml>\n|         encoding=\"application/svg+xml\"\n|     <div>\n"
5516         }, {
5517                 name: "tests20.dat #35",
5518                 html: "<math><annotation-xml encoding=\"application/xhtml+xml\"><div>",
5519                 errors: 2,
5520                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math annotation-xml>\n|         encoding=\"application/xhtml+xml\"\n|         <div>\n"
5521         }, {
5522                 name: "tests20.dat #36",
5523                 html: "<math><annotation-xml encoding=\"aPPlication/xhtmL+xMl\"><div>",
5524                 errors: 2,
5525                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math annotation-xml>\n|         encoding=\"aPPlication/xhtmL+xMl\"\n|         <div>\n"
5526         }, {
5527                 name: "tests20.dat #37",
5528                 html: "<math><annotation-xml encoding=\"text/html\"><div>",
5529                 errors: 2,
5530                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math annotation-xml>\n|         encoding=\"text/html\"\n|         <div>\n"
5531         }, {
5532                 name: "tests20.dat #38",
5533                 html: "<math><annotation-xml encoding=\"Text/htmL\"><div>",
5534                 errors: 2,
5535                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math annotation-xml>\n|         encoding=\"Text/htmL\"\n|         <div>\n"
5536         }, {
5537                 name: "tests20.dat #39",
5538                 html: "<math><annotation-xml encoding=\" text/html \"><div>",
5539                 errors: 3,
5540                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math annotation-xml>\n|         encoding=\" text/html \"\n|     <div>\n"
5541         }, {
5542                 name: "tests21.dat #1",
5543                 html: "<svg><![CDATA[foo]]>",
5544                 errors: 2,
5545                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"foo\"\n"
5546         }, {
5547                 name: "tests21.dat #2",
5548                 html: "<math><![CDATA[foo]]>",
5549                 errors: 2,
5550                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       \"foo\"\n"
5551         }, {
5552                 name: "tests21.dat #3",
5553                 html: "<div><![CDATA[foo]]>",
5554                 errors: 3,
5555                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <!-- [CDATA[foo]] -->\n"
5556         }, {
5557                 name: "tests21.dat #4",
5558                 html: "<svg><![CDATA[foo",
5559                 errors: 2,
5560                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"foo\"\n"
5561         }, {
5562                 name: "tests21.dat #5",
5563                 html: "<svg><![CDATA[foo",
5564                 errors: 2,
5565                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"foo\"\n"
5566         }, {
5567                 name: "tests21.dat #6",
5568                 html: "<svg><![CDATA[",
5569                 errors: 2,
5570                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n"
5571         }, {
5572                 name: "tests21.dat #7",
5573                 html: "<svg><![CDATA[]]>",
5574                 errors: 2,
5575                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n"
5576         }, {
5577                 name: "tests21.dat #8",
5578                 html: "<svg><![CDATA[]] >]]>",
5579                 errors: 2,
5580                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"]] >\"\n"
5581         }, {
5582                 name: "tests21.dat #9",
5583                 html: "<svg><![CDATA[]] >]]>",
5584                 errors: 2,
5585                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"]] >\"\n"
5586         }, {
5587                 name: "tests21.dat #10",
5588                 html: "<svg><![CDATA[]]",
5589                 errors: 2,
5590                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"]]\"\n"
5591         }, {
5592                 name: "tests21.dat #11",
5593                 html: "<svg><![CDATA[]",
5594                 errors: 2,
5595                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"]\"\n"
5596         }, {
5597                 name: "tests21.dat #12",
5598                 html: "<svg><![CDATA[]>a",
5599                 errors: 2,
5600                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"]>a\"\n"
5601         }, {
5602                 name: "tests21.dat #13",
5603                 html: "<!DOCTYPE html><svg><![CDATA[foo]]]>",
5604                 errors: 1,
5605                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"foo]\"\n"
5606         }, {
5607                 name: "tests21.dat #14",
5608                 html: "<!DOCTYPE html><svg><![CDATA[foo]]]]>",
5609                 errors: 1,
5610                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"foo]]\"\n"
5611         }, {
5612                 name: "tests21.dat #15",
5613                 html: "<!DOCTYPE html><svg><![CDATA[foo]]]]]>",
5614                 errors: 1,
5615                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"foo]]]\"\n"
5616         }, {
5617                 name: "tests21.dat #16",
5618                 html: "<svg><foreignObject><div><![CDATA[foo]]>",
5619                 errors: 3,
5620                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg foreignObject>\n|         <div>\n|           <!-- [CDATA[foo]] -->\n"
5621         }, {
5622                 name: "tests21.dat #17",
5623                 html: "<svg><![CDATA[<svg>]]>",
5624                 errors: 2,
5625                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"<svg>\"\n"
5626         }, {
5627                 name: "tests21.dat #18",
5628                 html: "<svg><![CDATA[</svg>a]]>",
5629                 errors: 2,
5630                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"</svg>a\"\n"
5631         }, {
5632                 name: "tests21.dat #19",
5633                 html: "<svg><![CDATA[<svg>a",
5634                 errors: 2,
5635                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"<svg>a\"\n"
5636         }, {
5637                 name: "tests21.dat #20",
5638                 html: "<svg><![CDATA[</svg>a",
5639                 errors: 2,
5640                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"</svg>a\"\n"
5641         }, {
5642                 name: "tests21.dat #21",
5643                 html: "<svg><![CDATA[<svg>]]><path>",
5644                 errors: 2,
5645                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"<svg>\"\n|       <svg path>\n"
5646         }, {
5647                 name: "tests21.dat #22",
5648                 html: "<svg><![CDATA[<svg>]]></path>",
5649                 errors: 4,
5650                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"<svg>\"\n"
5651         }, {
5652                 name: "tests21.dat #23",
5653                 html: "<svg><![CDATA[<svg>]]><!--path-->",
5654                 errors: 2,
5655                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"<svg>\"\n|       <!-- path -->\n"
5656         }, {
5657                 name: "tests21.dat #24",
5658                 html: "<svg><![CDATA[<svg>]]>path",
5659                 errors: 2,
5660                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"<svg>path\"\n"
5661         }, {
5662                 name: "tests21.dat #25",
5663                 html: "<svg><![CDATA[<!--svg-->]]>",
5664                 errors: 2,
5665                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       \"<!--svg-->\"\n"
5666         }, {
5667                 name: "tests22.dat #1",
5668                 html: "<a><b><big><em><strong><div>X</a>",
5669                 errors: 3,
5670                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       <b>\n|         <big>\n|           <em>\n|             <strong>\n|     <big>\n|       <em>\n|         <strong>\n|           <div>\n|             <a>\n|               \"X\"\n"
5671         }, {
5672                 name: "tests22.dat #2",
5673                 html: "<a><b><div id=1><div id=2><div id=3><div id=4><div id=5><div id=6><div id=7><div id=8>A</a>",
5674                 errors: 10,
5675                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       <b>\n|     <b>\n|       <div>\n|         id=\"1\"\n|         <a>\n|         <div>\n|           id=\"2\"\n|           <a>\n|           <div>\n|             id=\"3\"\n|             <a>\n|             <div>\n|               id=\"4\"\n|               <a>\n|               <div>\n|                 id=\"5\"\n|                 <a>\n|                 <div>\n|                   id=\"6\"\n|                   <a>\n|                   <div>\n|                     id=\"7\"\n|                     <a>\n|                     <div>\n|                       id=\"8\"\n|                       <a>\n|                         \"A\"\n"
5676         }, {
5677                 name: "tests22.dat #3",
5678                 html: "<a><b><div id=1><div id=2><div id=3><div id=4><div id=5><div id=6><div id=7><div id=8><div id=9>A</a>",
5679                 errors: 10,
5680                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       <b>\n|     <b>\n|       <div>\n|         id=\"1\"\n|         <a>\n|         <div>\n|           id=\"2\"\n|           <a>\n|           <div>\n|             id=\"3\"\n|             <a>\n|             <div>\n|               id=\"4\"\n|               <a>\n|               <div>\n|                 id=\"5\"\n|                 <a>\n|                 <div>\n|                   id=\"6\"\n|                   <a>\n|                   <div>\n|                     id=\"7\"\n|                     <a>\n|                     <div>\n|                       id=\"8\"\n|                       <a>\n|                         <div>\n|                           id=\"9\"\n|                           \"A\"\n"
5681         }, {
5682                 name: "tests22.dat #4",
5683                 html: "<a><b><div id=1><div id=2><div id=3><div id=4><div id=5><div id=6><div id=7><div id=8><div id=9><div id=10>A</a>",
5684                 errors: 10,
5685                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       <b>\n|     <b>\n|       <div>\n|         id=\"1\"\n|         <a>\n|         <div>\n|           id=\"2\"\n|           <a>\n|           <div>\n|             id=\"3\"\n|             <a>\n|             <div>\n|               id=\"4\"\n|               <a>\n|               <div>\n|                 id=\"5\"\n|                 <a>\n|                 <div>\n|                   id=\"6\"\n|                   <a>\n|                   <div>\n|                     id=\"7\"\n|                     <a>\n|                     <div>\n|                       id=\"8\"\n|                       <a>\n|                         <div>\n|                           id=\"9\"\n|                           <div>\n|                             id=\"10\"\n|                             \"A\"\n"
5686         }, {
5687                 name: "tests22.dat #5",
5688                 html: "<cite><b><cite><i><cite><i><cite><i><div>X</b>TEST",
5689                 errors: 3,
5690                 expected: "| <html>\n|   <head>\n|   <body>\n|     <cite>\n|       <b>\n|         <cite>\n|           <i>\n|             <cite>\n|               <i>\n|                 <cite>\n|                   <i>\n|       <i>\n|         <i>\n|           <div>\n|             <b>\n|               \"X\"\n|             \"TEST\"\n"
5691         }, {
5692                 name: "tests23.dat #1",
5693                 html: "<p><font size=4><font color=red><font size=4><font size=4><font size=4><font size=4><font size=4><font color=red><p>X",
5694                 errors: 3,
5695                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <font>\n|         size=\"4\"\n|         <font>\n|           color=\"red\"\n|           <font>\n|             size=\"4\"\n|             <font>\n|               size=\"4\"\n|               <font>\n|                 size=\"4\"\n|                 <font>\n|                   size=\"4\"\n|                   <font>\n|                     size=\"4\"\n|                     <font>\n|                       color=\"red\"\n|     <p>\n|       <font>\n|         color=\"red\"\n|         <font>\n|           size=\"4\"\n|           <font>\n|             size=\"4\"\n|             <font>\n|               size=\"4\"\n|               <font>\n|                 color=\"red\"\n|                 \"X\"\n"
5696         }, {
5697                 name: "tests23.dat #2",
5698                 html: "<p><font size=4><font size=4><font size=4><font size=4><p>X",
5699                 errors: 3,
5700                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <font>\n|         size=\"4\"\n|         <font>\n|           size=\"4\"\n|           <font>\n|             size=\"4\"\n|             <font>\n|               size=\"4\"\n|     <p>\n|       <font>\n|         size=\"4\"\n|         <font>\n|           size=\"4\"\n|           <font>\n|             size=\"4\"\n|             \"X\"\n"
5701         }, {
5702                 name: "tests23.dat #3",
5703                 html: "<p><font size=4><font size=4><font size=4><font size=\"5\"><font size=4><p>X",
5704                 errors: 3,
5705                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <font>\n|         size=\"4\"\n|         <font>\n|           size=\"4\"\n|           <font>\n|             size=\"4\"\n|             <font>\n|               size=\"5\"\n|               <font>\n|                 size=\"4\"\n|     <p>\n|       <font>\n|         size=\"4\"\n|         <font>\n|           size=\"4\"\n|           <font>\n|             size=\"5\"\n|             <font>\n|               size=\"4\"\n|               \"X\"\n"
5706         }, {
5707                 name: "tests23.dat #4",
5708                 html: "<p><font size=4 id=a><font size=4 id=b><font size=4><font size=4><p>X",
5709                 errors: 3,
5710                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <font>\n|         id=\"a\"\n|         size=\"4\"\n|         <font>\n|           id=\"b\"\n|           size=\"4\"\n|           <font>\n|             size=\"4\"\n|             <font>\n|               size=\"4\"\n|     <p>\n|       <font>\n|         id=\"a\"\n|         size=\"4\"\n|         <font>\n|           id=\"b\"\n|           size=\"4\"\n|           <font>\n|             size=\"4\"\n|             <font>\n|               size=\"4\"\n|               \"X\"\n"
5711         }, {
5712                 name: "tests23.dat #5",
5713                 html: "<p><b id=a><b id=a><b id=a><b><object><b id=a><b id=a>X</object><p>Y",
5714                 errors: 4,
5715                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <b>\n|         id=\"a\"\n|         <b>\n|           id=\"a\"\n|           <b>\n|             id=\"a\"\n|             <b>\n|               <object>\n|                 <b>\n|                   id=\"a\"\n|                   <b>\n|                     id=\"a\"\n|                     \"X\"\n|     <p>\n|       <b>\n|         id=\"a\"\n|         <b>\n|           id=\"a\"\n|           <b>\n|             id=\"a\"\n|             <b>\n|               \"Y\"\n"
5716         }, {
5717                 name: "tests24.dat #1",
5718                 html: "<!DOCTYPE html>&NotEqualTilde;",
5719                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"≂̸\"\n"
5720         }, {
5721                 name: "tests24.dat #2",
5722                 html: "<!DOCTYPE html>&NotEqualTilde;A",
5723                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"≂̸A\"\n"
5724         }, {
5725                 name: "tests24.dat #3",
5726                 html: "<!DOCTYPE html>&ThickSpace;",
5727                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"  \"\n"
5728         }, {
5729                 name: "tests24.dat #4",
5730                 html: "<!DOCTYPE html>&ThickSpace;A",
5731                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"  A\"\n"
5732         }, {
5733                 name: "tests24.dat #5",
5734                 html: "<!DOCTYPE html>&NotSubset;",
5735                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"⊂⃒\"\n"
5736         }, {
5737                 name: "tests24.dat #6",
5738                 html: "<!DOCTYPE html>&NotSubset;A",
5739                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"⊂⃒A\"\n"
5740         }, {
5741                 name: "tests24.dat #7",
5742                 html: "<!DOCTYPE html>&Gopf;",
5743                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"𝔾\"\n"
5744         }, {
5745                 name: "tests24.dat #8",
5746                 html: "<!DOCTYPE html>&Gopf;A",
5747                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"𝔾A\"\n"
5748         }, {
5749                 name: "tests25.dat #1",
5750                 html: "<!DOCTYPE html><body><foo>A",
5751                 errors: 1,
5752                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <foo>\n|       \"A\"\n"
5753         }, {
5754                 name: "tests25.dat #2",
5755                 html: "<!DOCTYPE html><body><area>A",
5756                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <area>\n|     \"A\"\n"
5757         }, {
5758                 name: "tests25.dat #3",
5759                 html: "<!DOCTYPE html><body><base>A",
5760                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <base>\n|     \"A\"\n"
5761         }, {
5762                 name: "tests25.dat #4",
5763                 html: "<!DOCTYPE html><body><basefont>A",
5764                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <basefont>\n|     \"A\"\n"
5765         }, {
5766                 name: "tests25.dat #5",
5767                 html: "<!DOCTYPE html><body><bgsound>A",
5768                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <bgsound>\n|     \"A\"\n"
5769         }, {
5770                 name: "tests25.dat #6",
5771                 html: "<!DOCTYPE html><body><br>A",
5772                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <br>\n|     \"A\"\n"
5773         }, {
5774                 name: "tests25.dat #7",
5775                 html: "<!DOCTYPE html><body><col>A",
5776                 errors: 1,
5777                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"A\"\n"
5778         }, {
5779                 name: "tests25.dat #8",
5780                 html: "<!DOCTYPE html><body><command>A",
5781                 errors: 1,
5782                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <command>\n|       \"A\"\n"
5783         }, {
5784                 name: "tests25.dat #9",
5785                 html: "<!DOCTYPE html><body><menuitem>A",
5786                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <menuitem>\n|     \"A\"\n"
5787         }, {
5788                 name: "tests25.dat #10",
5789                 html: "<!DOCTYPE html><body><embed>A",
5790                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <embed>\n|     \"A\"\n"
5791         }, {
5792                 name: "tests25.dat #11",
5793                 html: "<!DOCTYPE html><body><frame>A",
5794                 errors: 1,
5795                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"A\"\n"
5796         }, {
5797                 name: "tests25.dat #12",
5798                 html: "<!DOCTYPE html><body><hr>A",
5799                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <hr>\n|     \"A\"\n"
5800         }, {
5801                 name: "tests25.dat #13",
5802                 html: "<!DOCTYPE html><body><img>A",
5803                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <img>\n|     \"A\"\n"
5804         }, {
5805                 name: "tests25.dat #14",
5806                 html: "<!DOCTYPE html><body><input>A",
5807                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <input>\n|     \"A\"\n"
5808         }, {
5809                 name: "tests25.dat #15",
5810                 html: "<!DOCTYPE html><body><keygen>A",
5811                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <keygen>\n|     \"A\"\n"
5812         }, {
5813                 name: "tests25.dat #16",
5814                 html: "<!DOCTYPE html><body><link>A",
5815                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <link>\n|     \"A\"\n"
5816         }, {
5817                 name: "tests25.dat #17",
5818                 html: "<!DOCTYPE html><body><meta>A",
5819                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <meta>\n|     \"A\"\n"
5820         }, {
5821                 name: "tests25.dat #18",
5822                 html: "<!DOCTYPE html><body><param>A",
5823                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <param>\n|     \"A\"\n"
5824         }, {
5825                 name: "tests25.dat #19",
5826                 html: "<!DOCTYPE html><body><source>A",
5827                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <source>\n|     \"A\"\n"
5828         }, {
5829                 name: "tests25.dat #20",
5830                 html: "<!DOCTYPE html><body><track>A",
5831                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <track>\n|     \"A\"\n"
5832         }, {
5833                 name: "tests25.dat #21",
5834                 html: "<!DOCTYPE html><body><wbr>A",
5835                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <wbr>\n|     \"A\"\n"
5836         }, {
5837                 name: "tests26.dat #1",
5838                 html: "<!DOCTYPE html><body><a href='#1'><nobr>1<nobr></a><br><a href='#2'><nobr>2<nobr></a><br><a href='#3'><nobr>3<nobr></a>",
5839                 errors: 10,
5840                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <a>\n|       href=\"#1\"\n|       <nobr>\n|         \"1\"\n|       <nobr>\n|     <nobr>\n|       <br>\n|       <a>\n|         href=\"#2\"\n|     <a>\n|       href=\"#2\"\n|       <nobr>\n|         \"2\"\n|       <nobr>\n|     <nobr>\n|       <br>\n|       <a>\n|         href=\"#3\"\n|     <a>\n|       href=\"#3\"\n|       <nobr>\n|         \"3\"\n|       <nobr>\n"
5841         }, {
5842                 name: "tests26.dat #2",
5843                 html: "<!DOCTYPE html><body><b><nobr>1<nobr></b><i><nobr>2<nobr></i>3",
5844                 errors: 7,
5845                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <nobr>\n|         \"1\"\n|       <nobr>\n|     <nobr>\n|       <i>\n|     <i>\n|       <nobr>\n|         \"2\"\n|       <nobr>\n|     <nobr>\n|       \"3\"\n"
5846         }, {
5847                 name: "tests26.dat #3",
5848                 html: "<!DOCTYPE html><body><b><nobr>1<table><nobr></b><i><nobr>2<nobr></i>3",
5849                 errors: 14,
5850                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <nobr>\n|         \"1\"\n|         <nobr>\n|           <i>\n|         <i>\n|           <nobr>\n|             \"2\"\n|           <nobr>\n|         <nobr>\n|           \"3\"\n|         <table>\n"
5851         }, {
5852                 name: "tests26.dat #4",
5853                 html: "<!DOCTYPE html><body><b><nobr>1<table><tr><td><nobr></b><i><nobr>2<nobr></i>3",
5854                 errors: 6,
5855                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <nobr>\n|         \"1\"\n|         <table>\n|           <tbody>\n|             <tr>\n|               <td>\n|                 <nobr>\n|                   <i>\n|                 <i>\n|                   <nobr>\n|                     \"2\"\n|                   <nobr>\n|                 <nobr>\n|                   \"3\"\n"
5856         }, {
5857                 name: "tests26.dat #5",
5858                 html: "<!DOCTYPE html><body><b><nobr>1<div><nobr></b><i><nobr>2<nobr></i>3",
5859                 errors: 9,
5860                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <nobr>\n|         \"1\"\n|     <div>\n|       <b>\n|         <nobr>\n|         <nobr>\n|       <nobr>\n|         <i>\n|       <i>\n|         <nobr>\n|           \"2\"\n|         <nobr>\n|       <nobr>\n|         \"3\"\n"
5861         }, {
5862                 name: "tests26.dat #6",
5863                 html: "<!DOCTYPE html><body><b><nobr>1<nobr></b><div><i><nobr>2<nobr></i>3",
5864                 errors: 7,
5865                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <nobr>\n|         \"1\"\n|       <nobr>\n|     <div>\n|       <nobr>\n|         <i>\n|       <i>\n|         <nobr>\n|           \"2\"\n|         <nobr>\n|       <nobr>\n|         \"3\"\n"
5866         }, {
5867                 name: "tests26.dat #7",
5868                 html: "<!DOCTYPE html><body><b><nobr>1<nobr><ins></b><i><nobr>",
5869                 errors: 5,
5870                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <nobr>\n|         \"1\"\n|       <nobr>\n|         <ins>\n|     <nobr>\n|       <i>\n|     <i>\n|       <nobr>\n"
5871         }, {
5872                 name: "tests26.dat #8",
5873                 html: "<!DOCTYPE html><body><b><nobr>1<ins><nobr></b><i>2",
5874                 errors: 4,
5875                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <nobr>\n|         \"1\"\n|         <ins>\n|       <nobr>\n|     <nobr>\n|       <i>\n|         \"2\"\n"
5876         }, {
5877                 name: "tests26.dat #9",
5878                 html: "<!DOCTYPE html><body><b>1<nobr></b><i><nobr>2</i>",
5879                 errors: 4,
5880                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <b>\n|       \"1\"\n|       <nobr>\n|     <nobr>\n|       <i>\n|     <i>\n|       <nobr>\n|         \"2\"\n"
5881         }, {
5882                 name: "tests26.dat #10",
5883                 html: "<p><code x</code></p>\n",
5884                 errors: 5,
5885                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <code>\n|         code=\"\"\n|         x<=\"\"\n|     <code>\n|       code=\"\"\n|       x<=\"\"\n|       \"\n\"\n"
5886         }, {
5887                 name: "tests26.dat #11",
5888                 html: "<!DOCTYPE html><svg><foreignObject><p><i></p>a",
5889                 errors: 2,
5890                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg foreignObject>\n|         <p>\n|           <i>\n|         <i>\n|           \"a\"\n"
5891         }, {
5892                 name: "tests26.dat #12",
5893                 html: "<!DOCTYPE html><table><tr><td><svg><foreignObject><p><i></p>a",
5894                 errors: 2,
5895                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <svg svg>\n|               <svg foreignObject>\n|                 <p>\n|                   <i>\n|                 <i>\n|                   \"a\"\n"
5896         }, {
5897                 name: "tests26.dat #13",
5898                 html: "<!DOCTYPE html><math><mtext><p><i></p>a",
5899                 errors: 2,
5900                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mtext>\n|         <p>\n|           <i>\n|         <i>\n|           \"a\"\n"
5901         }, {
5902                 name: "tests26.dat #14",
5903                 html: "<!DOCTYPE html><table><tr><td><math><mtext><p><i></p>a",
5904                 errors: 2,
5905                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <math math>\n|               <math mtext>\n|                 <p>\n|                   <i>\n|                 <i>\n|                   \"a\"\n"
5906         }, {
5907                 name: "tests26.dat #15",
5908                 html: "<!DOCTYPE html><body><div><!/div>a",
5909                 errors: 2,
5910                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <!-- /div -->\n|       \"a\"\n"
5911         }, {
5912                 name: "tests26.dat #16",
5913                 html: "<button><p><button>",
5914                 errors: 3,
5915                 expected: "| <html>\n|   <head>\n|   <body>\n|     <button>\n|       <p>\n|     <button>\n"
5916         }, {
5917                 name: "tests2.dat #1",
5918                 html: "<!DOCTYPE html>Test",
5919                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"Test\"\n"
5920         }, {
5921                 name: "tests2.dat #2",
5922                 html: "<textarea>test</div>test",
5923                 errors: 2,
5924                 expected: "| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"test</div>test\"\n"
5925         }, {
5926                 name: "tests2.dat #3",
5927                 html: "<table><td>",
5928                 errors: 3,
5929                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n"
5930         }, {
5931                 name: "tests2.dat #4",
5932                 html: "<table><td>test</tbody></table>",
5933                 errors: 2,
5934                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             \"test\"\n"
5935         }, {
5936                 name: "tests2.dat #5",
5937                 html: "<frame>test",
5938                 errors: 2,
5939                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"test\"\n"
5940         }, {
5941                 name: "tests2.dat #6",
5942                 html: "<!DOCTYPE html><frameset>test",
5943                 errors: 5,
5944                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
5945         }, {
5946                 name: "tests2.dat #7",
5947                 html: "<!DOCTYPE html><frameset> te st",
5948                 errors: 5,
5949                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|     \"  \"\n"
5950         }, {
5951                 name: "tests2.dat #8",
5952                 html: "<!DOCTYPE html><frameset></frameset> te st",
5953                 errors: 4,
5954                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n|   \"  \"\n"
5955         }, {
5956                 name: "tests2.dat #9",
5957                 html: "<!DOCTYPE html><frameset><!DOCTYPE html>",
5958                 errors: 2,
5959                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
5960         }, {
5961                 name: "tests2.dat #10",
5962                 html: "<!DOCTYPE html><font><p><b>test</font>",
5963                 errors: 2,
5964                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <font>\n|     <p>\n|       <font>\n|         <b>\n|           \"test\"\n"
5965         }, {
5966                 name: "tests2.dat #11",
5967                 html: "<!DOCTYPE html><dt><div><dd>",
5968                 errors: 1,
5969                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <dt>\n|       <div>\n|     <dd>\n"
5970         }, {
5971                 name: "tests2.dat #12",
5972                 html: "<script></x",
5973                 errors: 2,
5974                 expected: "| <html>\n|   <head>\n|     <script>\n|       \"</x\"\n|   <body>\n"
5975         }, {
5976                 name: "tests2.dat #13",
5977                 html: "<table><plaintext><td>",
5978                 errors: 7,
5979                 expected: "| <html>\n|   <head>\n|   <body>\n|     <plaintext>\n|       \"<td>\"\n|     <table>\n"
5980         }, {
5981                 name: "tests2.dat #14",
5982                 html: "<plaintext></plaintext>",
5983                 errors: 2,
5984                 expected: "| <html>\n|   <head>\n|   <body>\n|     <plaintext>\n|       \"</plaintext>\"\n"
5985         }, {
5986                 name: "tests2.dat #15",
5987                 html: "<!DOCTYPE html><table><tr>TEST",
5988                 errors: 5,
5989                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"TEST\"\n|     <table>\n|       <tbody>\n|         <tr>\n"
5990         }, {
5991                 name: "tests2.dat #16",
5992                 html: "<!DOCTYPE html><body t1=1><body t2=2><body t3=3 t4=4>",
5993                 errors: 2,
5994                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     t1=\"1\"\n|     t2=\"2\"\n|     t3=\"3\"\n|     t4=\"4\"\n"
5995         }, {
5996                 name: "tests2.dat #17",
5997                 html: "</b test",
5998                 errors: 2,
5999                 expected: "| <html>\n|   <head>\n|   <body>\n"
6000         }, {
6001                 name: "tests2.dat #18",
6002                 html: "<!DOCTYPE html></b test<b &=&amp>X",
6003                 errors: 4,
6004                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"X\"\n"
6005         }, {
6006                 name: "tests2.dat #19",
6007                 html: "<!doctypehtml><scrIPt type=text/x-foobar;baz>X</SCRipt",
6008                 errors: 2,
6009                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       type=\"text/x-foobar;baz\"\n|       \"X</SCRipt\"\n|   <body>\n"
6010         }, {
6011                 name: "tests2.dat #20",
6012                 html: "&",
6013                 errors: 1,
6014                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"&\"\n"
6015         }, {
6016                 name: "tests2.dat #21",
6017                 html: "&#",
6018                 errors: 2,
6019                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"&#\"\n"
6020         }, {
6021                 name: "tests2.dat #22",
6022                 html: "&#X",
6023                 errors: 2,
6024                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"&#X\"\n"
6025         }, {
6026                 name: "tests2.dat #23",
6027                 html: "&#x",
6028                 errors: 2,
6029                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"&#x\"\n"
6030         }, {
6031                 name: "tests2.dat #24",
6032                 html: "&#45",
6033                 errors: 2,
6034                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"-\"\n"
6035         }, {
6036                 name: "tests2.dat #25",
6037                 html: "&x-test",
6038                 errors: 1,
6039                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"&x-test\"\n"
6040         }, {
6041                 name: "tests2.dat #26",
6042                 html: "<!doctypehtml><p><li>",
6043                 errors: 1,
6044                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <li>\n"
6045         }, {
6046                 name: "tests2.dat #27",
6047                 html: "<!doctypehtml><p><dt>",
6048                 errors: 1,
6049                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <dt>\n"
6050         }, {
6051                 name: "tests2.dat #28",
6052                 html: "<!doctypehtml><p><dd>",
6053                 errors: 1,
6054                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <dd>\n"
6055         }, {
6056                 name: "tests2.dat #29",
6057                 html: "<!doctypehtml><p><form>",
6058                 errors: 2,
6059                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <form>\n"
6060         }, {
6061                 name: "tests2.dat #30",
6062                 html: "<!DOCTYPE html><p></P>X",
6063                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     \"X\"\n"
6064         }, {
6065                 name: "tests2.dat #31",
6066                 html: "&AMP",
6067                 errors: 2,
6068                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"&\"\n"
6069         }, {
6070                 name: "tests2.dat #32",
6071                 html: "&AMp;",
6072                 errors: 2,
6073                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"&AMp;\"\n"
6074         }, {
6075                 name: "tests2.dat #33",
6076                 html: "<!DOCTYPE html><html><head></head><body><thisISasillyTESTelementNameToMakeSureCrazyTagNamesArePARSEDcorrectLY>",
6077                 errors: 1,
6078                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <thisisasillytestelementnametomakesurecrazytagnamesareparsedcorrectly>\n"
6079         }, {
6080                 name: "tests2.dat #34",
6081                 html: "<!DOCTYPE html>X</body>X",
6082                 errors: 1,
6083                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"XX\"\n"
6084         }, {
6085                 name: "tests2.dat #35",
6086                 html: "<!DOCTYPE html><!-- X",
6087                 errors: 1,
6088                 expected: "| <!DOCTYPE html>\n| <!--  X -->\n| <html>\n|   <head>\n|   <body>\n"
6089         }, {
6090                 name: "tests2.dat #36",
6091                 html: "<!DOCTYPE html><table><caption>test TEST</caption><td>test",
6092                 errors: 2,
6093                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         \"test TEST\"\n|       <tbody>\n|         <tr>\n|           <td>\n|             \"test\"\n"
6094         }, {
6095                 name: "tests2.dat #37",
6096                 html: "<!DOCTYPE html><select><option><optgroup>",
6097                 errors: 1,
6098                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n|       <optgroup>\n"
6099         }, {
6100                 name: "tests2.dat #38",
6101                 html: "<!DOCTYPE html><select><optgroup><option></optgroup><option><select><option>",
6102                 errors: 2,
6103                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <optgroup>\n|         <option>\n|       <option>\n|     <option>\n"
6104         }, {
6105                 name: "tests2.dat #39",
6106                 html: "<!DOCTYPE html><select><optgroup><option><optgroup>",
6107                 errors: 1,
6108                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <optgroup>\n|         <option>\n|       <optgroup>\n"
6109         }, {
6110                 name: "tests2.dat #40",
6111                 html: "<!DOCTYPE html><datalist><option>foo</datalist>bar",
6112                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <datalist>\n|       <option>\n|         \"foo\"\n|     \"bar\"\n"
6113         }, {
6114                 name: "tests2.dat #41",
6115                 html: "<!DOCTYPE html><font><input><input></font>",
6116                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <font>\n|       <input>\n|       <input>\n"
6117         }, {
6118                 name: "tests2.dat #42",
6119                 html: "<!DOCTYPE html><!-- XXX - XXX -->",
6120                 expected: "| <!DOCTYPE html>\n| <!--  XXX - XXX  -->\n| <html>\n|   <head>\n|   <body>\n"
6121         }, {
6122                 name: "tests2.dat #43",
6123                 html: "<!DOCTYPE html><!-- XXX - XXX",
6124                 errors: 1,
6125                 expected: "| <!DOCTYPE html>\n| <!--  XXX - XXX -->\n| <html>\n|   <head>\n|   <body>\n"
6126         }, {
6127                 name: "tests2.dat #44",
6128                 html: "<!DOCTYPE html><!-- XXX - XXX - XXX -->",
6129                 expected: "| <!DOCTYPE html>\n| <!--  XXX - XXX - XXX  -->\n| <html>\n|   <head>\n|   <body>\n"
6130         }, {
6131                 name: "tests2.dat #45",
6132                 html: "<isindex test=x name=x>",
6133                 errors: 2,
6134                 expected: "| <html>\n|   <head>\n|   <body>\n|     <form>\n|       <hr>\n|       <label>\n|         \"This is a searchable index. Enter search keywords: \"\n|         <input>\n|           name=\"isindex\"\n|           test=\"x\"\n|       <hr>\n"
6135         }, {
6136                 name: "tests2.dat #46",
6137                 html: "test\ntest",
6138                 errors: 1,
6139                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"test\ntest\"\n"
6140         }, {
6141                 name: "tests2.dat #47",
6142                 html: "<!DOCTYPE html><body><title>test</body></title>",
6143                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <title>\n|       \"test</body>\"\n"
6144         }, {
6145                 name: "tests2.dat #48",
6146                 html: "<!DOCTYPE html><body><title>X</title><meta name=z><link rel=foo><style>\nx { content:\"</style\" } </style>",
6147                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <title>\n|       \"X\"\n|     <meta>\n|       name=\"z\"\n|     <link>\n|       rel=\"foo\"\n|     <style>\n|       \"\nx { content:\"</style\" } \"\n"
6148         }, {
6149                 name: "tests2.dat #49",
6150                 html: "<!DOCTYPE html><select><optgroup></optgroup></select>",
6151                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <optgroup>\n"
6152         }, {
6153                 name: "tests2.dat #50",
6154                 html: " \n ",
6155                 errors: 1,
6156                 expected: "| <html>\n|   <head>\n|   <body>\n"
6157         }, {
6158                 name: "tests2.dat #51",
6159                 html: "<!DOCTYPE html>  <html>",
6160                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n"
6161         }, {
6162                 name: "tests2.dat #52",
6163                 html: "<!DOCTYPE html><script>\n</script>  <title>x</title>  </head>",
6164                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <script>\n|       \"\n\"\n|     \"  \"\n|     <title>\n|       \"x\"\n|     \"  \"\n|   <body>\n"
6165         }, {
6166                 name: "tests2.dat #53",
6167                 html: "<!DOCTYPE html><html><body><html id=x>",
6168                 errors: 1,
6169                 expected: "| <!DOCTYPE html>\n| <html>\n|   id=\"x\"\n|   <head>\n|   <body>\n"
6170         }, {
6171                 name: "tests2.dat #54",
6172                 html: "<!DOCTYPE html>X</body><html id=\"x\">",
6173                 errors: 1,
6174                 expected: "| <!DOCTYPE html>\n| <html>\n|   id=\"x\"\n|   <head>\n|   <body>\n|     \"X\"\n"
6175         }, {
6176                 name: "tests2.dat #55",
6177                 html: "<!DOCTYPE html><head><html id=x>",
6178                 errors: 1,
6179                 expected: "| <!DOCTYPE html>\n| <html>\n|   id=\"x\"\n|   <head>\n|   <body>\n"
6180         }, {
6181                 name: "tests2.dat #56",
6182                 html: "<!DOCTYPE html>X</html>X",
6183                 errors: 1,
6184                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"XX\"\n"
6185         }, {
6186                 name: "tests2.dat #57",
6187                 html: "<!DOCTYPE html>X</html> ",
6188                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"X \"\n"
6189         }, {
6190                 name: "tests2.dat #58",
6191                 html: "<!DOCTYPE html>X</html><p>X",
6192                 errors: 1,
6193                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"X\"\n|     <p>\n|       \"X\"\n"
6194         }, {
6195                 name: "tests2.dat #59",
6196                 html: "<!DOCTYPE html>X<p/x/y/z>",
6197                 errors: 3,
6198                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"X\"\n|     <p>\n|       x=\"\"\n|       y=\"\"\n|       z=\"\"\n"
6199         }, {
6200                 name: "tests2.dat #60",
6201                 html: "<!DOCTYPE html><!--x--",
6202                 errors: 1,
6203                 expected: "| <!DOCTYPE html>\n| <!-- x -->\n| <html>\n|   <head>\n|   <body>\n"
6204         }, {
6205                 name: "tests2.dat #61",
6206                 html: "<!DOCTYPE html><table><tr><td></p></table>",
6207                 errors: 1,
6208                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <p>\n"
6209         }, {
6210                 name: "tests2.dat #62",
6211                 html: "<!DOCTYPE <!DOCTYPE HTML>><!--<!--x-->-->",
6212                 errors: 3,
6213                 expected: "| <!DOCTYPE <!doctype>\n| <html>\n|   <head>\n|   <body>\n|     \">\"\n|     <!-- <!--x -->\n|     \"-->\"\n"
6214         }, {
6215                 name: "tests2.dat #63",
6216                 html: "<!doctype html><div><form></form><div></div></div>",
6217                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <form>\n|       <div>\n"
6218         }, {
6219                 name: "tests3.dat #1",
6220                 html: "<head></head><style></style>",
6221                 errors: 2,
6222                 expected: "| <html>\n|   <head>\n|     <style>\n|   <body>\n"
6223         }, {
6224                 name: "tests3.dat #2",
6225                 html: "<head></head><script></script>",
6226                 errors: 2,
6227                 expected: "| <html>\n|   <head>\n|     <script>\n|   <body>\n"
6228         }, {
6229                 name: "tests3.dat #3",
6230                 html: "<head></head><!-- --><style></style><!-- --><script></script>",
6231                 errors: 3,
6232                 expected: "| <html>\n|   <head>\n|     <style>\n|     <script>\n|   <!--   -->\n|   <!--   -->\n|   <body>\n"
6233         }, {
6234                 name: "tests3.dat #4",
6235                 html: "<head></head><!-- -->x<style></style><!-- --><script></script>",
6236                 errors: 1,
6237                 expected: "| <html>\n|   <head>\n|   <!--   -->\n|   <body>\n|     \"x\"\n|     <style>\n|     <!--   -->\n|     <script>\n"
6238         }, {
6239                 name: "tests3.dat #5",
6240                 html: "<!DOCTYPE html><html><head></head><body><pre>\n</pre></body></html>",
6241                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n"
6242         }, {
6243                 name: "tests3.dat #6",
6244                 html: "<!DOCTYPE html><html><head></head><body><pre>\nfoo</pre></body></html>",
6245                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n|       \"foo\"\n"
6246         }, {
6247                 name: "tests3.dat #7",
6248                 html: "<!DOCTYPE html><html><head></head><body><pre>\n\nfoo</pre></body></html>",
6249                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n|       \"\nfoo\"\n"
6250         }, {
6251                 name: "tests3.dat #8",
6252                 html: "<!DOCTYPE html><html><head></head><body><pre>\nfoo\n</pre></body></html>",
6253                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n|       \"foo\n\"\n"
6254         }, {
6255                 name: "tests3.dat #9",
6256                 html: "<!DOCTYPE html><html><head></head><body><pre>x</pre><span>\n</span></body></html>",
6257                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n|       \"x\"\n|     <span>\n|       \"\n\"\n"
6258         }, {
6259                 name: "tests3.dat #10",
6260                 html: "<!DOCTYPE html><html><head></head><body><pre>x\ny</pre></body></html>",
6261                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n|       \"x\ny\"\n"
6262         }, {
6263                 name: "tests3.dat #11",
6264                 html: "<!DOCTYPE html><html><head></head><body><pre>x<div>\ny</pre></body></html>",
6265                 errors: 1,
6266                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n|       \"x\"\n|       <div>\n|         \"\ny\"\n"
6267         }, {
6268                 name: "tests3.dat #12",
6269                 html: "<!DOCTYPE html><pre>&#x0a;&#x0a;A</pre>",
6270                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <pre>\n|       \"\nA\"\n"
6271         }, {
6272                 name: "tests3.dat #13",
6273                 html: "<!DOCTYPE html><HTML><META><HEAD></HEAD></HTML>",
6274                 errors: 1,
6275                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <meta>\n|   <body>\n"
6276         }, {
6277                 name: "tests3.dat #14",
6278                 html: "<!DOCTYPE html><HTML><HEAD><head></HEAD></HTML>",
6279                 errors: 1,
6280                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n"
6281         }, {
6282                 name: "tests3.dat #15",
6283                 html: "<textarea>foo<span>bar</span><i>baz",
6284                 errors: 2,
6285                 expected: "| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"foo<span>bar</span><i>baz\"\n"
6286         }, {
6287                 name: "tests3.dat #16",
6288                 html: "<title>foo<span>bar</em><i>baz",
6289                 errors: 2,
6290                 expected: "| <html>\n|   <head>\n|     <title>\n|       \"foo<span>bar</em><i>baz\"\n|   <body>\n"
6291         }, {
6292                 name: "tests3.dat #17",
6293                 html: "<!DOCTYPE html><textarea>\n</textarea>",
6294                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <textarea>\n"
6295         }, {
6296                 name: "tests3.dat #18",
6297                 html: "<!DOCTYPE html><textarea>\nfoo</textarea>",
6298                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"foo\"\n"
6299         }, {
6300                 name: "tests3.dat #19",
6301                 html: "<!DOCTYPE html><textarea>\n\nfoo</textarea>",
6302                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \"\nfoo\"\n"
6303         }, {
6304                 name: "tests3.dat #20",
6305                 html: "<!DOCTYPE html><html><head></head><body><ul><li><div><p><li></ul></body></html>",
6306                 errors: 1,
6307                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <ul>\n|       <li>\n|         <div>\n|           <p>\n|       <li>\n"
6308         }, {
6309                 name: "tests3.dat #21",
6310                 html: "<!doctype html><nobr><nobr><nobr>",
6311                 errors: 3,
6312                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <nobr>\n|     <nobr>\n|     <nobr>\n"
6313         }, {
6314                 name: "tests3.dat #22",
6315                 html: "<!doctype html><nobr><nobr></nobr><nobr>",
6316                 errors: 2,
6317                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <nobr>\n|     <nobr>\n|     <nobr>\n"
6318         }, {
6319                 name: "tests3.dat #23",
6320                 html: "<!doctype html><html><body><p><table></table></body></html>",
6321                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <table>\n"
6322         }, {
6323                 name: "tests3.dat #24",
6324                 html: "<p><table></table>",
6325                 errors: 1,
6326                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <table>\n"
6327         }, {
6328                 name: "tests4.dat #1",
6329                 html: "direct div content",
6330                 fragment: "div",
6331                 expected: "| \"direct div content\"\n"
6332         }, {
6333                 name: "tests4.dat #2",
6334                 html: "direct textarea content",
6335                 fragment: "textarea",
6336                 expected: "| \"direct textarea content\"\n"
6337         }, {
6338                 name: "tests4.dat #3",
6339                 html: "textarea content with <em>pseudo</em> <foo>markup",
6340                 fragment: "textarea",
6341                 expected: "| \"textarea content with <em>pseudo</em> <foo>markup\"\n"
6342         }, {
6343                 name: "tests4.dat #4",
6344                 html: "this is &#x0043;DATA inside a <style> element",
6345                 fragment: "style",
6346                 expected: "| \"this is &#x0043;DATA inside a <style> element\"\n"
6347         }, {
6348                 name: "tests4.dat #5",
6349                 html: "</plaintext>",
6350                 fragment: "plaintext",
6351                 expected: "| \"</plaintext>\"\n"
6352         }, {
6353                 name: "tests4.dat #6",
6354                 html: "setting html's innerHTML",
6355                 fragment: "html",
6356                 expected: "| <head>\n| <body>\n|   \"setting html's innerHTML\"\n"
6357         }, {
6358                 name: "tests4.dat #7",
6359                 html: "<title>setting head's innerHTML</title>",
6360                 fragment: "head",
6361                 expected: "| <title>\n|   \"setting head's innerHTML\"\n"
6362         }, {
6363                 name: "tests5.dat #1",
6364                 html: "<style> <!-- </style>x",
6365                 errors: 1,
6366                 expected: "| <html>\n|   <head>\n|     <style>\n|       \" <!-- \"\n|   <body>\n|     \"x\"\n"
6367         }, {
6368                 name: "tests5.dat #2",
6369                 html: "<style> <!-- </style> --> </style>x",
6370                 errors: 2,
6371                 expected: "| <html>\n|   <head>\n|     <style>\n|       \" <!-- \"\n|     \" \"\n|   <body>\n|     \"--> x\"\n"
6372         }, {
6373                 name: "tests5.dat #3",
6374                 html: "<style> <!--> </style>x",
6375                 errors: 1,
6376                 expected: "| <html>\n|   <head>\n|     <style>\n|       \" <!--> \"\n|   <body>\n|     \"x\"\n"
6377         }, {
6378                 name: "tests5.dat #4",
6379                 html: "<style> <!---> </style>x",
6380                 errors: 1,
6381                 expected: "| <html>\n|   <head>\n|     <style>\n|       \" <!---> \"\n|   <body>\n|     \"x\"\n"
6382         }, {
6383                 name: "tests5.dat #5",
6384                 html: "<iframe> <!---> </iframe>x",
6385                 errors: 1,
6386                 expected: "| <html>\n|   <head>\n|   <body>\n|     <iframe>\n|       \" <!---> \"\n|     \"x\"\n"
6387         }, {
6388                 name: "tests5.dat #6",
6389                 html: "<iframe> <!--- </iframe>->x</iframe> --> </iframe>x",
6390                 errors: 3,
6391                 expected: "| <html>\n|   <head>\n|   <body>\n|     <iframe>\n|       \" <!--- \"\n|     \"->x --> x\"\n"
6392         }, {
6393                 name: "tests5.dat #7",
6394                 html: "<script> <!-- </script> --> </script>x",
6395                 errors: 2,
6396                 expected: "| <html>\n|   <head>\n|     <script>\n|       \" <!-- \"\n|     \" \"\n|   <body>\n|     \"--> x\"\n"
6397         }, {
6398                 name: "tests5.dat #8",
6399                 html: "<title> <!-- </title> --> </title>x",
6400                 errors: 2,
6401                 expected: "| <html>\n|   <head>\n|     <title>\n|       \" <!-- \"\n|     \" \"\n|   <body>\n|     \"--> x\"\n"
6402         }, {
6403                 name: "tests5.dat #9",
6404                 html: "<textarea> <!--- </textarea>->x</textarea> --> </textarea>x",
6405                 errors: 3,
6406                 expected: "| <html>\n|   <head>\n|   <body>\n|     <textarea>\n|       \" <!--- \"\n|     \"->x --> x\"\n"
6407         }, {
6408                 name: "tests5.dat #10",
6409                 html: "<style> <!</-- </style>x",
6410                 errors: 1,
6411                 expected: "| <html>\n|   <head>\n|     <style>\n|       \" <!</-- \"\n|   <body>\n|     \"x\"\n"
6412         }, {
6413                 name: "tests5.dat #11",
6414                 html: "<p><xmp></xmp>",
6415                 errors: 1,
6416                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|     <xmp>\n"
6417         }, {
6418                 name: "tests5.dat #12",
6419                 html: "<xmp> <!-- > --> </xmp>",
6420                 errors: 1,
6421                 expected: "| <html>\n|   <head>\n|   <body>\n|     <xmp>\n|       \" <!-- > --> \"\n"
6422         }, {
6423                 name: "tests5.dat #13",
6424                 html: "<title>&amp;</title>",
6425                 errors: 1,
6426                 expected: "| <html>\n|   <head>\n|     <title>\n|       \"&\"\n|   <body>\n"
6427         }, {
6428                 name: "tests5.dat #14",
6429                 html: "<title><!--&amp;--></title>",
6430                 errors: 1,
6431                 expected: "| <html>\n|   <head>\n|     <title>\n|       \"<!--&-->\"\n|   <body>\n"
6432         }, {
6433                 name: "tests5.dat #15",
6434                 html: "<title><!--</title>",
6435                 errors: 1,
6436                 expected: "| <html>\n|   <head>\n|     <title>\n|       \"<!--\"\n|   <body>\n"
6437         }, {
6438                 name: "tests5.dat #16",
6439                 html: "<noscript><!--</noscript>--></noscript>",
6440                 scripting: true,
6441                 errors: 2,
6442                 expected: "| <html>\n|   <head>\n|     <noscript>\n|       \"<!--\"\n|   <body>\n|     \"-->\"\n"
6443         }, {
6444                 name: "tests5.dat #17",
6445                 html: "<noscript><!--</noscript>--></noscript>",
6446                 scripting: false,
6447                 errors: 1,
6448                 expected: "| <html>\n|   <head>\n|     <noscript>\n|       <!-- </noscript> -->\n|   <body>\n"
6449         }, {
6450                 name: "tests6.dat #1",
6451                 html: "<!doctype html></head> <head>",
6452                 errors: 1,
6453                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   \" \"\n|   <body>\n"
6454         }, {
6455                 name: "tests6.dat #2",
6456                 html: "<!doctype html><form><div></form><div>",
6457                 errors: 2,
6458                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <form>\n|       <div>\n|         <div>\n"
6459         }, {
6460                 name: "tests6.dat #3",
6461                 html: "<!doctype html><title>&amp;</title>",
6462                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <title>\n|       \"&\"\n|   <body>\n"
6463         }, {
6464                 name: "tests6.dat #4",
6465                 html: "<!doctype html><title><!--&amp;--></title>",
6466                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <title>\n|       \"<!--&-->\"\n|   <body>\n"
6467         }, {
6468                 name: "tests6.dat #5",
6469                 html: "<!doctype>",
6470                 errors: 3,
6471                 expected: "| <!DOCTYPE >\n| <html>\n|   <head>\n|   <body>\n"
6472         }, {
6473                 name: "tests6.dat #6",
6474                 html: "<!---x",
6475                 errors: 2,
6476                 expected: "| <!-- -x -->\n| <html>\n|   <head>\n|   <body>\n"
6477         }, {
6478                 name: "tests6.dat #7",
6479                 html: "<body>\n<div>",
6480                 errors: 2,
6481                 fragment: "div",
6482                 expected: "| \"\n\"\n| <div>\n"
6483         }, {
6484                 name: "tests6.dat #8",
6485                 html: "<frameset></frameset>\nfoo",
6486                 errors: 4,
6487                 expected: "| <html>\n|   <head>\n|   <frameset>\n|   \"\n\"\n"
6488         }, {
6489                 name: "tests6.dat #9",
6490                 html: "<frameset></frameset>\n<noframes>",
6491                 errors: 2,
6492                 expected: "| <html>\n|   <head>\n|   <frameset>\n|   \"\n\"\n|   <noframes>\n"
6493         }, {
6494                 name: "tests6.dat #10",
6495                 html: "<frameset></frameset>\n<div>",
6496                 errors: 2,
6497                 expected: "| <html>\n|   <head>\n|   <frameset>\n|   \"\n\"\n"
6498         }, {
6499                 name: "tests6.dat #11",
6500                 html: "<frameset></frameset>\n</html>",
6501                 errors: 1,
6502                 expected: "| <html>\n|   <head>\n|   <frameset>\n|   \"\n\"\n"
6503         }, {
6504                 name: "tests6.dat #12",
6505                 html: "<frameset></frameset>\n</div>",
6506                 errors: 2,
6507                 expected: "| <html>\n|   <head>\n|   <frameset>\n|   \"\n\"\n"
6508         }, {
6509                 name: "tests6.dat #13",
6510                 html: "<form><form>",
6511                 errors: 3,
6512                 expected: "| <html>\n|   <head>\n|   <body>\n|     <form>\n"
6513         }, {
6514                 name: "tests6.dat #14",
6515                 html: "<button><button>",
6516                 errors: 3,
6517                 expected: "| <html>\n|   <head>\n|   <body>\n|     <button>\n|     <button>\n"
6518         }, {
6519                 name: "tests6.dat #15",
6520                 html: "<table><tr><td></th>",
6521                 errors: 3,
6522                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n"
6523         }, {
6524                 name: "tests6.dat #16",
6525                 html: "<table><caption><td>",
6526                 errors: 3,
6527                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|       <tbody>\n|         <tr>\n|           <td>\n"
6528         }, {
6529                 name: "tests6.dat #17",
6530                 html: "<table><caption><div>",
6531                 errors: 2,
6532                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <div>\n"
6533         }, {
6534                 name: "tests6.dat #18",
6535                 html: "</caption><div>",
6536                 errors: 2,
6537                 fragment: "caption",
6538                 expected: "| <div>\n"
6539         }, {
6540                 name: "tests6.dat #19",
6541                 html: "<table><caption><div></caption>",
6542                 errors: 3,
6543                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <div>\n"
6544         }, {
6545                 name: "tests6.dat #20",
6546                 html: "<table><caption></table>",
6547                 errors: 1,
6548                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n"
6549         }, {
6550                 name: "tests6.dat #21",
6551                 html: "</table><div>",
6552                 errors: 2,
6553                 fragment: "caption",
6554                 expected: "| <div>\n"
6555         }, {
6556                 name: "tests6.dat #22",
6557                 html: "<table><caption></body></col></colgroup></html></tbody></td></tfoot></th></thead></tr>",
6558                 errors: 12,
6559                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n"
6560         }, {
6561                 name: "tests6.dat #23",
6562                 html: "<table><caption><div></div>",
6563                 errors: 2,
6564                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <div>\n"
6565         }, {
6566                 name: "tests6.dat #24",
6567                 html: "<table><tr><td></body></caption></col></colgroup></html>",
6568                 errors: 7,
6569                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n"
6570         }, {
6571                 name: "tests6.dat #25",
6572                 html: "</table></tbody></tfoot></thead></tr><div>",
6573                 errors: 6,
6574                 fragment: "td",
6575                 expected: "| <div>\n"
6576         }, {
6577                 name: "tests6.dat #26",
6578                 html: "<table><colgroup>foo",
6579                 errors: 5,
6580                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"foo\"\n|     <table>\n|       <colgroup>\n"
6581         }, {
6582                 name: "tests6.dat #27",
6583                 html: "foo<col>",
6584                 errors: 3,
6585                 fragment: "colgroup",
6586                 expected: "| <col>\n"
6587         }, {
6588                 name: "tests6.dat #28",
6589                 html: "<table><colgroup></col>",
6590                 errors: 3,
6591                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <colgroup>\n"
6592         }, {
6593                 name: "tests6.dat #29",
6594                 html: "<frameset><div>",
6595                 errors: 3,
6596                 expected: "| <html>\n|   <head>\n|   <frameset>\n"
6597         }, {
6598                 name: "tests6.dat #30",
6599                 html: "</frameset><frame>",
6600                 errors: 1,
6601                 fragment: "frameset",
6602                 expected: "| <frame>\n"
6603         }, {
6604                 name: "tests6.dat #31",
6605                 html: "<frameset></div>",
6606                 errors: 3,
6607                 expected: "| <html>\n|   <head>\n|   <frameset>\n"
6608         }, {
6609                 name: "tests6.dat #32",
6610                 html: "</body><div>",
6611                 errors: 2,
6612                 fragment: "body",
6613                 expected: "| <div>\n"
6614         }, {
6615                 name: "tests6.dat #33",
6616                 html: "<table><tr><div>",
6617                 errors: 3,
6618                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|     <table>\n|       <tbody>\n|         <tr>\n"
6619         }, {
6620                 name: "tests6.dat #34",
6621                 html: "</tr><td>",
6622                 errors: 1,
6623                 fragment: "tr",
6624                 expected: "| <td>\n"
6625         }, {
6626                 name: "tests6.dat #35",
6627                 html: "</tbody></tfoot></thead><td>",
6628                 errors: 3,
6629                 fragment: "tr",
6630                 expected: "| <td>\n"
6631         }, {
6632                 name: "tests6.dat #36",
6633                 html: "<table><tr><div><td>",
6634                 errors: 3,
6635                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n"
6636         }, {
6637                 name: "tests6.dat #37",
6638                 html: "<caption><col><colgroup><tbody><tfoot><thead><tr>",
6639                 errors: 6,
6640                 fragment: "tbody",
6641                 expected: "| <tr>\n"
6642         }, {
6643                 name: "tests6.dat #38",
6644                 html: "<table><tbody></thead>",
6645                 errors: 3,
6646                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n"
6647         }, {
6648                 name: "tests6.dat #39",
6649                 html: "</table><tr>",
6650                 errors: 1,
6651                 fragment: "tbody",
6652                 expected: "| <tr>\n"
6653         }, {
6654                 name: "tests6.dat #40",
6655                 html: "<table><tbody></body></caption></col></colgroup></html></td></th></tr>",
6656                 errors: 10,
6657                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n"
6658         }, {
6659                 name: "tests6.dat #41",
6660                 html: "<table><tbody></div>",
6661                 errors: 4,
6662                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n"
6663         }, {
6664                 name: "tests6.dat #42",
6665                 html: "<table><table>",
6666                 errors: 3,
6667                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|     <table>\n"
6668         }, {
6669                 name: "tests6.dat #43",
6670                 html: "<table></body></caption></col></colgroup></html></tbody></td></tfoot></th></thead></tr>",
6671                 errors: 13,
6672                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n"
6673         }, {
6674                 name: "tests6.dat #44",
6675                 html: "</table><tr>",
6676                 errors: 1,
6677                 fragment: "table",
6678                 expected: "| <tbody>\n|   <tr>\n"
6679         }, {
6680                 name: "tests6.dat #45",
6681                 html: "<body></body></html>",
6682                 errors: 1,
6683                 fragment: "html",
6684                 expected: "| <head>\n| <body>\n"
6685         }, {
6686                 name: "tests6.dat #46",
6687                 html: "<html><frameset></frameset></html> ",
6688                 errors: 1,
6689                 expected: "| <html>\n|   <head>\n|   <frameset>\n|   \" \"\n"
6690         }, {
6691                 name: "tests6.dat #47",
6692                 html: "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\"><html></html>",
6693                 expected: "| <!DOCTYPE html \"-//W3C//DTD HTML 4.01//EN\" \"\">\n| <html>\n|   <head>\n|   <body>\n"
6694         }, {
6695                 name: "tests6.dat #48",
6696                 html: "<param><frameset></frameset>",
6697                 errors: 2,
6698                 expected: "| <html>\n|   <head>\n|   <frameset>\n"
6699         }, {
6700                 name: "tests6.dat #49",
6701                 html: "<source><frameset></frameset>",
6702                 errors: 2,
6703                 expected: "| <html>\n|   <head>\n|   <frameset>\n"
6704         }, {
6705                 name: "tests6.dat #50",
6706                 html: "<track><frameset></frameset>",
6707                 errors: 2,
6708                 expected: "| <html>\n|   <head>\n|   <frameset>\n"
6709         }, {
6710                 name: "tests6.dat #51",
6711                 html: "</html><frameset></frameset>",
6712                 errors: 3,
6713                 expected: "| <html>\n|   <head>\n|   <frameset>\n"
6714         }, {
6715                 name: "tests6.dat #52",
6716                 html: "</body><frameset></frameset>",
6717                 errors: 3,
6718                 expected: "| <html>\n|   <head>\n|   <frameset>\n"
6719         }, {
6720                 name: "tests7.dat #1",
6721                 html: "<!doctype html><body><title>X</title>",
6722                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <title>\n|       \"X\"\n"
6723         }, {
6724                 name: "tests7.dat #2",
6725                 html: "<!doctype html><table><title>X</title></table>",
6726                 errors: 1,
6727                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <title>\n|       \"X\"\n|     <table>\n"
6728         }, {
6729                 name: "tests7.dat #3",
6730                 html: "<!doctype html><head></head><title>X</title>",
6731                 errors: 1,
6732                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <title>\n|       \"X\"\n|   <body>\n"
6733         }, {
6734                 name: "tests7.dat #4",
6735                 html: "<!doctype html></head><title>X</title>",
6736                 errors: 1,
6737                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|     <title>\n|       \"X\"\n|   <body>\n"
6738         }, {
6739                 name: "tests7.dat #5",
6740                 html: "<!doctype html><table><meta></table>",
6741                 errors: 1,
6742                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <meta>\n|     <table>\n"
6743         }, {
6744                 name: "tests7.dat #6",
6745                 html: "<!doctype html><table>X<tr><td><table> <meta></table></table>",
6746                 errors: 2,
6747                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"X\"\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <meta>\n|             <table>\n|               \" \"\n"
6748         }, {
6749                 name: "tests7.dat #7",
6750                 html: "<!doctype html><html> <head>",
6751                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n"
6752         }, {
6753                 name: "tests7.dat #8",
6754                 html: "<!doctype html> <head>",
6755                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n"
6756         }, {
6757                 name: "tests7.dat #9",
6758                 html: "<!doctype html><table><style> <tr>x </style> </table>",
6759                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <style>\n|         \" <tr>x \"\n|       \" \"\n"
6760         }, {
6761                 name: "tests7.dat #10",
6762                 html: "<!doctype html><table><TBODY><script> <tr>x </script> </table>",
6763                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <script>\n|           \" <tr>x \"\n|         \" \"\n"
6764         }, {
6765                 name: "tests7.dat #11",
6766                 html: "<!doctype html><p><applet><p>X</p></applet>",
6767                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <applet>\n|         <p>\n|           \"X\"\n"
6768         }, {
6769                 name: "tests7.dat #12",
6770                 html: "<!doctype html><p><object type=\"application/x-non-existant-plugin\"><p>X</p></object>",
6771                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <object>\n|         type=\"application/x-non-existant-plugin\"\n|         <p>\n|           \"X\"\n"
6772         }, {
6773                 name: "tests7.dat #13",
6774                 html: "<!doctype html><listing>\nX</listing>",
6775                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <listing>\n|       \"X\"\n"
6776         }, {
6777                 name: "tests7.dat #14",
6778                 html: "<!doctype html><select><input>X",
6779                 errors: 1,
6780                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|     <input>\n|     \"X\"\n"
6781         }, {
6782                 name: "tests7.dat #15",
6783                 html: "<!doctype html><select><select>X",
6784                 errors: 1,
6785                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|     \"X\"\n"
6786         }, {
6787                 name: "tests7.dat #16",
6788                 html: "<!doctype html><table><input type=hidDEN></table>",
6789                 errors: 1,
6790                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <input>\n|         type=\"hidDEN\"\n"
6791         }, {
6792                 name: "tests7.dat #17",
6793                 html: "<!doctype html><table>X<input type=hidDEN></table>",
6794                 errors: 2,
6795                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     \"X\"\n|     <table>\n|       <input>\n|         type=\"hidDEN\"\n"
6796         }, {
6797                 name: "tests7.dat #18",
6798                 html: "<!doctype html><table>  <input type=hidDEN></table>",
6799                 errors: 1,
6800                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       \"  \"\n|       <input>\n|         type=\"hidDEN\"\n"
6801         }, {
6802                 name: "tests7.dat #19",
6803                 html: "<!doctype html><table>  <input type='hidDEN'></table>",
6804                 errors: 1,
6805                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       \"  \"\n|       <input>\n|         type=\"hidDEN\"\n"
6806         }, {
6807                 name: "tests7.dat #20",
6808                 html: "<!doctype html><table><input type=\" hidden\"><input type=hidDEN></table>",
6809                 errors: 2,
6810                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <input>\n|       type=\" hidden\"\n|     <table>\n|       <input>\n|         type=\"hidDEN\"\n"
6811         }, {
6812                 name: "tests7.dat #21",
6813                 html: "<!doctype html><table><select>X<tr>",
6814                 errors: 3,
6815                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       \"X\"\n|     <table>\n|       <tbody>\n|         <tr>\n"
6816         }, {
6817                 name: "tests7.dat #22",
6818                 html: "<!doctype html><select>X</select>",
6819                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       \"X\"\n"
6820         }, {
6821                 name: "tests7.dat #23",
6822                 html: "<!DOCTYPE hTmL><html></html>",
6823                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n"
6824         }, {
6825                 name: "tests7.dat #24",
6826                 html: "<!DOCTYPE HTML><html></html>",
6827                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n"
6828         }, {
6829                 name: "tests7.dat #25",
6830                 html: "<body>X</body></body>",
6831                 errors: 1,
6832                 fragment: "html",
6833                 expected: "| <head>\n| <body>\n|   \"X\"\n"
6834         }, {
6835                 name: "tests7.dat #26",
6836                 html: "<div><p>a</x> b",
6837                 errors: 3,
6838                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <p>\n|         \"a b\"\n"
6839         }, {
6840                 name: "tests7.dat #27",
6841                 html: "<table><tr><td><code></code> </table>",
6842                 errors: 1,
6843                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <code>\n|             \" \"\n"
6844         }, {
6845                 name: "tests7.dat #28",
6846                 html: "<table><b><tr><td>aaa</td></tr>bbb</table>ccc",
6847                 errors: 6,
6848                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|     <b>\n|       \"bbb\"\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             \"aaa\"\n|     <b>\n|       \"ccc\"\n"
6849         }, {
6850                 name: "tests7.dat #29",
6851                 html: "A<table><tr> B</tr> B</table>",
6852                 errors: 5,
6853                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"A B B\"\n|     <table>\n|       <tbody>\n|         <tr>\n"
6854         }, {
6855                 name: "tests7.dat #30",
6856                 html: "A<table><tr> B</tr> </em>C</table>",
6857                 errors: 6,
6858                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"A BC\"\n|     <table>\n|       <tbody>\n|         <tr>\n|         \" \"\n"
6859         }, {
6860                 name: "tests7.dat #31",
6861                 html: "<select><keygen>",
6862                 errors: 2,
6863                 expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|     <keygen>\n"
6864         }, {
6865                 name: "tests8.dat #1",
6866                 html: "<div>\n<div></div>\n</span>x",
6867                 errors: 3,
6868                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"\n\"\n|       <div>\n|       \"\nx\"\n"
6869         }, {
6870                 name: "tests8.dat #2",
6871                 html: "<div>x<div></div>\n</span>x",
6872                 errors: 3,
6873                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"x\"\n|       <div>\n|       \"\nx\"\n"
6874         }, {
6875                 name: "tests8.dat #3",
6876                 html: "<div>x<div></div>x</span>x",
6877                 errors: 3,
6878                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"x\"\n|       <div>\n|       \"xx\"\n"
6879         }, {
6880                 name: "tests8.dat #4",
6881                 html: "<div>x<div></div>y</span>z",
6882                 errors: 3,
6883                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"x\"\n|       <div>\n|       \"yz\"\n"
6884         }, {
6885                 name: "tests8.dat #5",
6886                 html: "<table><div>x<div></div>x</span>x",
6887                 errors: 10,
6888                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"x\"\n|       <div>\n|       \"xx\"\n|     <table>\n"
6889         }, {
6890                 name: "tests8.dat #6",
6891                 html: "x<table>x",
6892                 errors: 3,
6893                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"xx\"\n|     <table>\n"
6894         }, {
6895                 name: "tests8.dat #7",
6896                 html: "x<table><table>x",
6897                 errors: 4,
6898                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"x\"\n|     <table>\n|     \"x\"\n|     <table>\n"
6899         }, {
6900                 name: "tests8.dat #8",
6901                 html: "<b>a<div></div><div></b>y",
6902                 errors: 3,
6903                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       \"a\"\n|       <div>\n|     <div>\n|       <b>\n|       \"y\"\n"
6904         }, {
6905                 name: "tests8.dat #9",
6906                 html: "<a><div><p></a>",
6907                 errors: 4,
6908                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|     <div>\n|       <a>\n|       <p>\n|         <a>\n"
6909         }, {
6910                 name: "tests9.dat #1",
6911                 html: "<!DOCTYPE html><math></math>",
6912                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n"
6913         }, {
6914                 name: "tests9.dat #2",
6915                 html: "<!DOCTYPE html><body><math></math>",
6916                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n"
6917         }, {
6918                 name: "tests9.dat #3",
6919                 html: "<!DOCTYPE html><math><mi>",
6920                 errors: 1,
6921                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n"
6922         }, {
6923                 name: "tests9.dat #4",
6924                 html: "<!DOCTYPE html><math><annotation-xml><svg><u>",
6925                 errors: 2,
6926                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math annotation-xml>\n|         <svg svg>\n|     <u>\n"
6927         }, {
6928                 name: "tests9.dat #5",
6929                 html: "<!DOCTYPE html><body><select><math></math></select>",
6930                 errors: 2,
6931                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n"
6932         }, {
6933                 name: "tests9.dat #6",
6934                 html: "<!DOCTYPE html><body><select><option><math></math></option></select>",
6935                 errors: 2,
6936                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n"
6937         }, {
6938                 name: "tests9.dat #7",
6939                 html: "<!DOCTYPE html><body><table><math></math></table>",
6940                 errors: 1,
6941                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|     <table>\n"
6942         }, {
6943                 name: "tests9.dat #8",
6944                 html: "<!DOCTYPE html><body><table><math><mi>foo</mi></math></table>",
6945                 errors: 4,
6946                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         \"foo\"\n|     <table>\n"
6947         }, {
6948                 name: "tests9.dat #9",
6949                 html: "<!DOCTYPE html><body><table><math><mi>foo</mi><mi>bar</mi></math></table>",
6950                 errors: 7,
6951                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         \"foo\"\n|       <math mi>\n|         \"bar\"\n|     <table>\n"
6952         }, {
6953                 name: "tests9.dat #10",
6954                 html: "<!DOCTYPE html><body><table><tbody><math><mi>foo</mi><mi>bar</mi></math></tbody></table>",
6955                 errors: 7,
6956                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         \"foo\"\n|       <math mi>\n|         \"bar\"\n|     <table>\n|       <tbody>\n"
6957         }, {
6958                 name: "tests9.dat #11",
6959                 html: "<!DOCTYPE html><body><table><tbody><tr><math><mi>foo</mi><mi>bar</mi></math></tr></tbody></table>",
6960                 errors: 7,
6961                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         \"foo\"\n|       <math mi>\n|         \"bar\"\n|     <table>\n|       <tbody>\n|         <tr>\n"
6962         }, {
6963                 name: "tests9.dat #12",
6964                 html: "<!DOCTYPE html><body><table><tbody><tr><td><math><mi>foo</mi><mi>bar</mi></math></td></tr></tbody></table>",
6965                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <math math>\n|               <math mi>\n|                 \"foo\"\n|               <math mi>\n|                 \"bar\"\n"
6966         }, {
6967                 name: "tests9.dat #13",
6968                 html: "<!DOCTYPE html><body><table><tbody><tr><td><math><mi>foo</mi><mi>bar</mi></math><p>baz</td></tr></tbody></table>",
6969                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <math math>\n|               <math mi>\n|                 \"foo\"\n|               <math mi>\n|                 \"bar\"\n|             <p>\n|               \"baz\"\n"
6970         }, {
6971                 name: "tests9.dat #14",
6972                 html: "<!DOCTYPE html><body><table><caption><math><mi>foo</mi><mi>bar</mi></math><p>baz</caption></table>",
6973                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <math math>\n|           <math mi>\n|             \"foo\"\n|           <math mi>\n|             \"bar\"\n|         <p>\n|           \"baz\"\n"
6974         }, {
6975                 name: "tests9.dat #15",
6976                 html: "<!DOCTYPE html><body><table><caption><math><mi>foo</mi><mi>bar</mi><p>baz</table><p>quux",
6977                 errors: 1,
6978                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <math math>\n|           <math mi>\n|             \"foo\"\n|           <math mi>\n|             \"bar\"\n|         <p>\n|           \"baz\"\n|     <p>\n|       \"quux\"\n"
6979         }, {
6980                 name: "tests9.dat #16",
6981                 html: "<!DOCTYPE html><body><table><caption><math><mi>foo</mi><mi>bar</mi>baz</table><p>quux",
6982                 errors: 2,
6983                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <caption>\n|         <math math>\n|           <math mi>\n|             \"foo\"\n|           <math mi>\n|             \"bar\"\n|           \"baz\"\n|     <p>\n|       \"quux\"\n"
6984         }, {
6985                 name: "tests9.dat #17",
6986                 html: "<!DOCTYPE html><body><table><colgroup><math><mi>foo</mi><mi>bar</mi><p>baz</table><p>quux",
6987                 errors: 12,
6988                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         \"foo\"\n|       <math mi>\n|         \"bar\"\n|     <p>\n|       \"baz\"\n|     <table>\n|       <colgroup>\n|     <p>\n|       \"quux\"\n"
6989         }, {
6990                 name: "tests9.dat #18",
6991                 html: "<!DOCTYPE html><body><table><tr><td><select><math><mi>foo</mi><mi>bar</mi><p>baz</table><p>quux",
6992                 errors: 7,
6993                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <select>\n|               \"foobarbaz\"\n|     <p>\n|       \"quux\"\n"
6994         }, {
6995                 name: "tests9.dat #19",
6996                 html: "<!DOCTYPE html><body><table><select><math><mi>foo</mi><mi>bar</mi><p>baz</table><p>quux",
6997                 errors: 8,
6998                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <select>\n|       \"foobarbaz\"\n|     <table>\n|     <p>\n|       \"quux\"\n"
6999         }, {
7000                 name: "tests9.dat #20",
7001                 html: "<!DOCTYPE html><body></body></html><math><mi>foo</mi><mi>bar</mi><p>baz",
7002                 errors: 2,
7003                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         \"foo\"\n|       <math mi>\n|         \"bar\"\n|     <p>\n|       \"baz\"\n"
7004         }, {
7005                 name: "tests9.dat #21",
7006                 html: "<!DOCTYPE html><body></body><math><mi>foo</mi><mi>bar</mi><p>baz",
7007                 errors: 2,
7008                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mi>\n|         \"foo\"\n|       <math mi>\n|         \"bar\"\n|     <p>\n|       \"baz\"\n"
7009         }, {
7010                 name: "tests9.dat #22",
7011                 html: "<!DOCTYPE html><frameset><math><mi></mi><mi></mi><p><span>",
7012                 errors: 8,
7013                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
7014         }, {
7015                 name: "tests9.dat #23",
7016                 html: "<!DOCTYPE html><frameset></frameset><math><mi></mi><mi></mi><p><span>",
7017                 errors: 7,
7018                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
7019         }, {
7020                 name: "tests9.dat #24",
7021                 html: "<!DOCTYPE html><body xlink:href=foo><math xlink:href=foo></math>",
7022                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     xlink:href=\"foo\"\n|     <math math>\n|       xlink href=\"foo\"\n"
7023         }, {
7024                 name: "tests9.dat #25",
7025                 html: "<!DOCTYPE html><body xlink:href=foo xml:lang=en><math><mi xml:lang=en xlink:href=foo></mi></math>",
7026                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     xlink:href=\"foo\"\n|     xml:lang=\"en\"\n|     <math math>\n|       <math mi>\n|         xlink href=\"foo\"\n|         xml lang=\"en\"\n"
7027         }, {
7028                 name: "tests9.dat #26",
7029                 html: "<!DOCTYPE html><body xlink:href=foo xml:lang=en><math><mi xml:lang=en xlink:href=foo /></math>",
7030                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     xlink:href=\"foo\"\n|     xml:lang=\"en\"\n|     <math math>\n|       <math mi>\n|         xlink href=\"foo\"\n|         xml lang=\"en\"\n"
7031         }, {
7032                 name: "tests9.dat #27",
7033                 html: "<!DOCTYPE html><body xlink:href=foo xml:lang=en><math><mi xml:lang=en xlink:href=foo />bar</math>",
7034                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     xlink:href=\"foo\"\n|     xml:lang=\"en\"\n|     <math math>\n|       <math mi>\n|         xlink href=\"foo\"\n|         xml lang=\"en\"\n|       \"bar\"\n"
7035         }, {
7036                 name: "tests_innerHTML_1.dat #1",
7037                 html: "<body><span>",
7038                 errors: 2,
7039                 fragment: "body",
7040                 expected: "| <span>\n"
7041         }, {
7042                 name: "tests_innerHTML_1.dat #2",
7043                 html: "<span><body>",
7044                 errors: 2,
7045                 fragment: "body",
7046                 expected: "| <span>\n"
7047         }, {
7048                 name: "tests_innerHTML_1.dat #3",
7049                 html: "<span><body>",
7050                 errors: 2,
7051                 fragment: "div",
7052                 expected: "| <span>\n"
7053         }, {
7054                 name: "tests_innerHTML_1.dat #4",
7055                 html: "<body><span>",
7056                 errors: 1,
7057                 fragment: "html",
7058                 expected: "| <head>\n| <body>\n|   <span>\n"
7059         }, {
7060                 name: "tests_innerHTML_1.dat #5",
7061                 html: "<frameset><span>",
7062                 errors: 2,
7063                 fragment: "body",
7064                 expected: "| <span>\n"
7065         }, {
7066                 name: "tests_innerHTML_1.dat #6",
7067                 html: "<span><frameset>",
7068                 errors: 2,
7069                 fragment: "body",
7070                 expected: "| <span>\n"
7071         }, {
7072                 name: "tests_innerHTML_1.dat #7",
7073                 html: "<span><frameset>",
7074                 errors: 2,
7075                 fragment: "div",
7076                 expected: "| <span>\n"
7077         }, {
7078                 name: "tests_innerHTML_1.dat #8",
7079                 html: "<frameset><span>",
7080                 errors: 2,
7081                 fragment: "html",
7082                 expected: "| <head>\n| <frameset>\n"
7083         }, {
7084                 name: "tests_innerHTML_1.dat #9",
7085                 html: "<table><tr>",
7086                 errors: 1,
7087                 fragment: "table",
7088                 expected: "| <tbody>\n|   <tr>\n"
7089         }, {
7090                 name: "tests_innerHTML_1.dat #10",
7091                 html: "</table><tr>",
7092                 errors: 1,
7093                 fragment: "table",
7094                 expected: "| <tbody>\n|   <tr>\n"
7095         }, {
7096                 name: "tests_innerHTML_1.dat #11",
7097                 html: "<a>",
7098                 errors: 2,
7099                 fragment: "table",
7100                 expected: "| <a>\n"
7101         }, {
7102                 name: "tests_innerHTML_1.dat #12",
7103                 html: "<a>",
7104                 errors: 2,
7105                 fragment: "table",
7106                 expected: "| <a>\n"
7107         }, {
7108                 name: "tests_innerHTML_1.dat #13",
7109                 html: "<a><caption>a",
7110                 errors: 2,
7111                 fragment: "table",
7112                 expected: "| <a>\n| <caption>\n|   \"a\"\n"
7113         }, {
7114                 name: "tests_innerHTML_1.dat #14",
7115                 html: "<a><colgroup><col>",
7116                 errors: 2,
7117                 fragment: "table",
7118                 expected: "| <a>\n| <colgroup>\n|   <col>\n"
7119         }, {
7120                 name: "tests_innerHTML_1.dat #15",
7121                 html: "<a><tbody><tr>",
7122                 errors: 1,
7123                 fragment: "table",
7124                 expected: "| <a>\n| <tbody>\n|   <tr>\n"
7125         }, {
7126                 name: "tests_innerHTML_1.dat #16",
7127                 html: "<a><tfoot><tr>",
7128                 errors: 1,
7129                 fragment: "table",
7130                 expected: "| <a>\n| <tfoot>\n|   <tr>\n"
7131         }, {
7132                 name: "tests_innerHTML_1.dat #17",
7133                 html: "<a><thead><tr>",
7134                 errors: 1,
7135                 fragment: "table",
7136                 expected: "| <a>\n| <thead>\n|   <tr>\n"
7137         }, {
7138                 name: "tests_innerHTML_1.dat #18",
7139                 html: "<a><tr>",
7140                 errors: 1,
7141                 fragment: "table",
7142                 expected: "| <a>\n| <tbody>\n|   <tr>\n"
7143         }, {
7144                 name: "tests_innerHTML_1.dat #19",
7145                 html: "<a><th>",
7146                 errors: 2,
7147                 fragment: "table",
7148                 expected: "| <a>\n| <tbody>\n|   <tr>\n|     <th>\n"
7149         }, {
7150                 name: "tests_innerHTML_1.dat #20",
7151                 html: "<a><td>",
7152                 errors: 2,
7153                 fragment: "table",
7154                 expected: "| <a>\n| <tbody>\n|   <tr>\n|     <td>\n"
7155         }, {
7156                 name: "tests_innerHTML_1.dat #21",
7157                 html: "<table></table><tbody>",
7158                 errors: 1,
7159                 fragment: "caption",
7160                 expected: "| <table>\n"
7161         }, {
7162                 name: "tests_innerHTML_1.dat #22",
7163                 html: "</table><span>",
7164                 errors: 2,
7165                 fragment: "caption",
7166                 expected: "| <span>\n"
7167         }, {
7168                 name: "tests_innerHTML_1.dat #23",
7169                 html: "<span></table>",
7170                 errors: 2,
7171                 fragment: "caption",
7172                 expected: "| <span>\n"
7173         }, {
7174                 name: "tests_innerHTML_1.dat #24",
7175                 html: "</caption><span>",
7176                 errors: 2,
7177                 fragment: "caption",
7178                 expected: "| <span>\n"
7179         }, {
7180                 name: "tests_innerHTML_1.dat #25",
7181                 html: "<span></caption><span>",
7182                 errors: 2,
7183                 fragment: "caption",
7184                 expected: "| <span>\n|   <span>\n"
7185         }, {
7186                 name: "tests_innerHTML_1.dat #26",
7187                 html: "<span><caption><span>",
7188                 errors: 2,
7189                 fragment: "caption",
7190                 expected: "| <span>\n|   <span>\n"
7191         }, {
7192                 name: "tests_innerHTML_1.dat #27",
7193                 html: "<span><col><span>",
7194                 errors: 2,
7195                 fragment: "caption",
7196                 expected: "| <span>\n|   <span>\n"
7197         }, {
7198                 name: "tests_innerHTML_1.dat #28",
7199                 html: "<span><colgroup><span>",
7200                 errors: 2,
7201                 fragment: "caption",
7202                 expected: "| <span>\n|   <span>\n"
7203         }, {
7204                 name: "tests_innerHTML_1.dat #29",
7205                 html: "<span><html><span>",
7206                 errors: 2,
7207                 fragment: "caption",
7208                 expected: "| <span>\n|   <span>\n"
7209         }, {
7210                 name: "tests_innerHTML_1.dat #30",
7211                 html: "<span><tbody><span>",
7212                 errors: 2,
7213                 fragment: "caption",
7214                 expected: "| <span>\n|   <span>\n"
7215         }, {
7216                 name: "tests_innerHTML_1.dat #31",
7217                 html: "<span><td><span>",
7218                 errors: 2,
7219                 fragment: "caption",
7220                 expected: "| <span>\n|   <span>\n"
7221         }, {
7222                 name: "tests_innerHTML_1.dat #32",
7223                 html: "<span><tfoot><span>",
7224                 errors: 2,
7225                 fragment: "caption",
7226                 expected: "| <span>\n|   <span>\n"
7227         }, {
7228                 name: "tests_innerHTML_1.dat #33",
7229                 html: "<span><thead><span>",
7230                 errors: 2,
7231                 fragment: "caption",
7232                 expected: "| <span>\n|   <span>\n"
7233         }, {
7234                 name: "tests_innerHTML_1.dat #34",
7235                 html: "<span><th><span>",
7236                 errors: 2,
7237                 fragment: "caption",
7238                 expected: "| <span>\n|   <span>\n"
7239         }, {
7240                 name: "tests_innerHTML_1.dat #35",
7241                 html: "<span><tr><span>",
7242                 errors: 2,
7243                 fragment: "caption",
7244                 expected: "| <span>\n|   <span>\n"
7245         }, {
7246                 name: "tests_innerHTML_1.dat #36",
7247                 html: "<span></table><span>",
7248                 errors: 2,
7249                 fragment: "caption",
7250                 expected: "| <span>\n|   <span>\n"
7251         }, {
7252                 name: "tests_innerHTML_1.dat #37",
7253                 html: "</colgroup><col>",
7254                 errors: 1,
7255                 fragment: "colgroup",
7256                 expected: "| <col>\n"
7257         }, {
7258                 name: "tests_innerHTML_1.dat #38",
7259                 html: "<a><col>",
7260                 errors: 1,
7261                 fragment: "colgroup",
7262                 expected: "| <col>\n"
7263         }, {
7264                 name: "tests_innerHTML_1.dat #39",
7265                 html: "<caption><a>",
7266                 errors: 3,
7267                 fragment: "tbody",
7268                 expected: "| <a>\n"
7269         }, {
7270                 name: "tests_innerHTML_1.dat #40",
7271                 html: "<col><a>",
7272                 errors: 3,
7273                 fragment: "tbody",
7274                 expected: "| <a>\n"
7275         }, {
7276                 name: "tests_innerHTML_1.dat #41",
7277                 html: "<colgroup><a>",
7278                 errors: 3,
7279                 fragment: "tbody",
7280                 expected: "| <a>\n"
7281         }, {
7282                 name: "tests_innerHTML_1.dat #42",
7283                 html: "<tbody><a>",
7284                 errors: 3,
7285                 fragment: "tbody",
7286                 expected: "| <a>\n"
7287         }, {
7288                 name: "tests_innerHTML_1.dat #43",
7289                 html: "<tfoot><a>",
7290                 errors: 3,
7291                 fragment: "tbody",
7292                 expected: "| <a>\n"
7293         }, {
7294                 name: "tests_innerHTML_1.dat #44",
7295                 html: "<thead><a>",
7296                 errors: 3,
7297                 fragment: "tbody",
7298                 expected: "| <a>\n"
7299         }, {
7300                 name: "tests_innerHTML_1.dat #45",
7301                 html: "</table><a>",
7302                 errors: 3,
7303                 fragment: "tbody",
7304                 expected: "| <a>\n"
7305         }, {
7306                 name: "tests_innerHTML_1.dat #46",
7307                 html: "<a><tr>",
7308                 errors: 1,
7309                 fragment: "tbody",
7310                 expected: "| <a>\n| <tr>\n"
7311         }, {
7312                 name: "tests_innerHTML_1.dat #47",
7313                 html: "<a><td>",
7314                 errors: 2,
7315                 fragment: "tbody",
7316                 expected: "| <a>\n| <tr>\n|   <td>\n"
7317         }, {
7318                 name: "tests_innerHTML_1.dat #48",
7319                 html: "<a><td>",
7320                 errors: 2,
7321                 fragment: "tbody",
7322                 expected: "| <a>\n| <tr>\n|   <td>\n"
7323         }, {
7324                 name: "tests_innerHTML_1.dat #49",
7325                 html: "<a><td>",
7326                 errors: 2,
7327                 fragment: "tbody",
7328                 expected: "| <a>\n| <tr>\n|   <td>\n"
7329         }, {
7330                 name: "tests_innerHTML_1.dat #50",
7331                 html: "<td><table><tbody><a><tr>",
7332                 errors: 3,
7333                 fragment: "tbody",
7334                 expected: "| <tr>\n|   <td>\n|     <a>\n|     <table>\n|       <tbody>\n|         <tr>\n"
7335         }, {
7336                 name: "tests_innerHTML_1.dat #51",
7337                 html: "</tr><td>",
7338                 errors: 1,
7339                 fragment: "tr",
7340                 expected: "| <td>\n"
7341         }, {
7342                 name: "tests_innerHTML_1.dat #52",
7343                 html: "<td><table><a><tr></tr><tr>",
7344                 errors: 2,
7345                 fragment: "tr",
7346                 expected: "| <td>\n|   <a>\n|   <table>\n|     <tbody>\n|       <tr>\n|       <tr>\n"
7347         }, {
7348                 name: "tests_innerHTML_1.dat #53",
7349                 html: "<caption><td>",
7350                 errors: 1,
7351                 fragment: "tr",
7352                 expected: "| <td>\n"
7353         }, {
7354                 name: "tests_innerHTML_1.dat #54",
7355                 html: "<col><td>",
7356                 errors: 1,
7357                 fragment: "tr",
7358                 expected: "| <td>\n"
7359         }, {
7360                 name: "tests_innerHTML_1.dat #55",
7361                 html: "<colgroup><td>",
7362                 errors: 1,
7363                 fragment: "tr",
7364                 expected: "| <td>\n"
7365         }, {
7366                 name: "tests_innerHTML_1.dat #56",
7367                 html: "<tbody><td>",
7368                 errors: 1,
7369                 fragment: "tr",
7370                 expected: "| <td>\n"
7371         }, {
7372                 name: "tests_innerHTML_1.dat #57",
7373                 html: "<tfoot><td>",
7374                 errors: 1,
7375                 fragment: "tr",
7376                 expected: "| <td>\n"
7377         }, {
7378                 name: "tests_innerHTML_1.dat #58",
7379                 html: "<thead><td>",
7380                 errors: 1,
7381                 fragment: "tr",
7382                 expected: "| <td>\n"
7383         }, {
7384                 name: "tests_innerHTML_1.dat #59",
7385                 html: "<tr><td>",
7386                 errors: 1,
7387                 fragment: "tr",
7388                 expected: "| <td>\n"
7389         }, {
7390                 name: "tests_innerHTML_1.dat #60",
7391                 html: "</table><td>",
7392                 errors: 1,
7393                 fragment: "tr",
7394                 expected: "| <td>\n"
7395         }, {
7396                 name: "tests_innerHTML_1.dat #61",
7397                 html: "<td><table></table><td>",
7398                 fragment: "tr",
7399                 expected: "| <td>\n|   <table>\n| <td>\n"
7400         }, {
7401                 name: "tests_innerHTML_1.dat #62",
7402                 html: "<td><table></table><td>",
7403                 fragment: "tr",
7404                 expected: "| <td>\n|   <table>\n| <td>\n"
7405         }, {
7406                 name: "tests_innerHTML_1.dat #63",
7407                 html: "<caption><a>",
7408                 errors: 2,
7409                 fragment: "td",
7410                 expected: "| <a>\n"
7411         }, {
7412                 name: "tests_innerHTML_1.dat #64",
7413                 html: "<col><a>",
7414                 errors: 2,
7415                 fragment: "td",
7416                 expected: "| <a>\n"
7417         }, {
7418                 name: "tests_innerHTML_1.dat #65",
7419                 html: "<colgroup><a>",
7420                 errors: 2,
7421                 fragment: "td",
7422                 expected: "| <a>\n"
7423         }, {
7424                 name: "tests_innerHTML_1.dat #66",
7425                 html: "<tbody><a>",
7426                 errors: 2,
7427                 fragment: "td",
7428                 expected: "| <a>\n"
7429         }, {
7430                 name: "tests_innerHTML_1.dat #67",
7431                 html: "<tfoot><a>",
7432                 errors: 2,
7433                 fragment: "td",
7434                 expected: "| <a>\n"
7435         }, {
7436                 name: "tests_innerHTML_1.dat #68",
7437                 html: "<th><a>",
7438                 errors: 2,
7439                 fragment: "td",
7440                 expected: "| <a>\n"
7441         }, {
7442                 name: "tests_innerHTML_1.dat #69",
7443                 html: "<thead><a>",
7444                 errors: 2,
7445                 fragment: "td",
7446                 expected: "| <a>\n"
7447         }, {
7448                 name: "tests_innerHTML_1.dat #70",
7449                 html: "<tr><a>",
7450                 errors: 2,
7451                 fragment: "td",
7452                 expected: "| <a>\n"
7453         }, {
7454                 name: "tests_innerHTML_1.dat #71",
7455                 html: "</table><a>",
7456                 errors: 2,
7457                 fragment: "td",
7458                 expected: "| <a>\n"
7459         }, {
7460                 name: "tests_innerHTML_1.dat #72",
7461                 html: "</tbody><a>",
7462                 errors: 2,
7463                 fragment: "td",
7464                 expected: "| <a>\n"
7465         }, {
7466                 name: "tests_innerHTML_1.dat #73",
7467                 html: "</td><a>",
7468                 errors: 2,
7469                 fragment: "td",
7470                 expected: "| <a>\n"
7471         }, {
7472                 name: "tests_innerHTML_1.dat #74",
7473                 html: "</tfoot><a>",
7474                 errors: 2,
7475                 fragment: "td",
7476                 expected: "| <a>\n"
7477         }, {
7478                 name: "tests_innerHTML_1.dat #75",
7479                 html: "</thead><a>",
7480                 errors: 2,
7481                 fragment: "td",
7482                 expected: "| <a>\n"
7483         }, {
7484                 name: "tests_innerHTML_1.dat #76",
7485                 html: "</th><a>",
7486                 errors: 2,
7487                 fragment: "td",
7488                 expected: "| <a>\n"
7489         }, {
7490                 name: "tests_innerHTML_1.dat #77",
7491                 html: "</tr><a>",
7492                 errors: 2,
7493                 fragment: "td",
7494                 expected: "| <a>\n"
7495         }, {
7496                 name: "tests_innerHTML_1.dat #78",
7497                 html: "<table><td><td>",
7498                 errors: 2,
7499                 fragment: "td",
7500                 expected: "| <table>\n|   <tbody>\n|     <tr>\n|       <td>\n|       <td>\n"
7501         }, {
7502                 name: "tests_innerHTML_1.dat #79",
7503                 html: "</select><option>",
7504                 errors: 2,
7505                 fragment: "select",
7506                 expected: "| <option>\n"
7507         }, {
7508                 name: "tests_innerHTML_1.dat #80",
7509                 html: "<input><option>",
7510                 errors: 2,
7511                 fragment: "select",
7512                 expected: "| <option>\n"
7513         }, {
7514                 name: "tests_innerHTML_1.dat #81",
7515                 html: "<keygen><option>",
7516                 errors: 2,
7517                 fragment: "select",
7518                 expected: "| <option>\n"
7519         }, {
7520                 name: "tests_innerHTML_1.dat #82",
7521                 html: "<textarea><option>",
7522                 errors: 2,
7523                 fragment: "select",
7524                 expected: "| <option>\n"
7525         }, {
7526                 name: "tests_innerHTML_1.dat #83",
7527                 html: "</html><!--abc-->",
7528                 errors: 1,
7529                 fragment: "html",
7530                 expected: "| <head>\n| <body>\n| <!-- abc -->\n"
7531         }, {
7532                 name: "tests_innerHTML_1.dat #84",
7533                 html: "</frameset><frame>",
7534                 errors: 1,
7535                 fragment: "frameset",
7536                 expected: "| <frame>\n"
7537         }, {
7538                 name: "tests_innerHTML_1.dat #85",
7539                 html: "",
7540                 fragment: "html",
7541                 expected: "| <head>\n| <body>\n"
7542         }, {
7543                 name: "tricky01.dat #1",
7544                 html: "<b><p>Bold </b> Not bold</p>\nAlso not bold.",
7545                 errors: 2,
7546                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|     <p>\n|       <b>\n|         \"Bold \"\n|       \" Not bold\"\n|     \"\nAlso not bold.\"\n"
7547         }, {
7548                 name: "tricky01.dat #2",
7549                 html: "<html>\n<font color=red><i>Italic and Red<p>Italic and Red </font> Just italic.</p> Italic only.</i> Plain\n<p>I should not be red. <font color=red>Red. <i>Italic and red.</p>\n<p>Italic and red. </i> Red.</font> I should not be red.</p>\n<b>Bold <i>Bold and italic</b> Only Italic </i> Plain",
7550                 errors: 6,
7551                 expected: "| <html>\n|   <head>\n|   <body>\n|     <font>\n|       color=\"red\"\n|       <i>\n|         \"Italic and Red\"\n|     <i>\n|       <p>\n|         <font>\n|           color=\"red\"\n|           \"Italic and Red \"\n|         \" Just italic.\"\n|       \" Italic only.\"\n|     \" Plain\n\"\n|     <p>\n|       \"I should not be red. \"\n|       <font>\n|         color=\"red\"\n|         \"Red. \"\n|         <i>\n|           \"Italic and red.\"\n|     <font>\n|       color=\"red\"\n|       <i>\n|         \"\n\"\n|     <p>\n|       <font>\n|         color=\"red\"\n|         <i>\n|           \"Italic and red. \"\n|         \" Red.\"\n|       \" I should not be red.\"\n|     \"\n\"\n|     <b>\n|       \"Bold \"\n|       <i>\n|         \"Bold and italic\"\n|     <i>\n|       \" Only Italic \"\n|     \" Plain\"\n"
7552         }, {
7553                 name: "tricky01.dat #3",
7554                 html: "<html><body>\n<p><font size=\"7\">First paragraph.</p>\n<p>Second paragraph.</p></font>\n<b><p><i>Bold and Italic</b> Italic</p>",
7555                 errors: 5,
7556                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"\n\"\n|     <p>\n|       <font>\n|         size=\"7\"\n|         \"First paragraph.\"\n|     <font>\n|       size=\"7\"\n|       \"\n\"\n|       <p>\n|         \"Second paragraph.\"\n|     \"\n\"\n|     <b>\n|     <p>\n|       <b>\n|         <i>\n|           \"Bold and Italic\"\n|       <i>\n|         \" Italic\"\n"
7557         }, {
7558                 name: "tricky01.dat #4",
7559                 html: "<html>\n<dl>\n<dt><b>Boo\n<dd>Goo?\n</dl>\n</html>",
7560                 errors: 4,
7561                 expected: "| <html>\n|   <head>\n|   <body>\n|     <dl>\n|       \"\n\"\n|       <dt>\n|         <b>\n|           \"Boo\n\"\n|       <dd>\n|         <b>\n|           \"Goo?\n\"\n|     <b>\n|       \"\n\"\n"
7562         }, {
7563                 name: "tricky01.dat #5",
7564                 html: "<html><body>\n<label><a><div>Hello<div>World</div></a></label>  \n</body></html>",
7565                 errors: 4,
7566                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"\n\"\n|     <label>\n|       <a>\n|       <div>\n|         <a>\n|           \"Hello\"\n|           <div>\n|             \"World\"\n|         \"  \n\"\n"
7567         }, {
7568                 name: "tricky01.dat #6",
7569                 html: "<table><center> <font>a</center> <img> <tr><td> </td> </tr> </table>",
7570                 errors: 9,
7571                 expected: "| <html>\n|   <head>\n|   <body>\n|     <center>\n|       \" \"\n|       <font>\n|         \"a\"\n|     <font>\n|       <img>\n|       \" \"\n|     <table>\n|       \" \"\n|       <tbody>\n|         <tr>\n|           <td>\n|             \" \"\n|           \" \"\n|         \" \"\n"
7572         }, {
7573                 name: "tricky01.dat #7",
7574                 html: "<table><tr><p><a><p>You should see this text.",
7575                 errors: 31,
7576                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       <a>\n|     <p>\n|       <a>\n|         \"You should see this text.\"\n|     <table>\n|       <tbody>\n|         <tr>\n"
7577         }, {
7578                 name: "tricky01.dat #8",
7579                 html: "<TABLE>\n<TR>\n<CENTER><CENTER><TD></TD></TR><TR>\n<FONT>\n<TABLE><tr></tr></TABLE>\n</P>\n<a></font><font></a>\nThis page contains an insanely badly-nested tag sequence.",
7580                 errors: 10,
7581                 expected: "| <html>\n|   <head>\n|   <body>\n|     <center>\n|       <center>\n|     <font>\n|       \"\n\"\n|     <table>\n|       \"\n\"\n|       <tbody>\n|         <tr>\n|           \"\n\"\n|           <td>\n|         <tr>\n|           \"\n\"\n|     <table>\n|       <tbody>\n|         <tr>\n|     <font>\n|       \"\n\"\n|       <p>\n|       \"\n\"\n|       <a>\n|     <a>\n|       <font>\n|     <font>\n|       \"\nThis page contains an insanely badly-nested tag sequence.\"\n"
7582         }, {
7583                 name: "tricky01.dat #9",
7584                 html: "<html>\n<body>\n<b><nobr><div>This text is in a div inside a nobr</nobr>More text that should not be in the nobr, i.e., the\nnobr should have closed the div inside it implicitly. </b><pre>A pre tag outside everything else.</pre>\n</body>\n</html>",
7585                 errors: 4,
7586                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"\n\"\n|     <b>\n|       <nobr>\n|     <div>\n|       <b>\n|         <nobr>\n|           \"This text is in a div inside a nobr\"\n|         \"More text that should not be in the nobr, i.e., the\nnobr should have closed the div inside it implicitly. \"\n|       <pre>\n|         \"A pre tag outside everything else.\"\n|       \"\n\n\"\n"
7587         }, {
7588                 name: "webkit01.dat #1",
7589                 html: "Test",
7590                 errors: 1,
7591                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"Test\"\n"
7592         }, {
7593                 name: "webkit01.dat #2",
7594                 html: "<div></div>",
7595                 errors: 1,
7596                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n"
7597         }, {
7598                 name: "webkit01.dat #3",
7599                 html: "<div>Test</div>",
7600                 errors: 1,
7601                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"Test\"\n"
7602         }, {
7603                 name: "webkit01.dat #4",
7604                 html: "<di",
7605                 errors: 2,
7606                 expected: "| <html>\n|   <head>\n|   <body>\n"
7607         }, {
7608                 name: "webkit01.dat #5",
7609                 html: "<div>Hello</div>\n<script>\nconsole.log(\"PASS\");\n</script>\n<div>Bye</div>",
7610                 errors: 1,
7611                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"Hello\"\n|     \"\n\"\n|     <script>\n|       \"\nconsole.log(\"PASS\");\n\"\n|     \"\n\"\n|     <div>\n|       \"Bye\"\n"
7612         }, {
7613                 name: "webkit01.dat #6",
7614                 html: "<div foo=\"bar\">Hello</div>",
7615                 errors: 1,
7616                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       foo=\"bar\"\n|       \"Hello\"\n"
7617         }, {
7618                 name: "webkit01.dat #7",
7619                 html: "<div>Hello</div>\n<script>\nconsole.log(\"FOO<span>BAR</span>BAZ\");\n</script>\n<div>Bye</div>",
7620                 errors: 1,
7621                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       \"Hello\"\n|     \"\n\"\n|     <script>\n|       \"\nconsole.log(\"FOO<span>BAR</span>BAZ\");\n\"\n|     \"\n\"\n|     <div>\n|       \"Bye\"\n"
7622         }, {
7623                 name: "webkit01.dat #8",
7624                 html: "<foo bar=\"baz\"></foo><potato quack=\"duck\"></potato>",
7625                 errors: 1,
7626                 expected: "| <html>\n|   <head>\n|   <body>\n|     <foo>\n|       bar=\"baz\"\n|     <potato>\n|       quack=\"duck\"\n"
7627         }, {
7628                 name: "webkit01.dat #9",
7629                 html: "<foo bar=\"baz\"><potato quack=\"duck\"></potato></foo>",
7630                 errors: 1,
7631                 expected: "| <html>\n|   <head>\n|   <body>\n|     <foo>\n|       bar=\"baz\"\n|       <potato>\n|         quack=\"duck\"\n"
7632         }, {
7633                 name: "webkit01.dat #10",
7634                 html: "<foo></foo bar=\"baz\"><potato></potato quack=\"duck\">",
7635                 errors: 3,
7636                 expected: "| <html>\n|   <head>\n|   <body>\n|     <foo>\n|     <potato>\n"
7637         }, {
7638                 name: "webkit01.dat #11",
7639                 html: "</ tttt>",
7640                 errors: 2,
7641                 expected: "| <!--  tttt -->\n| <html>\n|   <head>\n|   <body>\n"
7642         }, {
7643                 name: "webkit01.dat #12",
7644                 html: "<div FOO ><img><img></div>",
7645                 errors: 1,
7646                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       foo=\"\"\n|       <img>\n|       <img>\n"
7647         }, {
7648                 name: "webkit01.dat #13",
7649                 html: "<p>Test</p<p>Test2</p>",
7650                 errors: 2,
7651                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       \"TestTest2\"\n"
7652         }, {
7653                 name: "webkit01.dat #14",
7654                 html: "<rdar://problem/6869687>",
7655                 errors: 5,
7656                 expected: "| <html>\n|   <head>\n|   <body>\n|     <rdar:>\n|       6869687=\"\"\n|       problem=\"\"\n"
7657         }, {
7658                 name: "webkit01.dat #15",
7659                 html: "<A>test< /A>",
7660                 errors: 3,
7661                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|       \"test< /A>\"\n"
7662         }, {
7663                 name: "webkit01.dat #16",
7664                 html: "&lt;",
7665                 errors: 1,
7666                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"<\"\n"
7667         }, {
7668                 name: "webkit01.dat #17",
7669                 html: "<body foo='bar'><body foo='baz' yo='mama'>",
7670                 errors: 2,
7671                 expected: "| <html>\n|   <head>\n|   <body>\n|     foo=\"bar\"\n|     yo=\"mama\"\n"
7672         }, {
7673                 name: "webkit01.dat #18",
7674                 html: "<body></br foo=\"bar\"></body>",
7675                 errors: 3,
7676                 expected: "| <html>\n|   <head>\n|   <body>\n|     <br>\n"
7677         }, {
7678                 name: "webkit01.dat #19",
7679                 html: "<bdy><br foo=\"bar\"></body>",
7680                 errors: 2,
7681                 expected: "| <html>\n|   <head>\n|   <body>\n|     <bdy>\n|       <br>\n|         foo=\"bar\"\n"
7682         }, {
7683                 name: "webkit01.dat #20",
7684                 html: "<body></body></br foo=\"bar\">",
7685                 errors: 4,
7686                 expected: "| <html>\n|   <head>\n|   <body>\n|     <br>\n"
7687         }, {
7688                 name: "webkit01.dat #21",
7689                 html: "<bdy></body><br foo=\"bar\">",
7690                 errors: 4,
7691                 expected: "| <html>\n|   <head>\n|   <body>\n|     <bdy>\n|       <br>\n|         foo=\"bar\"\n"
7692         }, {
7693                 name: "webkit01.dat #22",
7694                 html: "<html><body></body></html><!-- Hi there -->",
7695                 errors: 1,
7696                 expected: "| <html>\n|   <head>\n|   <body>\n| <!--  Hi there  -->\n"
7697         }, {
7698                 name: "webkit01.dat #23",
7699                 html: "<html><body></body></html>x<!-- Hi there -->",
7700                 errors: 2,
7701                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"x\"\n|     <!--  Hi there  -->\n"
7702         }, {
7703                 name: "webkit01.dat #24",
7704                 html: "<html><body></body></html>x<!-- Hi there --></html><!-- Again -->",
7705                 errors: 2,
7706                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"x\"\n|     <!--  Hi there  -->\n| <!--  Again  -->\n"
7707         }, {
7708                 name: "webkit01.dat #25",
7709                 html: "<html><body></body></html>x<!-- Hi there --></body></html><!-- Again -->",
7710                 errors: 2,
7711                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"x\"\n|     <!--  Hi there  -->\n| <!--  Again  -->\n"
7712         }, {
7713                 name: "webkit01.dat #26",
7714                 html: "<html><body><ruby><div><rp>xx</rp></div></ruby></body></html>",
7715                 errors: 2,
7716                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       <div>\n|         <rp>\n|           \"xx\"\n"
7717         }, {
7718                 name: "webkit01.dat #27",
7719                 html: "<html><body><ruby><div><rt>xx</rt></div></ruby></body></html>",
7720                 errors: 2,
7721                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ruby>\n|       <div>\n|         <rt>\n|           \"xx\"\n"
7722         }, {
7723                 name: "webkit01.dat #28",
7724                 html: "<html><frameset><!--1--><noframes>A</noframes><!--2--></frameset><!--3--><noframes>B</noframes><!--4--></html><!--5--><noframes>C</noframes><!--6-->",
7725                 errors: 1,
7726                 expected: "| <html>\n|   <head>\n|   <frameset>\n|     <!-- 1 -->\n|     <noframes>\n|       \"A\"\n|     <!-- 2 -->\n|   <!-- 3 -->\n|   <noframes>\n|     \"B\"\n|   <!-- 4 -->\n|   <noframes>\n|     \"C\"\n| <!-- 5 -->\n| <!-- 6 -->\n"
7727         }, {
7728                 name: "webkit01.dat #29",
7729                 html: "<select><option>A<select><option>B<select><option>C<select><option>D<select><option>E<select><option>F<select><option>G<select>",
7730                 errors: 6,
7731                 expected: "| <html>\n|   <head>\n|   <body>\n|     <select>\n|       <option>\n|         \"A\"\n|     <option>\n|       \"B\"\n|       <select>\n|         <option>\n|           \"C\"\n|     <option>\n|       \"D\"\n|       <select>\n|         <option>\n|           \"E\"\n|     <option>\n|       \"F\"\n|       <select>\n|         <option>\n|           \"G\"\n"
7732         }, {
7733                 name: "webkit01.dat #30",
7734                 html: "<dd><dd><dt><dt><dd><li><li>",
7735                 errors: 1,
7736                 expected: "| <html>\n|   <head>\n|   <body>\n|     <dd>\n|     <dd>\n|     <dt>\n|     <dt>\n|     <dd>\n|       <li>\n|       <li>\n"
7737         }, {
7738                 name: "webkit01.dat #31",
7739                 html: "<div><b></div><div><nobr>a<nobr>",
7740                 errors: 4,
7741                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <b>\n|     <div>\n|       <b>\n|         <nobr>\n|           \"a\"\n|         <nobr>\n"
7742         }, {
7743                 name: "webkit01.dat #32",
7744                 html: "<head></head>\n<body></body>",
7745                 errors: 1,
7746                 expected: "| <html>\n|   <head>\n|   \"\n\"\n|   <body>\n"
7747         }, {
7748                 name: "webkit01.dat #33",
7749                 html: "<head></head> <style></style>ddd",
7750                 errors: 2,
7751                 expected: "| <html>\n|   <head>\n|     <style>\n|   \" \"\n|   <body>\n|     \"ddd\"\n"
7752         }, {
7753                 name: "webkit01.dat #34",
7754                 html: "<kbd><table></kbd><col><select><tr>",
7755                 errors: 6,
7756                 expected: "| <html>\n|   <head>\n|   <body>\n|     <kbd>\n|       <select>\n|       <table>\n|         <colgroup>\n|           <col>\n|         <tbody>\n|           <tr>\n"
7757         }, {
7758                 name: "webkit01.dat #35",
7759                 html: "<kbd><table></kbd><col><select><tr></table><div>",
7760                 errors: 6,
7761                 expected: "| <html>\n|   <head>\n|   <body>\n|     <kbd>\n|       <select>\n|       <table>\n|         <colgroup>\n|           <col>\n|         <tbody>\n|           <tr>\n|       <div>\n"
7762         }, {
7763                 name: "webkit01.dat #36",
7764                 html: "<a><li><style></style><title></title></a>",
7765                 errors: 2,
7766                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|     <li>\n|       <a>\n|         <style>\n|         <title>\n"
7767         }, {
7768                 name: "webkit01.dat #37",
7769                 html: "<font></p><p><meta><title></title></font>",
7770                 errors: 3,
7771                 expected: "| <html>\n|   <head>\n|   <body>\n|     <font>\n|       <p>\n|     <p>\n|       <font>\n|         <meta>\n|         <title>\n"
7772         }, {
7773                 name: "webkit01.dat #38",
7774                 html: "<a><center><title></title><a>",
7775                 errors: 4,
7776                 expected: "| <html>\n|   <head>\n|   <body>\n|     <a>\n|     <center>\n|       <a>\n|         <title>\n|       <a>\n"
7777         }, {
7778                 name: "webkit01.dat #39",
7779                 html: "<svg><title><div>",
7780                 errors: 2,
7781                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg title>\n|         <div>\n"
7782         }, {
7783                 name: "webkit01.dat #40",
7784                 html: "<svg><title><rect><div>",
7785                 errors: 2,
7786                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg title>\n|         <rect>\n|           <div>\n"
7787         }, {
7788                 name: "webkit01.dat #41",
7789                 html: "<svg><title><svg><div>",
7790                 errors: 3,
7791                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg title>\n|         <svg svg>\n|         <div>\n"
7792         }, {
7793                 name: "webkit01.dat #42",
7794                 html: "<img <=\"\" FAIL>",
7795                 errors: 2,
7796                 expected: "| <html>\n|   <head>\n|   <body>\n|     <img>\n|       <=\"\"\n|       fail=\"\"\n"
7797         }, {
7798                 name: "webkit01.dat #43",
7799                 html: "<ul><li><div id='foo'/>A</li><li>B<div>C</div></li></ul>",
7800                 errors: 3,
7801                 expected: "| <html>\n|   <head>\n|   <body>\n|     <ul>\n|       <li>\n|         <div>\n|           id=\"foo\"\n|           \"A\"\n|       <li>\n|         \"B\"\n|         <div>\n|           \"C\"\n"
7802         }, {
7803                 name: "webkit01.dat #44",
7804                 html: "<svg><em><desc></em>",
7805                 errors: 3,
7806                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|     <em>\n|       <desc>\n"
7807         }, {
7808                 name: "webkit01.dat #45",
7809                 html: "<table><tr><td><svg><desc><td></desc><circle>",
7810                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             <svg svg>\n|               <svg desc>\n|           <td>\n|             <circle>\n"
7811         }, {
7812                 name: "webkit01.dat #46",
7813                 html: "<svg><tfoot></mi><td>",
7814                 errors: 4,
7815                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg tfoot>\n|         <svg td>\n"
7816         }, {
7817                 name: "webkit01.dat #47",
7818                 html: "<math><mrow><mrow><mn>1</mn></mrow><mi>a</mi></mrow></math>",
7819                 errors: 1,
7820                 expected: "| <html>\n|   <head>\n|   <body>\n|     <math math>\n|       <math mrow>\n|         <math mrow>\n|           <math mn>\n|             \"1\"\n|         <math mi>\n|           \"a\"\n"
7821         }, {
7822                 name: "webkit01.dat #48",
7823                 html: "<!doctype html><input type=\"hidden\"><frameset>",
7824                 errors: 2,
7825                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <frameset>\n"
7826         }, {
7827                 name: "webkit01.dat #49",
7828                 html: "<!doctype html><input type=\"button\"><frameset>",
7829                 errors: 1,
7830                 expected: "| <!DOCTYPE html>\n| <html>\n|   <head>\n|   <body>\n|     <input>\n|       type=\"button\"\n"
7831         }, {
7832                 name: "webkit02.dat #1",
7833                 html: "<foo bar=qux/>",
7834                 errors: 2,
7835                 expected: "| <html>\n|   <head>\n|   <body>\n|     <foo>\n|       bar=\"qux/\"\n"
7836         }, {
7837                 name: "webkit02.dat #2",
7838                 html: "<p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p>",
7839                 scripting: true,
7840                 errors: 1,
7841                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       id=\"status\"\n|       <noscript>\n|         \"<strong>A</strong>\"\n|       <span>\n|         \"B\"\n"
7842         }, {
7843                 name: "webkit02.dat #3",
7844                 html: "<p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p>",
7845                 scripting: false,
7846                 errors: 1,
7847                 expected: "| <html>\n|   <head>\n|   <body>\n|     <p>\n|       id=\"status\"\n|       <noscript>\n|         <strong>\n|           \"A\"\n|       <span>\n|         \"B\"\n"
7848         }, {
7849                 name: "webkit02.dat #4",
7850                 html: "<div><sarcasm><div></div></sarcasm></div>",
7851                 errors: 1,
7852                 expected: "| <html>\n|   <head>\n|   <body>\n|     <div>\n|       <sarcasm>\n|         <div>\n"
7853         }, {
7854                 name: "webkit02.dat #5",
7855                 html: "<html><body><img src=\"\" border=\"0\" alt=\"><div>A</div></body></html>",
7856                 errors: 2,
7857                 expected: "| <html>\n|   <head>\n|   <body>\n"
7858         }, {
7859                 name: "webkit02.dat #6",
7860                 html: "<table><td></tbody>A",
7861                 errors: 4,
7862                 expected: "| <html>\n|   <head>\n|   <body>\n|     \"A\"\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n"
7863         }, {
7864                 name: "webkit02.dat #7",
7865                 html: "<table><td></thead>A",
7866                 errors: 4,
7867                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             \"A\"\n"
7868         }, {
7869                 name: "webkit02.dat #8",
7870                 html: "<table><td></tfoot>A",
7871                 errors: 4,
7872                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <tbody>\n|         <tr>\n|           <td>\n|             \"A\"\n"
7873         }, {
7874                 name: "webkit02.dat #9",
7875                 html: "<table><thead><td></tbody>A",
7876                 errors: 4,
7877                 expected: "| <html>\n|   <head>\n|   <body>\n|     <table>\n|       <thead>\n|         <tr>\n|           <td>\n|             \"A\"\n"
7878         }, {
7879                 name: "webkit02.dat #10",
7880                 html: "<legend>test</legend>",
7881                 expected: "| <html>\n|   <head>\n|   <body>\n|     <legend>\n|       \"test\"\n"
7882         }, {
7883                 name: "webkit02.dat #11",
7884                 html: "<table><input>",
7885                 expected: "| <html>\n|   <head>\n|   <body>\n|     <input>\n|     <table>\n"
7886         }, {
7887                 name: "webkit02.dat #12",
7888                 html: "<b><em><foo><foo><aside></b>",
7889                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <em>\n|         <foo>\n|           <foo>\n|     <em>\n|       <aside>\n|         <b>\n"
7890         }, {
7891                 name: "webkit02.dat #13",
7892                 html: "<b><em><foo><foo><aside></b></em>",
7893                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <em>\n|         <foo>\n|           <foo>\n|     <em>\n|     <aside>\n|       <em>\n|         <b>\n"
7894         }, {
7895                 name: "webkit02.dat #14",
7896                 html: "<b><em><foo><foo><foo><aside></b>",
7897                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <em>\n|         <foo>\n|           <foo>\n|             <foo>\n|     <aside>\n|       <b>\n"
7898         }, {
7899                 name: "webkit02.dat #15",
7900                 html: "<b><em><foo><foo><foo><aside></b></em>",
7901                 expected: "| <html>\n|   <head>\n|   <body>\n|     <b>\n|       <em>\n|         <foo>\n|           <foo>\n|             <foo>\n|     <aside>\n|       <b>\n"
7902         }, {
7903                 name: "webkit02.dat #16",
7904                 html: "<b><em><foo><foo><foo><foo><foo><foo><foo><foo><foo><foo><aside></b></em>",
7905                 fragment: "div",
7906                 expected: "| <b>\n|   <em>\n|     <foo>\n|       <foo>\n|         <foo>\n|           <foo>\n|             <foo>\n|               <foo>\n|                 <foo>\n|                   <foo>\n|                     <foo>\n|                       <foo>\n| <aside>\n|   <b>\n"
7907         }, {
7908                 name: "webkit02.dat #17",
7909                 html: "<b><em><foo><foob><foob><foob><foob><fooc><fooc><fooc><fooc><food><aside></b></em>",
7910                 fragment: "div",
7911                 expected: "| <b>\n|   <em>\n|     <foo>\n|       <foob>\n|         <foob>\n|           <foob>\n|             <foob>\n|               <fooc>\n|                 <fooc>\n|                   <fooc>\n|                     <fooc>\n|                       <food>\n| <aside>\n|   <b>\n"
7912         }, {
7913                 name: "webkit02.dat #18",
7914                 html: "<isindex action=\"x\">",
7915                 fragment: "table",
7916                 expected: "| <form>\n|   action=\"x\"\n|   <hr>\n|   <label>\n|     \"This is a searchable index. Enter search keywords: \"\n|     <input>\n|       name=\"isindex\"\n|   <hr>\n"
7917         }, {
7918                 name: "webkit02.dat #19",
7919                 html: "<option><XH<optgroup></optgroup>",
7920                 fragment: "select",
7921                 expected: "| <option>\n"
7922         }, {
7923                 name: "webkit02.dat #20",
7924                 html: "<svg><foreignObject><div>foo</div><plaintext></foreignObject></svg><div>bar</div>",
7925                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg foreignObject>\n|         <div>\n|           \"foo\"\n|         <plaintext>\n|           \"</foreignObject></svg><div>bar</div>\"\n"
7926         }, {
7927                 name: "webkit02.dat #21",
7928                 html: "<svg><foreignObject></foreignObject><title></svg>foo",
7929                 expected: "| <html>\n|   <head>\n|   <body>\n|     <svg svg>\n|       <svg foreignObject>\n|       <svg title>\n|     \"foo\"\n"
7930         }, {
7931                 name: "webkit02.dat #22",
7932                 html: "</foreignObject><plaintext><div>foo</div>",
7933                 expected: "| <html>\n|   <head>\n|   <body>\n|     <plaintext>\n|       \"<div>foo</div>\"\n"
7934         }
7935 ]
7936
7937 if (typeof module !== 'undefined' && (module.exports != null)) {
7938         peach_parser = require('./parser.js')
7939 } else {
7940         peach_parser = window.peach_parser
7941 }
7942
7943 serialize_els = function (els, prefix) {
7944         var attr_keys, el, i, j, ret
7945         if (prefix == null) {
7946                 prefix = '| '
7947         }
7948         ret = ''
7949         for (i = 0; i < els.length; ++i) {
7950                 el = els[i]
7951                 switch (el.type) {
7952                         case "tag":
7953                                 ret += prefix + "<"
7954                                 if (el.namespace === "mathml") {
7955                                         ret += "math "
7956                                 }
7957                                 if (el.namespace === "svg") {
7958                                         ret += "svg "
7959                                 }
7960                                 ret += el.name + ">\n"
7961                                 attr_keys = []
7962                                 for (k in el.attrs) {
7963                                         attr_keys.push(k)
7964                                 }
7965                                 attr_keys.sort() // TODO this should be "lexicographically by UTF-16 code unit"
7966                                 for (j = 0; j < attr_keys.length; ++j) {
7967                                         k = attr_keys[j]
7968                                         ret += prefix + "  " + k + "=\"" + el.attrs[k] + "\"\n"
7969                                 }
7970                                 if (el.name === 'template' && el.namespace === "html") {
7971                                         ret += prefix + "  content\n"
7972                                         ret += serialize_els(el.children, prefix + "    ")
7973                                 } else {
7974                                         ret += serialize_els(el.children, prefix + "  ")
7975                                 }
7976                         break
7977                         case "text":
7978                                 ret += prefix + "\"" + el.text + "\"\n"
7979                         break
7980                         case "comment":
7981                                 ret += prefix + "<!-- " + el.text + " -->\n"
7982                         break
7983                         case "doctype":
7984                                 ret += prefix + "<!DOCTYPE " + el.name
7985                                 if (((el.public_identifier != null) && el.public_identifier.length > 0) || ((el.system_identifier != null) && el.system_identifier.length > 0)) {
7986                                         ret += " \"" + ((ref = el.public_identifier) != null ? ref : '') + "\""
7987                                         ret += " \"" + ((ref1 = el.system_identifier) != null ? ref1 : '') + "\""
7988                                 }
7989                                 ret += ">\n"
7990                         break
7991                         default:
7992                                 ret += prefix + "UNKNOWN TAG TYPE " + el.type
7993                 }
7994         }
7995         return ret
7996 }
7997
7998 test_results = { passed: 0, failed: 0 }
7999 test_parser = function (args) {
8000         var parse_errors, parsed, prev_node_id, serialized
8001         parse_errors = []
8002         args.error_cb = function (i) {
8003                 parse_errors.push(i)
8004         }
8005         prev_node_id = 0 // reset counter
8006         parsed = peach_parser(args.html, args)
8007         serialized = serialize_els(parsed)
8008         if (serialized !== args.expected) {
8009                 test_results.failed += 1
8010                 if (test_results.failed === 1) {
8011                         console.log("FAILED: \"" + args.name + "\"")
8012                         console.log("      Input: " + args.html)
8013                         if (args.fragment != null) {
8014                                 console.log("   Fragment: " + args.fragment)
8015                         }
8016                         console.log("    Correct: " + args.expected)
8017                         console.log("     Output: " + serialized)
8018                         if (parse_errors.length > 0) {
8019                                 console.log(" parse errs: " + (JSON.stringify(parse_errors)))
8020                         } else {
8021                                 console.log("   No parse errors")
8022                         }
8023                 }
8024         } else {
8025                 test_results.passed += 1
8026                 // console.log "passed \"#{args.name}\""
8027         }
8028 }
8029 test_summary = function() {
8030         console.log("Tests passed: " + test_results.passed + ", Failed: " + test_results.failed)
8031 }
8032
8033 next_test = 0
8034 run_tests_and_breathe = function () {
8035         var now, start_time
8036         start_time = new Date()
8037         while (true) {
8038                 if (next_test >= tests.length) {
8039                         test_summary()
8040                         return
8041                 }
8042                 test_parser(tests[next_test])
8043                 next_test += 1
8044                 now = new Date()
8045                 if (now - start_time > 100) { // miliseconds
8046                         break
8047                 }
8048         }
8049         setTimeout(run_tests_and_breathe, 1)
8050 }
8051
8052 run_tests_and_breathe()
8053
8054 }).call(this)