html: port html5lib test data from html5lib/html5lib-tests

1. git clone git@github.com:html5lib/html5lib-tests.git && git checkout 88b8ee967f9f6f42fcd84c65af774860a70ecf3c
2. cp -Rv html5lib-tests/tree-construction/ into testdata/webkit
3. Drop unpassed following changes:

testdata/webkit/foreign-fragment.dat
testdata/webkit/isindex.dat
testdata/webkit/main-element.dat
testdata/webkit/menuitem-element.dat
testdata/webkit/tests11.dat
testdata/webkit/tests16.dat
testdata/webkit/tests19.dat
testdata/webkit/tests25.dat
testdata/webkit/tests5.dat
testdata/webkit/webkit02.dat

Change-Id: Ie60b6e24751a1efb83caf326b7e42f0517ec6b96
Reviewed-on: https://go-review.googlesource.com/c/net/+/205617
Run-TryBot: Kunpei Sakai <namusyaka@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
diff --git a/html/testdata/webkit/adoption01.dat b/html/testdata/webkit/adoption01.dat
index 787e1b0..2e1127e 100644
--- a/html/testdata/webkit/adoption01.dat
+++ b/html/testdata/webkit/adoption01.dat
@@ -1,6 +1,8 @@
 #data
 <a><p></a></p>
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,10): adoption-agency-1.3
 #document
 | <html>
 |   <head>
@@ -12,6 +14,8 @@
 #data
 <a>1<p>2</a>3</p>
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,12): adoption-agency-1.3
 #document
 | <html>
 |   <head>
@@ -26,6 +30,8 @@
 #data
 <a>1<button>2</a>3</button>
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,17): adoption-agency-1.3
 #document
 | <html>
 |   <head>
@@ -40,6 +46,8 @@
 #data
 <a>1<b>2</a>3</b>
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,12): adoption-agency-1.3
 #document
 | <html>
 |   <head>
@@ -54,6 +62,9 @@
 #data
 <a>1<div>2<div>3</a>4</div>5</div>
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,20): adoption-agency-1.3
+(1,20): adoption-agency-1.3
 #document
 | <html>
 |   <head>
@@ -72,6 +83,16 @@
 #data
 <table><a>1<p>2</a>3</p>
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,10): unexpected-start-tag-implies-table-voodoo
+(1,11): unexpected-character-implies-table-voodoo
+(1,14): unexpected-start-tag-implies-table-voodoo
+(1,15): unexpected-character-implies-table-voodoo
+(1,19): unexpected-end-tag-implies-table-voodoo
+(1,19): adoption-agency-1.3
+(1,20): unexpected-character-implies-table-voodoo
+(1,24): unexpected-end-tag-implies-table-voodoo
+(1,24): eof-in-table
 #document
 | <html>
 |   <head>
@@ -87,6 +108,9 @@
 #data
 <b><b><a><p></a>
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,16): adoption-agency-1.3
+(1,16): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -100,6 +124,9 @@
 #data
 <b><a><b><p></a>
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,16): adoption-agency-1.3
+(1,16): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -114,6 +141,9 @@
 #data
 <a><b><b><p></a>
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,16): adoption-agency-1.3
+(1,16): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -129,6 +159,9 @@
 #data
 <p>1<s id="A">2<b id="B">3</p>4</s>5</b>
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,30): unexpected-end-tag
+(1,35): adoption-agency-1.3
 #document
 | <html>
 |   <head>
@@ -153,6 +186,11 @@
 #data
 <table><a>1<td>2</td>3</table>
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,10): unexpected-start-tag-implies-table-voodoo
+(1,11): unexpected-character-implies-table-voodoo
+(1,15): unexpected-cell-in-table-body
+(1,30): unexpected-implied-end-tag-in-table-view
 #document
 | <html>
 |   <head>
@@ -170,6 +208,10 @@
 #data
 <table>A<td>B</td>C</table>
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,8): unexpected-character-implies-table-voodoo
+(1,12): unexpected-cell-in-table-body
+(1,22): unexpected-character-implies-table-voodoo
 #document
 | <html>
 |   <head>
@@ -184,6 +226,9 @@
 #data
 <a><svg><tr><input></a>
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,23): unexpected-end-tag
+(1,23): adoption-agency-1.3
 #document
 | <html>
 |   <head>
@@ -192,3 +237,101 @@
 |       <svg svg>
 |         <svg tr>
 |           <svg input>
+
+#data
+<div><a><b><div><div><div><div><div><div><div><div><div><div></a>
+#errors
+(1,5): expected-doctype-but-got-start-tag
+(1,65): adoption-agency-1.3
+(1,65): adoption-agency-1.3
+(1,65): adoption-agency-1.3
+(1,65): adoption-agency-1.3
+(1,65): adoption-agency-1.3
+(1,65): adoption-agency-1.3
+(1,65): adoption-agency-1.3
+(1,65): adoption-agency-1.3
+(1,65): expected-closing-tag-but-got-eof
+#document
+| <html>
+|   <head>
+|   <body>
+|     <div>
+|       <a>
+|         <b>
+|       <b>
+|         <div>
+|           <a>
+|           <div>
+|             <a>
+|             <div>
+|               <a>
+|               <div>
+|                 <a>
+|                 <div>
+|                   <a>
+|                   <div>
+|                     <a>
+|                     <div>
+|                       <a>
+|                       <div>
+|                         <a>
+|                           <div>
+|                             <div>
+
+#data
+<div><a><b><u><i><code><div></a>
+#errors
+(1,5): expected-doctype-but-got-start-tag
+(1,32): adoption-agency-1.3
+(1,32): expected-closing-tag-but-got-eof
+#document
+| <html>
+|   <head>
+|   <body>
+|     <div>
+|       <a>
+|         <b>
+|           <u>
+|             <i>
+|               <code>
+|       <u>
+|         <i>
+|           <code>
+|             <div>
+|               <a>
+
+#data
+<b><b><b><b>x</b></b></b></b>y
+#errors
+(1,3): expected-doctype-but-got-start-tag
+#document
+| <html>
+|   <head>
+|   <body>
+|     <b>
+|       <b>
+|         <b>
+|           <b>
+|             "x"
+|     "y"
+
+#data
+<p><b><b><b><b><p>x
+#errors
+(1,3): expected-doctype-but-got-start-tag
+(1,18): unexpected-end-tag
+(1,19): expected-closing-tag-but-got-eof
+#document
+| <html>
+|   <head>
+|   <body>
+|     <p>
+|       <b>
+|         <b>
+|           <b>
+|             <b>
+|     <p>
+|       <b>
+|         <b>
+|           <b>
+|             "x"
diff --git a/html/testdata/webkit/adoption02.dat b/html/testdata/webkit/adoption02.dat
index d18151b..e54d803 100644
--- a/html/testdata/webkit/adoption02.dat
+++ b/html/testdata/webkit/adoption02.dat
@@ -1,6 +1,9 @@
 #data
 <b>1<i>2<p>3</b>4
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,16): adoption-agency-1.3
+(1,17): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -18,6 +21,11 @@
 #data
 <a><div><style></style><address><a>
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,35): unexpected-start-tag-implies-end-tag
+(1,35): adoption-agency-1.3
+(1,35): adoption-agency-1.3
+(1,35): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
diff --git a/html/testdata/webkit/comments01.dat b/html/testdata/webkit/comments01.dat
index 44f1876..35ec6cc 100644
--- a/html/testdata/webkit/comments01.dat
+++ b/html/testdata/webkit/comments01.dat
@@ -1,6 +1,7 @@
 #data
 FOO<!-- BAR -->BAZ
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -12,6 +13,8 @@
 #data
 FOO<!-- BAR --!>BAZ
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,15): unexpected-bang-after-double-dash-in-comment
 #document
 | <html>
 |   <head>
@@ -23,6 +26,9 @@
 #data
 FOO<!-- BAR --   >BAZ
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,15): unexpected-char-in-comment
+(1,21): eof-in-comment
 #document
 | <html>
 |   <head>
@@ -33,6 +39,9 @@
 #data
 FOO<!-- BAR -- <QUX> -- MUX -->BAZ
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,15): unexpected-char-in-comment
+(1,24): unexpected-char-in-comment
 #document
 | <html>
 |   <head>
@@ -44,6 +53,10 @@
 #data
 FOO<!-- BAR -- <QUX> -- MUX --!>BAZ
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,15): unexpected-char-in-comment
+(1,24): unexpected-char-in-comment
+(1,31): unexpected-bang-after-double-dash-in-comment
 #document
 | <html>
 |   <head>
@@ -55,6 +68,11 @@
 #data
 FOO<!-- BAR -- <QUX> -- MUX -- >BAZ
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,15): unexpected-char-in-comment
+(1,24): unexpected-char-in-comment
+(1,31): unexpected-char-in-comment
+(1,35): eof-in-comment
 #document
 | <html>
 |   <head>
@@ -65,6 +83,7 @@
 #data
 FOO<!---->BAZ
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -76,6 +95,8 @@
 #data
 FOO<!--->BAZ
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,9): incorrect-comment
 #document
 | <html>
 |   <head>
@@ -87,6 +108,8 @@
 #data
 FOO<!-->BAZ
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,8): incorrect-comment
 #document
 | <html>
 |   <head>
@@ -98,6 +121,8 @@
 #data
 <?xml version="1.0">Hi
 #errors
+(1,1): expected-tag-name-but-got-question-mark
+(1,22): expected-doctype-but-got-chars
 #document
 | <!-- ?xml version="1.0" -->
 | <html>
@@ -108,6 +133,8 @@
 #data
 <?xml version="1.0">
 #errors
+(1,1): expected-tag-name-but-got-question-mark
+(1,20): expected-doctype-but-got-eof
 #document
 | <!-- ?xml version="1.0" -->
 | <html>
@@ -117,6 +144,8 @@
 #data
 <?xml version
 #errors
+(1,1): expected-tag-name-but-got-question-mark
+(1,13): expected-doctype-but-got-eof
 #document
 | <!-- ?xml version -->
 | <html>
@@ -126,6 +155,8 @@
 #data
 FOO<!----->BAZ
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,10): unexpected-dash-after-double-dash-in-comment
 #document
 | <html>
 |   <head>
@@ -133,3 +164,15 @@
 |     "FOO"
 |     <!-- - -->
 |     "BAZ"
+
+#data
+<html><!-- comment --><title>Comment before head</title>
+#errors
+(1,6): expected-doctype-but-got-start-tag
+#document
+| <html>
+|   <!--  comment  -->
+|   <head>
+|     <title>
+|       "Comment before head"
+|   <body>
diff --git a/html/testdata/webkit/doctype01.dat b/html/testdata/webkit/doctype01.dat
index ae45732..cec6638 100644
--- a/html/testdata/webkit/doctype01.dat
+++ b/html/testdata/webkit/doctype01.dat
@@ -21,6 +21,7 @@
 #data
 <!DOCTYPEhtml>Hello
 #errors
+(1,9): need-space-after-doctype
 #document
 | <!DOCTYPE html>
 | <html>
@@ -31,6 +32,9 @@
 #data
 <!DOCTYPE>Hello
 #errors
+(1,9): need-space-after-doctype
+(1,10): expected-doctype-name-but-got-right-bracket
+(1,10): unknown-doctype
 #document
 | <!DOCTYPE >
 | <html>
@@ -41,6 +45,8 @@
 #data
 <!DOCTYPE >Hello
 #errors
+(1,11): expected-doctype-name-but-got-right-bracket
+(1,11): unknown-doctype
 #document
 | <!DOCTYPE >
 | <html>
@@ -51,6 +57,7 @@
 #data
 <!DOCTYPE potato>Hello
 #errors
+(1,17): unknown-doctype
 #document
 | <!DOCTYPE potato>
 | <html>
@@ -61,6 +68,7 @@
 #data
 <!DOCTYPE potato >Hello
 #errors
+(1,18): unknown-doctype
 #document
 | <!DOCTYPE potato>
 | <html>
@@ -71,6 +79,8 @@
 #data
 <!DOCTYPE potato taco>Hello
 #errors
+(1,17): expected-space-or-right-bracket-in-doctype
+(1,22): unknown-doctype
 #document
 | <!DOCTYPE potato>
 | <html>
@@ -81,6 +91,8 @@
 #data
 <!DOCTYPE potato taco "ddd>Hello
 #errors
+(1,17): expected-space-or-right-bracket-in-doctype
+(1,27): unknown-doctype
 #document
 | <!DOCTYPE potato>
 | <html>
@@ -91,6 +103,8 @@
 #data
 <!DOCTYPE potato sYstEM>Hello
 #errors
+(1,24): unexpected-char-in-doctype
+(1,24): unknown-doctype
 #document
 | <!DOCTYPE potato>
 | <html>
@@ -101,6 +115,8 @@
 #data
 <!DOCTYPE potato sYstEM    >Hello
 #errors
+(1,28): unexpected-char-in-doctype
+(1,28): unknown-doctype
 #document
 | <!DOCTYPE potato>
 | <html>
@@ -111,6 +127,8 @@
 #data
 <!DOCTYPE   potato       sYstEM  ggg>Hello
 #errors
+(1,34): unexpected-char-in-doctype
+(1,37): unknown-doctype
 #document
 | <!DOCTYPE potato>
 | <html>
@@ -121,6 +139,8 @@
 #data
 <!DOCTYPE potato SYSTEM taco  >Hello
 #errors
+(1,25): unexpected-char-in-doctype
+(1,31): unknown-doctype
 #document
 | <!DOCTYPE potato>
 | <html>
@@ -131,6 +151,7 @@
 #data
 <!DOCTYPE potato SYSTEM 'taco"'>Hello
 #errors
+(1,32): unknown-doctype
 #document
 | <!DOCTYPE potato "" "taco"">
 | <html>
@@ -141,6 +162,7 @@
 #data
 <!DOCTYPE potato SYSTEM "taco">Hello
 #errors
+(1,31): unknown-doctype
 #document
 | <!DOCTYPE potato "" "taco">
 | <html>
@@ -151,6 +173,7 @@
 #data
 <!DOCTYPE potato SYSTEM "tai'co">Hello
 #errors
+(1,33): unknown-doctype
 #document
 | <!DOCTYPE potato "" "tai'co">
 | <html>
@@ -161,6 +184,8 @@
 #data
 <!DOCTYPE potato SYSTEMtaco "ddd">Hello
 #errors
+(1,24): unexpected-char-in-doctype
+(1,34): unknown-doctype
 #document
 | <!DOCTYPE potato>
 | <html>
@@ -171,6 +196,8 @@
 #data
 <!DOCTYPE potato grass SYSTEM taco>Hello
 #errors
+(1,17): expected-space-or-right-bracket-in-doctype
+(1,35): unknown-doctype
 #document
 | <!DOCTYPE potato>
 | <html>
@@ -181,6 +208,8 @@
 #data
 <!DOCTYPE potato pUbLIc>Hello
 #errors
+(1,24): unexpected-end-of-doctype
+(1,24): unknown-doctype
 #document
 | <!DOCTYPE potato>
 | <html>
@@ -191,6 +220,8 @@
 #data
 <!DOCTYPE potato pUbLIc >Hello
 #errors
+(1,25): unexpected-end-of-doctype
+(1,25): unknown-doctype
 #document
 | <!DOCTYPE potato>
 | <html>
@@ -201,6 +232,8 @@
 #data
 <!DOCTYPE potato pUbLIcgoof>Hello
 #errors
+(1,24): unexpected-char-in-doctype
+(1,28): unknown-doctype
 #document
 | <!DOCTYPE potato>
 | <html>
@@ -211,6 +244,8 @@
 #data
 <!DOCTYPE potato PUBLIC goof>Hello
 #errors
+(1,25): unexpected-char-in-doctype
+(1,29): unknown-doctype
 #document
 | <!DOCTYPE potato>
 | <html>
@@ -221,6 +256,7 @@
 #data
 <!DOCTYPE potato PUBLIC "go'of">Hello
 #errors
+(1,32): unknown-doctype
 #document
 | <!DOCTYPE potato "go'of" "">
 | <html>
@@ -231,6 +267,8 @@
 #data
 <!DOCTYPE potato PUBLIC 'go'of'>Hello
 #errors
+(1,29): unexpected-char-in-doctype
+(1,32): unknown-doctype
 #document
 | <!DOCTYPE potato "go" "">
 | <html>
@@ -241,6 +279,7 @@
 #data
 <!DOCTYPE potato PUBLIC 'go:hh   of' >Hello
 #errors
+(1,38): unknown-doctype
 #document
 | <!DOCTYPE potato "go:hh   of" "">
 | <html>
@@ -251,6 +290,8 @@
 #data
 <!DOCTYPE potato PUBLIC "W3C-//dfdf" SYSTEM ggg>Hello
 #errors
+(1,38): unexpected-char-in-doctype
+(1,48): unknown-doctype
 #document
 | <!DOCTYPE potato "W3C-//dfdf" "">
 | <html>
@@ -272,6 +313,7 @@
 #data
 <!DOCTYPE ...>Hello
 #errors
+(1,14): unknown-doctype
 #document
 | <!DOCTYPE ...>
 | <html>
@@ -283,6 +325,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 #errors
+(2,58): unknown-doctype
 #document
 | <!DOCTYPE html "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 | <html>
@@ -293,6 +336,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
 #errors
+(2,54): unknown-doctype
 #document
 | <!DOCTYPE html "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
 | <html>
@@ -304,6 +348,8 @@
 <!-- internal declarations -->
 ]>
 #errors
+(1,23): expected-space-or-right-bracket-in-doctype
+(2,30): unknown-doctype
 #document
 | <!DOCTYPE root-element>
 | <html>
@@ -316,6 +362,7 @@
   "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
     "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
 #errors
+(3,53): unknown-doctype
 #document
 | <!DOCTYPE html "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
 | <html>
@@ -325,6 +372,7 @@
 #data
 <!DOCTYPE HTML SYSTEM "http://www.w3.org/DTD/HTML4-strict.dtd"><body><b>Mine!</b></body>
 #errors
+(1,63): unknown-doctype
 #document
 | <!DOCTYPE html "" "http://www.w3.org/DTD/HTML4-strict.dtd">
 | <html>
@@ -336,6 +384,7 @@
 #data
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
 #errors
+(1,50): unexpected-char-in-doctype
 #document
 | <!DOCTYPE html "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 | <html>
@@ -345,6 +394,7 @@
 #data
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"'http://www.w3.org/TR/html4/strict.dtd'>
 #errors
+(1,50): unexpected-char-in-doctype
 #document
 | <!DOCTYPE html "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 | <html>
@@ -354,6 +404,8 @@
 #data
 <!DOCTYPE HTML PUBLIC"-//W3C//DTD HTML 4.01//EN"'http://www.w3.org/TR/html4/strict.dtd'>
 #errors
+(1,21): unexpected-char-in-doctype
+(1,49): unexpected-char-in-doctype
 #document
 | <!DOCTYPE html "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 | <html>
@@ -363,6 +415,8 @@
 #data
 <!DOCTYPE HTML PUBLIC'-//W3C//DTD HTML 4.01//EN''http://www.w3.org/TR/html4/strict.dtd'>
 #errors
+(1,21): unexpected-char-in-doctype
+(1,49): unexpected-char-in-doctype
 #document
 | <!DOCTYPE html "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 | <html>
diff --git a/html/testdata/webkit/domjs-unsafe.dat b/html/testdata/webkit/domjs-unsafe.dat
new file mode 100644
index 0000000..34b4e62
--- /dev/null
+++ b/html/testdata/webkit/domjs-unsafe.dat
Binary files differ
diff --git a/html/testdata/webkit/entities01.dat b/html/testdata/webkit/entities01.dat
index c8073b7..b271f82 100644
--- a/html/testdata/webkit/entities01.dat
+++ b/html/testdata/webkit/entities01.dat
@@ -1,6 +1,7 @@
 #data
 FOO&gt;BAR
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -10,6 +11,8 @@
 #data
 FOO&gtBAR
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,6): named-entity-without-semicolon
 #document
 | <html>
 |   <head>
@@ -19,6 +22,8 @@
 #data
 FOO&gt BAR
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,6): named-entity-without-semicolon
 #document
 | <html>
 |   <head>
@@ -28,6 +33,7 @@
 #data
 FOO&gt;;;BAR
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -37,6 +43,8 @@
 #data
 I'm &notit; I tell you
 #errors
+(1,4): expected-doctype-but-got-chars
+(1,9): named-entity-without-semicolon
 #document
 | <html>
 |   <head>
@@ -46,6 +54,7 @@
 #data
 I'm &notin; I tell you
 #errors
+(1,4): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -55,6 +64,7 @@
 #data
 FOO& BAR
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -64,6 +74,8 @@
 #data
 FOO&<BAR>
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,9): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -74,6 +86,7 @@
 #data
 FOO&&&&gt;BAR
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -83,6 +96,7 @@
 #data
 FOO&#41;BAR
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -92,6 +106,7 @@
 #data
 FOO&#x41;BAR
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -101,6 +116,7 @@
 #data
 FOO&#X41;BAR
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -110,6 +126,8 @@
 #data
 FOO&#BAR
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,5): expected-numeric-entity
 #document
 | <html>
 |   <head>
@@ -119,6 +137,8 @@
 #data
 FOO&#ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,5): expected-numeric-entity
 #document
 | <html>
 |   <head>
@@ -128,6 +148,8 @@
 #data
 FOO&#xBAR
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,7): expected-numeric-entity
 #document
 | <html>
 |   <head>
@@ -137,6 +159,8 @@
 #data
 FOO&#xZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,6): expected-numeric-entity
 #document
 | <html>
 |   <head>
@@ -146,6 +170,8 @@
 #data
 FOO&#XZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,6): expected-numeric-entity
 #document
 | <html>
 |   <head>
@@ -155,6 +181,8 @@
 #data
 FOO&#41BAR
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,7): numeric-entity-without-semicolon
 #document
 | <html>
 |   <head>
@@ -164,6 +192,8 @@
 #data
 FOO&#x41BAR
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,10): numeric-entity-without-semicolon
 #document
 | <html>
 |   <head>
@@ -173,6 +203,8 @@
 #data
 FOO&#x41ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,8): numeric-entity-without-semicolon
 #document
 | <html>
 |   <head>
@@ -182,6 +214,8 @@
 #data
 FOO&#x0000;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -191,6 +225,7 @@
 #data
 FOO&#x0078;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -200,6 +235,7 @@
 #data
 FOO&#x0079;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -209,6 +245,8 @@
 #data
 FOO&#x0080;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -218,6 +256,8 @@
 #data
 FOO&#x0081;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -227,6 +267,8 @@
 #data
 FOO&#x0082;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -236,6 +278,8 @@
 #data
 FOO&#x0083;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -245,6 +289,8 @@
 #data
 FOO&#x0084;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -254,6 +300,8 @@
 #data
 FOO&#x0085;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -263,6 +311,8 @@
 #data
 FOO&#x0086;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -272,6 +322,8 @@
 #data
 FOO&#x0087;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -281,6 +333,8 @@
 #data
 FOO&#x0088;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -290,6 +344,8 @@
 #data
 FOO&#x0089;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -299,6 +355,8 @@
 #data
 FOO&#x008A;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -308,6 +366,8 @@
 #data
 FOO&#x008B;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -317,6 +377,8 @@
 #data
 FOO&#x008C;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -326,6 +388,8 @@
 #data
 FOO&#x008D;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -335,6 +399,8 @@
 #data
 FOO&#x008E;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -344,6 +410,8 @@
 #data
 FOO&#x008F;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -353,6 +421,8 @@
 #data
 FOO&#x0090;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -362,6 +432,8 @@
 #data
 FOO&#x0091;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -371,6 +443,8 @@
 #data
 FOO&#x0092;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -380,6 +454,8 @@
 #data
 FOO&#x0093;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -389,6 +465,8 @@
 #data
 FOO&#x0094;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -398,6 +476,8 @@
 #data
 FOO&#x0095;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -407,6 +487,8 @@
 #data
 FOO&#x0096;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -416,6 +498,8 @@
 #data
 FOO&#x0097;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -425,6 +509,8 @@
 #data
 FOO&#x0098;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -434,6 +520,8 @@
 #data
 FOO&#x0099;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -443,6 +531,8 @@
 #data
 FOO&#x009A;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -452,6 +542,8 @@
 #data
 FOO&#x009B;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -461,6 +553,8 @@
 #data
 FOO&#x009C;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -470,6 +564,8 @@
 #data
 FOO&#x009D;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -479,6 +575,8 @@
 #data
 FOO&#x009E;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -488,6 +586,8 @@
 #data
 FOO&#x009F;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -497,6 +597,7 @@
 #data
 FOO&#x00A0;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -506,6 +607,7 @@
 #data
 FOO&#xD7FF;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -515,6 +617,8 @@
 #data
 FOO&#xD800;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -524,6 +628,8 @@
 #data
 FOO&#xD801;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -533,6 +639,8 @@
 #data
 FOO&#xDFFE;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -542,6 +650,8 @@
 #data
 FOO&#xDFFF;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,11): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -551,6 +661,7 @@
 #data
 FOO&#xE000;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -560,6 +671,8 @@
 #data
 FOO&#x10FFFE;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,13): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -569,6 +682,7 @@
 #data
 FOO&#x1087D4;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -578,6 +692,8 @@
 #data
 FOO&#x10FFFF;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,13): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -587,6 +703,8 @@
 #data
 FOO&#x110000;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,13): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
@@ -596,6 +714,77 @@
 #data
 FOO&#xFFFFFF;ZOO
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,13): illegal-codepoint-for-numeric-entity
+#document
+| <html>
+|   <head>
+|   <body>
+|     "FOO�ZOO"
+
+#data
+FOO&#11111111111
+#errors
+(1,3): expected-doctype-but-got-chars
+(1,13): illegal-codepoint-for-numeric-entity
+(1,13): eof-in-numeric-entity
+#document
+| <html>
+|   <head>
+|   <body>
+|     "FOO�"
+
+#data
+FOO&#1111111111
+#errors
+(1,3): expected-doctype-but-got-chars
+(1,13): illegal-codepoint-for-numeric-entity
+(1,13): eof-in-numeric-entity
+#document
+| <html>
+|   <head>
+|   <body>
+|     "FOO�"
+
+#data
+FOO&#111111111111
+#errors
+(1,3): expected-doctype-but-got-chars
+(1,13): illegal-codepoint-for-numeric-entity
+(1,13): eof-in-numeric-entity
+#document
+| <html>
+|   <head>
+|   <body>
+|     "FOO�"
+
+#data
+FOO&#11111111111ZOO
+#errors
+(1,3): expected-doctype-but-got-chars
+(1,13): illegal-codepoint-for-numeric-entity
+#document
+| <html>
+|   <head>
+|   <body>
+|     "FOO�ZOO"
+
+#data
+FOO&#1111111111ZOO
+#errors
+(1,3): expected-doctype-but-got-chars
+(1,13): illegal-codepoint-for-numeric-entity
+#document
+| <html>
+|   <head>
+|   <body>
+|     "FOO�ZOO"
+
+#data
+FOO&#111111111111ZOO
+#errors
+(1,3): expected-doctype-but-got-chars
+(1,13): illegal-codepoint-for-numeric-entity
 #document
 | <html>
 |   <head>
diff --git a/html/testdata/webkit/entities02.dat b/html/testdata/webkit/entities02.dat
index e2fb42a..22365c9 100644
--- a/html/testdata/webkit/entities02.dat
+++ b/html/testdata/webkit/entities02.dat
@@ -1,6 +1,7 @@
 #data
 <div bar="ZZ&gt;YY"></div>
 #errors
+(1,20): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -11,6 +12,7 @@
 #data
 <div bar="ZZ&"></div>
 #errors
+(1,15): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -21,6 +23,7 @@
 #data
 <div bar='ZZ&'></div>
 #errors
+(1,15): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -31,6 +34,7 @@
 #data
 <div bar=ZZ&></div>
 #errors
+(1,13): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -41,6 +45,8 @@
 #data
 <div bar="ZZ&gt=YY"></div>
 #errors
+(1,15): named-entity-without-semicolon
+(1,20): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -51,6 +57,7 @@
 #data
 <div bar="ZZ&gt0YY"></div>
 #errors
+(1,20): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -61,6 +68,7 @@
 #data
 <div bar="ZZ&gt9YY"></div>
 #errors
+(1,20): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -71,6 +79,7 @@
 #data
 <div bar="ZZ&gtaYY"></div>
 #errors
+(1,20): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -81,6 +90,7 @@
 #data
 <div bar="ZZ&gtZYY"></div>
 #errors
+(1,20): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -91,6 +101,8 @@
 #data
 <div bar="ZZ&gt YY"></div>
 #errors
+(1,15): named-entity-without-semicolon
+(1,20): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -101,6 +113,8 @@
 #data
 <div bar="ZZ&gt"></div>
 #errors
+(1,15): named-entity-without-semicolon
+(1,17): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -111,6 +125,8 @@
 #data
 <div bar='ZZ&gt'></div>
 #errors
+(1,15): named-entity-without-semicolon
+(1,17): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -121,6 +137,8 @@
 #data
 <div bar=ZZ&gt></div>
 #errors
+(1,14): named-entity-without-semicolon
+(1,15): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -131,6 +149,8 @@
 #data
 <div bar="ZZ&pound_id=23"></div>
 #errors
+(1,18): named-entity-without-semicolon
+(1,26): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -141,6 +161,7 @@
 #data
 <div bar="ZZ&prod_id=23"></div>
 #errors
+(1,25): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -151,6 +172,7 @@
 #data
 <div bar="ZZ&pound;_id=23"></div>
 #errors
+(1,27): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -161,6 +183,7 @@
 #data
 <div bar="ZZ&prod;_id=23"></div>
 #errors
+(1,26): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -171,6 +194,8 @@
 #data
 <div bar="ZZ&pound=23"></div>
 #errors
+(1,18): named-entity-without-semicolon
+(1,23): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -181,6 +206,7 @@
 #data
 <div bar="ZZ&prod=23"></div>
 #errors
+(1,22): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -191,6 +217,8 @@
 #data
 <div>ZZ&pound_id=23</div>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,13): named-entity-without-semicolon
 #document
 | <html>
 |   <head>
@@ -201,6 +229,7 @@
 #data
 <div>ZZ&prod_id=23</div>
 #errors
+(1,5): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -211,6 +240,7 @@
 #data
 <div>ZZ&pound;_id=23</div>
 #errors
+(1,5): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -221,6 +251,7 @@
 #data
 <div>ZZ&prod;_id=23</div>
 #errors
+(1,5): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -231,6 +262,8 @@
 #data
 <div>ZZ&pound=23</div>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,13): named-entity-without-semicolon
 #document
 | <html>
 |   <head>
@@ -241,9 +274,20 @@
 #data
 <div>ZZ&prod=23</div>
 #errors
+(1,5): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
 |   <body>
 |     <div>
 |       "ZZ&prod=23"
+
+#data
+<div>ZZ&AElig=</div>
+#errors
+#document
+| <html>
+|   <head>
+|   <body>
+|     <div>
+|       "ZZÆ="
diff --git a/html/testdata/webkit/html5test-com.dat b/html/testdata/webkit/html5test-com.dat
index d7cb71d..8c6ec40 100644
--- a/html/testdata/webkit/html5test-com.dat
+++ b/html/testdata/webkit/html5test-com.dat
@@ -1,6 +1,8 @@
 #data
 <div<div>
 #errors
+(1,9): expected-doctype-but-got-start-tag
+(1,9): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -10,6 +12,9 @@
 #data
 <div foo<bar=''>
 #errors
+(1,9): invalid-character-in-attribute-name
+(1,16): expected-doctype-but-got-start-tag
+(1,16): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -20,6 +25,10 @@
 #data
 <div foo=`bar`>
 #errors
+(1,10): equals-in-unquoted-attribute-value
+(1,14): unexpected-character-in-unquoted-attribute-value
+(1,15): expected-doctype-but-got-start-tag
+(1,15): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -30,6 +39,9 @@
 #data
 <div \"foo=''>
 #errors
+(1,7): invalid-character-in-attribute-name
+(1,14): expected-doctype-but-got-start-tag
+(1,14): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -40,6 +52,7 @@
 #data
 <a href='\nbar'></a>
 #errors
+(1,16): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -59,6 +72,7 @@
 #data
 &lang;&rang;
 #errors
+(1,6): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -68,6 +82,7 @@
 #data
 &apos;
 #errors
+(1,6): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -77,6 +92,7 @@
 #data
 &ImaginaryI;
 #errors
+(1,12): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -86,6 +102,7 @@
 #data
 &Kopf;
 #errors
+(1,6): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -95,6 +112,7 @@
 #data
 &notinva;
 #errors
+(1,9): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -104,6 +122,8 @@
 #data
 <?import namespace="foo" implementation="#bar">
 #errors
+(1,1): expected-tag-name-but-got-question-mark
+(1,47): expected-doctype-but-got-eof
 #document
 | <!-- ?import namespace="foo" implementation="#bar" -->
 | <html>
@@ -113,6 +133,8 @@
 #data
 <!--foo--bar-->
 #errors
+(1,10): unexpected-char-in-comment
+(1,15): expected-doctype-but-got-eof
 #document
 | <!-- foo--bar -->
 | <html>
@@ -122,6 +144,8 @@
 #data
 <![CDATA[x]]>
 #errors
+(1,2): expected-dashes-or-doctype
+(1,13): expected-doctype-but-got-eof
 #document
 | <!-- [CDATA[x]] -->
 | <html>
@@ -131,6 +155,8 @@
 #data
 <textarea><!--</textarea>--></textarea>
 #errors
+(1,10): expected-doctype-but-got-start-tag
+(1,39): unexpected-end-tag
 #document
 | <html>
 |   <head>
@@ -142,6 +168,7 @@
 #data
 <textarea><!--</textarea>-->
 #errors
+(1,10): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -153,6 +180,8 @@
 #data
 <style><!--</style>--></style>
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,30): unexpected-end-tag
 #document
 | <html>
 |   <head>
@@ -164,6 +193,7 @@
 #data
 <style><!--</style>-->
 #errors
+(1,7): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -175,6 +205,7 @@
 #data
 <ul><li>A </li> <li>B</li></ul>
 #errors
+(1,4): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -189,6 +220,14 @@
 #data
 <table><form><input type=hidden><input></form><div></div></table>
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,13): unexpected-form-in-table
+(1,32): unexpected-hidden-input-in-table
+(1,39): unexpected-start-tag-implies-table-voodoo
+(1,46): unexpected-end-tag-implies-table-voodoo
+(1,46): unexpected-end-tag
+(1,51): unexpected-start-tag-implies-table-voodoo
+(1,57): unexpected-end-tag-implies-table-voodoo
 #document
 | <html>
 |   <head>
@@ -203,6 +242,9 @@
 #data
 <i>A<b>B<p></i>C</b>D
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,15): adoption-agency-1.3
+(1,20): adoption-agency-1.3
 #document
 | <html>
 |   <head>
@@ -221,6 +263,7 @@
 #data
 <div></div>
 #errors
+(1,5): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -230,6 +273,7 @@
 #data
 <svg></svg>
 #errors
+(1,5): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -239,6 +283,7 @@
 #data
 <math></math>
 #errors
+(1,6): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
diff --git a/html/testdata/webkit/inbody01.dat b/html/testdata/webkit/inbody01.dat
index 3f2bd37..10f6520 100644
--- a/html/testdata/webkit/inbody01.dat
+++ b/html/testdata/webkit/inbody01.dat
@@ -1,6 +1,9 @@
 #data
 <button>1</foo>
 #errors
+(1,8): expected-doctype-but-got-start-tag
+(1,15): unexpected-end-tag
+(1,15): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -11,6 +14,9 @@
 #data
 <foo>1<p>2</foo>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,16): unexpected-end-tag
+(1,16): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -23,6 +29,8 @@
 #data
 <dd>1</foo>
 #errors
+(1,4): expected-doctype-but-got-start-tag
+(1,11): unexpected-end-tag
 #document
 | <html>
 |   <head>
@@ -33,6 +41,9 @@
 #data
 <foo>1<dd>2</foo>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,17): unexpected-end-tag
+(1,17): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
diff --git a/html/testdata/webkit/math.dat b/html/testdata/webkit/math.dat
new file mode 100644
index 0000000..ae9cd7c
--- /dev/null
+++ b/html/testdata/webkit/math.dat
@@ -0,0 +1,81 @@
+#data
+<math><tr><td><mo><tr>
+#errors
+#document-fragment
+td
+#document
+| <math math>
+|   <math tr>
+|     <math td>
+|       <math mo>
+
+#data
+<math><tr><td><mo><tr>
+#errors
+#document-fragment
+tr
+#document
+| <math math>
+|   <math tr>
+|     <math td>
+|       <math mo>
+
+#data
+<math><thead><mo><tbody>
+#errors
+#document-fragment
+thead
+#document
+| <math math>
+|   <math thead>
+|     <math mo>
+
+#data
+<math><tfoot><mo><tbody>
+#errors
+#document-fragment
+tfoot
+#document
+| <math math>
+|   <math tfoot>
+|     <math mo>
+
+#data
+<math><tbody><mo><tfoot>
+#errors
+#document-fragment
+tbody
+#document
+| <math math>
+|   <math tbody>
+|     <math mo>
+
+#data
+<math><tbody><mo></table>
+#errors
+#document-fragment
+tbody
+#document
+| <math math>
+|   <math tbody>
+|     <math mo>
+
+#data
+<math><thead><mo></table>
+#errors
+#document-fragment
+tbody
+#document
+| <math math>
+|   <math thead>
+|     <math mo>
+
+#data
+<math><tfoot><mo></table>
+#errors
+#document-fragment
+tbody
+#document
+| <math math>
+|   <math tfoot>
+|     <math mo>
diff --git a/html/testdata/webkit/namespace-sensitivity.dat b/html/testdata/webkit/namespace-sensitivity.dat
new file mode 100644
index 0000000..ca35c0e
--- /dev/null
+++ b/html/testdata/webkit/namespace-sensitivity.dat
@@ -0,0 +1,16 @@
+#data
+<body><table><tr><td><svg><td><foreignObject><span></td>Foo
+#errors
+#document
+| <html>
+|   <head>
+|   <body>
+|     "Foo"
+|     <table>
+|       <tbody>
+|         <tr>
+|           <td>
+|             <svg svg>
+|               <svg td>
+|                 <svg foreignObject>
+|                   <span>
diff --git a/html/testdata/webkit/pending-spec-changes-plain-text-unsafe.dat b/html/testdata/webkit/pending-spec-changes-plain-text-unsafe.dat
index a5ebb1e..3ee8cec 100644
--- a/html/testdata/webkit/pending-spec-changes-plain-text-unsafe.dat
+++ b/html/testdata/webkit/pending-spec-changes-plain-text-unsafe.dat
Binary files differ
diff --git a/html/testdata/webkit/pending-spec-changes.dat b/html/testdata/webkit/pending-spec-changes.dat
index 5a92084..1647d7f 100644
--- a/html/testdata/webkit/pending-spec-changes.dat
+++ b/html/testdata/webkit/pending-spec-changes.dat
@@ -1,9 +1,9 @@
 #data
 <input type="hidden"><frameset>
 #errors
-21: Start tag seen without seeing a doctype first. Expected “<!DOCTYPE html>”.
-31: “frameset” start tag seen.
-31: End of file seen and there were open elements.
+(1,21): expected-doctype-but-got-start-tag
+(1,31): unexpected-start-tag
+(1,31): eof-in-frameset
 #document
 | <html>
 |   <head>
@@ -12,10 +12,8 @@
 #data
 <!DOCTYPE html><table><caption><svg>foo</table>bar
 #errors
-47: End tag “table” did not match the name of the current open element (“svg”).
-47: “table” closed but “caption” was still open.
-47: End tag “table” seen, but there were open elements.
-36: Unclosed element “svg”.
+(1,47): unexpected-end-tag
+(1,47): end-table-tag-in-caption
 #document
 | <!DOCTYPE html>
 | <html>
@@ -30,14 +28,10 @@
 #data
 <table><tr><td><svg><desc><td></desc><circle>
 #errors
-7: Start tag seen without seeing a doctype first. Expected “<!DOCTYPE html>”.
-30: A table cell was implicitly closed, but there were open elements.
-26: Unclosed element “desc”.
-20: Unclosed element “svg”.
-37: Stray end tag “desc”.
-45: End of file seen and there were open elements.
-45: Unclosed element “circle”.
-7: Unclosed element “table”.
+(1,7): expected-doctype-but-got-start-tag
+(1,30): unexpected-cell-end-tag
+(1,37): unexpected-end-tag
+(1,45): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
diff --git a/html/testdata/webkit/plain-text-unsafe.dat b/html/testdata/webkit/plain-text-unsafe.dat
index 04cc11f..f40dd57 100644
--- a/html/testdata/webkit/plain-text-unsafe.dat
+++ b/html/testdata/webkit/plain-text-unsafe.dat
Binary files differ
diff --git a/html/testdata/webkit/scriptdata01.dat b/html/testdata/webkit/scriptdata01.dat
index 76b67f4..ac698d2 100644
--- a/html/testdata/webkit/scriptdata01.dat
+++ b/html/testdata/webkit/scriptdata01.dat
@@ -1,6 +1,7 @@
 #data
 FOO<script>'Hello'</script>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -13,6 +14,7 @@
 #data
 FOO<script></script>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -24,6 +26,7 @@
 #data
 FOO<script></script >BAR
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -35,6 +38,8 @@
 #data
 FOO<script></script/>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,21): self-closing-flag-on-end-tag
 #document
 | <html>
 |   <head>
@@ -46,6 +51,8 @@
 #data
 FOO<script></script/ >BAR
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,20): unexpected-character-after-solidus-in-tag
 #document
 | <html>
 |   <head>
@@ -57,6 +64,8 @@
 #data
 FOO<script type="text/plain"></scriptx>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,42): expected-named-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -69,6 +78,8 @@
 #data
 FOO<script></script foo=">" dd>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,31): attributes-in-end-tag
 #document
 | <html>
 |   <head>
@@ -80,6 +91,7 @@
 #data
 FOO<script>'<'</script>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -92,6 +104,7 @@
 #data
 FOO<script>'<!'</script>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -104,6 +117,7 @@
 #data
 FOO<script>'<!-'</script>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -116,6 +130,7 @@
 #data
 FOO<script>'<!--'</script>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -128,6 +143,7 @@
 #data
 FOO<script>'<!---'</script>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -140,6 +156,7 @@
 #data
 FOO<script>'<!-->'</script>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -152,6 +169,7 @@
 #data
 FOO<script>'<!-->'</script>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -164,6 +182,7 @@
 #data
 FOO<script>'<!-- potato'</script>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -176,6 +195,7 @@
 #data
 FOO<script>'<!-- <sCrIpt'</script>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -188,6 +208,9 @@
 #data
 FOO<script type="text/plain">'<!-- <sCrIpt>'</script>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,56): expected-script-data-but-got-eof
+(1,56): expected-named-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -200,6 +223,9 @@
 #data
 FOO<script type="text/plain">'<!-- <sCrIpt> -'</script>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,58): expected-script-data-but-got-eof
+(1,58): expected-named-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -212,6 +238,9 @@
 #data
 FOO<script type="text/plain">'<!-- <sCrIpt> --'</script>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,59): expected-script-data-but-got-eof
+(1,59): expected-named-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -224,6 +253,7 @@
 #data
 FOO<script>'<!-- <sCrIpt> -->'</script>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -236,6 +266,9 @@
 #data
 FOO<script type="text/plain">'<!-- <sCrIpt> --!>'</script>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,61): expected-script-data-but-got-eof
+(1,61): expected-named-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -248,6 +281,9 @@
 #data
 FOO<script type="text/plain">'<!-- <sCrIpt> -- >'</script>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,61): expected-script-data-but-got-eof
+(1,61): expected-named-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -260,6 +296,9 @@
 #data
 FOO<script type="text/plain">'<!-- <sCrIpt '</script>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,56): expected-script-data-but-got-eof
+(1,56): expected-named-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -272,6 +311,9 @@
 #data
 FOO<script type="text/plain">'<!-- <sCrIpt/'</script>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
+(1,56): expected-script-data-but-got-eof
+(1,56): expected-named-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -284,6 +326,7 @@
 #data
 FOO<script type="text/plain">'<!-- <sCrIpt\'</script>BAR
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -297,6 +340,7 @@
 #data
 FOO<script type="text/plain">'<!-- <sCrIpt/'</script>BAR</script>QUX
 #errors
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -306,3 +350,16 @@
 |       type="text/plain"
 |       "'<!-- <sCrIpt/'</script>BAR"
 |     "QUX"
+
+#data
+FOO<script><!--<script>-></script>--></script>QUX
+#errors
+(1,3): expected-doctype-but-got-chars
+#document
+| <html>
+|   <head>
+|   <body>
+|     "FOO"
+|     <script>
+|       "<!--<script>-></script>-->"
+|     "QUX"
diff --git a/html/testdata/webkit/scripted/ark.dat b/html/testdata/webkit/scripted/ark.dat
new file mode 100644
index 0000000..acbac41
--- /dev/null
+++ b/html/testdata/webkit/scripted/ark.dat
@@ -0,0 +1,26 @@
+#data
+<p><font size=4><font size=4><font size=4><script>document.getElementsByTagName("font")[2].setAttribute("size", "5");</script><font size=4><p>X
+#errors
+#document
+| <html>
+|   <head>
+|   <body>
+|     <p>
+|       <font>
+|         size="4"
+|         <font>
+|           size="4"
+|           <font>
+|             size="5"
+|             <script>
+|               "document.getElementsByTagName("font")[2].setAttribute("size", "5");"
+|             <font>
+|               size="4"
+|     <p>
+|       <font>
+|         size="4"
+|         <font>
+|           size="4"
+|           <font>
+|             size="4"
+|             "X"
diff --git a/html/testdata/webkit/tables01.dat b/html/testdata/webkit/tables01.dat
index c4b47e4..f0caaa3 100644
--- a/html/testdata/webkit/tables01.dat
+++ b/html/testdata/webkit/tables01.dat
@@ -1,6 +1,9 @@
 #data
 <table><th>
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,11): unexpected-cell-in-table-body
+(1,11): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -13,6 +16,9 @@
 #data
 <table><td>
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,11): unexpected-cell-in-table-body
+(1,11): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -25,6 +31,8 @@
 #data
 <table><col foo='bar'>
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,22): eof-in-table
 #document
 | <html>
 |   <head>
@@ -37,6 +45,12 @@
 #data
 <table><colgroup></html>foo
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,24): unexpected-end-tag
+(1,27): foster-parenting-character-in-table
+(1,27): foster-parenting-character-in-table
+(1,27): foster-parenting-character-in-table
+(1,27): eof-in-table
 #document
 | <html>
 |   <head>
@@ -48,6 +62,7 @@
 #data
 <table></table><p>foo
 #errors
+(1,7): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -59,6 +74,20 @@
 #data
 <table></body></caption></col></colgroup></html></tbody></td></tfoot></th></thead></tr><td>
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,14): unexpected-end-tag
+(1,24): unexpected-end-tag
+(1,30): unexpected-end-tag
+(1,41): unexpected-end-tag
+(1,48): unexpected-end-tag
+(1,56): unexpected-end-tag
+(1,61): unexpected-end-tag
+(1,69): unexpected-end-tag
+(1,74): unexpected-end-tag
+(1,82): unexpected-end-tag
+(1,87): unexpected-end-tag
+(1,91): unexpected-cell-in-table-body
+(1,91): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -71,6 +100,8 @@
 #data
 <table><select><option>3</select></table>
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,15): unexpected-start-tag-implies-table-voodoo
 #document
 | <html>
 |   <head>
@@ -83,6 +114,12 @@
 #data
 <table><select><table></table></select></table>
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,15): unexpected-start-tag-implies-table-voodoo
+(1,22): unexpected-table-element-start-tag-in-select-in-table
+(1,22): unexpected-start-tag-implies-end-tag
+(1,39): unexpected-end-tag
+(1,47): unexpected-end-tag
 #document
 | <html>
 |   <head>
@@ -94,6 +131,9 @@
 #data
 <table><select></table>
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,15): unexpected-start-tag-implies-table-voodoo
+(1,23): unexpected-table-element-end-tag-in-select-in-table
 #document
 | <html>
 |   <head>
@@ -104,6 +144,9 @@
 #data
 <table><select><option>A<tr><td>B</td></tr></table>
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,15): unexpected-start-tag-implies-table-voodoo
+(1,28): unexpected-table-element-start-tag-in-select-in-table
 #document
 | <html>
 |   <head>
@@ -120,6 +163,14 @@
 #data
 <table><td></body></caption></col></colgroup></html>foo
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,11): unexpected-cell-in-table-body
+(1,18): unexpected-end-tag
+(1,28): unexpected-end-tag
+(1,34): unexpected-end-tag
+(1,45): unexpected-end-tag
+(1,52): unexpected-end-tag
+(1,55): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -133,6 +184,8 @@
 #data
 <table><td>A</table>B
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,11): unexpected-cell-in-table-body
 #document
 | <html>
 |   <head>
@@ -147,6 +200,8 @@
 #data
 <table><tr><caption>
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,20): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -159,6 +214,15 @@
 #data
 <table><tr></body></caption></col></colgroup></html></td></th><td>foo
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,18): unexpected-end-tag-in-table-row
+(1,28): unexpected-end-tag-in-table-row
+(1,34): unexpected-end-tag-in-table-row
+(1,45): unexpected-end-tag-in-table-row
+(1,52): unexpected-end-tag-in-table-row
+(1,57): unexpected-end-tag-in-table-row
+(1,62): unexpected-end-tag-in-table-row
+(1,69): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -172,6 +236,9 @@
 #data
 <table><td><tr>
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,11): unexpected-cell-in-table-body
+(1,15): eof-in-table
 #document
 | <html>
 |   <head>
@@ -185,6 +252,10 @@
 #data
 <table><td><button><td>
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,11): unexpected-cell-in-table-body
+(1,23): unexpected-cell-end-tag
+(1,23): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -199,6 +270,9 @@
 #data
 <table><tr><td><svg><desc><td>
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,30): unexpected-cell-end-tag
+(1,30): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
diff --git a/html/testdata/webkit/template.dat b/html/testdata/webkit/template.dat
index ff822b0..b38d4f5 100644
--- a/html/testdata/webkit/template.dat
+++ b/html/testdata/webkit/template.dat
@@ -1,6 +1,7 @@
 #data
 <body><template>Hello</template>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -12,6 +13,7 @@
 #data
 <template>Hello</template>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -23,6 +25,7 @@
 #data
 <template></template><div></div>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -34,6 +37,7 @@
 #data
 <html><template>Hello</template>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -45,6 +49,7 @@
 #data
 <head><template><div></div></template></head>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -56,6 +61,9 @@
 #data
 <div><template><div><span></template><b>
 #errors
+ * (1,6) missing DOCTYPE
+ * (1,38) mismatched template end tag
+ * (1,41) unexpected end of file
 #document
 | <html>
 |   <head>
@@ -70,6 +78,10 @@
 #data
 <div><template></div>Hello
 #errors
+ * (1,6) missing DOCTYPE
+ * (1,22) unexpected token in template
+ * (1,27) unexpected end of file in template
+ * (1,27) unexpected end of file
 #document
 | <html>
 |   <head>
@@ -82,6 +94,8 @@
 #data
 <div></template></div>
 #errors
+ * (1,6) missing DOCTYPE
+ * (1,17) unexpected template end tag
 #document
 | <html>
 |   <head>
@@ -91,6 +105,7 @@
 #data
 <table><template></template></table>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -102,6 +117,10 @@
 #data
 <table><template></template></div>
 #errors
+ * (1,8) missing DOCTYPE
+ * (1,35) unexpected token in table - foster parenting
+ * (1,35) unexpected end tag
+ * (1,35) unexpected end of file
 #document
 | <html>
 |   <head>
@@ -113,6 +132,10 @@
 #data
 <table><div><template></template></div>
 #errors
+ * (1,8) missing DOCTYPE
+ * (1,13) unexpected token in table - foster parenting
+ * (1,40) unexpected token in table - foster parenting
+ * (1,40) unexpected end of file
 #document
 | <html>
 |   <head>
@@ -125,6 +148,10 @@
 #data
 <table><template></template><div></div>
 #errors
+no doctype
+bad div in table
+bad /div in table
+eof in table
 #document
 | <html>
 |   <head>
@@ -137,6 +164,7 @@
 #data
 <table>   <template></template></table>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -149,6 +177,8 @@
 #data
 <table><tbody><template></template></tbody>
 #errors
+no doctype
+eof in table
 #document
 | <html>
 |   <head>
@@ -161,6 +191,9 @@
 #data
 <table><tbody><template></tbody></template>
 #errors
+no doctype
+bad /tbody
+eof in table
 #document
 | <html>
 |   <head>
@@ -173,6 +206,7 @@
 #data
 <table><tbody><template></template></tbody></table>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -185,6 +219,8 @@
 #data
 <table><thead><template></template></thead>
 #errors
+no doctype
+eof in table
 #document
 | <html>
 |   <head>
@@ -197,6 +233,8 @@
 #data
 <table><tfoot><template></template></tfoot>
 #errors
+no doctype
+eof in table
 #document
 | <html>
 |   <head>
@@ -209,6 +247,7 @@
 #data
 <select><template></template></select>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -220,6 +259,7 @@
 #data
 <select><template><option></option></template></select>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -232,6 +272,8 @@
 #data
 <template><option></option></select><option></option></template>
 #errors
+no doctype
+bad /select
 #document
 | <html>
 |   <head>
@@ -244,6 +286,7 @@
 #data
 <select><template></template><option></select>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -256,6 +299,7 @@
 #data
 <select><option><template></template></select>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -268,6 +312,9 @@
 #data
 <select><template>
 #errors
+no doctype
+eof in template
+eof in select
 #document
 | <html>
 |   <head>
@@ -279,6 +326,9 @@
 #data
 <select><option></option><template>
 #errors
+no doctype
+eof in template
+eof in select
 #document
 | <html>
 |   <head>
@@ -291,6 +341,9 @@
 #data
 <select><option></option><template><option>
 #errors
+no doctype
+eof in template
+eof in select
 #document
 | <html>
 |   <head>
@@ -304,6 +357,7 @@
 #data
 <table><thead><template><td></template></table>
 #errors
+ * (1,8) missing DOCTYPE
 #document
 | <html>
 |   <head>
@@ -317,6 +371,7 @@
 #data
 <table><template><thead></template></table>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -329,6 +384,9 @@
 #data
 <body><table><template><td></tr><div></template></table>
 #errors
+no doctype
+bad </tr>
+missing </div>
 #document
 | <html>
 |   <head>
@@ -342,6 +400,8 @@
 #data
 <table><template><thead></template></thead></table>
 #errors
+no doctype
+bad /thead after /template
 #document
 | <html>
 |   <head>
@@ -354,6 +414,7 @@
 #data
 <table><thead><template><tr></template></table>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -367,6 +428,7 @@
 #data
 <table><template><tr></template></table>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -379,6 +441,9 @@
 #data
 <table><tr><template><td>
 #errors
+no doctype
+eof in template
+eof in table
 #document
 | <html>
 |   <head>
@@ -393,6 +458,7 @@
 #data
 <table><template><tr><template><td></template></tr></template></table>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -408,6 +474,7 @@
 #data
 <table><template><tr><template><td></td></template></tr></template></table>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -423,6 +490,8 @@
 #data
 <table><template><td></template>
 #errors
+no doctype
+eof in table
 #document
 | <html>
 |   <head>
@@ -435,6 +504,7 @@
 #data
 <body><template><td></td></template>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -446,6 +516,7 @@
 #data
 <body><template><template><tr></tr></template><td></td></template>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -460,6 +531,9 @@
 #data
 <table><colgroup><template><col>
 #errors
+no doctype
+eof in template
+eof in table
 #document
 | <html>
 |   <head>
@@ -473,6 +547,10 @@
 #data
 <frameset><template><frame></frame></template></frameset>
 #errors
+ * (1,11) missing DOCTYPE
+ * (1,21) unexpected start tag token
+ * (1,36) unexpected end tag token
+ * (1,47) unexpected end tag token
 #document
 | <html>
 |   <head>
@@ -482,6 +560,12 @@
 #data
 <template><frame></frame></frameset><frame></frame></template>
 #errors
+ * (1,11) missing DOCTYPE
+ * (1,18) unexpected start tag
+ * (1,26) unexpected end tag
+ * (1,37) unexpected end tag
+ * (1,44) unexpected start tag
+ * (1,52) unexpected end tag
 #document
 | <html>
 |   <head>
@@ -492,6 +576,8 @@
 #data
 <template><div><frameset><span></span></div><span></span></template>
 #errors
+no doctype
+bad frameset
 #document
 | <html>
 |   <head>
@@ -505,6 +591,8 @@
 #data
 <body><template><div><frameset><span></span></div><span></span></template></body>
 #errors
+no doctype
+bad frameset
 #document
 | <html>
 |   <head>
@@ -518,6 +606,7 @@
 #data
 <body><template><script>var i = 1;</script><td></td></template>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -531,6 +620,9 @@
 #data
 <body><template><tr><div></div></tr></template>
 #errors
+no doctype
+foster-parented div
+foster-parented /div
 #document
 | <html>
 |   <head>
@@ -543,6 +635,8 @@
 #data
 <body><template><tr></tr><td></td></template>
 #errors
+no doctype
+unexpected <td>
 #document
 | <html>
 |   <head>
@@ -556,6 +650,8 @@
 #data
 <body><template><td></td></tr><td></td></template>
 #errors
+no doctype
+bad </tr>
 #document
 | <html>
 |   <head>
@@ -568,6 +664,8 @@
 #data
 <body><template><td></td><tbody><td></td></template>
 #errors
+no doctype
+bad <tbody>
 #document
 | <html>
 |   <head>
@@ -580,6 +678,9 @@
 #data
 <body><template><td></td><caption></caption><td></td></template>
 #errors
+ * (1,7) missing DOCTYPE
+ * (1,35) unexpected start tag in table row
+ * (1,45) unexpected end tag in table row
 #document
 | <html>
 |   <head>
@@ -592,6 +693,9 @@
 #data
 <body><template><td></td><colgroup></caption><td></td></template>
 #errors
+ * (1,7) missing DOCTYPE
+ * (1,36) unexpected start tag in table row
+ * (1,46) unexpected end tag in table row
 #document
 | <html>
 |   <head>
@@ -604,6 +708,8 @@
 #data
 <body><template><td></td></table><td></td></template>
 #errors
+no doctype
+bad </table>
 #document
 | <html>
 |   <head>
@@ -616,6 +722,8 @@
 #data
 <body><template><tr></tr><tbody><tr></tr></template>
 #errors
+no doctype
+bad <tbody>
 #document
 | <html>
 |   <head>
@@ -628,6 +736,8 @@
 #data
 <body><template><tr></tr><caption><tr></tr></template>
 #errors
+no doctype
+bad <caption>
 #document
 | <html>
 |   <head>
@@ -640,6 +750,8 @@
 #data
 <body><template><tr></tr></table><tr></tr></template>
 #errors
+no doctype
+bad </table>
 #document
 | <html>
 |   <head>
@@ -652,6 +764,7 @@
 #data
 <body><template><thead></thead><caption></caption><tbody></tbody></template>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -665,6 +778,8 @@
 #data
 <body><template><thead></thead></table><tbody></tbody></template></body>
 #errors
+no doctype
+bad </table>
 #document
 | <html>
 |   <head>
@@ -677,6 +792,9 @@
 #data
 <body><template><div><tr></tr></div></template>
 #errors
+no doctype
+bad tr
+bad /tr
 #document
 | <html>
 |   <head>
@@ -688,6 +806,7 @@
 #data
 <body><template><em>Hello</em></template>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -700,6 +819,7 @@
 #data
 <body><template><!--comment--></template>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -711,6 +831,7 @@
 #data
 <body><template><style></style><td></td></template>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -723,6 +844,7 @@
 #data
 <body><template><meta><td></td></template>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -735,6 +857,7 @@
 #data
 <body><template><link><td></td></template>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -747,6 +870,7 @@
 #data
 <body><template><template><tr></tr></template><td></td></template>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -761,6 +885,8 @@
 #data
 <body><table><colgroup><template><col></col></template></colgroup></table></body>
 #errors
+no doctype
+bad /col
 #document
 | <html>
 |   <head>
@@ -774,6 +900,9 @@
 #data
 <body a=b><template><div></div><body c=d><div></div></body></template></body>
 #errors
+no doctype
+bad <body>
+bad </body>
 #document
 | <html>
 |   <head>
@@ -787,6 +916,9 @@
 #data
 <html a=b><template><div><html b=c><span></template>
 #errors
+no doctype
+bad <html>
+missing end tags in template
 #document
 | <html>
 |   a="b"
@@ -800,6 +932,10 @@
 #data
 <html a=b><template><col></col><html b=c><col></col></template>
 #errors
+no doctype
+bad /col
+bad html
+bad /col
 #document
 | <html>
 |   a="b"
@@ -813,6 +949,12 @@
 #data
 <html a=b><template><frame></frame><html b=c><frame></frame></template>
 #errors
+no doctype
+bad frame
+bad /frame
+bad html
+bad frame
+bad /frame
 #document
 | <html>
 |   a="b"
@@ -824,6 +966,8 @@
 #data
 <body><template><tr></tr><template></template><td></td></template>
 #errors
+no doctype
+unexpected <td>
 #document
 | <html>
 |   <head>
@@ -839,6 +983,7 @@
 #data
 <body><template><thead></thead><template><tr></tr></template><tr></tr><tfoot></tfoot></template>
 #errors
+no doctype
 #document
 | <html>
 |   <head>
@@ -856,6 +1001,8 @@
 #data
 <body><template><template><b><template></template></template>text</template>
 #errors
+no doctype
+missing </b>
 #document
 | <html>
 |   <head>
@@ -872,6 +1019,9 @@
 #data
 <body><template><col><colgroup>
 #errors
+no doctype
+bad colgroup
+eof in template
 #document
 | <html>
 |   <head>
@@ -883,6 +1033,9 @@
 #data
 <body><template><col></colgroup>
 #errors
+no doctype
+bogus /colgroup
+eof in template
 #document
 | <html>
 |   <head>
@@ -894,6 +1047,8 @@
 #data
 <body><template><col><colgroup></template></body>
 #errors
+no doctype
+bad colgroup
 #document
 | <html>
 |   <head>
@@ -905,6 +1060,9 @@
 #data
 <body><template><col><div>
 #errors
+ * (1,7) missing DOCTYPE
+ * (1,27) unexpected token
+ * (1,27) unexpected end of file in template
 #document
 | <html>
 |   <head>
@@ -916,6 +1074,9 @@
 #data
 <body><template><col></div>
 #errors
+no doctype
+bad /div
+eof in template
 #document
 | <html>
 |   <head>
@@ -927,6 +1088,9 @@
 #data
 <body><template><col>Hello
 #errors
+no doctype
+unexpected text
+eof in template
 #document
 | <html>
 |   <head>
@@ -938,6 +1102,9 @@
 #data
 <body><template><i><menu>Foo</i>
 #errors
+no doctype
+mising /menu
+eof in template
 #document
 | <html>
 |   <head>
@@ -952,6 +1119,11 @@
 #data
 <body><template></div><div>Foo</div><template></template><tr></tr>
 #errors
+no doctype
+bogus /div
+bogus tr
+bogus /tr
+eof in template
 #document
 | <html>
 |   <head>
@@ -966,6 +1138,9 @@
 #data
 <body><div><template></div><tr><td>Foo</td></tr></template>
 #errors
+ * (1,7) missing DOCTYPE
+ * (1,28) unexpected token in template
+ * (1,60) unexpected end of file
 #document
 | <html>
 |   <head>
@@ -980,6 +1155,9 @@
 #data
 <template></figcaption><sub><table></table>
 #errors
+no doctype
+bad /figcaption
+eof in template
 #document
 | <html>
 |   <head>
@@ -992,6 +1170,9 @@
 #data
 <template><template>
 #errors
+no doctype
+eof in template
+eof in template
 #document
 | <html>
 |   <head>
@@ -1004,6 +1185,8 @@
 #data
 <template><div>
 #errors
+no doctype
+eof in template
 #document
 | <html>
 |   <head>
@@ -1015,6 +1198,9 @@
 #data
 <template><template><div>
 #errors
+no doctype
+eof in template
+eof in template
 #document
 | <html>
 |   <head>
@@ -1028,6 +1214,9 @@
 #data
 <template><template><table>
 #errors
+no doctype
+eof in template
+eof in template
 #document
 | <html>
 |   <head>
@@ -1041,6 +1230,9 @@
 #data
 <template><template><tbody>
 #errors
+no doctype
+eof in template
+eof in template
 #document
 | <html>
 |   <head>
@@ -1054,6 +1246,9 @@
 #data
 <template><template><tr>
 #errors
+no doctype
+eof in template
+eof in template
 #document
 | <html>
 |   <head>
@@ -1067,6 +1262,9 @@
 #data
 <template><template><td>
 #errors
+no doctype
+eof in template
+eof in template
 #document
 | <html>
 |   <head>
@@ -1080,6 +1278,9 @@
 #data
 <template><template><caption>
 #errors
+no doctype
+eof in template
+eof in template
 #document
 | <html>
 |   <head>
@@ -1093,6 +1294,9 @@
 #data
 <template><template><colgroup>
 #errors
+no doctype
+eof in template
+eof in template
 #document
 | <html>
 |   <head>
@@ -1106,6 +1310,9 @@
 #data
 <template><template><col>
 #errors
+no doctype
+eof in template
+eof in template
 #document
 | <html>
 |   <head>
@@ -1119,6 +1326,10 @@
 #data
 <template><template><tbody><select>
 #errors
+ * (1,11) missing DOCTYPE
+ * (1,36) unexpected token in table - foster parenting
+ * (1,36) unexpected end of file in template
+ * (1,36) unexpected end of file in template
 #document
 | <html>
 |   <head>
@@ -1133,6 +1344,12 @@
 #data
 <template><template><table>Foo
 #errors
+no doctype
+foster-parenting text F
+foster-parenting text o
+foster-parenting text o
+eof
+eof
 #document
 | <html>
 |   <head>
@@ -1147,6 +1364,10 @@
 #data
 <template><template><frame>
 #errors
+no doctype
+bad tag
+eof
+eof
 #document
 | <html>
 |   <head>
@@ -1159,6 +1380,10 @@
 #data
 <template><template><script>var i
 #errors
+no doctype
+eof in script
+eof in template
+eof in template
 #document
 | <html>
 |   <head>
@@ -1173,6 +1398,10 @@
 #data
 <template><template><style>var i
 #errors
+no doctype
+eof in style
+eof in template
+eof in template
 #document
 | <html>
 |   <head>
@@ -1187,6 +1416,9 @@
 #data
 <template><table></template><body><span>Foo
 #errors
+no doctype
+missing /table
+bad eof
 #document
 | <html>
 |   <head>
@@ -1200,6 +1432,8 @@
 #data
 <template><td></template><body><span>Foo
 #errors
+no doctype
+bad eof
 #document
 | <html>
 |   <head>
@@ -1213,6 +1447,9 @@
 #data
 <template><object></template><body><span>Foo
 #errors
+no doctype
+missing /object
+bad eof
 #document
 | <html>
 |   <head>
@@ -1226,6 +1463,8 @@
 #data
 <template><svg><template>
 #errors
+no doctype
+eof in template
 #document
 | <html>
 |   <head>
@@ -1238,6 +1477,9 @@
 #data
 <template><svg><foo><template><foreignObject><div></template><div>
 #errors
+no doctype
+ugly template closure
+bad eof
 #document
 | <html>
 |   <head>
@@ -1254,6 +1496,10 @@
 #data
 <dummy><template><span></dummy>
 #errors
+no doctype
+bad end tag </dummy>
+eof in template
+eof in dummy
 #document
 | <html>
 |   <head>
@@ -1266,6 +1512,8 @@
 #data
 <body><table><tr><td><select><template>Foo</template><caption>A</table>
 #errors
+no doctype
+(1,62): unexpected-caption-in-select-in-table
 #document
 | <html>
 |   <head>
@@ -1284,6 +1532,9 @@
 #data
 <body></body><template>
 #errors
+no doctype
+(1,23): template-after-body
+(1,24): eof-in-template
 #document
 | <html>
 |   <head>
@@ -1294,6 +1545,9 @@
 #data
 <head></head><template>
 #errors
+no doctype
+(1,23): template-after-head
+(1,24): eof-in-template
 #document
 | <html>
 |   <head>
@@ -1304,6 +1558,8 @@
 #data
 <head></head><template>Foo</template>
 #errors
+no doctype
+(1,23): template-after-head
 #document
 | <html>
 |   <head>
@@ -1313,6 +1569,28 @@
 |   <body>
 
 #data
+<!DOCTYPE HTML><dummy><table><template><table><template><table><script>
+#errors
+eof script
+eof template
+eof template
+eof table
+#document
+| <!DOCTYPE html>
+| <html>
+|   <head>
+|   <body>
+|     <dummy>
+|       <table>
+|         <template>
+|           content
+|             <table>
+|               <template>
+|                 content
+|                   <table>
+|                     <script>
+
+#data
 <template><a><table><a>
 #errors
 #document
diff --git a/html/testdata/webkit/tests1.dat b/html/testdata/webkit/tests1.dat
index cbf8bdd..d6726e3 100644
--- a/html/testdata/webkit/tests1.dat
+++ b/html/testdata/webkit/tests1.dat
@@ -1,7 +1,7 @@
 #data
 Test
 #errors
-Line: 1 Col: 4 Unexpected non-space characters. Expected DOCTYPE.
+(1,0): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -11,7 +11,7 @@
 #data
 <p>One<p>Two
 #errors
-Line: 1 Col: 3 Unexpected start tag (p). Expected DOCTYPE.
+(1,3): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -24,7 +24,7 @@
 #data
 Line1<br>Line2<br>Line3<br>Line4
 #errors
-Line: 1 Col: 5 Unexpected non-space characters. Expected DOCTYPE.
+(1,0): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -40,7 +40,7 @@
 #data
 <html>
 #errors
-Line: 1 Col: 6 Unexpected start tag (html). Expected DOCTYPE.
+(1,6): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -49,7 +49,7 @@
 #data
 <head>
 #errors
-Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.
+(1,6): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -58,7 +58,7 @@
 #data
 <body>
 #errors
-Line: 1 Col: 6 Unexpected start tag (body). Expected DOCTYPE.
+(1,6): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -67,7 +67,7 @@
 #data
 <html><head>
 #errors
-Line: 1 Col: 6 Unexpected start tag (html). Expected DOCTYPE.
+(1,6): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -76,7 +76,7 @@
 #data
 <html><head></head>
 #errors
-Line: 1 Col: 6 Unexpected start tag (html). Expected DOCTYPE.
+(1,6): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -85,7 +85,7 @@
 #data
 <html><head></head><body>
 #errors
-Line: 1 Col: 6 Unexpected start tag (html). Expected DOCTYPE.
+(1,6): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -94,7 +94,7 @@
 #data
 <html><head></head><body></body>
 #errors
-Line: 1 Col: 6 Unexpected start tag (html). Expected DOCTYPE.
+(1,6): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -103,7 +103,7 @@
 #data
 <html><head><body></body></html>
 #errors
-Line: 1 Col: 6 Unexpected start tag (html). Expected DOCTYPE.
+(1,6): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -112,9 +112,7 @@
 #data
 <html><head></body></html>
 #errors
-Line: 1 Col: 6 Unexpected start tag (html). Expected DOCTYPE.
-Line: 1 Col: 19 Unexpected end tag (body).
-Line: 1 Col: 26 Unexpected end tag (html).
+(1,6): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -123,7 +121,7 @@
 #data
 <html><head><body></html>
 #errors
-Line: 1 Col: 6 Unexpected start tag (html). Expected DOCTYPE.
+(1,6): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -132,7 +130,7 @@
 #data
 <html><body></html>
 #errors
-Line: 1 Col: 6 Unexpected start tag (html). Expected DOCTYPE.
+(1,6): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -141,7 +139,7 @@
 #data
 <body></html>
 #errors
-Line: 1 Col: 6 Unexpected start tag (body). Expected DOCTYPE.
+(1,6): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -150,8 +148,7 @@
 #data
 <head></html>
 #errors
-Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.
-Line: 1 Col: 13 Unexpected end tag (html). Ignored.
+(1,6): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -160,7 +157,7 @@
 #data
 </head>
 #errors
-Line: 1 Col: 7 Unexpected end tag (head). Expected DOCTYPE.
+(1,7): expected-doctype-but-got-end-tag
 #document
 | <html>
 |   <head>
@@ -169,8 +166,7 @@
 #data
 </body>
 #errors
-Line: 1 Col: 7 Unexpected end tag (body). Expected DOCTYPE.
-Line: 1 Col: 7 Unexpected end tag (body) after the (implied) root element.
+(1,7): expected-doctype-but-got-end-tag element.
 #document
 | <html>
 |   <head>
@@ -179,8 +175,7 @@
 #data
 </html>
 #errors
-Line: 1 Col: 7 Unexpected end tag (html). Expected DOCTYPE.
-Line: 1 Col: 7 Unexpected end tag (html) after the (implied) root element.
+(1,7): expected-doctype-but-got-end-tag element.
 #document
 | <html>
 |   <head>
@@ -189,10 +184,10 @@
 #data
 <b><table><td><i></table>
 #errors
-Line: 1 Col: 3 Unexpected start tag (b). Expected DOCTYPE.
-Line: 1 Col: 14 Unexpected table cell start tag (td) in the table body phase.
-Line: 1 Col: 25 Got table cell end tag (td) while required end tags are missing.
-Line: 1 Col: 25 Expected closing tag. Unexpected end of file.
+(1,3): expected-doctype-but-got-start-tag
+(1,14): unexpected-cell-in-table-body
+(1,25): unexpected-cell-end-tag
+(1,25): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -207,11 +202,11 @@
 #data
 <b><table><td></b><i></table>X
 #errors
-Line: 1 Col: 3 Unexpected start tag (b). Expected DOCTYPE.
-Line: 1 Col: 14 Unexpected table cell start tag (td) in the table body phase.
-Line: 1 Col: 18 End tag (b) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 29 Got table cell end tag (td) while required end tags are missing.
-Line: 1 Col: 30 Expected closing tag. Unexpected end of file.
+(1,3): expected-doctype-but-got-start-tag
+(1,14): unexpected-cell-in-table-body
+(1,18): unexpected-end-tag
+(1,29): unexpected-cell-end-tag
+(1,30): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -227,9 +222,9 @@
 #data
 <h1>Hello<h2>World
 #errors
-4: Start tag seen without seeing a doctype first. Expected “<!DOCTYPE html>”.
-13: Heading cannot be a child of another heading.
-18: End of file seen and there were open elements.
+(1,4): expected-doctype-but-got-start-tag
+(1,13): unexpected-start-tag
+(1,18): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -242,10 +237,10 @@
 #data
 <a><p>X<a>Y</a>Z</p></a>
 #errors
-Line: 1 Col: 3 Unexpected start tag (a). Expected DOCTYPE.
-Line: 1 Col: 10 Unexpected start tag (a) implies end tag (a).
-Line: 1 Col: 10 End tag (a) violates step 1, paragraph 3 of the adoption agency algorithm.
-Line: 1 Col: 24 End tag (a) violates step 1, paragraph 1 of the adoption agency algorithm.
+(1,3): expected-doctype-but-got-start-tag
+(1,10): unexpected-start-tag-implies-end-tag
+(1,10): adoption-agency-1.3
+(1,24): unexpected-end-tag
 #document
 | <html>
 |   <head>
@@ -261,8 +256,9 @@
 #data
 <b><button>foo</b>bar
 #errors
-Line: 1 Col: 3 Unexpected start tag (b). Expected DOCTYPE.
-Line: 1 Col: 15 End tag (b) violates step 1, paragraph 1 of the adoption agency algorithm.
+(1,3): expected-doctype-but-got-start-tag
+(1,18): adoption-agency-1.3
+(1,21): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -276,7 +272,8 @@
 #data
 <!DOCTYPE html><span><button>foo</span>bar
 #errors
-39: End tag “span” seen but there were unclosed elements.
+(1,39): unexpected-end-tag
+(1,42): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -289,12 +286,12 @@
 #data
 <p><b><div><marquee></p></b></div>X
 #errors
-Line: 1 Col: 3 Unexpected start tag (p). Expected DOCTYPE.
-Line: 1 Col: 11 Unexpected end tag (p). Ignored.
-Line: 1 Col: 24 Unexpected end tag (p). Ignored.
-Line: 1 Col: 28 End tag (b) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 34 End tag (div) seen too early. Expected other end tag.
-Line: 1 Col: 35 Expected closing tag. Unexpected end of file.
+(1,3): expected-doctype-but-got-start-tag
+(1,11): unexpected-end-tag
+(1,24): unexpected-end-tag
+(1,28): unexpected-end-tag
+(1,34): end-tag-too-early
+(1,35): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -310,8 +307,8 @@
 #data
 <script><div></script></div><title><p></title><p><p>
 #errors
-Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE.
-Line: 1 Col: 28 Unexpected end tag (div). Ignored.
+(1,8): expected-doctype-but-got-start-tag
+(1,28): unexpected-end-tag
 #document
 | <html>
 |   <head>
@@ -326,10 +323,10 @@
 #data
 <!--><div>--<!-->
 #errors
-Line: 1 Col: 5 Incorrect comment.
-Line: 1 Col: 10 Unexpected start tag (div). Expected DOCTYPE.
-Line: 1 Col: 17 Incorrect comment.
-Line: 1 Col: 17 Expected closing tag. Unexpected end of file.
+(1,5): incorrect-comment
+(1,10): expected-doctype-but-got-start-tag
+(1,17): incorrect-comment
+(1,17): expected-closing-tag-but-got-eof
 #document
 | <!--  -->
 | <html>
@@ -342,8 +339,8 @@
 #data
 <p><hr></p>
 #errors
-Line: 1 Col: 3 Unexpected start tag (p). Expected DOCTYPE.
-Line: 1 Col: 11 Unexpected end tag (p). Ignored.
+(1,3): expected-doctype-but-got-start-tag
+(1,11): unexpected-end-tag
 #document
 | <html>
 |   <head>
@@ -355,12 +352,12 @@
 #data
 <select><b><option><select><option></b></select>X
 #errors
-Line: 1 Col: 8 Unexpected start tag (select). Expected DOCTYPE.
-Line: 1 Col: 11 Unexpected start tag token (b) in the select phase. Ignored.
-Line: 1 Col: 27 Unexpected select start tag in the select phase treated as select end tag.
-Line: 1 Col: 39 End tag (b) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 48 Unexpected end tag (select). Ignored.
-Line: 1 Col: 49 Expected closing tag. Unexpected end of file.
+(1,8): expected-doctype-but-got-start-tag
+(1,11): unexpected-start-tag-in-select
+(1,27): unexpected-select-in-select
+(1,39): unexpected-end-tag
+(1,48): unexpected-end-tag
+(1,49): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -373,16 +370,15 @@
 #data
 <a><table><td><a><table></table><a></tr><a></table><b>X</b>C<a>Y
 #errors
-Line: 1 Col: 3 Unexpected start tag (a). Expected DOCTYPE.
-Line: 1 Col: 14 Unexpected table cell start tag (td) in the table body phase.
-Line: 1 Col: 35 Unexpected start tag (a) implies end tag (a).
-Line: 1 Col: 40 Got table cell end tag (td) while required end tags are missing.
-Line: 1 Col: 43 Unexpected start tag (a) in table context caused voodoo mode.
-Line: 1 Col: 43 Unexpected start tag (a) implies end tag (a).
-Line: 1 Col: 43 End tag (a) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 51 Unexpected implied end tag (a) in the table phase.
-Line: 1 Col: 63 Unexpected start tag (a) implies end tag (a).
-Line: 1 Col: 64 Expected closing tag. Unexpected end of file.
+(1,3): expected-doctype-but-got-start-tag
+(1,14): unexpected-cell-in-table-body
+(1,35): unexpected-start-tag-implies-end-tag
+(1,40): unexpected-cell-end-tag
+(1,43): unexpected-start-tag-implies-table-voodoo
+(1,43): unexpected-start-tag-implies-end-tag
+(1,43): unexpected-end-tag
+(1,63): unexpected-start-tag-implies-end-tag
+(1,64): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -406,10 +402,10 @@
 #data
 <a X>0<b>1<a Y>2
 #errors
-Line: 1 Col: 5 Unexpected start tag (a). Expected DOCTYPE.
-Line: 1 Col: 15 Unexpected start tag (a) implies end tag (a).
-Line: 1 Col: 15 End tag (a) violates step 1, paragraph 3 of the adoption agency algorithm.
-Line: 1 Col: 16 Expected closing tag. Unexpected end of file.
+(1,5): expected-doctype-but-got-start-tag
+(1,15): unexpected-start-tag-implies-end-tag
+(1,15): adoption-agency-1.3
+(1,16): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -427,14 +423,22 @@
 #data
 <!-----><font><div>hello<table>excite!<b>me!<th><i>please!</tr><!--X-->
 #errors
-Line: 1 Col: 7 Unexpected '-' after '--' found in comment.
-Line: 1 Col: 14 Unexpected start tag (font). Expected DOCTYPE.
-Line: 1 Col: 38 Unexpected non-space characters in table context caused voodoo mode.
-Line: 1 Col: 41 Unexpected start tag (b) in table context caused voodoo mode.
-Line: 1 Col: 48 Unexpected implied end tag (b) in the table phase.
-Line: 1 Col: 48 Unexpected table cell start tag (th) in the table body phase.
-Line: 1 Col: 63 Got table cell end tag (th) while required end tags are missing.
-Line: 1 Col: 71 Unexpected end of file. Expected table content.
+(1,7): unexpected-dash-after-double-dash-in-comment
+(1,14): expected-doctype-but-got-start-tag
+(1,41): unexpected-start-tag-implies-table-voodoo
+(1,48): foster-parenting-character-in-table
+(1,48): foster-parenting-character-in-table
+(1,48): foster-parenting-character-in-table
+(1,48): foster-parenting-character-in-table
+(1,48): foster-parenting-character-in-table
+(1,48): foster-parenting-character-in-table
+(1,48): foster-parenting-character-in-table
+(1,48): foster-parenting-character-in-table
+(1,48): foster-parenting-character-in-table
+(1,48): foster-parenting-character-in-table
+(1,48): unexpected-cell-in-table-body
+(1,63): unexpected-cell-end-tag
+(1,71): eof-in-table
 #document
 | <!-- - -->
 | <html>
@@ -456,7 +460,6 @@
 #data
 <!DOCTYPE html><li>hello<li>world<ul>how<li>do</ul>you</body><!--do-->
 #errors
-Line: 1 Col: 61 Unexpected end tag (li). Missing end tag (body).
 #document
 | <!DOCTYPE html>
 | <html>
@@ -476,8 +479,8 @@
 #data
 <!DOCTYPE html>A<option>B<optgroup>C<select>D</option>E
 #errors
-Line: 1 Col: 54 Unexpected end tag (option) in the select phase. Ignored.
-Line: 1 Col: 55 Expected closing tag. Unexpected end of file.
+(1,54): unexpected-end-tag-in-select
+(1,55): eof-in-select
 #document
 | <!DOCTYPE html>
 | <html>
@@ -494,8 +497,8 @@
 #data
 <
 #errors
-Line: 1 Col: 1 Expected tag name. Got something else instead
-Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE.
+(1,1): expected-tag-name
+(1,1): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -505,8 +508,8 @@
 #data
 <#
 #errors
-Line: 1 Col: 1 Expected tag name. Got something else instead
-Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE.
+(1,1): expected-tag-name
+(1,1): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -516,8 +519,8 @@
 #data
 </
 #errors
-Line: 1 Col: 2 Expected closing tag. Unexpected end of file.
-Line: 1 Col: 2 Unexpected non-space characters. Expected DOCTYPE.
+(1,2): expected-closing-tag-but-got-eof
+(1,2): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -527,8 +530,8 @@
 #data
 </#
 #errors
-Line: 1 Col: 2 Expected closing tag. Unexpected character '#' found.
-Line: 1 Col: 3 Unexpected End of file. Expected DOCTYPE.
+(1,2): expected-closing-tag-but-got-char
+(1,3): expected-doctype-but-got-eof
 #document
 | <!-- # -->
 | <html>
@@ -538,8 +541,8 @@
 #data
 <?
 #errors
-Line: 1 Col: 1 Expected tag name. Got '?' instead. (HTML doesn't support processing instructions.)
-Line: 1 Col: 2 Unexpected End of file. Expected DOCTYPE.
+(1,1): expected-tag-name-but-got-question-mark
+(1,2): expected-doctype-but-got-eof
 #document
 | <!-- ? -->
 | <html>
@@ -549,8 +552,8 @@
 #data
 <?#
 #errors
-Line: 1 Col: 1 Expected tag name. Got '?' instead. (HTML doesn't support processing instructions.)
-Line: 1 Col: 3 Unexpected End of file. Expected DOCTYPE.
+(1,1): expected-tag-name-but-got-question-mark
+(1,3): expected-doctype-but-got-eof
 #document
 | <!-- ?# -->
 | <html>
@@ -560,8 +563,8 @@
 #data
 <!
 #errors
-Line: 1 Col: 2 Expected '--' or 'DOCTYPE'. Not found.
-Line: 1 Col: 2 Unexpected End of file. Expected DOCTYPE.
+(1,2): expected-dashes-or-doctype
+(1,2): expected-doctype-but-got-eof
 #document
 | <!--  -->
 | <html>
@@ -571,8 +574,8 @@
 #data
 <!#
 #errors
-Line: 1 Col: 3 Expected '--' or 'DOCTYPE'. Not found.
-Line: 1 Col: 3 Unexpected End of file. Expected DOCTYPE.
+(1,2): expected-dashes-or-doctype
+(1,3): expected-doctype-but-got-eof
 #document
 | <!-- # -->
 | <html>
@@ -582,8 +585,8 @@
 #data
 <?COMMENT?>
 #errors
-Line: 1 Col: 1 Expected tag name. Got '?' instead. (HTML doesn't support processing instructions.)
-Line: 1 Col: 11 Unexpected End of file. Expected DOCTYPE.
+(1,1): expected-tag-name-but-got-question-mark
+(1,11): expected-doctype-but-got-eof
 #document
 | <!-- ?COMMENT? -->
 | <html>
@@ -593,8 +596,8 @@
 #data
 <!COMMENT>
 #errors
-Line: 1 Col: 2 Expected '--' or 'DOCTYPE'. Not found.
-Line: 1 Col: 10 Unexpected End of file. Expected DOCTYPE.
+(1,2): expected-dashes-or-doctype
+(1,10): expected-doctype-but-got-eof
 #document
 | <!-- COMMENT -->
 | <html>
@@ -604,8 +607,8 @@
 #data
 </ COMMENT >
 #errors
-Line: 1 Col: 2 Expected closing tag. Unexpected character ' ' found.
-Line: 1 Col: 12 Unexpected End of file. Expected DOCTYPE.
+(1,2): expected-closing-tag-but-got-char
+(1,12): expected-doctype-but-got-eof
 #document
 | <!--  COMMENT  -->
 | <html>
@@ -615,8 +618,8 @@
 #data
 <?COM--MENT?>
 #errors
-Line: 1 Col: 1 Expected tag name. Got '?' instead. (HTML doesn't support processing instructions.)
-Line: 1 Col: 13 Unexpected End of file. Expected DOCTYPE.
+(1,1): expected-tag-name-but-got-question-mark
+(1,13): expected-doctype-but-got-eof
 #document
 | <!-- ?COM--MENT? -->
 | <html>
@@ -626,8 +629,8 @@
 #data
 <!COM--MENT>
 #errors
-Line: 1 Col: 2 Expected '--' or 'DOCTYPE'. Not found.
-Line: 1 Col: 12 Unexpected End of file. Expected DOCTYPE.
+(1,2): expected-dashes-or-doctype
+(1,12): expected-doctype-but-got-eof
 #document
 | <!-- COM--MENT -->
 | <html>
@@ -637,8 +640,8 @@
 #data
 </ COM--MENT >
 #errors
-Line: 1 Col: 2 Expected closing tag. Unexpected character ' ' found.
-Line: 1 Col: 14 Unexpected End of file. Expected DOCTYPE.
+(1,2): expected-closing-tag-but-got-char
+(1,14): expected-doctype-but-got-eof
 #document
 | <!--  COM--MENT  -->
 | <html>
@@ -648,7 +651,7 @@
 #data
 <!DOCTYPE html><style> EOF
 #errors
-Line: 1 Col: 26 Unexpected end of file. Expected end tag (style).
+(1,26): expected-named-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -660,6 +663,7 @@
 #data
 <!DOCTYPE html><script> <!-- </script> --> </script> EOF
 #errors
+(1,52): unexpected-end-tag
 #document
 | <!DOCTYPE html>
 | <html>
@@ -673,8 +677,8 @@
 #data
 <b><p></b>TEST
 #errors
-Line: 1 Col: 3 Unexpected start tag (b). Expected DOCTYPE.
-Line: 1 Col: 10 End tag (b) violates step 1, paragraph 3 of the adoption agency algorithm.
+(1,3): expected-doctype-but-got-start-tag
+(1,10): adoption-agency-1.3
 #document
 | <html>
 |   <head>
@@ -687,9 +691,9 @@
 #data
 <p id=a><b><p id=b></b>TEST
 #errors
-Line: 1 Col: 8 Unexpected start tag (p). Expected DOCTYPE.
-Line: 1 Col: 19 Unexpected end tag (p). Ignored.
-Line: 1 Col: 23 End tag (b) violates step 1, paragraph 2 of the adoption agency algorithm.
+(1,8): expected-doctype-but-got-start-tag
+(1,19): unexpected-end-tag
+(1,23): adoption-agency-1.2
 #document
 | <html>
 |   <head>
@@ -704,10 +708,10 @@
 #data
 <b id=a><p><b id=b></p></b>TEST
 #errors
-Line: 1 Col: 8 Unexpected start tag (b). Expected DOCTYPE.
-Line: 1 Col: 23 Unexpected end tag (p). Ignored.
-Line: 1 Col: 27 End tag (b) violates step 1, paragraph 2 of the adoption agency algorithm.
-Line: 1 Col: 31 Expected closing tag. Unexpected end of file.
+(1,8): expected-doctype-but-got-start-tag
+(1,23): unexpected-end-tag
+(1,27): adoption-agency-1.2
+(1,31): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -722,7 +726,7 @@
 #data
 <!DOCTYPE html><title>U-test</title><body><div><p>Test<u></p></div></body>
 #errors
-Line: 1 Col: 61 Unexpected end tag (p). Ignored.
+(1,61): unexpected-end-tag
 #document
 | <!DOCTYPE html>
 | <html>
@@ -738,8 +742,8 @@
 #data
 <!DOCTYPE html><font><table></font></table></font>
 #errors
-Line: 1 Col: 35 Unexpected end tag (font) in table context caused voodoo mode.
-Line: 1 Col: 35 End tag (font) violates step 1, paragraph 1 of the adoption agency algorithm.
+(1,35): unexpected-end-tag-implies-table-voodoo
+(1,35): unexpected-end-tag
 #document
 | <!DOCTYPE html>
 | <html>
@@ -751,10 +755,10 @@
 #data
 <font><p>hello<b>cruel</font>world
 #errors
-Line: 1 Col: 6 Unexpected start tag (font). Expected DOCTYPE.
-Line: 1 Col: 29 End tag (font) violates step 1, paragraph 3 of the adoption agency algorithm.
-Line: 1 Col: 29 End tag (font) violates step 1, paragraph 3 of the adoption agency algorithm.
-Line: 1 Col: 34 Expected closing tag. Unexpected end of file.
+(1,6): expected-doctype-but-got-start-tag
+(1,29): adoption-agency-1.3
+(1,29): adoption-agency-1.3
+(1,34): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -771,9 +775,9 @@
 #data
 <b>Test</i>Test
 #errors
-Line: 1 Col: 3 Unexpected start tag (b). Expected DOCTYPE.
-Line: 1 Col: 11 End tag (i) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 15 Expected closing tag. Unexpected end of file.
+(1,3): expected-doctype-but-got-start-tag
+(1,11): unexpected-end-tag
+(1,15): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -784,8 +788,8 @@
 #data
 <b>A<cite>B<div>C
 #errors
-Line: 1 Col: 3 Unexpected start tag (b). Expected DOCTYPE.
-Line: 1 Col: 17 Expected closing tag. Unexpected end of file.
+(1,3): expected-doctype-but-got-start-tag
+(1,17): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -800,9 +804,9 @@
 #data
 <b>A<cite>B<div>C</cite>D
 #errors
-Line: 1 Col: 3 Unexpected start tag (b). Expected DOCTYPE.
-Line: 1 Col: 24 Unexpected end tag (cite). Ignored.
-Line: 1 Col: 25 Expected closing tag. Unexpected end of file.
+(1,3): expected-doctype-but-got-start-tag
+(1,24): unexpected-end-tag
+(1,25): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -817,9 +821,9 @@
 #data
 <b>A<cite>B<div>C</b>D
 #errors
-Line: 1 Col: 3 Unexpected start tag (b). Expected DOCTYPE.
-Line: 1 Col: 21 End tag (b) violates step 1, paragraph 3 of the adoption agency algorithm.
-Line: 1 Col: 22 Expected closing tag. Unexpected end of file.
+(1,3): expected-doctype-but-got-start-tag
+(1,21): adoption-agency-1.3
+(1,22): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -836,7 +840,7 @@
 #data
 
 #errors
-Line: 1 Col: 0 Unexpected End of file. Expected DOCTYPE.
+(1,0): expected-doctype-but-got-eof
 #document
 | <html>
 |   <head>
@@ -845,8 +849,8 @@
 #data
 <DIV>
 #errors
-Line: 1 Col: 5 Unexpected start tag (div). Expected DOCTYPE.
-Line: 1 Col: 5 Expected closing tag. Unexpected end of file.
+(1,5): expected-doctype-but-got-start-tag
+(1,5): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -856,8 +860,8 @@
 #data
 <DIV> abc
 #errors
-Line: 1 Col: 5 Unexpected start tag (div). Expected DOCTYPE.
-Line: 1 Col: 9 Expected closing tag. Unexpected end of file.
+(1,5): expected-doctype-but-got-start-tag
+(1,9): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -868,8 +872,8 @@
 #data
 <DIV> abc <B>
 #errors
-Line: 1 Col: 5 Unexpected start tag (div). Expected DOCTYPE.
-Line: 1 Col: 13 Expected closing tag. Unexpected end of file.
+(1,5): expected-doctype-but-got-start-tag
+(1,13): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -881,8 +885,8 @@
 #data
 <DIV> abc <B> def
 #errors
-Line: 1 Col: 5 Unexpected start tag (div). Expected DOCTYPE.
-Line: 1 Col: 17 Expected closing tag. Unexpected end of file.
+(1,5): expected-doctype-but-got-start-tag
+(1,17): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -895,8 +899,8 @@
 #data
 <DIV> abc <B> def <I>
 #errors
-Line: 1 Col: 5 Unexpected start tag (div). Expected DOCTYPE.
-Line: 1 Col: 21 Expected closing tag. Unexpected end of file.
+(1,5): expected-doctype-but-got-start-tag
+(1,21): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -910,8 +914,8 @@
 #data
 <DIV> abc <B> def <I> ghi
 #errors
-Line: 1 Col: 5 Unexpected start tag (div). Expected DOCTYPE.
-Line: 1 Col: 25 Expected closing tag. Unexpected end of file.
+(1,5): expected-doctype-but-got-start-tag
+(1,25): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -926,8 +930,8 @@
 #data
 <DIV> abc <B> def <I> ghi <P>
 #errors
-Line: 1 Col: 5 Unexpected start tag (div). Expected DOCTYPE.
-Line: 1 Col: 29 Expected closing tag. Unexpected end of file.
+(1,5): expected-doctype-but-got-start-tag
+(1,29): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -943,8 +947,8 @@
 #data
 <DIV> abc <B> def <I> ghi <P> jkl
 #errors
-Line: 1 Col: 5 Unexpected start tag (div). Expected DOCTYPE.
-Line: 1 Col: 33 Expected closing tag. Unexpected end of file.
+(1,5): expected-doctype-but-got-start-tag
+(1,33): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -961,9 +965,9 @@
 #data
 <DIV> abc <B> def <I> ghi <P> jkl </B>
 #errors
-Line: 1 Col: 5 Unexpected start tag (div). Expected DOCTYPE.
-Line: 1 Col: 38 End tag (b) violates step 1, paragraph 3 of the adoption agency algorithm.
-Line: 1 Col: 38 Expected closing tag. Unexpected end of file.
+(1,5): expected-doctype-but-got-start-tag
+(1,38): adoption-agency-1.3
+(1,38): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -982,9 +986,9 @@
 #data
 <DIV> abc <B> def <I> ghi <P> jkl </B> mno
 #errors
-Line: 1 Col: 5 Unexpected start tag (div). Expected DOCTYPE.
-Line: 1 Col: 38 End tag (b) violates step 1, paragraph 3 of the adoption agency algorithm.
-Line: 1 Col: 42 Expected closing tag. Unexpected end of file.
+(1,5): expected-doctype-but-got-start-tag
+(1,38): adoption-agency-1.3
+(1,42): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -1004,10 +1008,10 @@
 #data
 <DIV> abc <B> def <I> ghi <P> jkl </B> mno </I>
 #errors
-Line: 1 Col: 5 Unexpected start tag (div). Expected DOCTYPE.
-Line: 1 Col: 38 End tag (b) violates step 1, paragraph 3 of the adoption agency algorithm.
-Line: 1 Col: 47 End tag (i) violates step 1, paragraph 3 of the adoption agency algorithm.
-Line: 1 Col: 47 Expected closing tag. Unexpected end of file.
+(1,5): expected-doctype-but-got-start-tag
+(1,38): adoption-agency-1.3
+(1,47): adoption-agency-1.3
+(1,47): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -1028,10 +1032,10 @@
 #data
 <DIV> abc <B> def <I> ghi <P> jkl </B> mno </I> pqr
 #errors
-Line: 1 Col: 5 Unexpected start tag (div). Expected DOCTYPE.
-Line: 1 Col: 38 End tag (b) violates step 1, paragraph 3 of the adoption agency algorithm.
-Line: 1 Col: 47 End tag (i) violates step 1, paragraph 3 of the adoption agency algorithm.
-Line: 1 Col: 51 Expected closing tag. Unexpected end of file.
+(1,5): expected-doctype-but-got-start-tag
+(1,38): adoption-agency-1.3
+(1,47): adoption-agency-1.3
+(1,51): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -1053,10 +1057,10 @@
 #data
 <DIV> abc <B> def <I> ghi <P> jkl </B> mno </I> pqr </P>
 #errors
-Line: 1 Col: 5 Unexpected start tag (div). Expected DOCTYPE.
-Line: 1 Col: 38 End tag (b) violates step 1, paragraph 3 of the adoption agency algorithm.
-Line: 1 Col: 47 End tag (i) violates step 1, paragraph 3 of the adoption agency algorithm.
-Line: 1 Col: 56 Expected closing tag. Unexpected end of file.
+(1,5): expected-doctype-but-got-start-tag
+(1,38): adoption-agency-1.3
+(1,47): adoption-agency-1.3
+(1,56): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -1078,10 +1082,10 @@
 #data
 <DIV> abc <B> def <I> ghi <P> jkl </B> mno </I> pqr </P> stu
 #errors
-Line: 1 Col: 5 Unexpected start tag (div). Expected DOCTYPE.
-Line: 1 Col: 38 End tag (b) violates step 1, paragraph 3 of the adoption agency algorithm.
-Line: 1 Col: 47 End tag (i) violates step 1, paragraph 3 of the adoption agency algorithm.
-Line: 1 Col: 60 Expected closing tag. Unexpected end of file.
+(1,5): expected-doctype-but-got-start-tag
+(1,38): adoption-agency-1.3
+(1,47): adoption-agency-1.3
+(1,60): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -1104,8 +1108,8 @@
 #data
 <test attribute---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
 #errors
-Line: 1 Col: 1040 Unexpected start tag (test). Expected DOCTYPE.
-Line: 1 Col: 1040 Expected closing tag. Unexpected end of file.
+(1,1040): expected-doctype-but-got-start-tag
+(1,1040): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -1116,14 +1120,14 @@
 #data
 <a href="blah">aba<table><a href="foo">br<tr><td></td></tr>x</table>aoe
 #errors
-Line: 1 Col: 15 Unexpected start tag (a). Expected DOCTYPE.
-Line: 1 Col: 39 Unexpected start tag (a) in table context caused voodoo mode.
-Line: 1 Col: 39 Unexpected start tag (a) implies end tag (a).
-Line: 1 Col: 39 End tag (a) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 45 Unexpected implied end tag (a) in the table phase.
-Line: 1 Col: 68 Unexpected implied end tag (a) in the table phase.
-Line: 1 Col: 71 Expected closing tag. Unexpected end of file.
-
+(1,15): expected-doctype-but-got-start-tag
+(1,39): unexpected-start-tag-implies-table-voodoo
+(1,39): unexpected-start-tag-implies-end-tag
+(1,39): unexpected-end-tag
+(1,45): foster-parenting-character-in-table
+(1,45): foster-parenting-character-in-table
+(1,68): foster-parenting-character-in-table
+(1,71): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -1148,10 +1152,10 @@
 #data
 <a href="blah">aba<table><tr><td><a href="foo">br</td></tr>x</table>aoe
 #errors
-Line: 1 Col: 15 Unexpected start tag (a). Expected DOCTYPE.
-Line: 1 Col: 54 Got table cell end tag (td) while required end tags are missing.
-Line: 1 Col: 60 Unexpected non-space characters in table context caused voodoo mode.
-Line: 1 Col: 71 Expected closing tag. Unexpected end of file.
+(1,15): expected-doctype-but-got-start-tag
+(1,54): unexpected-cell-end-tag
+(1,68): unexpected text in table
+(1,71): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -1171,12 +1175,14 @@
 #data
 <table><a href="blah">aba<tr><td><a href="foo">br</td></tr>x</table>aoe
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 22 Unexpected start tag (a) in table context caused voodoo mode.
-Line: 1 Col: 29 Unexpected implied end tag (a) in the table phase.
-Line: 1 Col: 54 Got table cell end tag (td) while required end tags are missing.
-Line: 1 Col: 68 Unexpected implied end tag (a) in the table phase.
-Line: 1 Col: 71 Expected closing tag. Unexpected end of file.
+(1,7): expected-doctype-but-got-start-tag
+(1,22): unexpected-start-tag-implies-table-voodoo
+(1,29): foster-parenting-character-in-table
+(1,29): foster-parenting-character-in-table
+(1,29): foster-parenting-character-in-table
+(1,54): unexpected-cell-end-tag
+(1,68): foster-parenting-character-in-table
+(1,71): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -1201,9 +1207,9 @@
 #data
 <a href=a>aa<marquee>aa<a href=b>bb</marquee>aa
 #errors
-Line: 1 Col: 10 Unexpected start tag (a). Expected DOCTYPE.
-Line: 1 Col: 45 End tag (marquee) seen too early. Expected other end tag.
-Line: 1 Col: 47 Expected closing tag. Unexpected end of file.
+(1,10): expected-doctype-but-got-start-tag
+(1,45): end-tag-too-early
+(1,47): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -1221,9 +1227,10 @@
 #data
 <wbr><strike><code></strike><code><strike></code>
 #errors
-Line: 1 Col: 5 Unexpected start tag (wbr). Expected DOCTYPE.
-Line: 1 Col: 28 End tag (strike) violates step 1, paragraph 3 of the adoption agency algorithm.
-Line: 1 Col: 49 Unexpected end tag (code). Ignored.
+(1,5): expected-doctype-but-got-start-tag
+(1,28): adoption-agency-1.3
+(1,49): adoption-agency-1.3
+(1,49): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -1238,7 +1245,7 @@
 #data
 <!DOCTYPE html><spacer>foo
 #errors
-26: End of file seen and there were open elements.
+(1,26): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -1250,7 +1257,7 @@
 #data
 <title><meta></title><link><title><meta></title>
 #errors
-Line: 1 Col: 7 Unexpected start tag (title). Expected DOCTYPE.
+(1,7): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -1264,8 +1271,7 @@
 #data
 <style><!--</style><meta><script>--><link></script>
 #errors
-Line: 1 Col: 7 Unexpected start tag (style). Expected DOCTYPE.
-Line: 1 Col: 51 Unexpected end of file. Expected end tag (style).
+(1,7): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -1279,8 +1285,8 @@
 #data
 <head><meta></head><link>
 #errors
-Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.
-Line: 1 Col: 25 Unexpected start tag (link) that can be in head. Moved.
+(1,6): expected-doctype-but-got-start-tag
+(1,25): unexpected-start-tag-out-of-my-head
 #document
 | <html>
 |   <head>
@@ -1291,9 +1297,9 @@
 #data
 <table><tr><tr><td><td><span><th><span>X</table>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 33 Got table cell end tag (td) while required end tags are missing.
-Line: 1 Col: 48 Got table cell end tag (th) while required end tags are missing.
+(1,7): expected-doctype-but-got-start-tag
+(1,33): unexpected-cell-end-tag
+(1,48): unexpected-cell-end-tag
 #document
 | <html>
 |   <head>
@@ -1312,10 +1318,9 @@
 #data
 <body><body><base><link><meta><title><p></title><body><p></body>
 #errors
-Line: 1 Col: 6 Unexpected start tag (body). Expected DOCTYPE.
-Line: 1 Col: 12 Unexpected start tag (body).
-Line: 1 Col: 54 Unexpected start tag (body).
-Line: 1 Col: 64 Unexpected end tag (p). Missing end tag (body).
+(1,6): expected-doctype-but-got-start-tag
+(1,12): unexpected-start-tag
+(1,54): unexpected-start-tag
 #document
 | <html>
 |   <head>
@@ -1330,7 +1335,7 @@
 #data
 <textarea><p></textarea>
 #errors
-Line: 1 Col: 10 Unexpected start tag (textarea). Expected DOCTYPE.
+(1,10): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -1341,8 +1346,8 @@
 #data
 <p><image></p>
 #errors
-Line: 1 Col: 3 Unexpected start tag (p). Expected DOCTYPE.
-Line: 1 Col: 10 Unexpected start tag (image). Treated as img.
+(1,3): expected-doctype-but-got-start-tag
+(1,10): unexpected-start-tag-treated-as
 #document
 | <html>
 |   <head>
@@ -1353,17 +1358,16 @@
 #data
 <a><table><a></table><p><a><div><a>
 #errors
-Line: 1 Col: 3 Unexpected start tag (a). Expected DOCTYPE.
-Line: 1 Col: 13 Unexpected start tag (a) in table context caused voodoo mode.
-Line: 1 Col: 13 Unexpected start tag (a) implies end tag (a).
-Line: 1 Col: 13 End tag (a) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 21 Unexpected end tag (table). Expected end tag (a).
-Line: 1 Col: 27 Unexpected start tag (a) implies end tag (a).
-Line: 1 Col: 27 End tag (a) violates step 1, paragraph 2 of the adoption agency algorithm.
-Line: 1 Col: 32 Unexpected end tag (p). Ignored.
-Line: 1 Col: 35 Unexpected start tag (a) implies end tag (a).
-Line: 1 Col: 35 End tag (a) violates step 1, paragraph 2 of the adoption agency algorithm.
-Line: 1 Col: 35 Expected closing tag. Unexpected end of file.
+(1,3): expected-doctype-but-got-start-tag
+(1,13): unexpected-start-tag-implies-table-voodoo
+(1,13): unexpected-start-tag-implies-end-tag
+(1,13): adoption-agency-1.3
+(1,27): unexpected-start-tag-implies-end-tag
+(1,27): adoption-agency-1.2
+(1,32): unexpected-end-tag
+(1,35): unexpected-start-tag-implies-end-tag
+(1,35): adoption-agency-1.2
+(1,35): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -1379,8 +1383,8 @@
 #data
 <head></p><meta><p>
 #errors
-Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.
-Line: 1 Col: 10 Unexpected end tag (p). Ignored.
+(1,6): expected-doctype-but-got-start-tag
+(1,10): unexpected-end-tag
 #document
 | <html>
 |   <head>
@@ -1391,8 +1395,8 @@
 #data
 <head></html><meta><p>
 #errors
-Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.
-Line: 1 Col: 19 Unexpected start tag (meta).
+(1,6): expected-doctype-but-got-start-tag
+(1,19): expected-eof-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -1403,10 +1407,10 @@
 #data
 <b><table><td><i></table>
 #errors
-Line: 1 Col: 3 Unexpected start tag (b). Expected DOCTYPE.
-Line: 1 Col: 14 Unexpected table cell start tag (td) in the table body phase.
-Line: 1 Col: 25 Got table cell end tag (td) while required end tags are missing.
-Line: 1 Col: 25 Expected closing tag. Unexpected end of file.
+(1,3): expected-doctype-but-got-start-tag
+(1,14): unexpected-cell-in-table-body
+(1,25): unexpected-cell-end-tag
+(1,25): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -1421,11 +1425,11 @@
 #data
 <b><table><td></b><i></table>
 #errors
-Line: 1 Col: 3 Unexpected start tag (b). Expected DOCTYPE.
-Line: 1 Col: 14 Unexpected table cell start tag (td) in the table body phase.
-Line: 1 Col: 18 End tag (b) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 29 Got table cell end tag (td) while required end tags are missing.
-Line: 1 Col: 29 Expected closing tag. Unexpected end of file.
+(1,3): expected-doctype-but-got-start-tag
+(1,14): unexpected-cell-in-table-body
+(1,18): unexpected-end-tag
+(1,29): unexpected-cell-end-tag
+(1,29): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -1440,9 +1444,9 @@
 #data
 <h1><h2>
 #errors
-4: Start tag seen without seeing a doctype first. Expected “<!DOCTYPE html>”.
-8: Heading cannot be a child of another heading.
-8: End of file seen and there were open elements.
+(1,4): expected-doctype-but-got-start-tag
+(1,8): unexpected-start-tag
+(1,8): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -1453,10 +1457,10 @@
 #data
 <a><p><a></a></p></a>
 #errors
-Line: 1 Col: 3 Unexpected start tag (a). Expected DOCTYPE.
-Line: 1 Col: 9 Unexpected start tag (a) implies end tag (a).
-Line: 1 Col: 9 End tag (a) violates step 1, paragraph 3 of the adoption agency algorithm.
-Line: 1 Col: 21 End tag (a) violates step 1, paragraph 1 of the adoption agency algorithm.
+(1,3): expected-doctype-but-got-start-tag
+(1,9): unexpected-start-tag-implies-end-tag
+(1,9): adoption-agency-1.3
+(1,21): unexpected-end-tag
 #document
 | <html>
 |   <head>
@@ -1469,8 +1473,9 @@
 #data
 <b><button></b></button></b>
 #errors
-Line: 1 Col: 3 Unexpected start tag (b). Expected DOCTYPE.
-Line: 1 Col: 15 End tag (b) violates step 1, paragraph 1 of the adoption agency algorithm.
+(1,3): expected-doctype-but-got-start-tag
+(1,15): adoption-agency-1.3
+(1,28): unexpected-end-tag
 #document
 | <html>
 |   <head>
@@ -1482,12 +1487,12 @@
 #data
 <p><b><div><marquee></p></b></div>
 #errors
-Line: 1 Col: 3 Unexpected start tag (p). Expected DOCTYPE.
-Line: 1 Col: 11 Unexpected end tag (p). Ignored.
-Line: 1 Col: 24 Unexpected end tag (p). Ignored.
-Line: 1 Col: 28 End tag (b) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 34 End tag (div) seen too early. Expected other end tag.
-Line: 1 Col: 34 Expected closing tag. Unexpected end of file.
+(1,3): expected-doctype-but-got-start-tag
+(1,11): unexpected-end-tag
+(1,24): unexpected-end-tag
+(1,28): unexpected-end-tag
+(1,34): end-tag-too-early
+(1,34): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -1502,8 +1507,8 @@
 #data
 <script></script></div><title></title><p><p>
 #errors
-Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE.
-Line: 1 Col: 23 Unexpected end tag (div). Ignored.
+(1,8): expected-doctype-but-got-start-tag
+(1,23): unexpected-end-tag
 #document
 | <html>
 |   <head>
@@ -1516,8 +1521,8 @@
 #data
 <p><hr></p>
 #errors
-Line: 1 Col: 3 Unexpected start tag (p). Expected DOCTYPE.
-Line: 1 Col: 11 Unexpected end tag (p). Ignored.
+(1,3): expected-doctype-but-got-start-tag
+(1,11): unexpected-end-tag
 #document
 | <html>
 |   <head>
@@ -1529,12 +1534,12 @@
 #data
 <select><b><option><select><option></b></select>
 #errors
-Line: 1 Col: 8 Unexpected start tag (select). Expected DOCTYPE.
-Line: 1 Col: 11 Unexpected start tag token (b) in the select phase. Ignored.
-Line: 1 Col: 27 Unexpected select start tag in the select phase treated as select end tag.
-Line: 1 Col: 39 End tag (b) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 48 Unexpected end tag (select). Ignored.
-Line: 1 Col: 48 Expected closing tag. Unexpected end of file.
+(1,8): expected-doctype-but-got-start-tag
+(1,11): unexpected-start-tag-in-select
+(1,27): unexpected-select-in-select
+(1,39): unexpected-end-tag
+(1,48): unexpected-end-tag
+(1,48): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -1546,7 +1551,7 @@
 #data
 <html><head><title></title><body></body></html>
 #errors
-Line: 1 Col: 6 Unexpected start tag (html). Expected DOCTYPE.
+(1,6): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -1556,17 +1561,16 @@
 #data
 <a><table><td><a><table></table><a></tr><a></table><a>
 #errors
-Line: 1 Col: 3 Unexpected start tag (a). Expected DOCTYPE.
-Line: 1 Col: 14 Unexpected table cell start tag (td) in the table body phase.
-Line: 1 Col: 35 Unexpected start tag (a) implies end tag (a).
-Line: 1 Col: 40 Got table cell end tag (td) while required end tags are missing.
-Line: 1 Col: 43 Unexpected start tag (a) in table context caused voodoo mode.
-Line: 1 Col: 43 Unexpected start tag (a) implies end tag (a).
-Line: 1 Col: 43 End tag (a) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 51 Unexpected implied end tag (a) in the table phase.
-Line: 1 Col: 54 Unexpected start tag (a) implies end tag (a).
-Line: 1 Col: 54 End tag (a) violates step 1, paragraph 2 of the adoption agency algorithm.
-Line: 1 Col: 54 Expected closing tag. Unexpected end of file.
+(1,3): expected-doctype-but-got-start-tag
+(1,14): unexpected-cell-in-table-body
+(1,35): unexpected-start-tag-implies-end-tag
+(1,40): unexpected-cell-end-tag
+(1,43): unexpected-start-tag-implies-table-voodoo
+(1,43): unexpected-start-tag-implies-end-tag
+(1,43): unexpected-end-tag
+(1,54): unexpected-start-tag-implies-end-tag
+(1,54): adoption-agency-1.2
+(1,54): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -1585,10 +1589,10 @@
 #data
 <ul><li></li><div><li></div><li><li><div><li><address><li><b><em></b><li></ul>
 #errors
-Line: 1 Col: 4 Unexpected start tag (ul). Expected DOCTYPE.
-Line: 1 Col: 45 Missing end tag (div, li).
-Line: 1 Col: 58 Missing end tag (address, li).
-Line: 1 Col: 69 End tag (b) violates step 1, paragraph 3 of the adoption agency algorithm.
+(1,4): expected-doctype-but-got-start-tag
+(1,45): end-tag-too-early
+(1,58): end-tag-too-early
+(1,69): adoption-agency-1.3
 #document
 | <html>
 |   <head>
@@ -1610,7 +1614,8 @@
 #data
 <ul><li><ul></li><li>a</li></ul></li></ul>
 #errors
-XXX: fix me
+(1,4): expected-doctype-but-got-start-tag
+(1,17): unexpected-end-tag
 #document
 | <html>
 |   <head>
@@ -1624,7 +1629,7 @@
 #data
 <frameset><frame><frameset><frame></frameset><noframes></noframes></frameset>
 #errors
-Line: 1 Col: 10 Unexpected start tag (frameset). Expected DOCTYPE.
+(1,10): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -1637,11 +1642,11 @@
 #data
 <h1><table><td><h3></table><h3></h1>
 #errors
-4: Start tag seen without seeing a doctype first. Expected “<!DOCTYPE html>”.
-15: “td” start tag in table body.
-27: Unclosed elements.
-31: Heading cannot be a child of another heading.
-36: End tag “h1” seen but there were unclosed elements.
+(1,4): expected-doctype-but-got-start-tag
+(1,15): unexpected-cell-in-table-body
+(1,27): unexpected-cell-end-tag
+(1,31): unexpected-start-tag
+(1,36): end-tag-too-early
 #document
 | <html>
 |   <head>
@@ -1657,7 +1662,7 @@
 #data
 <table><colgroup><col><colgroup><col><col><col><colgroup><col><col><thead><tr><td></table>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
+(1,7): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -1679,9 +1684,9 @@
 #data
 <table><col><tbody><col><tr><col><td><col></table><col>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 37 Unexpected table cell start tag (td) in the table body phase.
-Line: 1 Col: 55 Unexpected start tag col. Ignored.
+(1,7): expected-doctype-but-got-start-tag
+(1,37): unexpected-cell-in-table-body
+(1,55): unexpected-start-tag-ignored
 #document
 | <html>
 |   <head>
@@ -1705,9 +1710,9 @@
 #data
 <table><colgroup><tbody><colgroup><tr><colgroup><td><colgroup></table><colgroup>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 52 Unexpected table cell start tag (td) in the table body phase.
-Line: 1 Col: 80 Unexpected start tag colgroup. Ignored.
+(1,7): expected-doctype-but-got-start-tag
+(1,52): unexpected-cell-in-table-body
+(1,80): unexpected-start-tag-ignored
 #document
 | <html>
 |   <head>
@@ -1727,90 +1732,91 @@
 #data
 </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>
 #errors
-Line: 1 Col: 9 Unexpected end tag (strong). Expected DOCTYPE.
-Line: 1 Col: 9 Unexpected end tag (strong) after the (implied) root element.
-Line: 1 Col: 13 Unexpected end tag (b) after the (implied) root element.
-Line: 1 Col: 18 Unexpected end tag (em) after the (implied) root element.
-Line: 1 Col: 22 Unexpected end tag (i) after the (implied) root element.
-Line: 1 Col: 26 Unexpected end tag (u) after the (implied) root element.
-Line: 1 Col: 35 Unexpected end tag (strike) after the (implied) root element.
-Line: 1 Col: 39 Unexpected end tag (s) after the (implied) root element.
-Line: 1 Col: 47 Unexpected end tag (blink) after the (implied) root element.
-Line: 1 Col: 52 Unexpected end tag (tt) after the (implied) root element.
-Line: 1 Col: 58 Unexpected end tag (pre) after the (implied) root element.
-Line: 1 Col: 64 Unexpected end tag (big) after the (implied) root element.
-Line: 1 Col: 72 Unexpected end tag (small) after the (implied) root element.
-Line: 1 Col: 79 Unexpected end tag (font) after the (implied) root element.
-Line: 1 Col: 88 Unexpected end tag (select) after the (implied) root element.
-Line: 1 Col: 93 Unexpected end tag (h1) after the (implied) root element.
-Line: 1 Col: 98 Unexpected end tag (h2) after the (implied) root element.
-Line: 1 Col: 103 Unexpected end tag (h3) after the (implied) root element.
-Line: 1 Col: 108 Unexpected end tag (h4) after the (implied) root element.
-Line: 1 Col: 113 Unexpected end tag (h5) after the (implied) root element.
-Line: 1 Col: 118 Unexpected end tag (h6) after the (implied) root element.
-Line: 1 Col: 125 Unexpected end tag (body) after the (implied) root element.
-Line: 1 Col: 130 Unexpected end tag (br). Treated as br element.
-Line: 1 Col: 134 End tag (a) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 140 This element (img) has no end tag.
-Line: 1 Col: 148 Unexpected end tag (title). Ignored.
-Line: 1 Col: 155 Unexpected end tag (span). Ignored.
-Line: 1 Col: 163 Unexpected end tag (style). Ignored.
-Line: 1 Col: 172 Unexpected end tag (script). Ignored.
-Line: 1 Col: 180 Unexpected end tag (table). Ignored.
-Line: 1 Col: 185 Unexpected end tag (th). Ignored.
-Line: 1 Col: 190 Unexpected end tag (td). Ignored.
-Line: 1 Col: 195 Unexpected end tag (tr). Ignored.
-Line: 1 Col: 203 This element (frame) has no end tag.
-Line: 1 Col: 210 This element (area) has no end tag.
-Line: 1 Col: 217 Unexpected end tag (link). Ignored.
-Line: 1 Col: 225 This element (param) has no end tag.
-Line: 1 Col: 230 This element (hr) has no end tag.
-Line: 1 Col: 238 This element (input) has no end tag.
-Line: 1 Col: 244 Unexpected end tag (col). Ignored.
-Line: 1 Col: 251 Unexpected end tag (base). Ignored.
-Line: 1 Col: 258 Unexpected end tag (meta). Ignored.
-Line: 1 Col: 269 This element (basefont) has no end tag.
-Line: 1 Col: 279 This element (bgsound) has no end tag.
-Line: 1 Col: 287 This element (embed) has no end tag.
-Line: 1 Col: 296 This element (spacer) has no end tag.
-Line: 1 Col: 300 Unexpected end tag (p). Ignored.
-Line: 1 Col: 305 End tag (dd) seen too early. Expected other end tag.
-Line: 1 Col: 310 End tag (dt) seen too early. Expected other end tag.
-Line: 1 Col: 320 Unexpected end tag (caption). Ignored.
-Line: 1 Col: 331 Unexpected end tag (colgroup). Ignored.
-Line: 1 Col: 339 Unexpected end tag (tbody). Ignored.
-Line: 1 Col: 347 Unexpected end tag (tfoot). Ignored.
-Line: 1 Col: 355 Unexpected end tag (thead). Ignored.
-Line: 1 Col: 365 End tag (address) seen too early. Expected other end tag.
-Line: 1 Col: 378 End tag (blockquote) seen too early. Expected other end tag.
-Line: 1 Col: 387 End tag (center) seen too early. Expected other end tag.
-Line: 1 Col: 393 Unexpected end tag (dir). Ignored.
-Line: 1 Col: 399 End tag (div) seen too early. Expected other end tag.
-Line: 1 Col: 404 End tag (dl) seen too early. Expected other end tag.
-Line: 1 Col: 415 End tag (fieldset) seen too early. Expected other end tag.
-Line: 1 Col: 425 End tag (listing) seen too early. Expected other end tag.
-Line: 1 Col: 432 End tag (menu) seen too early. Expected other end tag.
-Line: 1 Col: 437 End tag (ol) seen too early. Expected other end tag.
-Line: 1 Col: 442 End tag (ul) seen too early. Expected other end tag.
-Line: 1 Col: 447 End tag (li) seen too early. Expected other end tag.
-Line: 1 Col: 454 End tag (nobr) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 460 This element (wbr) has no end tag.
-Line: 1 Col: 476 End tag (button) seen too early. Expected other end tag.
-Line: 1 Col: 486 End tag (marquee) seen too early. Expected other end tag.
-Line: 1 Col: 495 End tag (object) seen too early. Expected other end tag.
-Line: 1 Col: 513 Unexpected end tag (html). Ignored.
-Line: 1 Col: 513 Unexpected end tag (frameset). Ignored.
-Line: 1 Col: 520 Unexpected end tag (head). Ignored.
-Line: 1 Col: 529 Unexpected end tag (iframe). Ignored.
-Line: 1 Col: 537 This element (image) has no end tag.
-Line: 1 Col: 547 This element (isindex) has no end tag.
-Line: 1 Col: 557 Unexpected end tag (noembed). Ignored.
-Line: 1 Col: 568 Unexpected end tag (noframes). Ignored.
-Line: 1 Col: 579 Unexpected end tag (noscript). Ignored.
-Line: 1 Col: 590 Unexpected end tag (optgroup). Ignored.
-Line: 1 Col: 599 Unexpected end tag (option). Ignored.
-Line: 1 Col: 611 Unexpected end tag (plaintext). Ignored.
-Line: 1 Col: 622 Unexpected end tag (textarea). Ignored.
+(1,9): expected-doctype-but-got-end-tag
+(1,9): unexpected-end-tag-before-html
+(1,13): unexpected-end-tag-before-html
+(1,18): unexpected-end-tag-before-html
+(1,22): unexpected-end-tag-before-html
+(1,26): unexpected-end-tag-before-html
+(1,35): unexpected-end-tag-before-html
+(1,39): unexpected-end-tag-before-html
+(1,47): unexpected-end-tag-before-html
+(1,52): unexpected-end-tag-before-html
+(1,58): unexpected-end-tag-before-html
+(1,64): unexpected-end-tag-before-html
+(1,72): unexpected-end-tag-before-html
+(1,79): unexpected-end-tag-before-html
+(1,88): unexpected-end-tag-before-html
+(1,93): unexpected-end-tag-before-html
+(1,98): unexpected-end-tag-before-html
+(1,103): unexpected-end-tag-before-html
+(1,108): unexpected-end-tag-before-html
+(1,113): unexpected-end-tag-before-html
+(1,118): unexpected-end-tag-before-html
+(1,130): unexpected-end-tag-after-body
+(1,130): unexpected-end-tag-treated-as
+(1,134): unexpected-end-tag
+(1,140): unexpected-end-tag
+(1,148): unexpected-end-tag
+(1,155): unexpected-end-tag
+(1,163): unexpected-end-tag
+(1,172): unexpected-end-tag
+(1,180): unexpected-end-tag
+(1,185): unexpected-end-tag
+(1,190): unexpected-end-tag
+(1,195): unexpected-end-tag
+(1,203): unexpected-end-tag
+(1,210): unexpected-end-tag
+(1,217): unexpected-end-tag
+(1,225): unexpected-end-tag
+(1,230): unexpected-end-tag
+(1,238): unexpected-end-tag
+(1,244): unexpected-end-tag
+(1,251): unexpected-end-tag
+(1,258): unexpected-end-tag
+(1,269): unexpected-end-tag
+(1,279): unexpected-end-tag
+(1,287): unexpected-end-tag
+(1,296): unexpected-end-tag
+(1,300): unexpected-end-tag
+(1,305): unexpected-end-tag
+(1,310): unexpected-end-tag
+(1,320): unexpected-end-tag
+(1,331): unexpected-end-tag
+(1,339): unexpected-end-tag
+(1,347): unexpected-end-tag
+(1,355): unexpected-end-tag
+(1,365): end-tag-too-early
+(1,378): end-tag-too-early
+(1,387): end-tag-too-early
+(1,393): end-tag-too-early
+(1,399): end-tag-too-early
+(1,404): end-tag-too-early
+(1,415): end-tag-too-early
+(1,425): end-tag-too-early
+(1,432): end-tag-too-early
+(1,437): end-tag-too-early
+(1,442): end-tag-too-early
+(1,447): unexpected-end-tag
+(1,454): unexpected-end-tag
+(1,460): unexpected-end-tag
+(1,467): unexpected-end-tag
+(1,476): end-tag-too-early
+(1,486): end-tag-too-early
+(1,495): end-tag-too-early
+(1,513): expected-eof-but-got-end-tag
+(1,513): unexpected-end-tag
+(1,520): unexpected-end-tag
+(1,529): unexpected-end-tag
+(1,537): unexpected-end-tag
+(1,547): unexpected-end-tag
+(1,557): unexpected-end-tag
+(1,568): unexpected-end-tag
+(1,579): unexpected-end-tag
+(1,590): unexpected-end-tag
+(1,599): unexpected-end-tag
+(1,611): unexpected-end-tag
+(1,622): unexpected-end-tag
 #document
 | <html>
 |   <head>
@@ -1821,116 +1827,117 @@
 #data
 <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>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 20 Unexpected end tag (strong) in table context caused voodoo mode.
-Line: 1 Col: 20 End tag (strong) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 24 Unexpected end tag (b) in table context caused voodoo mode.
-Line: 1 Col: 24 End tag (b) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 29 Unexpected end tag (em) in table context caused voodoo mode.
-Line: 1 Col: 29 End tag (em) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 33 Unexpected end tag (i) in table context caused voodoo mode.
-Line: 1 Col: 33 End tag (i) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 37 Unexpected end tag (u) in table context caused voodoo mode.
-Line: 1 Col: 37 End tag (u) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 46 Unexpected end tag (strike) in table context caused voodoo mode.
-Line: 1 Col: 46 End tag (strike) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 50 Unexpected end tag (s) in table context caused voodoo mode.
-Line: 1 Col: 50 End tag (s) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 58 Unexpected end tag (blink) in table context caused voodoo mode.
-Line: 1 Col: 58 Unexpected end tag (blink). Ignored.
-Line: 1 Col: 63 Unexpected end tag (tt) in table context caused voodoo mode.
-Line: 1 Col: 63 End tag (tt) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 69 Unexpected end tag (pre) in table context caused voodoo mode.
-Line: 1 Col: 69 End tag (pre) seen too early. Expected other end tag.
-Line: 1 Col: 75 Unexpected end tag (big) in table context caused voodoo mode.
-Line: 1 Col: 75 End tag (big) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 83 Unexpected end tag (small) in table context caused voodoo mode.
-Line: 1 Col: 83 End tag (small) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 90 Unexpected end tag (font) in table context caused voodoo mode.
-Line: 1 Col: 90 End tag (font) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 99 Unexpected end tag (select) in table context caused voodoo mode.
-Line: 1 Col: 99 Unexpected end tag (select). Ignored.
-Line: 1 Col: 104 Unexpected end tag (h1) in table context caused voodoo mode.
-Line: 1 Col: 104 End tag (h1) seen too early. Expected other end tag.
-Line: 1 Col: 109 Unexpected end tag (h2) in table context caused voodoo mode.
-Line: 1 Col: 109 End tag (h2) seen too early. Expected other end tag.
-Line: 1 Col: 114 Unexpected end tag (h3) in table context caused voodoo mode.
-Line: 1 Col: 114 End tag (h3) seen too early. Expected other end tag.
-Line: 1 Col: 119 Unexpected end tag (h4) in table context caused voodoo mode.
-Line: 1 Col: 119 End tag (h4) seen too early. Expected other end tag.
-Line: 1 Col: 124 Unexpected end tag (h5) in table context caused voodoo mode.
-Line: 1 Col: 124 End tag (h5) seen too early. Expected other end tag.
-Line: 1 Col: 129 Unexpected end tag (h6) in table context caused voodoo mode.
-Line: 1 Col: 129 End tag (h6) seen too early. Expected other end tag.
-Line: 1 Col: 136 Unexpected end tag (body) in the table row phase. Ignored.
-Line: 1 Col: 141 Unexpected end tag (br) in table context caused voodoo mode.
-Line: 1 Col: 141 Unexpected end tag (br). Treated as br element.
-Line: 1 Col: 145 Unexpected end tag (a) in table context caused voodoo mode.
-Line: 1 Col: 145 End tag (a) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 151 Unexpected end tag (img) in table context caused voodoo mode.
-Line: 1 Col: 151 This element (img) has no end tag.
-Line: 1 Col: 159 Unexpected end tag (title) in table context caused voodoo mode.
-Line: 1 Col: 159 Unexpected end tag (title). Ignored.
-Line: 1 Col: 166 Unexpected end tag (span) in table context caused voodoo mode.
-Line: 1 Col: 166 Unexpected end tag (span). Ignored.
-Line: 1 Col: 174 Unexpected end tag (style) in table context caused voodoo mode.
-Line: 1 Col: 174 Unexpected end tag (style). Ignored.
-Line: 1 Col: 183 Unexpected end tag (script) in table context caused voodoo mode.
-Line: 1 Col: 183 Unexpected end tag (script). Ignored.
-Line: 1 Col: 196 Unexpected end tag (th). Ignored.
-Line: 1 Col: 201 Unexpected end tag (td). Ignored.
-Line: 1 Col: 206 Unexpected end tag (tr). Ignored.
-Line: 1 Col: 214 This element (frame) has no end tag.
-Line: 1 Col: 221 This element (area) has no end tag.
-Line: 1 Col: 228 Unexpected end tag (link). Ignored.
-Line: 1 Col: 236 This element (param) has no end tag.
-Line: 1 Col: 241 This element (hr) has no end tag.
-Line: 1 Col: 249 This element (input) has no end tag.
-Line: 1 Col: 255 Unexpected end tag (col). Ignored.
-Line: 1 Col: 262 Unexpected end tag (base). Ignored.
-Line: 1 Col: 269 Unexpected end tag (meta). Ignored.
-Line: 1 Col: 280 This element (basefont) has no end tag.
-Line: 1 Col: 290 This element (bgsound) has no end tag.
-Line: 1 Col: 298 This element (embed) has no end tag.
-Line: 1 Col: 307 This element (spacer) has no end tag.
-Line: 1 Col: 311 Unexpected end tag (p). Ignored.
-Line: 1 Col: 316 End tag (dd) seen too early. Expected other end tag.
-Line: 1 Col: 321 End tag (dt) seen too early. Expected other end tag.
-Line: 1 Col: 331 Unexpected end tag (caption). Ignored.
-Line: 1 Col: 342 Unexpected end tag (colgroup). Ignored.
-Line: 1 Col: 350 Unexpected end tag (tbody). Ignored.
-Line: 1 Col: 358 Unexpected end tag (tfoot). Ignored.
-Line: 1 Col: 366 Unexpected end tag (thead). Ignored.
-Line: 1 Col: 376 End tag (address) seen too early. Expected other end tag.
-Line: 1 Col: 389 End tag (blockquote) seen too early. Expected other end tag.
-Line: 1 Col: 398 End tag (center) seen too early. Expected other end tag.
-Line: 1 Col: 404 Unexpected end tag (dir). Ignored.
-Line: 1 Col: 410 End tag (div) seen too early. Expected other end tag.
-Line: 1 Col: 415 End tag (dl) seen too early. Expected other end tag.
-Line: 1 Col: 426 End tag (fieldset) seen too early. Expected other end tag.
-Line: 1 Col: 436 End tag (listing) seen too early. Expected other end tag.
-Line: 1 Col: 443 End tag (menu) seen too early. Expected other end tag.
-Line: 1 Col: 448 End tag (ol) seen too early. Expected other end tag.
-Line: 1 Col: 453 End tag (ul) seen too early. Expected other end tag.
-Line: 1 Col: 458 End tag (li) seen too early. Expected other end tag.
-Line: 1 Col: 465 End tag (nobr) violates step 1, paragraph 1 of the adoption agency algorithm.
-Line: 1 Col: 471 This element (wbr) has no end tag.
-Line: 1 Col: 487 End tag (button) seen too early. Expected other end tag.
-Line: 1 Col: 497 End tag (marquee) seen too early. Expected other end tag.
-Line: 1 Col: 506 End tag (object) seen too early. Expected other end tag.
-Line: 1 Col: 524 Unexpected end tag (html). Ignored.
-Line: 1 Col: 524 Unexpected end tag (frameset). Ignored.
-Line: 1 Col: 531 Unexpected end tag (head). Ignored.
-Line: 1 Col: 540 Unexpected end tag (iframe). Ignored.
-Line: 1 Col: 548 This element (image) has no end tag.
-Line: 1 Col: 558 This element (isindex) has no end tag.
-Line: 1 Col: 568 Unexpected end tag (noembed). Ignored.
-Line: 1 Col: 579 Unexpected end tag (noframes). Ignored.
-Line: 1 Col: 590 Unexpected end tag (noscript). Ignored.
-Line: 1 Col: 601 Unexpected end tag (optgroup). Ignored.
-Line: 1 Col: 610 Unexpected end tag (option). Ignored.
-Line: 1 Col: 622 Unexpected end tag (plaintext). Ignored.
-Line: 1 Col: 633 Unexpected end tag (textarea). Ignored.
+(1,7): expected-doctype-but-got-start-tag
+(1,20): unexpected-end-tag-implies-table-voodoo
+(1,20): unexpected-end-tag
+(1,24): unexpected-end-tag-implies-table-voodoo
+(1,24): unexpected-end-tag
+(1,29): unexpected-end-tag-implies-table-voodoo
+(1,29): unexpected-end-tag
+(1,33): unexpected-end-tag-implies-table-voodoo
+(1,33): unexpected-end-tag
+(1,37): unexpected-end-tag-implies-table-voodoo
+(1,37): unexpected-end-tag
+(1,46): unexpected-end-tag-implies-table-voodoo
+(1,46): unexpected-end-tag
+(1,50): unexpected-end-tag-implies-table-voodoo
+(1,50): unexpected-end-tag
+(1,58): unexpected-end-tag-implies-table-voodoo
+(1,58): unexpected-end-tag
+(1,63): unexpected-end-tag-implies-table-voodoo
+(1,63): unexpected-end-tag
+(1,69): unexpected-end-tag-implies-table-voodoo
+(1,69): end-tag-too-early
+(1,75): unexpected-end-tag-implies-table-voodoo
+(1,75): unexpected-end-tag
+(1,83): unexpected-end-tag-implies-table-voodoo
+(1,83): unexpected-end-tag
+(1,90): unexpected-end-tag-implies-table-voodoo
+(1,90): unexpected-end-tag
+(1,99): unexpected-end-tag-implies-table-voodoo
+(1,99): unexpected-end-tag
+(1,104): unexpected-end-tag-implies-table-voodoo
+(1,104): end-tag-too-early
+(1,109): unexpected-end-tag-implies-table-voodoo
+(1,109): end-tag-too-early
+(1,114): unexpected-end-tag-implies-table-voodoo
+(1,114): end-tag-too-early
+(1,119): unexpected-end-tag-implies-table-voodoo
+(1,119): end-tag-too-early
+(1,124): unexpected-end-tag-implies-table-voodoo
+(1,124): end-tag-too-early
+(1,129): unexpected-end-tag-implies-table-voodoo
+(1,129): end-tag-too-early
+(1,136): unexpected-end-tag-in-table-row
+(1,141): unexpected-end-tag-implies-table-voodoo
+(1,141): unexpected-end-tag-treated-as
+(1,145): unexpected-end-tag-implies-table-voodoo
+(1,145): unexpected-end-tag
+(1,151): unexpected-end-tag-implies-table-voodoo
+(1,151): unexpected-end-tag
+(1,159): unexpected-end-tag-implies-table-voodoo
+(1,159): unexpected-end-tag
+(1,166): unexpected-end-tag-implies-table-voodoo
+(1,166): unexpected-end-tag
+(1,174): unexpected-end-tag-implies-table-voodoo
+(1,174): unexpected-end-tag
+(1,183): unexpected-end-tag-implies-table-voodoo
+(1,183): unexpected-end-tag
+(1,196): unexpected-end-tag
+(1,201): unexpected-end-tag
+(1,206): unexpected-end-tag
+(1,214): unexpected-end-tag
+(1,221): unexpected-end-tag
+(1,228): unexpected-end-tag
+(1,236): unexpected-end-tag
+(1,241): unexpected-end-tag
+(1,249): unexpected-end-tag
+(1,255): unexpected-end-tag
+(1,262): unexpected-end-tag
+(1,269): unexpected-end-tag
+(1,280): unexpected-end-tag
+(1,290): unexpected-end-tag
+(1,298): unexpected-end-tag
+(1,307): unexpected-end-tag
+(1,311): unexpected-end-tag
+(1,316): unexpected-end-tag
+(1,321): unexpected-end-tag
+(1,331): unexpected-end-tag
+(1,342): unexpected-end-tag
+(1,350): unexpected-end-tag
+(1,358): unexpected-end-tag
+(1,366): unexpected-end-tag
+(1,376): end-tag-too-early
+(1,389): end-tag-too-early
+(1,398): end-tag-too-early
+(1,404): end-tag-too-early
+(1,410): end-tag-too-early
+(1,415): end-tag-too-early
+(1,426): end-tag-too-early
+(1,436): end-tag-too-early
+(1,443): end-tag-too-early
+(1,448): end-tag-too-early
+(1,453): end-tag-too-early
+(1,458): unexpected-end-tag
+(1,465): unexpected-end-tag
+(1,471): unexpected-end-tag
+(1,478): unexpected-end-tag
+(1,487): end-tag-too-early
+(1,497): end-tag-too-early
+(1,506): end-tag-too-early
+(1,524): expected-eof-but-got-end-tag
+(1,524): unexpected-end-tag
+(1,531): unexpected-end-tag
+(1,540): unexpected-end-tag
+(1,548): unexpected-end-tag
+(1,558): unexpected-end-tag
+(1,568): unexpected-end-tag
+(1,579): unexpected-end-tag
+(1,590): unexpected-end-tag
+(1,601): unexpected-end-tag
+(1,610): unexpected-end-tag
+(1,622): unexpected-end-tag
+(1,633): unexpected-end-tag
 #document
 | <html>
 |   <head>
@@ -1944,8 +1951,8 @@
 #data
 <frameset>
 #errors
-Line: 1 Col: 10 Unexpected start tag (frameset). Expected DOCTYPE.
-Line: 1 Col: 10 Expected closing tag. Unexpected end of file.
+(1,10): expected-doctype-but-got-start-tag
+(1,10): eof-in-frameset
 #document
 | <html>
 |   <head>
diff --git a/html/testdata/webkit/tests10.dat b/html/testdata/webkit/tests10.dat
index 4f8df86..3e9a9f1 100644
--- a/html/testdata/webkit/tests10.dat
+++ b/html/testdata/webkit/tests10.dat
@@ -11,7 +11,7 @@
 #data
 <!DOCTYPE html><svg></svg><![CDATA[a]]>
 #errors
-29: Bogus comment
+(1,28) expected-dashes-or-doctype
 #document
 | <!DOCTYPE html>
 | <html>
@@ -33,8 +33,8 @@
 #data
 <!DOCTYPE html><body><select><svg></svg></select>
 #errors
-35: Stray “svg” start tag.
-42: Stray end tag “svg”
+(1,34) unexpected-start-tag-in-select
+(1,40) unexpected-end-tag-in-select
 #document
 | <!DOCTYPE html>
 | <html>
@@ -45,8 +45,8 @@
 #data
 <!DOCTYPE html><body><select><option><svg></svg></option></select>
 #errors
-43: Stray “svg” start tag.
-50: Stray end tag “svg”
+(1,42) unexpected-start-tag-in-select
+(1,48) unexpected-end-tag-in-select
 #document
 | <!DOCTYPE html>
 | <html>
@@ -58,8 +58,7 @@
 #data
 <!DOCTYPE html><body><table><svg></svg></table>
 #errors
-34: Start tag “svg” seen in “table”.
-41: Stray end tag “svg”.
+(1,33) foster-parenting-start-tag
 #document
 | <!DOCTYPE html>
 | <html>
@@ -71,9 +70,7 @@
 #data
 <!DOCTYPE html><body><table><svg><g>foo</g></svg></table>
 #errors
-34: Start tag “svg” seen in “table”.
-46: Stray end tag “g”.
-53: Stray end tag “svg”.
+(1,33) foster-parenting-start-tag
 #document
 | <!DOCTYPE html>
 | <html>
@@ -87,10 +84,7 @@
 #data
 <!DOCTYPE html><body><table><svg><g>foo</g><g>bar</g></svg></table>
 #errors
-34: Start tag “svg” seen in “table”.
-46: Stray end tag “g”.
-58: Stray end tag “g”.
-65: Stray end tag “svg”.
+(1,33) foster-parenting-start-tag
 #document
 | <!DOCTYPE html>
 | <html>
@@ -106,10 +100,7 @@
 #data
 <!DOCTYPE html><body><table><tbody><svg><g>foo</g><g>bar</g></svg></tbody></table>
 #errors
-41: Start tag “svg” seen in “table”.
-53: Stray end tag “g”.
-65: Stray end tag “g”.
-72: Stray end tag “svg”.
+(1,40) foster-parenting-start-tag
 #document
 | <!DOCTYPE html>
 | <html>
@@ -126,10 +117,7 @@
 #data
 <!DOCTYPE html><body><table><tbody><tr><svg><g>foo</g><g>bar</g></svg></tr></tbody></table>
 #errors
-45: Start tag “svg” seen in “table”.
-57: Stray end tag “g”.
-69: Stray end tag “g”.
-76: Stray end tag “svg”.
+(1,44) foster-parenting-start-tag
 #document
 | <!DOCTYPE html>
 | <html>
@@ -203,8 +191,7 @@
 #data
 <!DOCTYPE html><body><table><caption><svg><g>foo</g><g>bar</g><p>baz</table><p>quux
 #errors
-70: HTML start tag “p” in a foreign namespace context.
-81: “table” closed but “caption” was still open.
+(1,65) unexpected-html-element-in-foreign-content
 #document
 | <!DOCTYPE html>
 | <html>
@@ -225,8 +212,8 @@
 #data
 <!DOCTYPE html><body><table><caption><svg><g>foo</g><g>bar</g>baz</table><p>quux
 #errors
-78: “table” closed but “caption” was still open.
-78: Unclosed elements on stack.
+(1,73) unexpected-end-tag
+(1,73) expected-one-end-tag-but-got-another
 #document
 | <!DOCTYPE html>
 | <html>
@@ -246,11 +233,12 @@
 #data
 <!DOCTYPE html><body><table><colgroup><svg><g>foo</g><g>bar</g><p>baz</table><p>quux
 #errors
-44: Start tag “svg” seen in “table”.
-56: Stray end tag “g”.
-68: Stray end tag “g”.
-71: HTML start tag “p” in a foreign namespace context.
-71: Start tag “p” seen in “table”.
+(1,43) foster-parenting-start-tag svg
+(1,66) unexpected HTML-like start tag token in foreign content
+(1,66) foster-parenting-start-tag
+(1,67) foster-parenting-character
+(1,68) foster-parenting-character
+(1,69) foster-parenting-character
 #document
 | <!DOCTYPE html>
 | <html>
@@ -271,13 +259,13 @@
 #data
 <!DOCTYPE html><body><table><tr><td><select><svg><g>foo</g><g>bar</g><p>baz</table><p>quux
 #errors
-50: Stray “svg” start tag.
-54: Stray “g” start tag.
-62: Stray end tag “g”
-66: Stray “g” start tag.
-74: Stray end tag “g”
-77: Stray “p” start tag.
-88: “table” end tag with “select” open.
+(1,49) unexpected-start-tag-in-select
+(1,52) unexpected-start-tag-in-select
+(1,59) unexpected-end-tag-in-select
+(1,62) unexpected-start-tag-in-select
+(1,69) unexpected-end-tag-in-select
+(1,72) unexpected-start-tag-in-select
+(1,83) unexpected-table-element-end-tag-in-select-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -295,14 +283,14 @@
 #data
 <!DOCTYPE html><body><table><select><svg><g>foo</g><g>bar</g><p>baz</table><p>quux
 #errors
-36: Start tag “select” seen in “table”.
-42: Stray “svg” start tag.
-46: Stray “g” start tag.
-54: Stray end tag “g”
-58: Stray “g” start tag.
-66: Stray end tag “g”
-69: Stray “p” start tag.
-80: “table” end tag with “select” open.
+(1,36) unexpected-start-tag-implies-table-voodoo
+(1,41) unexpected-start-tag-in-select
+(1,44) unexpected-start-tag-in-select
+(1,51) unexpected-end-tag-in-select
+(1,54) unexpected-start-tag-in-select
+(1,61) unexpected-end-tag-in-select
+(1,64) unexpected-start-tag-in-select
+(1,75) unexpected-table-element-end-tag-in-select-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -317,8 +305,8 @@
 #data
 <!DOCTYPE html><body></body></html><svg><g>foo</g><g>bar</g><p>baz
 #errors
-41: Stray “svg” start tag.
-68: HTML start tag “p” in a foreign namespace context.
+(1,40) expected-eof-but-got-start-tag
+(1,63) unexpected-html-element-in-foreign-content
 #document
 | <!DOCTYPE html>
 | <html>
@@ -335,8 +323,8 @@
 #data
 <!DOCTYPE html><body></body><svg><g>foo</g><g>bar</g><p>baz
 #errors
-34: Stray “svg” start tag.
-61: HTML start tag “p” in a foreign namespace context.
+(1,33) unexpected-start-tag-after-body
+(1,56) unexpected-html-element-in-foreign-content
 #document
 | <!DOCTYPE html>
 | <html>
@@ -353,14 +341,14 @@
 #data
 <!DOCTYPE html><frameset><svg><g></g><g></g><p><span>
 #errors
-31: Stray “svg” start tag.
-35: Stray “g” start tag.
-40: Stray end tag “g”
-44: Stray “g” start tag.
-49: Stray end tag “g”
-52: Stray “p” start tag.
-58: Stray “span” start tag.
-58: End of file seen and there were open elements.
+(1,30) unexpected-start-tag-in-frameset
+(1,33) unexpected-start-tag-in-frameset
+(1,37) unexpected-end-tag-in-frameset
+(1,40) unexpected-start-tag-in-frameset
+(1,44) unexpected-end-tag-in-frameset
+(1,47) unexpected-start-tag-in-frameset
+(1,53) unexpected-start-tag-in-frameset
+(1,53) eof-in-frameset
 #document
 | <!DOCTYPE html>
 | <html>
@@ -370,13 +358,13 @@
 #data
 <!DOCTYPE html><frameset></frameset><svg><g></g><g></g><p><span>
 #errors
-42: Stray “svg” start tag.
-46: Stray “g” start tag.
-51: Stray end tag “g”
-55: Stray “g” start tag.
-60: Stray end tag “g”
-63: Stray “p” start tag.
-69: Stray “span” start tag.
+(1,41) unexpected-start-tag-after-frameset
+(1,44) unexpected-start-tag-after-frameset
+(1,48) unexpected-end-tag-after-frameset
+(1,51) unexpected-start-tag-after-frameset
+(1,55) unexpected-end-tag-after-frameset
+(1,58) unexpected-start-tag-after-frameset
+(1,64) unexpected-start-tag-after-frameset
 #document
 | <!DOCTYPE html>
 | <html>
@@ -444,6 +432,10 @@
 #data
 <svg></path>
 #errors
+(1,5) expected-doctype-but-got-start-tag
+(1,12) unexpected-end-tag
+(1,12) unexpected-end-tag
+(1,12) expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -453,6 +445,9 @@
 #data
 <div><svg></div>a
 #errors
+(1,5) expected-doctype-but-got-start-tag
+(1,16) unexpected-end-tag
+(1,16) end-tag-too-early
 #document
 | <html>
 |   <head>
@@ -464,6 +459,9 @@
 #data
 <div><svg><path></div>a
 #errors
+(1,5) expected-doctype-but-got-start-tag
+(1,22) unexpected-end-tag
+(1,22) end-tag-too-early
 #document
 | <html>
 |   <head>
@@ -476,6 +474,9 @@
 #data
 <div><svg><path></svg><path>
 #errors
+(1,5) expected-doctype-but-got-start-tag
+(1,22) unexpected-end-tag
+(1,28) expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -488,6 +489,10 @@
 #data
 <div><svg><path><foreignObject><math></div>a
 #errors
+(1,5) expected-doctype-but-got-start-tag
+(1,43) unexpected-end-tag
+(1,43) end-tag-too-early
+(1,44) expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -502,6 +507,9 @@
 #data
 <div><svg><path><foreignObject><p></div>a
 #errors
+(1,5) expected-doctype-but-got-start-tag
+(1,40) end-tag-too-early
+(1,41) expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -516,8 +524,8 @@
 #data
 <!DOCTYPE html><svg><desc><div><svg><ul>a
 #errors
-40: HTML start tag “ul” in a foreign namespace context.
-41: End of file in a foreign namespace context.
+(1,40) unexpected-html-element-in-foreign-content
+(1,41) expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -533,8 +541,8 @@
 #data
 <!DOCTYPE html><svg><desc><svg><ul>a
 #errors
-35: HTML start tag “ul” in a foreign namespace context.
-36: End of file in a foreign namespace context.
+(1,35) unexpected-html-element-in-foreign-content
+(1,36) expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -549,6 +557,7 @@
 #data
 <!DOCTYPE html><p><svg><desc><p>
 #errors
+(1,32) expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -562,6 +571,7 @@
 #data
 <!DOCTYPE html><p><svg><title><p>
 #errors
+(1,33) expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -575,6 +585,9 @@
 #data
 <div><svg><path><foreignObject><p></foreignObject><p>
 #errors
+(1,5) expected-doctype-but-got-start-tag
+(1,50) unexpected-end-tag
+(1,53) expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -589,6 +602,8 @@
 #data
 <math><mi><div><object><div><span></span></div></object></div></mi><mi>
 #errors
+(1,6) expected-doctype-but-got-start-tag
+(1,71) expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -604,6 +619,8 @@
 #data
 <math><mi><svg><foreignObject><div><div></div></div></foreignObject></svg></mi><mi>
 #errors
+(1,6) expected-doctype-but-got-start-tag
+(1,83) expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -619,6 +636,8 @@
 #data
 <svg><script></script><path>
 #errors
+(1,5) expected-doctype-but-got-start-tag
+(1,28) expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -630,6 +649,9 @@
 #data
 <table><svg></svg><tr>
 #errors
+(1,7) expected-doctype-but-got-start-tag
+(1,12) unexpected-start-tag-implies-table-voodoo
+(1,22) eof-in-table
 #document
 | <html>
 |   <head>
@@ -642,6 +664,8 @@
 #data
 <math><mi><mglyph>
 #errors
+(1,6) expected-doctype-but-got-start-tag
+(1,18) expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -653,6 +677,8 @@
 #data
 <math><mi><malignmark>
 #errors
+(1,6) expected-doctype-but-got-start-tag
+(1,22) expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -664,6 +690,8 @@
 #data
 <math><mo><mglyph>
 #errors
+(1,6) expected-doctype-but-got-start-tag
+(1,18) expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -675,6 +703,8 @@
 #data
 <math><mo><malignmark>
 #errors
+(1,6) expected-doctype-but-got-start-tag
+(1,22) expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -686,6 +716,8 @@
 #data
 <math><mn><mglyph>
 #errors
+(1,6) expected-doctype-but-got-start-tag
+(1,18) expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -697,6 +729,8 @@
 #data
 <math><mn><malignmark>
 #errors
+(1,6) expected-doctype-but-got-start-tag
+(1,22) expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -708,6 +742,8 @@
 #data
 <math><ms><mglyph>
 #errors
+(1,6) expected-doctype-but-got-start-tag
+(1,18) expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -719,6 +755,8 @@
 #data
 <math><ms><malignmark>
 #errors
+(1,6) expected-doctype-but-got-start-tag
+(1,22) expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -730,6 +768,8 @@
 #data
 <math><mtext><mglyph>
 #errors
+(1,6) expected-doctype-but-got-start-tag
+(1,21) expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -741,6 +781,8 @@
 #data
 <math><mtext><malignmark>
 #errors
+(1,6) expected-doctype-but-got-start-tag
+(1,25) expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -752,6 +794,8 @@
 #data
 <math><annotation-xml><svg></svg></annotation-xml><mi>
 #errors
+(1,6) expected-doctype-but-got-start-tag
+(1,54) expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -764,6 +808,8 @@
 #data
 <math><annotation-xml><svg><foreignObject><div><math><mi></mi></math><span></span></div></foreignObject><path></path></svg></annotation-xml><mi>
 #errors
+(1,6) expected-doctype-but-got-start-tag
+(1,144) expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -782,6 +828,8 @@
 #data
 <math><annotation-xml><svg><foreignObject><math><mi><svg></svg></mi><mo></mo></math><span></span></foreignObject><path></path></svg></annotation-xml><mi>
 #errors
+(1,6) expected-doctype-but-got-start-tag
+(1,153) expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
diff --git a/html/testdata/webkit/tests11.dat b/html/testdata/webkit/tests11.dat
index 638cde4..faaf97b 100644
--- a/html/testdata/webkit/tests11.dat
+++ b/html/testdata/webkit/tests11.dat
@@ -1,5 +1,5 @@
 #data
-<!DOCTYPE html><body><svg attributeName='' attributeType='' baseFrequency='' baseProfile='' calcMode='' clipPathUnits='' contentScriptType='' contentStyleType='' diffuseConstant='' edgeMode='' externalResourcesRequired='' filterRes='' 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>
+<!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='' xChannelSelector='' yChannelSelector='' zoomAndPan=''></svg>
 #errors
 #document
 | <!DOCTYPE html>
@@ -13,12 +13,8 @@
 |       baseProfile=""
 |       calcMode=""
 |       clipPathUnits=""
-|       contentScriptType=""
-|       contentStyleType=""
 |       diffuseConstant=""
 |       edgeMode=""
-|       externalResourcesRequired=""
-|       filterRes=""
 |       filterUnits=""
 |       glyphRef=""
 |       gradientTransform=""
@@ -65,13 +61,12 @@
 |       targetY=""
 |       textLength=""
 |       viewBox=""
-|       viewTarget=""
 |       xChannelSelector=""
 |       yChannelSelector=""
 |       zoomAndPan=""
 
 #data
-<!DOCTYPE html><BODY><SVG ATTRIBUTENAME='' ATTRIBUTETYPE='' BASEFREQUENCY='' BASEPROFILE='' CALCMODE='' CLIPPATHUNITS='' CONTENTSCRIPTTYPE='' CONTENTSTYLETYPE='' DIFFUSECONSTANT='' EDGEMODE='' EXTERNALRESOURCESREQUIRED='' FILTERRES='' 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>
+<!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='' XCHANNELSELECTOR='' YCHANNELSELECTOR='' ZOOMANDPAN=''></SVG>
 #errors
 #document
 | <!DOCTYPE html>
@@ -85,12 +80,8 @@
 |       baseProfile=""
 |       calcMode=""
 |       clipPathUnits=""
-|       contentScriptType=""
-|       contentStyleType=""
 |       diffuseConstant=""
 |       edgeMode=""
-|       externalResourcesRequired=""
-|       filterRes=""
 |       filterUnits=""
 |       glyphRef=""
 |       gradientTransform=""
@@ -137,13 +128,12 @@
 |       targetY=""
 |       textLength=""
 |       viewBox=""
-|       viewTarget=""
 |       xChannelSelector=""
 |       yChannelSelector=""
 |       zoomAndPan=""
 
 #data
-<!DOCTYPE html><body><svg attributename='' attributetype='' basefrequency='' baseprofile='' calcmode='' clippathunits='' contentscripttype='' contentstyletype='' diffuseconstant='' edgemode='' externalresourcesrequired='' filterres='' 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>
+<!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='' xchannelselector='' ychannelselector='' zoomandpan=''></svg>
 #errors
 #document
 | <!DOCTYPE html>
@@ -157,12 +147,8 @@
 |       baseProfile=""
 |       calcMode=""
 |       clipPathUnits=""
-|       contentScriptType=""
-|       contentStyleType=""
 |       diffuseConstant=""
 |       edgeMode=""
-|       externalResourcesRequired=""
-|       filterRes=""
 |       filterUnits=""
 |       glyphRef=""
 |       gradientTransform=""
@@ -209,13 +195,12 @@
 |       targetY=""
 |       textLength=""
 |       viewBox=""
-|       viewTarget=""
 |       xChannelSelector=""
 |       yChannelSelector=""
 |       zoomAndPan=""
 
 #data
-<!DOCTYPE html><body><math attributeName='' attributeType='' baseFrequency='' baseProfile='' calcMode='' clipPathUnits='' contentScriptType='' contentStyleType='' diffuseConstant='' edgeMode='' externalResourcesRequired='' filterRes='' 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>
+<!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='' xChannelSelector='' yChannelSelector='' zoomAndPan=''></math>
 #errors
 #document
 | <!DOCTYPE html>
@@ -229,12 +214,8 @@
 |       baseprofile=""
 |       calcmode=""
 |       clippathunits=""
-|       contentscripttype=""
-|       contentstyletype=""
 |       diffuseconstant=""
 |       edgemode=""
-|       externalresourcesrequired=""
-|       filterres=""
 |       filterunits=""
 |       glyphref=""
 |       gradienttransform=""
@@ -281,13 +262,12 @@
 |       targety=""
 |       textlength=""
 |       viewbox=""
-|       viewtarget=""
 |       xchannelselector=""
 |       ychannelselector=""
 |       zoomandpan=""
 
 #data
-<!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>
+<!DOCTYPE html><body><svg><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 /><linearGradient /><radialGradient /><textPath /></svg>
 #errors
 #document
 | <!DOCTYPE html>
@@ -295,9 +275,6 @@
 |   <head>
 |   <body>
 |     <svg svg>
-|       <svg altGlyph>
-|       <svg altGlyphDef>
-|       <svg altGlyphItem>
 |       <svg animateColor>
 |       <svg animateMotion>
 |       <svg animateTransform>
@@ -327,13 +304,12 @@
 |       <svg feTile>
 |       <svg feTurbulence>
 |       <svg foreignObject>
-|       <svg glyphRef>
 |       <svg linearGradient>
 |       <svg radialGradient>
 |       <svg textPath>
 
 #data
-<!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>
+<!DOCTYPE html><body><svg><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 /><lineargradient /><radialgradient /><textpath /></svg>
 #errors
 #document
 | <!DOCTYPE html>
@@ -341,9 +317,6 @@
 |   <head>
 |   <body>
 |     <svg svg>
-|       <svg altGlyph>
-|       <svg altGlyphDef>
-|       <svg altGlyphItem>
 |       <svg animateColor>
 |       <svg animateMotion>
 |       <svg animateTransform>
@@ -373,13 +346,12 @@
 |       <svg feTile>
 |       <svg feTurbulence>
 |       <svg foreignObject>
-|       <svg glyphRef>
 |       <svg linearGradient>
 |       <svg radialGradient>
 |       <svg textPath>
 
 #data
-<!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>
+<!DOCTYPE html><BODY><SVG><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 /><LINEARGRADIENT /><RADIALGRADIENT /><TEXTPATH /></SVG>
 #errors
 #document
 | <!DOCTYPE html>
@@ -387,9 +359,6 @@
 |   <head>
 |   <body>
 |     <svg svg>
-|       <svg altGlyph>
-|       <svg altGlyphDef>
-|       <svg altGlyphItem>
 |       <svg animateColor>
 |       <svg animateMotion>
 |       <svg animateTransform>
@@ -419,13 +388,12 @@
 |       <svg feTile>
 |       <svg feTurbulence>
 |       <svg foreignObject>
-|       <svg glyphRef>
 |       <svg linearGradient>
 |       <svg radialGradient>
 |       <svg textPath>
 
 #data
-<!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>
+<!DOCTYPE html><body><math><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 /><linearGradient /><radialGradient /><textPath /></math>
 #errors
 #document
 | <!DOCTYPE html>
@@ -433,9 +401,6 @@
 |   <head>
 |   <body>
 |     <math math>
-|       <math altglyph>
-|       <math altglyphdef>
-|       <math altglyphitem>
 |       <math animatecolor>
 |       <math animatemotion>
 |       <math animatetransform>
@@ -465,7 +430,6 @@
 |       <math fetile>
 |       <math feturbulence>
 |       <math foreignobject>
-|       <math glyphref>
 |       <math lineargradient>
 |       <math radialgradient>
 |       <math textpath>
diff --git a/html/testdata/webkit/tests14.dat b/html/testdata/webkit/tests14.dat
index b8713f8..a08b764 100644
--- a/html/testdata/webkit/tests14.dat
+++ b/html/testdata/webkit/tests14.dat
@@ -22,7 +22,7 @@
 #data
 <!DOCTYPE html><html><html abc:def=gh><xyz:abc></xyz:abc>
 #errors
-15: Unexpected start tag html
+(1,38): non-html-root
 #document
 | <!DOCTYPE html>
 | <html>
@@ -34,7 +34,7 @@
 #data
 <!DOCTYPE html><html xml:lang=bar><html xml:lang=foo>
 #errors
-15: Unexpected start tag html
+(1,53): non-html-root
 #document
 | <!DOCTYPE html>
 | <html>
@@ -55,6 +55,7 @@
 #data
 <!DOCTYPE html><html 123=456><html 789=012>
 #errors
+(1,43): non-html-root
 #document
 | <!DOCTYPE html>
 | <html>
diff --git a/html/testdata/webkit/tests15.dat b/html/testdata/webkit/tests15.dat
index 6ce1c0d..93d06a8 100644
--- a/html/testdata/webkit/tests15.dat
+++ b/html/testdata/webkit/tests15.dat
@@ -1,8 +1,8 @@
 #data
 <!DOCTYPE html><p><b><i><u></p> <p>X
 #errors
-Line: 1 Col: 31 Unexpected end tag (p). Ignored.
-Line: 1 Col: 36 Expected closing tag. Unexpected end of file.
+(1,31): unexpected-end-tag
+(1,36): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -23,9 +23,9 @@
 <p><b><i><u></p>
 <p>X
 #errors
-Line: 1 Col: 3 Unexpected start tag (p). Expected DOCTYPE.
-Line: 1 Col: 16 Unexpected end tag (p). Ignored.
-Line: 2 Col: 4 Expected closing tag. Unexpected end of file.
+(1,3): expected-doctype-but-got-start-tag
+(1,16): unexpected-end-tag
+(2,4): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -45,7 +45,8 @@
 #data
 <!doctype html></html> <head>
 #errors
-Line: 1 Col: 22 Unexpected end tag (html) after the (implied) root element.
+(1,29): expected-eof-but-got-start-tag
+(1,29): unexpected-start-tag-ignored
 #document
 | <!DOCTYPE html>
 | <html>
@@ -56,7 +57,7 @@
 #data
 <!doctype html></body><meta>
 #errors
-Line: 1 Col: 22 Unexpected end tag (body) after the (implied) root element.
+(1,28): unexpected-start-tag-after-body
 #document
 | <!DOCTYPE html>
 | <html>
@@ -67,8 +68,7 @@
 #data
 <html></html><!-- foo -->
 #errors
-Line: 1 Col: 6 Unexpected start tag (html). Expected DOCTYPE.
-Line: 1 Col: 13 Unexpected end tag (html) after the (implied) root element.
+(1,6): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -78,7 +78,7 @@
 #data
 <!doctype html></body><title>X</title>
 #errors
-Line: 1 Col: 22 Unexpected end tag (body) after the (implied) root element.
+(1,29): unexpected-start-tag-after-body
 #document
 | <!DOCTYPE html>
 | <html>
@@ -90,8 +90,9 @@
 #data
 <!doctype html><table> X<meta></table>
 #errors
-Line: 1 Col: 24 Unexpected non-space characters in table context caused voodoo mode.
-Line: 1 Col: 30 Unexpected start tag (meta) in table context caused voodoo mode.
+(1,23): foster-parenting-character
+(1,24): foster-parenting-character
+(1,30): foster-parenting-start-character
 #document
 | <!DOCTYPE html>
 | <html>
@@ -104,7 +105,8 @@
 #data
 <!doctype html><table> x</table>
 #errors
-Line: 1 Col: 24 Unexpected non-space characters in table context caused voodoo mode.
+(1,23): foster-parenting-character
+(1,24): foster-parenting-character
 #document
 | <!DOCTYPE html>
 | <html>
@@ -116,7 +118,9 @@
 #data
 <!doctype html><table> x </table>
 #errors
-Line: 1 Col: 25 Unexpected non-space characters in table context caused voodoo mode.
+(1,23): foster-parenting-character
+(1,24): foster-parenting-character
+(1,25): foster-parenting-character
 #document
 | <!DOCTYPE html>
 | <html>
@@ -128,7 +132,8 @@
 #data
 <!doctype html><table><tr> x</table>
 #errors
-Line: 1 Col: 28 Unexpected non-space characters in table context caused voodoo mode.
+(1,27): foster-parenting-character
+(1,28): foster-parenting-character
 #document
 | <!DOCTYPE html>
 | <html>
@@ -142,7 +147,7 @@
 #data
 <!doctype html><table>X<style> <tr>x </style> </table>
 #errors
-Line: 1 Col: 23 Unexpected non-space characters in table context caused voodoo mode.
+(1,23): foster-parenting-character
 #document
 | <!DOCTYPE html>
 | <html>
@@ -157,8 +162,11 @@
 #data
 <!doctype html><div><table><a>foo</a> <tr><td>bar</td> </tr></table></div>
 #errors
-Line: 1 Col: 30 Unexpected start tag (a) in table context caused voodoo mode.
-Line: 1 Col: 37 Unexpected end tag (a) in table context caused voodoo mode.
+(1,30): foster-parenting-start-tag
+(1,31): foster-parenting-character
+(1,32): foster-parenting-character
+(1,33): foster-parenting-character
+(1,37): foster-parenting-end-tag
 #document
 | <!DOCTYPE html>
 | <html>
@@ -178,14 +186,13 @@
 #data
 <frame></frame></frame><frameset><frame><frameset><frame></frameset><noframes></frameset><noframes>
 #errors
-6: Start tag seen without seeing a doctype first. Expected “<!DOCTYPE html>”.
-13: Stray start tag “frame”.
-21: Stray end tag “frame”.
-29: Stray end tag “frame”.
-39: “frameset” start tag after “body” already open.
-105: End of file seen inside an [R]CDATA element.
-105: End of file seen and there were open elements.
-XXX: These errors are wrong, please fix me!
+(1,7): expected-doctype-but-got-start-tag
+(1,7): unexpected-start-tag-ignored
+(1,15): unexpected-end-tag
+(1,23): unexpected-end-tag
+(1,33): unexpected-start-tag
+(1,99): expected-named-closing-tag-but-got-eof
+(1,99): eof-in-frameset
 #document
 | <html>
 |   <head>
@@ -199,7 +206,8 @@
 #data
 <!DOCTYPE html><object></html>
 #errors
-1: Expected closing tag. Unexpected end of file
+(1,30): expected-body-in-scope
+(1,30): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
diff --git a/html/testdata/webkit/tests17.dat b/html/testdata/webkit/tests17.dat
index 7b555f8..e49bcf0 100644
--- a/html/testdata/webkit/tests17.dat
+++ b/html/testdata/webkit/tests17.dat
@@ -1,6 +1,9 @@
 #data
 <!doctype html><table><tbody><select><tr>
 #errors
+(1,37): unexpected-start-tag-implies-table-voodoo
+(1,41): unexpected-table-element-start-tag-in-select-in-table
+(1,41): eof-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -14,6 +17,9 @@
 #data
 <!doctype html><table><tr><select><td>
 #errors
+(1,34): unexpected-start-tag-implies-table-voodoo
+(1,38): unexpected-table-element-start-tag-in-select-in-table
+(1,38): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -28,6 +34,8 @@
 #data
 <!doctype html><table><tr><td><select><td>
 #errors
+(1,42): unexpected-table-element-start-tag-in-select-in-table
+(1,42): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -43,6 +51,8 @@
 #data
 <!doctype html><table><tr><th><select><td>
 #errors
+(1,42): unexpected-table-element-start-tag-in-select-in-table
+(1,42): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -58,6 +68,8 @@
 #data
 <!doctype html><table><caption><select><tr>
 #errors
+(1,43): unexpected-table-element-start-tag-in-select-in-table
+(1,43): eof-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -72,6 +84,8 @@
 #data
 <!doctype html><select><tr>
 #errors
+(1,27): unexpected-start-tag-in-select
+(1,27): eof-in-select
 #document
 | <!DOCTYPE html>
 | <html>
@@ -82,6 +96,8 @@
 #data
 <!doctype html><select><td>
 #errors
+(1,27): unexpected-start-tag-in-select
+(1,27): eof-in-select
 #document
 | <!DOCTYPE html>
 | <html>
@@ -92,6 +108,8 @@
 #data
 <!doctype html><select><th>
 #errors
+(1,27): unexpected-start-tag-in-select
+(1,27): eof-in-select
 #document
 | <!DOCTYPE html>
 | <html>
@@ -102,6 +120,8 @@
 #data
 <!doctype html><select><tbody>
 #errors
+(1,30): unexpected-start-tag-in-select
+(1,30): eof-in-select
 #document
 | <!DOCTYPE html>
 | <html>
@@ -112,6 +132,8 @@
 #data
 <!doctype html><select><thead>
 #errors
+(1,30): unexpected-start-tag-in-select
+(1,30): eof-in-select
 #document
 | <!DOCTYPE html>
 | <html>
@@ -122,6 +144,8 @@
 #data
 <!doctype html><select><tfoot>
 #errors
+(1,30): unexpected-start-tag-in-select
+(1,30): eof-in-select
 #document
 | <!DOCTYPE html>
 | <html>
@@ -132,6 +156,8 @@
 #data
 <!doctype html><select><caption>
 #errors
+(1,32): unexpected-start-tag-in-select
+(1,32): eof-in-select
 #document
 | <!DOCTYPE html>
 | <html>
diff --git a/html/testdata/webkit/tests18.dat b/html/testdata/webkit/tests18.dat
index 680e1f0..926bccb 100644
--- a/html/testdata/webkit/tests18.dat
+++ b/html/testdata/webkit/tests18.dat
@@ -1,6 +1,7 @@
 #data
 <!doctype html><plaintext></plaintext>
 #errors
+(1,38): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -12,6 +13,20 @@
 #data
 <!doctype html><table><plaintext></plaintext>
 #errors
+(1,33): foster-parenting-start-tag
+(1,34): foster-parenting-character
+(1,35): foster-parenting-character
+(1,36): foster-parenting-character
+(1,37): foster-parenting-character
+(1,38): foster-parenting-character
+(1,39): foster-parenting-character
+(1,40): foster-parenting-character
+(1,41): foster-parenting-character
+(1,42): foster-parenting-character
+(1,43): foster-parenting-character
+(1,44): foster-parenting-character
+(1,45): foster-parenting-character
+(1,45): eof-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -24,6 +39,20 @@
 #data
 <!doctype html><table><tbody><plaintext></plaintext>
 #errors
+(1,40): foster-parenting-start-tag
+(1,41): foster-parenting-character
+(1,41): foster-parenting-character
+(1,41): foster-parenting-character
+(1,41): foster-parenting-character
+(1,41): foster-parenting-character
+(1,41): foster-parenting-character
+(1,41): foster-parenting-character
+(1,41): foster-parenting-character
+(1,41): foster-parenting-character
+(1,41): foster-parenting-character
+(1,41): foster-parenting-character
+(1,41): foster-parenting-character
+(1,52): eof-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -37,20 +66,20 @@
 #data
 <!doctype html><table><tbody><tr><plaintext></plaintext>
 #errors
-#document
-| <!DOCTYPE html>
-| <html>
-|   <head>
-|   <body>
-|     <plaintext>
-|       "</plaintext>"
-|     <table>
-|       <tbody>
-|         <tr>
-
-#data
-<!doctype html><table><tbody><tr><plaintext></plaintext>
-#errors
+(1,44): foster-parenting-start-tag
+(1,45): foster-parenting-character
+(1,46): foster-parenting-character
+(1,47): foster-parenting-character
+(1,48): foster-parenting-character
+(1,49): foster-parenting-character
+(1,50): foster-parenting-character
+(1,51): foster-parenting-character
+(1,52): foster-parenting-character
+(1,53): foster-parenting-character
+(1,54): foster-parenting-character
+(1,55): foster-parenting-character
+(1,56): foster-parenting-character
+(1,56): eof-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -65,6 +94,8 @@
 #data
 <!doctype html><table><td><plaintext></plaintext>
 #errors
+(1,26): unexpected-cell-in-table-body
+(1,49): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -80,6 +111,7 @@
 #data
 <!doctype html><table><caption><plaintext></plaintext>
 #errors
+(1,54): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -93,6 +125,10 @@
 #data
 <!doctype html><table><tr><style></script></style>abc
 #errors
+(1,51): foster-parenting-character
+(1,52): foster-parenting-character
+(1,53): foster-parenting-character
+(1,53): eof-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -108,6 +144,10 @@
 #data
 <!doctype html><table><tr><script></style></script>abc
 #errors
+(1,52): foster-parenting-character
+(1,53): foster-parenting-character
+(1,54): foster-parenting-character
+(1,54): eof-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -123,6 +163,7 @@
 #data
 <!doctype html><table><caption><style></script></style>abc
 #errors
+(1,58): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -137,6 +178,8 @@
 #data
 <!doctype html><table><td><style></script></style>abc
 #errors
+(1,26): unexpected-cell-in-table-body
+(1,53): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -153,6 +196,7 @@
 #data
 <!doctype html><select><script></style></script>abc
 #errors
+(1,51): eof-in-select
 #document
 | <!DOCTYPE html>
 | <html>
@@ -166,6 +210,8 @@
 #data
 <!doctype html><table><select><script></style></script>abc
 #errors
+(1,30): unexpected-start-tag-implies-table-voodoo
+(1,58): eof-in-select
 #document
 | <!DOCTYPE html>
 | <html>
@@ -180,6 +226,8 @@
 #data
 <!doctype html><table><tr><select><script></style></script>abc
 #errors
+(1,34): unexpected-start-tag-implies-table-voodoo
+(1,62): eof-in-select
 #document
 | <!DOCTYPE html>
 | <html>
@@ -196,6 +244,7 @@
 #data
 <!doctype html><frameset></frameset><noframes>abc
 #errors
+(1,49): expected-named-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -219,6 +268,7 @@
 #data
 <!doctype html><frameset></frameset></html><noframes>abc
 #errors
+(1,56): expected-named-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -242,6 +292,7 @@
 #data
 <!doctype html><table><tr></tbody><tfoot>
 #errors
+(1,41): eof-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -255,6 +306,8 @@
 #data
 <!doctype html><table><td><svg></svg>abc<td>
 #errors
+(1,26): unexpected-cell-in-table-body
+(1,44): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
diff --git a/html/testdata/webkit/tests19.dat b/html/testdata/webkit/tests19.dat
index 0d62f5a..2470571 100644
--- a/html/testdata/webkit/tests19.dat
+++ b/html/testdata/webkit/tests19.dat
@@ -227,6 +227,65 @@
 |         <rt>
 
 #data
+<html><ruby>a<rb>b<rt></ruby></html>
+#errors
+(1,6): expected-doctype-but-got-start-tag
+#document
+| <html>
+|   <head>
+|   <body>
+|     <ruby>
+|       "a"
+|       <rb>
+|         "b"
+|       <rt>
+
+#data
+<html><ruby>a<rp>b<rt></ruby></html>
+#errors
+(1,6): expected-doctype-but-got-start-tag
+#document
+| <html>
+|   <head>
+|   <body>
+|     <ruby>
+|       "a"
+|       <rp>
+|         "b"
+|       <rt>
+
+#data
+<html><ruby>a<rt>b<rt></ruby></html>
+#errors
+(1,6): expected-doctype-but-got-start-tag
+#document
+| <html>
+|   <head>
+|   <body>
+|     <ruby>
+|       "a"
+|       <rt>
+|         "b"
+|       <rt>
+
+#data
+<html><ruby>a<rtc>b<rt>c<rb>d</ruby></html>
+#errors
+(1,6): expected-doctype-but-got-start-tag
+#document
+| <html>
+|   <head>
+|   <body>
+|     <ruby>
+|       "a"
+|       <rtc>
+|         "b"
+|         <rt>
+|           "c"
+|       <rb>
+|         "d"
+
+#data
 <!doctype html><math/><foo>
 #errors
 #document
diff --git a/html/testdata/webkit/tests2.dat b/html/testdata/webkit/tests2.dat
index 60d8592..abe8f84 100644
--- a/html/testdata/webkit/tests2.dat
+++ b/html/testdata/webkit/tests2.dat
@@ -11,8 +11,8 @@
 #data
 <textarea>test</div>test
 #errors
-Line: 1 Col: 10 Unexpected start tag (textarea). Expected DOCTYPE.
-Line: 1 Col: 24 Expected closing tag. Unexpected end of file.
+(1,10): expected-doctype-but-got-start-tag
+(1,24): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -23,9 +23,9 @@
 #data
 <table><td>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 11 Unexpected table cell start tag (td) in the table body phase.
-Line: 1 Col: 11 Expected closing tag. Unexpected end of file.
+(1,7): expected-doctype-but-got-start-tag
+(1,11): unexpected-cell-in-table-body
+(1,11): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -38,8 +38,8 @@
 #data
 <table><td>test</tbody></table>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 11 Unexpected table cell start tag (td) in the table body phase.
+(1,7): expected-doctype-but-got-start-tag
+(1,11): unexpected-cell-in-table-body
 #document
 | <html>
 |   <head>
@@ -53,8 +53,8 @@
 #data
 <frame>test
 #errors
-Line: 1 Col: 7 Unexpected start tag (frame). Expected DOCTYPE.
-Line: 1 Col: 7 Unexpected start tag frame. Ignored.
+(1,7): expected-doctype-but-got-start-tag
+(1,7): unexpected-start-tag-ignored
 #document
 | <html>
 |   <head>
@@ -64,8 +64,11 @@
 #data
 <!DOCTYPE html><frameset>test
 #errors
-Line: 1 Col: 29 Unepxected characters in the frameset phase. Characters ignored.
-Line: 1 Col: 29 Expected closing tag. Unexpected end of file.
+(1,29): unexpected-char-in-frameset
+(1,29): unexpected-char-in-frameset
+(1,29): unexpected-char-in-frameset
+(1,29): unexpected-char-in-frameset
+(1,29): eof-in-frameset
 #document
 | <!DOCTYPE html>
 | <html>
@@ -73,10 +76,39 @@
 |   <frameset>
 
 #data
+<!DOCTYPE html><frameset> te st
+#errors
+(1,29): unexpected-char-in-frameset
+(1,29): unexpected-char-in-frameset
+(1,29): unexpected-char-in-frameset
+(1,29): unexpected-char-in-frameset
+(1,29): eof-in-frameset
+#document
+| <!DOCTYPE html>
+| <html>
+|   <head>
+|   <frameset>
+|     "  "
+
+#data
+<!DOCTYPE html><frameset></frameset> te st
+#errors
+(1,29): unexpected-char-after-frameset
+(1,29): unexpected-char-after-frameset
+(1,29): unexpected-char-after-frameset
+(1,29): unexpected-char-after-frameset
+#document
+| <!DOCTYPE html>
+| <html>
+|   <head>
+|   <frameset>
+|   "  "
+
+#data
 <!DOCTYPE html><frameset><!DOCTYPE html>
 #errors
-Line: 1 Col: 40 Unexpected DOCTYPE. Ignored.
-Line: 1 Col: 40 Expected closing tag. Unexpected end of file.
+(1,40): unexpected-doctype
+(1,40): eof-in-frameset
 #document
 | <!DOCTYPE html>
 | <html>
@@ -86,8 +118,8 @@
 #data
 <!DOCTYPE html><font><p><b>test</font>
 #errors
-Line: 1 Col: 38 End tag (font) violates step 1, paragraph 3 of the adoption agency algorithm.
-Line: 1 Col: 38 End tag (font) violates step 1, paragraph 3 of the adoption agency algorithm.
+(1,38): adoption-agency-1.3
+(1,38): adoption-agency-1.3
 #document
 | <!DOCTYPE html>
 | <html>
@@ -102,7 +134,7 @@
 #data
 <!DOCTYPE html><dt><div><dd>
 #errors
-Line: 1 Col: 28 Missing end tag (div, dt).
+(1,28): end-tag-too-early
 #document
 | <!DOCTYPE html>
 | <html>
@@ -115,8 +147,8 @@
 #data
 <script></x
 #errors
-Line: 1 Col: 8 Unexpected start tag (script). Expected DOCTYPE.
-Line: 1 Col: 11 Unexpected end of file. Expected end tag (script).
+(1,8): expected-doctype-but-got-start-tag
+(1,11): expected-named-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -127,9 +159,13 @@
 #data
 <table><plaintext><td>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 18 Unexpected start tag (plaintext) in table context caused voodoo mode.
-Line: 1 Col: 22 Unexpected end of file. Expected table content.
+(1,7): expected-doctype-but-got-start-tag
+(1,18): unexpected-start-tag-implies-table-voodoo
+(1,22): foster-parenting-character-in-table
+(1,22): foster-parenting-character-in-table
+(1,22): foster-parenting-character-in-table
+(1,22): foster-parenting-character-in-table
+(1,22): eof-in-table
 #document
 | <html>
 |   <head>
@@ -141,8 +177,8 @@
 #data
 <plaintext></plaintext>
 #errors
-Line: 1 Col: 11 Unexpected start tag (plaintext). Expected DOCTYPE.
-Line: 1 Col: 23 Expected closing tag. Unexpected end of file.
+(1,11): expected-doctype-but-got-start-tag
+(1,23): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -153,8 +189,11 @@
 #data
 <!DOCTYPE html><table><tr>TEST
 #errors
-Line: 1 Col: 30 Unexpected non-space characters in table context caused voodoo mode.
-Line: 1 Col: 30 Unexpected end of file. Expected table content.
+(1,30): foster-parenting-character-in-table
+(1,30): foster-parenting-character-in-table
+(1,30): foster-parenting-character-in-table
+(1,30): foster-parenting-character-in-table
+(1,30): eof-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -168,8 +207,8 @@
 #data
 <!DOCTYPE html><body t1=1><body t2=2><body t3=3 t4=4>
 #errors
-Line: 1 Col: 37 Unexpected start tag (body).
-Line: 1 Col: 53 Unexpected start tag (body).
+(1,37): unexpected-start-tag
+(1,53): unexpected-start-tag
 #document
 | <!DOCTYPE html>
 | <html>
@@ -183,10 +222,8 @@
 #data
 </b test
 #errors
-Line: 1 Col: 8 Unexpected end of file in attribute name.
-Line: 1 Col: 8 End tag contains unexpected attributes.
-Line: 1 Col: 8 Unexpected end tag (b). Expected DOCTYPE.
-Line: 1 Col: 8 Unexpected end tag (b) after the (implied) root element.
+(1,8): eof-in-attribute-name
+(1,8): expected-doctype-but-got-eof
 #document
 | <html>
 |   <head>
@@ -195,9 +232,10 @@
 #data
 <!DOCTYPE html></b test<b &=&amp>X
 #errors
-Line: 1 Col: 32 Named entity didn't end with ';'.
-Line: 1 Col: 33 End tag contains unexpected attributes.
-Line: 1 Col: 33 Unexpected end tag (b) after the (implied) root element.
+(1,24): invalid-character-in-attribute-name
+(1,32): named-entity-without-semicolon
+(1,33): attributes-in-end-tag
+(1,33): unexpected-end-tag-before-html
 #document
 | <!DOCTYPE html>
 | <html>
@@ -208,8 +246,8 @@
 #data
 <!doctypehtml><scrIPt type=text/x-foobar;baz>X</SCRipt
 #errors
-Line: 1 Col: 9 No space after literal string 'DOCTYPE'.
-Line: 1 Col: 54 Unexpected end of file in the tag name.
+(1,9): need-space-after-doctype
+(1,54): expected-named-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -222,7 +260,7 @@
 #data
 &
 #errors
-Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE.
+(1,1): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -232,8 +270,8 @@
 #data
 &#
 #errors
-Line: 1 Col: 1 Numeric entity expected. Got end of file instead.
-Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE.
+(1,2): expected-numeric-entity
+(1,2): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -243,8 +281,8 @@
 #data
 &#X
 #errors
-Line: 1 Col: 3 Numeric entity expected but none found.
-Line: 1 Col: 3 Unexpected non-space characters. Expected DOCTYPE.
+(1,3): expected-numeric-entity
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -254,8 +292,8 @@
 #data
 &#x
 #errors
-Line: 1 Col: 3 Numeric entity expected but none found.
-Line: 1 Col: 3 Unexpected non-space characters. Expected DOCTYPE.
+(1,3): expected-numeric-entity
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -265,8 +303,8 @@
 #data
 &#45
 #errors
-Line: 1 Col: 4 Numeric entity didn't end with ';'.
-Line: 1 Col: 4 Unexpected non-space characters. Expected DOCTYPE.
+(1,4): numeric-entity-without-semicolon
+(1,4): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -276,8 +314,7 @@
 #data
 &x-test
 #errors
-Line: 1 Col: 1 Named entity expected. Got none.
-Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE.
+(1,2): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -287,7 +324,7 @@
 #data
 <!doctypehtml><p><li>
 #errors
-Line: 1 Col: 9 No space after literal string 'DOCTYPE'.
+(1,9): need-space-after-doctype
 #document
 | <!DOCTYPE html>
 | <html>
@@ -299,7 +336,7 @@
 #data
 <!doctypehtml><p><dt>
 #errors
-Line: 1 Col: 9 No space after literal string 'DOCTYPE'.
+(1,9): need-space-after-doctype
 #document
 | <!DOCTYPE html>
 | <html>
@@ -311,7 +348,7 @@
 #data
 <!doctypehtml><p><dd>
 #errors
-Line: 1 Col: 9 No space after literal string 'DOCTYPE'.
+(1,9): need-space-after-doctype
 #document
 | <!DOCTYPE html>
 | <html>
@@ -323,8 +360,8 @@
 #data
 <!doctypehtml><p><form>
 #errors
-Line: 1 Col: 9 No space after literal string 'DOCTYPE'.
-Line: 1 Col: 23 Expected closing tag. Unexpected end of file.
+(1,9): need-space-after-doctype
+(1,23): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -347,8 +384,8 @@
 #data
 &AMP
 #errors
-Line: 1 Col: 4 Named entity didn't end with ';'.
-Line: 1 Col: 4 Unexpected non-space characters. Expected DOCTYPE.
+(1,4): named-entity-without-semicolon
+(1,4): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -358,8 +395,8 @@
 #data
 &AMp;
 #errors
-Line: 1 Col: 1 Named entity expected. Got none.
-Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE.
+(1,3): expected-named-entity
+(1,3): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -369,7 +406,7 @@
 #data
 <!DOCTYPE html><html><head></head><body><thisISasillyTESTelementNameToMakeSureCrazyTagNamesArePARSEDcorrectLY>
 #errors
-Line: 1 Col: 110 Expected closing tag. Unexpected end of file.
+(1,110): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -380,7 +417,7 @@
 #data
 <!DOCTYPE html>X</body>X
 #errors
-Line: 1 Col: 24 Unexpected non-space characters in the after body phase.
+(1,24): unexpected-char-after-body
 #document
 | <!DOCTYPE html>
 | <html>
@@ -391,7 +428,7 @@
 #data
 <!DOCTYPE html><!-- X
 #errors
-Line: 1 Col: 21 Unexpected end of file in comment.
+(1,21): eof-in-comment
 #document
 | <!DOCTYPE html>
 | <!--  X -->
@@ -402,8 +439,8 @@
 #data
 <!DOCTYPE html><table><caption>test TEST</caption><td>test
 #errors
-Line: 1 Col: 54 Unexpected table cell start tag (td) in the table body phase.
-Line: 1 Col: 58 Expected closing tag. Unexpected end of file.
+(1,54): unexpected-cell-in-table-body
+(1,58): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -420,7 +457,7 @@
 #data
 <!DOCTYPE html><select><option><optgroup>
 #errors
-Line: 1 Col: 41 Expected closing tag. Unexpected end of file.
+(1,41): eof-in-select
 #document
 | <!DOCTYPE html>
 | <html>
@@ -433,8 +470,8 @@
 #data
 <!DOCTYPE html><select><optgroup><option></optgroup><option><select><option>
 #errors
-Line: 1 Col: 68 Unexpected select start tag in the select phase treated as select end tag.
-Line: 1 Col: 76 Expected closing tag. Unexpected end of file.
+(1,68): unexpected-select-in-select
+(1,76): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -449,7 +486,7 @@
 #data
 <!DOCTYPE html><select><optgroup><option><optgroup>
 #errors
-Line: 1 Col: 51 Expected closing tag. Unexpected end of file.
+(1,51): eof-in-select
 #document
 | <!DOCTYPE html>
 | <html>
@@ -498,7 +535,7 @@
 #data
 <!DOCTYPE html><!-- XXX - XXX
 #errors
-Line: 1 Col: 29 Unexpected end of file in comment (-)
+(1,29): eof-in-comment
 #document
 | <!DOCTYPE html>
 | <!--  XXX - XXX -->
@@ -517,28 +554,10 @@
 |   <body>
 
 #data
-<isindex test=x name=x>
-#errors
-Line: 1 Col: 23 Unexpected start tag (isindex). Expected DOCTYPE.
-Line: 1 Col: 23 Unexpected start tag isindex. Don't use it!
-#document
-| <html>
-|   <head>
-|   <body>
-|     <form>
-|       <hr>
-|       <label>
-|         "This is a searchable index. Enter search keywords: "
-|         <input>
-|           name="isindex"
-|           test="x"
-|       <hr>
-
-#data
 test
 test
 #errors
-Line: 2 Col: 4 Unexpected non-space characters. Expected DOCTYPE.
+(2,4): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -591,7 +610,7 @@
  
  
 #errors
-Line: 2 Col: 1 Unexpected End of file. Expected DOCTYPE.
+(2,1): expected-doctype-but-got-eof
 #document
 | <html>
 |   <head>
@@ -626,7 +645,7 @@
 #data
 <!DOCTYPE html><html><body><html id=x>
 #errors
-Line: 1 Col: 38 html needs to be the first start tag.
+(1,38): non-html-root
 #document
 | <!DOCTYPE html>
 | <html>
@@ -637,8 +656,7 @@
 #data
 <!DOCTYPE html>X</body><html id="x">
 #errors
-Line: 1 Col: 36 Unexpected start tag token (html) in the after body phase.
-Line: 1 Col: 36 html needs to be the first start tag.
+(1,36): non-html-root
 #document
 | <!DOCTYPE html>
 | <html>
@@ -650,7 +668,7 @@
 #data
 <!DOCTYPE html><head><html id=x>
 #errors
-Line: 1 Col: 32 html needs to be the first start tag.
+(1,32): non-html-root
 #document
 | <!DOCTYPE html>
 | <html>
@@ -661,7 +679,7 @@
 #data
 <!DOCTYPE html>X</html>X
 #errors
-Line: 1 Col: 24 Unexpected non-space characters in the after body phase.
+(1,24): expected-eof-but-got-char
 #document
 | <!DOCTYPE html>
 | <html>
@@ -682,7 +700,7 @@
 #data
 <!DOCTYPE html>X</html><p>X
 #errors
-Line: 1 Col: 26 Unexpected start tag (p).
+(1,26): expected-eof-but-got-start-tag
 #document
 | <!DOCTYPE html>
 | <html>
@@ -695,9 +713,9 @@
 #data
 <!DOCTYPE html>X<p/x/y/z>
 #errors
-Line: 1 Col: 19 Expected a > after the /.
-Line: 1 Col: 21 Solidus (/) incorrectly placed in tag.
-Line: 1 Col: 23 Solidus (/) incorrectly placed in tag.
+(1,19): unexpected-character-after-solidus-in-tag
+(1,21): unexpected-character-after-solidus-in-tag
+(1,23): unexpected-character-after-solidus-in-tag
 #document
 | <!DOCTYPE html>
 | <html>
@@ -712,7 +730,7 @@
 #data
 <!DOCTYPE html><!--x--
 #errors
-Line: 1 Col: 22 Unexpected end of file in comment (--).
+(1,22): eof-in-comment-double-dash
 #document
 | <!DOCTYPE html>
 | <!-- x -->
@@ -723,7 +741,7 @@
 #data
 <!DOCTYPE html><table><tr><td></p></table>
 #errors
-Line: 1 Col: 34 Unexpected end tag (p). Ignored.
+(1,34): unexpected-end-tag
 #document
 | <!DOCTYPE html>
 | <html>
@@ -738,9 +756,9 @@
 #data
 <!DOCTYPE <!DOCTYPE HTML>><!--<!--x-->-->
 #errors
-Line: 1 Col: 20 Expected space or '>'. Got ''
-Line: 1 Col: 25 Erroneous DOCTYPE.
-Line: 1 Col: 35 Unexpected character in comment found.
+(1,20): expected-space-or-right-bracket-in-doctype
+(1,25): unknown-doctype
+(1,35): unexpected-char-in-comment
 #document
 | <!DOCTYPE <!doctype>
 | <html>
diff --git a/html/testdata/webkit/tests20.dat b/html/testdata/webkit/tests20.dat
index 6bd8256..52c5acd 100644
--- a/html/testdata/webkit/tests20.dat
+++ b/html/testdata/webkit/tests20.dat
@@ -1,6 +1,8 @@
 #data
 <!doctype html><p><button><button>
 #errors
+(1,34): unexpected-start-tag-implies-end-tag
+(1,34): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -13,6 +15,7 @@
 #data
 <!doctype html><p><button><address>
 #errors
+(1,35): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -25,6 +28,7 @@
 #data
 <!doctype html><p><button><blockquote>
 #errors
+(1,38): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -37,6 +41,7 @@
 #data
 <!doctype html><p><button><menu>
 #errors
+(1,32): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -49,6 +54,7 @@
 #data
 <!doctype html><p><button><p>
 #errors
+(1,29): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -61,6 +67,7 @@
 #data
 <!doctype html><p><button><ul>
 #errors
+(1,30): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -73,6 +80,7 @@
 #data
 <!doctype html><p><button><h1>
 #errors
+(1,30): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -85,6 +93,7 @@
 #data
 <!doctype html><p><button><h6>
 #errors
+(1,30): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -97,6 +106,7 @@
 #data
 <!doctype html><p><button><listing>
 #errors
+(1,35): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -109,6 +119,7 @@
 #data
 <!doctype html><p><button><pre>
 #errors
+(1,31): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -121,6 +132,7 @@
 #data
 <!doctype html><p><button><form>
 #errors
+(1,32): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -133,6 +145,7 @@
 #data
 <!doctype html><p><button><li>
 #errors
+(1,30): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -145,6 +158,7 @@
 #data
 <!doctype html><p><button><dd>
 #errors
+(1,30): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -157,6 +171,7 @@
 #data
 <!doctype html><p><button><dt>
 #errors
+(1,30): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -169,6 +184,7 @@
 #data
 <!doctype html><p><button><plaintext>
 #errors
+(1,37): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -181,6 +197,7 @@
 #data
 <!doctype html><p><button><table>
 #errors
+(1,33): eof-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -193,6 +210,7 @@
 #data
 <!doctype html><p><button><hr>
 #errors
+(1,30): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -205,6 +223,8 @@
 #data
 <!doctype html><p><button><xmp>
 #errors
+(1,31): expected-named-closing-tag-but-got-eof
+(1,31): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -217,6 +237,8 @@
 #data
 <!doctype html><p><button></p>
 #errors
+(1,30): unexpected-end-tag
+(1,30): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -229,6 +251,7 @@
 #data
 <!doctype html><address><button></address>a
 #errors
+(1,42): end-tag-too-early
 #document
 | <!DOCTYPE html>
 | <html>
@@ -241,6 +264,7 @@
 #data
 <!doctype html><address><button></address>a
 #errors
+(1,42): end-tag-too-early
 #document
 | <!DOCTYPE html>
 | <html>
@@ -253,6 +277,10 @@
 #data
 <p><table></p>
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,14): unexpected-end-tag-implies-table-voodoo
+(1,14): unexpected-end-tag
+(1,14): eof-in-table
 #document
 | <html>
 |   <head>
@@ -264,6 +292,7 @@
 #data
 <!doctype html><svg>
 #errors
+(1,20): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -274,6 +303,7 @@
 #data
 <!doctype html><p><figcaption>
 #errors
+(1,30): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -285,6 +315,7 @@
 #data
 <!doctype html><p><summary>
 #errors
+(1,27): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -296,6 +327,8 @@
 #data
 <!doctype html><form><table><form>
 #errors
+(1,34): unexpected-form-in-table
+(1,34): eof-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -307,6 +340,9 @@
 #data
 <!doctype html><table><form><form>
 #errors
+(1,28): unexpected-form-in-table
+(1,34): unexpected-form-in-table
+(1,34): eof-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -318,6 +354,8 @@
 #data
 <!doctype html><table><form></table><form>
 #errors
+(1,28): unexpected-form-in-table
+(1,42): unexpected-start-tag
 #document
 | <!DOCTYPE html>
 | <html>
@@ -329,6 +367,7 @@
 #data
 <!doctype html><svg><foreignObject><p>
 #errors
+(1,38): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -341,6 +380,7 @@
 #data
 <!doctype html><svg><title>abc
 #errors
+(1,30): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -353,6 +393,8 @@
 #data
 <option><span><option>
 #errors
+(1,8): expected-doctype-but-got-start-tag
+(1,22): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -364,6 +406,8 @@
 #data
 <option><option>
 #errors
+(1,8): expected-doctype-but-got-start-tag
+(1,16): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -374,6 +418,9 @@
 #data
 <math><annotation-xml><div>
 #errors
+(1,6): expected-doctype-but-got-start-tag
+(1,27): unexpected-html-element-in-foreign-content
+(1,27): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -385,6 +432,9 @@
 #data
 <math><annotation-xml encoding="application/svg+xml"><div>
 #errors
+(1,6): expected-doctype-but-got-start-tag
+(1,58): unexpected-html-element-in-foreign-content
+(1,58): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -397,6 +447,8 @@
 #data
 <math><annotation-xml encoding="application/xhtml+xml"><div>
 #errors
+(1,6): expected-doctype-but-got-start-tag
+(1,60): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -409,6 +461,8 @@
 #data
 <math><annotation-xml encoding="aPPlication/xhtmL+xMl"><div>
 #errors
+(1,6): expected-doctype-but-got-start-tag
+(1,60): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -421,6 +475,8 @@
 #data
 <math><annotation-xml encoding="text/html"><div>
 #errors
+(1,6): expected-doctype-but-got-start-tag
+(1,48): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -433,6 +489,8 @@
 #data
 <math><annotation-xml encoding="Text/htmL"><div>
 #errors
+(1,6): expected-doctype-but-got-start-tag
+(1,48): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -445,6 +503,9 @@
 #data
 <math><annotation-xml encoding=" text/html "><div>
 #errors
+(1,6): expected-doctype-but-got-start-tag
+(1,50): unexpected-html-element-in-foreign-content
+(1,50): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
diff --git a/html/testdata/webkit/tests21.dat b/html/testdata/webkit/tests21.dat
index 1260ec0..d384a55 100644
--- a/html/testdata/webkit/tests21.dat
+++ b/html/testdata/webkit/tests21.dat
@@ -1,6 +1,8 @@
 #data
 <svg><![CDATA[foo]]>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,20): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -11,6 +13,8 @@
 #data
 <math><![CDATA[foo]]>
 #errors
+(1,6): expected-doctype-but-got-start-tag
+(1,21): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -21,6 +25,9 @@
 #data
 <div><![CDATA[foo]]>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,7): expected-dashes-or-doctype
+(1,20): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -31,6 +38,8 @@
 #data
 <svg><![CDATA[foo
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,17): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -41,6 +50,8 @@
 #data
 <svg><![CDATA[foo
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,17): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -51,6 +62,8 @@
 #data
 <svg><![CDATA[
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,14): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -60,6 +73,8 @@
 #data
 <svg><![CDATA[]]>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,17): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -69,6 +84,8 @@
 #data
 <svg><![CDATA[]] >]]>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,21): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -79,6 +96,8 @@
 #data
 <svg><![CDATA[]] >]]>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,21): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -89,6 +108,8 @@
 #data
 <svg><![CDATA[]]
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,16): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -99,6 +120,8 @@
 #data
 <svg><![CDATA[]
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,15): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -109,6 +132,8 @@
 #data
 <svg><![CDATA[]>a
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,17): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -117,8 +142,47 @@
 |       "]>a"
 
 #data
+<!DOCTYPE html><svg><![CDATA[foo]]]>
+#errors
+(1,36): expected-closing-tag-but-got-eof
+#document
+| <!DOCTYPE html>
+| <html>
+|   <head>
+|   <body>
+|     <svg svg>
+|       "foo]"
+
+#data
+<!DOCTYPE html><svg><![CDATA[foo]]]]>
+#errors
+(1,37): expected-closing-tag-but-got-eof
+#document
+| <!DOCTYPE html>
+| <html>
+|   <head>
+|   <body>
+|     <svg svg>
+|       "foo]]"
+
+#data
+<!DOCTYPE html><svg><![CDATA[foo]]]]]>
+#errors
+(1,38): expected-closing-tag-but-got-eof
+#document
+| <!DOCTYPE html>
+| <html>
+|   <head>
+|   <body>
+|     <svg svg>
+|       "foo]]]"
+
+#data
 <svg><foreignObject><div><![CDATA[foo]]>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,27): expected-dashes-or-doctype
+(1,40): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -131,6 +195,8 @@
 #data
 <svg><![CDATA[<svg>]]>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,22): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -141,6 +207,8 @@
 #data
 <svg><![CDATA[</svg>a]]>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,24): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -151,6 +219,8 @@
 #data
 <svg><![CDATA[<svg>a
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,20): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -161,6 +231,8 @@
 #data
 <svg><![CDATA[</svg>a
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,21): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -171,6 +243,8 @@
 #data
 <svg><![CDATA[<svg>]]><path>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,28): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -182,6 +256,10 @@
 #data
 <svg><![CDATA[<svg>]]></path>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,29): unexpected-end-tag
+(1,29): unexpected-end-tag
+(1,29): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -192,6 +270,8 @@
 #data
 <svg><![CDATA[<svg>]]><!--path-->
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,33): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -203,6 +283,8 @@
 #data
 <svg><![CDATA[<svg>]]>path
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,26): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -213,6 +295,8 @@
 #data
 <svg><![CDATA[<!--svg-->]]>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,27): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
diff --git a/html/testdata/webkit/tests22.dat b/html/testdata/webkit/tests22.dat
index aab27b2..31e6d9e 100644
--- a/html/testdata/webkit/tests22.dat
+++ b/html/testdata/webkit/tests22.dat
@@ -1,6 +1,9 @@
 #data
 <a><b><big><em><strong><div>X</a>
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,33): adoption-agency-1.3
+(1,33): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -20,6 +23,16 @@
 #data
 <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>
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,91): adoption-agency-1.3
+(1,91): adoption-agency-1.3
+(1,91): adoption-agency-1.3
+(1,91): adoption-agency-1.3
+(1,91): adoption-agency-1.3
+(1,91): adoption-agency-1.3
+(1,91): adoption-agency-1.3
+(1,91): adoption-agency-1.3
+(1,91): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -56,6 +69,16 @@
 #data
 <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>
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,101): adoption-agency-1.3
+(1,101): adoption-agency-1.3
+(1,101): adoption-agency-1.3
+(1,101): adoption-agency-1.3
+(1,101): adoption-agency-1.3
+(1,101): adoption-agency-1.3
+(1,101): adoption-agency-1.3
+(1,101): adoption-agency-1.3
+(1,101): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -94,6 +117,16 @@
 #data
 <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>
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,112): adoption-agency-1.3
+(1,112): adoption-agency-1.3
+(1,112): adoption-agency-1.3
+(1,112): adoption-agency-1.3
+(1,112): adoption-agency-1.3
+(1,112): adoption-agency-1.3
+(1,112): adoption-agency-1.3
+(1,112): adoption-agency-1.3
+(1,112): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -134,9 +167,9 @@
 #data
 <cite><b><cite><i><cite><i><cite><i><div>X</b>TEST
 #errors
-Line: 1 Col: 6 Unexpected start tag (cite). Expected DOCTYPE.
-Line: 1 Col: 46 End tag (b) violates step 1, paragraph 3 of the adoption agency algorithm.
-Line: 1 Col: 50 Expected closing tag. Unexpected end of file.
+(1,6): expected-doctype-but-got-start-tag
+(1,46): adoption-agency-1.3
+(1,50): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
diff --git a/html/testdata/webkit/tests23.dat b/html/testdata/webkit/tests23.dat
index 34d2a73..49e4a4a 100644
--- a/html/testdata/webkit/tests23.dat
+++ b/html/testdata/webkit/tests23.dat
@@ -1,9 +1,9 @@
 #data
 <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
 #errors
-3: Start tag seen without seeing a doctype first. Expected “<!DOCTYPE html>”.
-116: Unclosed elements.
-117: End of file seen and there were open elements.
+(1,3): expected-doctype-but-got-start-tag
+(1,116): unexpected-end-tag
+(1,117): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -41,6 +41,9 @@
 #data
 <p><font size=4><font size=4><font size=4><font size=4><p>X
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,58): unexpected-end-tag
+(1,59): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -66,6 +69,9 @@
 #data
 <p><font size=4><font size=4><font size=4><font size="5"><font size=4><p>X
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,73): unexpected-end-tag
+(1,74): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -95,6 +101,9 @@
 #data
 <p><font size=4 id=a><font size=4 id=b><font size=4><font size=4><p>X
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,68): unexpected-end-tag
+(1,69): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -126,6 +135,10 @@
 #data
 <p><b id=a><b id=a><b id=a><b><object><b id=a><b id=a>X</object><p>Y
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,64): end-tag-too-early
+(1,67): unexpected-end-tag
+(1,68): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
diff --git a/html/testdata/webkit/tests26.dat b/html/testdata/webkit/tests26.dat
index fae11ff..8964624 100644
--- a/html/testdata/webkit/tests26.dat
+++ b/html/testdata/webkit/tests26.dat
@@ -1,6 +1,16 @@
 #data
 <!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>
 #errors
+(1,47): unexpected-start-tag-implies-end-tag
+(1,51): adoption-agency-1.3
+(1,74): unexpected-start-tag-implies-end-tag
+(1,74): adoption-agency-1.3
+(1,81): unexpected-start-tag-implies-end-tag
+(1,85): adoption-agency-1.3
+(1,108): unexpected-start-tag-implies-end-tag
+(1,108): adoption-agency-1.3
+(1,115): unexpected-start-tag-implies-end-tag
+(1,119): adoption-agency-1.3
 #document
 | <!DOCTYPE html>
 | <html>
@@ -33,6 +43,13 @@
 #data
 <!DOCTYPE html><body><b><nobr>1<nobr></b><i><nobr>2<nobr></i>3
 #errors
+(1,37): unexpected-start-tag-implies-end-tag
+(1,41): adoption-agency-1.3
+(1,50): unexpected-start-tag-implies-end-tag
+(1,50): adoption-agency-1.3
+(1,57): unexpected-start-tag-implies-end-tag
+(1,61): adoption-agency-1.3
+(1,62): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -54,6 +71,20 @@
 #data
 <!DOCTYPE html><body><b><nobr>1<table><nobr></b><i><nobr>2<nobr></i>3
 #errors
+(1,44): foster-parenting-start-tag
+(1,48): foster-parenting-end-tag
+(1,48): adoption-agency-1.3
+(1,51): foster-parenting-start-tag
+(1,57): foster-parenting-start-tag
+(1,57): nobr-already-in-scope
+(1,57): adoption-agency-1.2
+(1,58): foster-parenting-character
+(1,64): foster-parenting-start-tag
+(1,64): nobr-already-in-scope
+(1,68): foster-parenting-end-tag
+(1,68): adoption-agency-1.2
+(1,69): foster-parenting-character
+(1,69): eof-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -75,6 +106,12 @@
 #data
 <!DOCTYPE html><body><b><nobr>1<table><tr><td><nobr></b><i><nobr>2<nobr></i>3
 #errors
+(1,56): unexpected-end-tag
+(1,65): unexpected-start-tag-implies-end-tag
+(1,65): adoption-agency-1.3
+(1,72): unexpected-start-tag-implies-end-tag
+(1,76): adoption-agency-1.3
+(1,77): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -99,6 +136,15 @@
 #data
 <!DOCTYPE html><body><b><nobr>1<div><nobr></b><i><nobr>2<nobr></i>3
 #errors
+(1,42): unexpected-start-tag-implies-end-tag
+(1,42): adoption-agency-1.3
+(1,46): adoption-agency-1.3
+(1,46): adoption-agency-1.3
+(1,55): unexpected-start-tag-implies-end-tag
+(1,55): adoption-agency-1.3
+(1,62): unexpected-start-tag-implies-end-tag
+(1,66): adoption-agency-1.3
+(1,67): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -123,6 +169,13 @@
 #data
 <!DOCTYPE html><body><b><nobr>1<nobr></b><div><i><nobr>2<nobr></i>3
 #errors
+(1,37): unexpected-start-tag-implies-end-tag
+(1,41): adoption-agency-1.3
+(1,55): unexpected-start-tag-implies-end-tag
+(1,55): adoption-agency-1.3
+(1,62): unexpected-start-tag-implies-end-tag
+(1,66): adoption-agency-1.3
+(1,67): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -145,6 +198,11 @@
 #data
 <!DOCTYPE html><body><b><nobr>1<nobr><ins></b><i><nobr>
 #errors
+(1,37): unexpected-start-tag-implies-end-tag
+(1,46): adoption-agency-1.3
+(1,55): unexpected-start-tag-implies-end-tag
+(1,55): adoption-agency-1.3
+(1,55): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -163,6 +221,10 @@
 #data
 <!DOCTYPE html><body><b><nobr>1<ins><nobr></b><i>2
 #errors
+(1,42): unexpected-start-tag-implies-end-tag
+(1,42): adoption-agency-1.3
+(1,46): adoption-agency-1.3
+(1,50): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -180,6 +242,10 @@
 #data
 <!DOCTYPE html><body><b>1<nobr></b><i><nobr>2</i>
 #errors
+(1,35): adoption-agency-1.3
+(1,44): unexpected-start-tag-implies-end-tag
+(1,44): adoption-agency-1.3
+(1,49): adoption-agency-1.3
 #document
 | <!DOCTYPE html>
 | <html>
@@ -198,6 +264,11 @@
 <p><code x</code></p>
 
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,11): invalid-character-in-attribute-name
+(1,12): unexpected-character-after-solidus-in-tag
+(1,21): unexpected-end-tag
+(2,0): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -215,11 +286,8 @@
 #data
 <!DOCTYPE html><svg><foreignObject><p><i></p>a
 #errors
-45: End tag “p” seen, but there were open elements.
-41: Unclosed element “i”.
-46: End of file seen and there were open elements.
-35: Unclosed element “foreignObject”.
-20: Unclosed element “svg”.
+(1,45): unexpected-end-tag
+(1,46): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -235,12 +303,8 @@
 #data
 <!DOCTYPE html><table><tr><td><svg><foreignObject><p><i></p>a
 #errors
-56: End tag “p” seen, but there were open elements.
-52: Unclosed element “i”.
-57: End of file seen and there were open elements.
-46: Unclosed element “foreignObject”.
-31: Unclosed element “svg”.
-22: Unclosed element “table”.
+(1,60): unexpected-end-tag
+(1,61): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -260,9 +324,8 @@
 #data
 <!DOCTYPE html><math><mtext><p><i></p>a
 #errors
-38: End tag “p” seen, but there were open elements.
-34: Unclosed element “i”.
-39: End of file in a foreign namespace context.
+(1,38): unexpected-end-tag
+(1,39): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -278,9 +341,8 @@
 #data
 <!DOCTYPE html><table><tr><td><math><mtext><p><i></p>a
 #errors
-53: End tag “p” seen, but there were open elements.
-49: Unclosed element “i”.
-54: End of file in a foreign namespace context.
+(1,53): unexpected-end-tag
+(1,54): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -300,9 +362,8 @@
 #data
 <!DOCTYPE html><body><div><!/div>a
 #errors
-29: Bogus comment.
-34: End of file seen and there were open elements.
-26: Unclosed element “div”.
+(1,28): expected-dashes-or-doctype
+(1,34): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -311,3 +372,17 @@
 |     <div>
 |       <!-- /div -->
 |       "a"
+
+#data
+<button><p><button>
+#errors
+Line 1 Col 8 Unexpected start tag (button). Expected DOCTYPE.
+Line 1 Col 19 Unexpected start tag (button) implies end tag (button).
+Line 1 Col 19 Expected closing tag. Unexpected end of file.
+#document
+| <html>
+|   <head>
+|   <body>
+|     <button>
+|       <p>
+|     <button>
diff --git a/html/testdata/webkit/tests3.dat b/html/testdata/webkit/tests3.dat
index 38dc501..c7583d9 100644
--- a/html/testdata/webkit/tests3.dat
+++ b/html/testdata/webkit/tests3.dat
@@ -1,8 +1,8 @@
 #data
 <head></head><style></style>
 #errors
-Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.
-Line: 1 Col: 20 Unexpected start tag (style) that can be in head. Moved.
+(1,6): expected-doctype-but-got-start-tag
+(1,20): unexpected-start-tag-out-of-my-head
 #document
 | <html>
 |   <head>
@@ -12,8 +12,8 @@
 #data
 <head></head><script></script>
 #errors
-Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.
-Line: 1 Col: 21 Unexpected start tag (script) that can be in head. Moved.
+(1,6): expected-doctype-but-got-start-tag
+(1,21): unexpected-start-tag-out-of-my-head
 #document
 | <html>
 |   <head>
@@ -23,8 +23,9 @@
 #data
 <head></head><!-- --><style></style><!-- --><script></script>
 #errors
-Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.
-Line: 1 Col: 28 Unexpected start tag (style) that can be in head. Moved.
+(1,6): expected-doctype-but-got-start-tag
+(1,28): unexpected-start-tag-out-of-my-head
+(1,52): unexpected-start-tag-out-of-my-head
 #document
 | <html>
 |   <head>
@@ -37,7 +38,7 @@
 #data
 <head></head><!-- -->x<style></style><!-- --><script></script>
 #errors
-Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.
+(1,6): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -131,7 +132,7 @@
 <!DOCTYPE html><html><head></head><body><pre>x<div>
 y</pre></body></html>
 #errors
-Line: 2 Col: 7 End tag (pre) seen too early. Expected other end tag.
+(2,7): end-tag-too-early
 #document
 | <!DOCTYPE html>
 | <html>
@@ -158,7 +159,7 @@
 #data
 <!DOCTYPE html><HTML><META><HEAD></HEAD></HTML>
 #errors
-Line: 1 Col: 33 Unexpected start tag head in existing head. Ignored.
+(1,33): two-heads-are-not-better-than-one
 #document
 | <!DOCTYPE html>
 | <html>
@@ -169,7 +170,7 @@
 #data
 <!DOCTYPE html><HTML><HEAD><head></HEAD></HTML>
 #errors
-Line: 1 Col: 33 Unexpected start tag head in existing head. Ignored.
+(1,33): two-heads-are-not-better-than-one
 #document
 | <!DOCTYPE html>
 | <html>
@@ -179,8 +180,8 @@
 #data
 <textarea>foo<span>bar</span><i>baz
 #errors
-Line: 1 Col: 10 Unexpected start tag (textarea). Expected DOCTYPE.
-Line: 1 Col: 35 Expected closing tag. Unexpected end of file.
+(1,10): expected-doctype-but-got-start-tag
+(1,35): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -191,8 +192,8 @@
 #data
 <title>foo<span>bar</em><i>baz
 #errors
-Line: 1 Col: 7 Unexpected start tag (title). Expected DOCTYPE.
-Line: 1 Col: 30 Unexpected end of file. Expected end tag (title).
+(1,7): expected-doctype-but-got-start-tag
+(1,30): expected-named-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -240,7 +241,7 @@
 #data
 <!DOCTYPE html><html><head></head><body><ul><li><div><p><li></ul></body></html>
 #errors
-Line: 1 Col: 60 Missing end tag (div, li).
+(1,60): end-tag-too-early
 #document
 | <!DOCTYPE html>
 | <html>
@@ -255,9 +256,9 @@
 #data
 <!doctype html><nobr><nobr><nobr>
 #errors
-Line: 1 Col: 27 Unexpected start tag (nobr) implies end tag (nobr).
-Line: 1 Col: 33 Unexpected start tag (nobr) implies end tag (nobr).
-Line: 1 Col: 33 Expected closing tag. Unexpected end of file.
+(1,27): unexpected-start-tag-implies-end-tag
+(1,33): unexpected-start-tag-implies-end-tag
+(1,33): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -270,8 +271,8 @@
 #data
 <!doctype html><nobr><nobr></nobr><nobr>
 #errors
-Line: 1 Col: 27 Unexpected start tag (nobr) implies end tag (nobr).
-Line: 1 Col: 40 Expected closing tag. Unexpected end of file.
+(1,27): unexpected-start-tag-implies-end-tag
+(1,40): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -284,7 +285,6 @@
 #data
 <!doctype html><html><body><p><table></table></body></html>
 #errors
-Not known
 #document
 | <!DOCTYPE html>
 | <html>
@@ -296,7 +296,7 @@
 #data
 <p><table></table>
 #errors
-Not known
+(1,3): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
diff --git a/html/testdata/webkit/tests4.dat b/html/testdata/webkit/tests4.dat
index 3c50632..0a6174c 100644
--- a/html/testdata/webkit/tests4.dat
+++ b/html/testdata/webkit/tests4.dat
@@ -41,7 +41,6 @@
 #data
 setting html's innerHTML
 #errors
-Line: 1 Col: 24 Unexpected EOF in inner html mode.
 #document-fragment
 html
 #document
diff --git a/html/testdata/webkit/tests6.dat b/html/testdata/webkit/tests6.dat
index f28ece4..d774fc2 100644
--- a/html/testdata/webkit/tests6.dat
+++ b/html/testdata/webkit/tests6.dat
@@ -1,7 +1,7 @@
 #data
 <!doctype html></head> <head>
 #errors
-Line: 1 Col: 29 Unexpected start tag head. Ignored.
+(1,29): unexpected-start-tag
 #document
 | <!DOCTYPE html>
 | <html>
@@ -12,8 +12,8 @@
 #data
 <!doctype html><form><div></form><div>
 #errors
-33: End tag "form" seen but there were unclosed elements.
-38: End of file seen and there were open elements.
+(1,33): end-tag-too-early-ignored
+(1,38): expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -48,9 +48,9 @@
 #data
 <!doctype>
 #errors
-Line: 1 Col: 9 No space after literal string 'DOCTYPE'.
-Line: 1 Col: 10 Unexpected > character. Expected DOCTYPE name.
-Line: 1 Col: 10 Erroneous DOCTYPE.
+(1,9): need-space-after-doctype
+(1,10): expected-doctype-name-but-got-right-bracket
+(1,10): unknown-doctype
 #document
 | <!DOCTYPE >
 | <html>
@@ -60,8 +60,8 @@
 #data
 <!---x
 #errors
-Line: 1 Col: 6 Unexpected end of file in comment.
-Line: 1 Col: 6 Unexpected End of file. Expected DOCTYPE.
+(1,6): eof-in-comment
+(1,6): expected-doctype-but-got-eof
 #document
 | <!-- -x -->
 | <html>
@@ -72,8 +72,8 @@
 <body>
 <div>
 #errors
-Line: 1 Col: 6 Unexpected start tag (body).
-Line: 2 Col: 5 Expected closing tag. Unexpected end of file.
+(1,6): unexpected-start-tag
+(2,5): expected-closing-tag-but-got-eof
 #document-fragment
 div
 #document
@@ -85,8 +85,10 @@
 <frameset></frameset>
 foo
 #errors
-Line: 1 Col: 10 Unexpected start tag (frameset). Expected DOCTYPE.
-Line: 2 Col: 3 Unexpected non-space characters in the after frameset phase. Ignored.
+(1,10): expected-doctype-but-got-start-tag
+(2,1): unexpected-char-after-frameset
+(2,2): unexpected-char-after-frameset
+(2,3): unexpected-char-after-frameset
 #document
 | <html>
 |   <head>
@@ -98,8 +100,8 @@
 <frameset></frameset>
 <noframes>
 #errors
-Line: 1 Col: 10 Unexpected start tag (frameset). Expected DOCTYPE.
-Line: 2 Col: 10 Expected closing tag. Unexpected end of file.
+(1,10): expected-doctype-but-got-start-tag
+(2,10): expected-named-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -112,8 +114,8 @@
 <frameset></frameset>
 <div>
 #errors
-Line: 1 Col: 10 Unexpected start tag (frameset). Expected DOCTYPE.
-Line: 2 Col: 5 Unexpected start tag (div) in the after frameset phase. Ignored.
+(1,10): expected-doctype-but-got-start-tag
+(2,5): unexpected-start-tag-after-frameset
 #document
 | <html>
 |   <head>
@@ -125,7 +127,7 @@
 <frameset></frameset>
 </html>
 #errors
-Line: 1 Col: 10 Unexpected start tag (frameset). Expected DOCTYPE.
+(1,10): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -137,8 +139,8 @@
 <frameset></frameset>
 </div>
 #errors
-Line: 1 Col: 10 Unexpected start tag (frameset). Expected DOCTYPE.
-Line: 2 Col: 6 Unexpected end tag (div) in the after frameset phase. Ignored.
+(1,10): expected-doctype-but-got-start-tag
+(2,6): unexpected-end-tag-after-frameset
 #document
 | <html>
 |   <head>
@@ -149,9 +151,9 @@
 #data
 <form><form>
 #errors
-Line: 1 Col: 6 Unexpected start tag (form). Expected DOCTYPE.
-Line: 1 Col: 12 Unexpected start tag (form).
-Line: 1 Col: 12 Expected closing tag. Unexpected end of file.
+(1,6): expected-doctype-but-got-start-tag
+(1,12): unexpected-start-tag
+(1,12): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -161,9 +163,9 @@
 #data
 <button><button>
 #errors
-Line: 1 Col: 8 Unexpected start tag (button). Expected DOCTYPE.
-Line: 1 Col: 16 Unexpected start tag (button) implies end tag (button).
-Line: 1 Col: 16 Expected closing tag. Unexpected end of file.
+(1,8): expected-doctype-but-got-start-tag
+(1,16): unexpected-start-tag-implies-end-tag
+(1,16): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -174,9 +176,9 @@
 #data
 <table><tr><td></th>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 20 Unexpected end tag (th). Ignored.
-Line: 1 Col: 20 Expected closing tag. Unexpected end of file.
+(1,7): expected-doctype-but-got-start-tag
+(1,20): unexpected-end-tag
+(1,20): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -189,10 +191,9 @@
 #data
 <table><caption><td>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 20 Unexpected end tag (td). Ignored.
-Line: 1 Col: 20 Unexpected table cell start tag (td) in the table body phase.
-Line: 1 Col: 20 Expected closing tag. Unexpected end of file.
+(1,7): expected-doctype-but-got-start-tag
+(1,20): unexpected-cell-in-table-body
+(1,20): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -206,8 +207,8 @@
 #data
 <table><caption><div>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 21 Expected closing tag. Unexpected end of file.
+(1,7): expected-doctype-but-got-start-tag
+(1,21): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -219,8 +220,8 @@
 #data
 </caption><div>
 #errors
-Line: 1 Col: 10 Unexpected end tag (caption). Ignored.
-Line: 1 Col: 15 Expected closing tag. Unexpected end of file.
+(1,10): XXX-undefined-error
+(1,15): expected-closing-tag-but-got-eof
 #document-fragment
 caption
 #document
@@ -229,9 +230,9 @@
 #data
 <table><caption><div></caption>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 31 Unexpected end tag (caption). Missing end tag (div).
-Line: 1 Col: 31 Unexpected end of file. Expected table content.
+(1,7): expected-doctype-but-got-start-tag
+(1,31): expected-one-end-tag-but-got-another
+(1,31): eof-in-table
 #document
 | <html>
 |   <head>
@@ -243,8 +244,7 @@
 #data
 <table><caption></table>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 24 Unexpected end table tag in caption. Generates implied end caption.
+(1,7): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -255,9 +255,8 @@
 #data
 </table><div>
 #errors
-Line: 1 Col: 8 Unexpected end table tag in caption. Generates implied end caption.
-Line: 1 Col: 8 Unexpected end tag (caption). Ignored.
-Line: 1 Col: 13 Expected closing tag. Unexpected end of file.
+(1,8): unexpected-end-tag
+(1,13): expected-closing-tag-but-got-eof
 #document-fragment
 caption
 #document
@@ -266,18 +265,18 @@
 #data
 <table><caption></body></col></colgroup></html></tbody></td></tfoot></th></thead></tr>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 23 Unexpected end tag (body). Ignored.
-Line: 1 Col: 29 Unexpected end tag (col). Ignored.
-Line: 1 Col: 40 Unexpected end tag (colgroup). Ignored.
-Line: 1 Col: 47 Unexpected end tag (html). Ignored.
-Line: 1 Col: 55 Unexpected end tag (tbody). Ignored.
-Line: 1 Col: 60 Unexpected end tag (td). Ignored.
-Line: 1 Col: 68 Unexpected end tag (tfoot). Ignored.
-Line: 1 Col: 73 Unexpected end tag (th). Ignored.
-Line: 1 Col: 81 Unexpected end tag (thead). Ignored.
-Line: 1 Col: 86 Unexpected end tag (tr). Ignored.
-Line: 1 Col: 86 Expected closing tag. Unexpected end of file.
+(1,7): expected-doctype-but-got-start-tag
+(1,23): unexpected-end-tag
+(1,29): unexpected-end-tag
+(1,40): unexpected-end-tag
+(1,47): unexpected-end-tag
+(1,55): unexpected-end-tag
+(1,60): unexpected-end-tag
+(1,68): unexpected-end-tag
+(1,73): unexpected-end-tag
+(1,81): unexpected-end-tag
+(1,86): unexpected-end-tag
+(1,86): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -288,8 +287,8 @@
 #data
 <table><caption><div></div>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 27 Expected closing tag. Unexpected end of file.
+(1,7): expected-doctype-but-got-start-tag
+(1,27): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -301,13 +300,13 @@
 #data
 <table><tr><td></body></caption></col></colgroup></html>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 22 Unexpected end tag (body). Ignored.
-Line: 1 Col: 32 Unexpected end tag (caption). Ignored.
-Line: 1 Col: 38 Unexpected end tag (col). Ignored.
-Line: 1 Col: 49 Unexpected end tag (colgroup). Ignored.
-Line: 1 Col: 56 Unexpected end tag (html). Ignored.
-Line: 1 Col: 56 Expected closing tag. Unexpected end of file.
+(1,7): expected-doctype-but-got-start-tag
+(1,22): unexpected-end-tag
+(1,32): unexpected-end-tag
+(1,38): unexpected-end-tag
+(1,49): unexpected-end-tag
+(1,56): unexpected-end-tag
+(1,56): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -320,12 +319,12 @@
 #data
 </table></tbody></tfoot></thead></tr><div>
 #errors
-Line: 1 Col: 8 Unexpected end tag (table). Ignored.
-Line: 1 Col: 16 Unexpected end tag (tbody). Ignored.
-Line: 1 Col: 24 Unexpected end tag (tfoot). Ignored.
-Line: 1 Col: 32 Unexpected end tag (thead). Ignored.
-Line: 1 Col: 37 Unexpected end tag (tr). Ignored.
-Line: 1 Col: 42 Expected closing tag. Unexpected end of file.
+(1,8): unexpected-end-tag
+(1,16): unexpected-end-tag
+(1,24): unexpected-end-tag
+(1,32): unexpected-end-tag
+(1,37): unexpected-end-tag
+(1,42): expected-closing-tag-but-got-eof
 #document-fragment
 td
 #document
@@ -334,9 +333,11 @@
 #data
 <table><colgroup>foo
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 20 Unexpected non-space characters in table context caused voodoo mode.
-Line: 1 Col: 20 Unexpected end of file. Expected table content.
+(1,7): expected-doctype-but-got-start-tag
+(1,18): foster-parenting-character-in-table
+(1,19): foster-parenting-character-in-table
+(1,20): foster-parenting-character-in-table
+(1,20): eof-in-table
 #document
 | <html>
 |   <head>
@@ -348,7 +349,9 @@
 #data
 foo<col>
 #errors
-Line: 1 Col: 3 Unexpected end tag (colgroup). Ignored.
+(1,1): unexpected-character-in-colgroup
+(1,2): unexpected-character-in-colgroup
+(1,3): unexpected-character-in-colgroup
 #document-fragment
 colgroup
 #document
@@ -357,9 +360,9 @@
 #data
 <table><colgroup></col>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 23 This element (col) has no end tag.
-Line: 1 Col: 23 Expected closing tag. Unexpected end of file.
+(1,7): expected-doctype-but-got-start-tag
+(1,23): no-end-tag
+(1,23): eof-in-table
 #document
 | <html>
 |   <head>
@@ -370,9 +373,9 @@
 #data
 <frameset><div>
 #errors
-Line: 1 Col: 10 Unexpected start tag (frameset). Expected DOCTYPE.
-Line: 1 Col: 15 Unexpected start tag token (div) in the frameset phase. Ignored.
-Line: 1 Col: 15 Expected closing tag. Unexpected end of file.
+(1,10): expected-doctype-but-got-start-tag
+(1,15): unexpected-start-tag-in-frameset
+(1,15): eof-in-frameset
 #document
 | <html>
 |   <head>
@@ -381,7 +384,7 @@
 #data
 </frameset><frame>
 #errors
-Line: 1 Col: 11 Unexpected end tag token (frameset) in the frameset phase (innerHTML).
+(1,11): unexpected-frameset-in-frameset-innerhtml
 #document-fragment
 frameset
 #document
@@ -390,9 +393,9 @@
 #data
 <frameset></div>
 #errors
-Line: 1 Col: 10 Unexpected start tag (frameset). Expected DOCTYPE.
-Line: 1 Col: 16 Unexpected end tag token (div) in the frameset phase. Ignored.
-Line: 1 Col: 16 Expected closing tag. Unexpected end of file.
+(1,10): expected-doctype-but-got-start-tag
+(1,16): unexpected-end-tag-in-frameset
+(1,16): eof-in-frameset
 #document
 | <html>
 |   <head>
@@ -401,8 +404,8 @@
 #data
 </body><div>
 #errors
-Line: 1 Col: 7 Unexpected end tag (body). Ignored.
-Line: 1 Col: 12 Expected closing tag. Unexpected end of file.
+(1,7): unexpected-close-tag
+(1,12): expected-closing-tag-but-got-eof
 #document-fragment
 body
 #document
@@ -411,9 +414,9 @@
 #data
 <table><tr><div>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 16 Unexpected start tag (div) in table context caused voodoo mode.
-Line: 1 Col: 16 Unexpected end of file. Expected table content.
+(1,7): expected-doctype-but-got-start-tag
+(1,16): unexpected-start-tag-implies-table-voodoo
+(1,16): eof-in-table
 #document
 | <html>
 |   <head>
@@ -426,7 +429,7 @@
 #data
 </tr><td>
 #errors
-Line: 1 Col: 5 Unexpected end tag (tr). Ignored.
+(1,5): unexpected-end-tag
 #document-fragment
 tr
 #document
@@ -435,9 +438,9 @@
 #data
 </tbody></tfoot></thead><td>
 #errors
-Line: 1 Col: 8 Unexpected end tag (tbody). Ignored.
-Line: 1 Col: 16 Unexpected end tag (tfoot). Ignored.
-Line: 1 Col: 24 Unexpected end tag (thead). Ignored.
+(1,8): unexpected-end-tag
+(1,16): unexpected-end-tag
+(1,24): unexpected-end-tag
 #document-fragment
 tr
 #document
@@ -446,10 +449,9 @@
 #data
 <table><tr><div><td>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 16 Unexpected start tag (div) in table context caused voodoo mode.
-Line: 1 Col: 20 Unexpected implied end tag (div) in the table row phase.
-Line: 1 Col: 20 Expected closing tag. Unexpected end of file.
+(1,7): expected-doctype-but-got-start-tag
+(1,16): foster-parenting-start-tag
+(1,20): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -463,13 +465,12 @@
 #data
 <caption><col><colgroup><tbody><tfoot><thead><tr>
 #errors
-Line: 1 Col: 9 Unexpected start tag (caption).
-Line: 1 Col: 14 Unexpected start tag (col).
-Line: 1 Col: 24 Unexpected start tag (colgroup).
-Line: 1 Col: 31 Unexpected start tag (tbody).
-Line: 1 Col: 38 Unexpected start tag (tfoot).
-Line: 1 Col: 45 Unexpected start tag (thead).
-Line: 1 Col: 49 Unexpected end of file. Expected table content.
+(1,9): unexpected-start-tag
+(1,14): unexpected-start-tag
+(1,24): unexpected-start-tag
+(1,31): unexpected-start-tag
+(1,38): unexpected-start-tag
+(1,45): unexpected-start-tag
 #document-fragment
 tbody
 #document
@@ -478,9 +479,9 @@
 #data
 <table><tbody></thead>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 22 Unexpected end tag (thead) in the table body phase. Ignored.
-Line: 1 Col: 22 Unexpected end of file. Expected table content.
+(1,7): expected-doctype-but-got-start-tag
+(1,22): unexpected-end-tag-in-table-body
+(1,22): eof-in-table
 #document
 | <html>
 |   <head>
@@ -491,8 +492,7 @@
 #data
 </table><tr>
 #errors
-Line: 1 Col: 8 Unexpected end tag (table). Ignored.
-Line: 1 Col: 12 Unexpected end of file. Expected table content.
+(1,8): unexpected-end-tag
 #document-fragment
 tbody
 #document
@@ -501,16 +501,16 @@
 #data
 <table><tbody></body></caption></col></colgroup></html></td></th></tr>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 21 Unexpected end tag (body) in the table body phase. Ignored.
-Line: 1 Col: 31 Unexpected end tag (caption) in the table body phase. Ignored.
-Line: 1 Col: 37 Unexpected end tag (col) in the table body phase. Ignored.
-Line: 1 Col: 48 Unexpected end tag (colgroup) in the table body phase. Ignored.
-Line: 1 Col: 55 Unexpected end tag (html) in the table body phase. Ignored.
-Line: 1 Col: 60 Unexpected end tag (td) in the table body phase. Ignored.
-Line: 1 Col: 65 Unexpected end tag (th) in the table body phase. Ignored.
-Line: 1 Col: 70 Unexpected end tag (tr) in the table body phase. Ignored.
-Line: 1 Col: 70 Unexpected end of file. Expected table content.
+(1,7): expected-doctype-but-got-start-tag
+(1,21): unexpected-end-tag-in-table-body
+(1,31): unexpected-end-tag-in-table-body
+(1,37): unexpected-end-tag-in-table-body
+(1,48): unexpected-end-tag-in-table-body
+(1,55): unexpected-end-tag-in-table-body
+(1,60): unexpected-end-tag-in-table-body
+(1,65): unexpected-end-tag-in-table-body
+(1,70): unexpected-end-tag-in-table-body
+(1,70): eof-in-table
 #document
 | <html>
 |   <head>
@@ -521,10 +521,10 @@
 #data
 <table><tbody></div>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 20 Unexpected end tag (div) in table context caused voodoo mode.
-Line: 1 Col: 20 End tag (div) seen too early. Expected other end tag.
-Line: 1 Col: 20 Unexpected end of file. Expected table content.
+(1,7): expected-doctype-but-got-start-tag
+(1,20): unexpected-end-tag-implies-table-voodoo
+(1,20): end-tag-too-early
+(1,20): eof-in-table
 #document
 | <html>
 |   <head>
@@ -535,9 +535,9 @@
 #data
 <table><table>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 14 Unexpected start tag (table) implies end tag (table).
-Line: 1 Col: 14 Unexpected end of file. Expected table content.
+(1,7): expected-doctype-but-got-start-tag
+(1,14): unexpected-start-tag-implies-end-tag
+(1,14): eof-in-table
 #document
 | <html>
 |   <head>
@@ -548,19 +548,19 @@
 #data
 <table></body></caption></col></colgroup></html></tbody></td></tfoot></th></thead></tr>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 14 Unexpected end tag (body). Ignored.
-Line: 1 Col: 24 Unexpected end tag (caption). Ignored.
-Line: 1 Col: 30 Unexpected end tag (col). Ignored.
-Line: 1 Col: 41 Unexpected end tag (colgroup). Ignored.
-Line: 1 Col: 48 Unexpected end tag (html). Ignored.
-Line: 1 Col: 56 Unexpected end tag (tbody). Ignored.
-Line: 1 Col: 61 Unexpected end tag (td). Ignored.
-Line: 1 Col: 69 Unexpected end tag (tfoot). Ignored.
-Line: 1 Col: 74 Unexpected end tag (th). Ignored.
-Line: 1 Col: 82 Unexpected end tag (thead). Ignored.
-Line: 1 Col: 87 Unexpected end tag (tr). Ignored.
-Line: 1 Col: 87 Unexpected end of file. Expected table content.
+(1,7): expected-doctype-but-got-start-tag
+(1,14): unexpected-end-tag
+(1,24): unexpected-end-tag
+(1,30): unexpected-end-tag
+(1,41): unexpected-end-tag
+(1,48): unexpected-end-tag
+(1,56): unexpected-end-tag
+(1,61): unexpected-end-tag
+(1,69): unexpected-end-tag
+(1,74): unexpected-end-tag
+(1,82): unexpected-end-tag
+(1,87): unexpected-end-tag
+(1,87): eof-in-table
 #document
 | <html>
 |   <head>
@@ -570,8 +570,7 @@
 #data
 </table><tr>
 #errors
-Line: 1 Col: 8 Unexpected end tag (table). Ignored.
-Line: 1 Col: 12 Unexpected end of file. Expected table content.
+(1,8): unexpected-end-tag
 #document-fragment
 table
 #document
@@ -581,8 +580,7 @@
 #data
 <body></body></html>
 #errors
-Line: 1 Col: 20 Unexpected html end tag in inner html mode.
-Line: 1 Col: 20 Unexpected EOF in inner html mode.
+(1,20): unexpected-end-tag-after-body-innerhtml
 #document-fragment
 html
 #document
@@ -592,7 +590,7 @@
 #data
 <html><frameset></frameset></html> 
 #errors
-Line: 1 Col: 6 Unexpected start tag (html). Expected DOCTYPE.
+(1,6): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -602,8 +600,6 @@
 #data
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"><html></html>
 #errors
-Line: 1 Col: 50 Erroneous DOCTYPE.
-Line: 1 Col: 63 Unexpected end tag (html) after the (implied) root element.
 #document
 | <!DOCTYPE html "-//W3C//DTD HTML 4.01//EN" "">
 | <html>
@@ -613,8 +609,8 @@
 #data
 <param><frameset></frameset>
 #errors
-Line: 1 Col: 7 Unexpected start tag (param). Expected DOCTYPE.
-Line: 1 Col: 17 Unexpected start tag (frameset).
+(1,7): expected-doctype-but-got-start-tag
+(1,17): unexpected-start-tag
 #document
 | <html>
 |   <head>
@@ -623,8 +619,8 @@
 #data
 <source><frameset></frameset>
 #errors
-Line: 1 Col: 7 Unexpected start tag (source). Expected DOCTYPE.
-Line: 1 Col: 17 Unexpected start tag (frameset).
+(1,8): expected-doctype-but-got-start-tag
+(1,18): unexpected-start-tag
 #document
 | <html>
 |   <head>
@@ -633,8 +629,8 @@
 #data
 <track><frameset></frameset>
 #errors
-Line: 1 Col: 7 Unexpected start tag (track). Expected DOCTYPE.
-Line: 1 Col: 17 Unexpected start tag (frameset).
+(1,7): expected-doctype-but-got-start-tag
+(1,17): unexpected-start-tag
 #document
 | <html>
 |   <head>
@@ -643,9 +639,9 @@
 #data
 </html><frameset></frameset>
 #errors
-7: End tag seen without seeing a doctype first. Expected “<!DOCTYPE html>”.
-17: Stray “frameset” start tag.
-17: “frameset” start tag seen.
+(1,7): expected-doctype-but-got-end-tag
+(1,17): expected-eof-but-got-start-tag
+(1,17): unexpected-start-tag
 #document
 | <html>
 |   <head>
@@ -654,9 +650,9 @@
 #data
 </body><frameset></frameset>
 #errors
-7: End tag seen without seeing a doctype first. Expected “<!DOCTYPE html>”.
-17: Stray “frameset” start tag.
-17: “frameset” start tag seen.
+(1,7): expected-doctype-but-got-end-tag
+(1,17): unexpected-start-tag-after-body
+(1,17): unexpected-start-tag
 #document
 | <html>
 |   <head>
diff --git a/html/testdata/webkit/tests7.dat b/html/testdata/webkit/tests7.dat
index f5193c6..78fb6fa 100644
--- a/html/testdata/webkit/tests7.dat
+++ b/html/testdata/webkit/tests7.dat
@@ -12,8 +12,7 @@
 #data
 <!doctype html><table><title>X</title></table>
 #errors
-Line: 1 Col: 29 Unexpected start tag (title) in table context caused voodoo mode.
-Line: 1 Col: 38 Unexpected end tag (title) in table context caused voodoo mode.
+(1,29): unexpected-start-tag-implies-table-voodoo
 #document
 | <!DOCTYPE html>
 | <html>
@@ -26,7 +25,7 @@
 #data
 <!doctype html><head></head><title>X</title>
 #errors
-Line: 1 Col: 35 Unexpected start tag (title) that can be in head. Moved.
+(1,35): unexpected-start-tag-out-of-my-head
 #document
 | <!DOCTYPE html>
 | <html>
@@ -38,7 +37,7 @@
 #data
 <!doctype html></head><title>X</title>
 #errors
-Line: 1 Col: 29 Unexpected start tag (title) that can be in head. Moved.
+(1,29): unexpected-start-tag-out-of-my-head
 #document
 | <!DOCTYPE html>
 | <html>
@@ -50,7 +49,7 @@
 #data
 <!doctype html><table><meta></table>
 #errors
-Line: 1 Col: 28 Unexpected start tag (meta) in table context caused voodoo mode.
+(1,28): unexpected-start-tag-implies-table-voodoo
 #document
 | <!DOCTYPE html>
 | <html>
@@ -62,8 +61,8 @@
 #data
 <!doctype html><table>X<tr><td><table> <meta></table></table>
 #errors
-Line: 1 Col: 23 Unexpected non-space characters in table context caused voodoo mode.
-Line: 1 Col: 45 Unexpected start tag (meta) in table context caused voodoo mode.
+unexpected text in table
+(1,45): unexpected-start-tag-implies-table-voodoo
 #document
 | <!DOCTYPE html>
 | <html>
@@ -137,6 +136,20 @@
 |           "X"
 
 #data
+<!doctype html><p><object type="application/x-non-existant-plugin"><p>X</p></object>
+#errors
+#document
+| <!DOCTYPE html>
+| <html>
+|   <head>
+|   <body>
+|     <p>
+|       <object>
+|         type="application/x-non-existant-plugin"
+|         <p>
+|           "X"
+
+#data
 <!doctype html><listing>
 X</listing>
 #errors
@@ -151,7 +164,7 @@
 #data
 <!doctype html><select><input>X
 #errors
-Line: 1 Col: 30 Unexpected input start tag in the select phase.
+(1,30): unexpected-input-in-select
 #document
 | <!DOCTYPE html>
 | <html>
@@ -164,7 +177,7 @@
 #data
 <!doctype html><select><select>X
 #errors
-Line: 1 Col: 31 Unexpected select start tag in the select phase treated as select end tag.
+(1,31): unexpected-select-in-select
 #document
 | <!DOCTYPE html>
 | <html>
@@ -176,7 +189,7 @@
 #data
 <!doctype html><table><input type=hidDEN></table>
 #errors
-Line: 1 Col: 41 Unexpected input with type hidden in table context.
+(1,41): unexpected-hidden-input-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -189,7 +202,8 @@
 #data
 <!doctype html><table>X<input type=hidDEN></table>
 #errors
-Line: 1 Col: 23 Unexpected non-space characters in table context caused voodoo mode.
+(1,23): foster-parenting-character
+(1,42): unexpected-hidden-input-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -203,7 +217,7 @@
 #data
 <!doctype html><table>  <input type=hidDEN></table>
 #errors
-Line: 1 Col: 43 Unexpected input with type hidden in table context.
+(1,43): unexpected-hidden-input-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -217,7 +231,7 @@
 #data
 <!doctype html><table>  <input type='hidDEN'></table>
 #errors
-Line: 1 Col: 45 Unexpected input with type hidden in table context.
+(1,45): unexpected-hidden-input-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -231,7 +245,8 @@
 #data
 <!doctype html><table><input type=" hidden"><input type=hidDEN></table>
 #errors
-Line: 1 Col: 44 Unexpected start tag (input) in table context caused voodoo mode.
+(1,44): unexpected-start-tag-implies-table-voodoo
+(1,63): unexpected-hidden-input-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -246,9 +261,9 @@
 #data
 <!doctype html><table><select>X<tr>
 #errors
-Line: 1 Col: 30 Unexpected start tag (select) in table context caused voodoo mode.
-Line: 1 Col: 35 Unexpected table element start tag (trs) in the select in table phase.
-Line: 1 Col: 35 Unexpected end of file. Expected table content.
+(1,30): unexpected-start-tag-implies-table-voodoo
+(1,35): unexpected-table-element-start-tag-in-select-in-table
+(1,35): eof-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -274,7 +289,6 @@
 #data
 <!DOCTYPE hTmL><html></html>
 #errors
-Line: 1 Col: 28 Unexpected end tag (html) after the (implied) root element.
 #document
 | <!DOCTYPE html>
 | <html>
@@ -284,7 +298,6 @@
 #data
 <!DOCTYPE HTML><html></html>
 #errors
-Line: 1 Col: 28 Unexpected end tag (html) after the (implied) root element.
 #document
 | <!DOCTYPE html>
 | <html>
@@ -294,8 +307,7 @@
 #data
 <body>X</body></body>
 #errors
-Line: 1 Col: 21 Unexpected end tag token (body) in the after body phase.
-Line: 1 Col: 21 Unexpected EOF in inner html mode.
+(1,21): unexpected-end-tag-after-body
 #document-fragment
 html
 #document
@@ -306,9 +318,9 @@
 #data
 <div><p>a</x> b
 #errors
-Line: 1 Col: 5 Unexpected start tag (div). Expected DOCTYPE.
-Line: 1 Col: 13 Unexpected end tag (x). Ignored.
-Line: 1 Col: 15 Expected closing tag. Unexpected end of file.
+(1,5): expected-doctype-but-got-start-tag
+(1,13): unexpected-end-tag
+(1,15): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -320,7 +332,7 @@
 #data
 <table><tr><td><code></code> </table>
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
+(1,7): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -335,7 +347,12 @@
 #data
 <table><b><tr><td>aaa</td></tr>bbb</table>ccc
 #errors
-XXX: Fix me
+(1,7): expected-doctype-but-got-start-tag
+(1,10): foster-parenting-start-tag
+(1,32): foster-parenting-character
+(1,33): foster-parenting-character
+(1,34): foster-parenting-character
+(1,45): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -354,7 +371,11 @@
 #data
 A<table><tr> B</tr> B</table>
 #errors
-XXX: Fix me
+(1,1): expected-doctype-but-got-chars
+(1,13): foster-parenting-character
+(1,14): foster-parenting-character
+(1,20): foster-parenting-character
+(1,21): foster-parenting-character
 #document
 | <html>
 |   <head>
@@ -367,7 +388,12 @@
 #data
 A<table><tr> B</tr> </em>C</table>
 #errors
-XXX: Fix me
+(1,1): expected-doctype-but-got-chars
+(1,13): foster-parenting-character
+(1,14): foster-parenting-character
+(1,20): foster-parenting-character
+(1,25): unexpected-end-tag
+(1,26): foster-parenting-character
 #document
 | <html>
 |   <head>
@@ -381,7 +407,8 @@
 #data
 <select><keygen>
 #errors
-Not known
+(1,8): expected-doctype-but-got-start-tag
+(1,16): unexpected-input-in-select
 #document
 | <html>
 |   <head>
diff --git a/html/testdata/webkit/tests8.dat b/html/testdata/webkit/tests8.dat
index 90e6c91..33dd96d 100644
--- a/html/testdata/webkit/tests8.dat
+++ b/html/testdata/webkit/tests8.dat
@@ -3,9 +3,9 @@
 <div></div>
 </span>x
 #errors
-Line: 1 Col: 5 Unexpected start tag (div). Expected DOCTYPE.
-Line: 3 Col: 7 Unexpected end tag (span). Ignored.
-Line: 3 Col: 8 Expected closing tag. Unexpected end of file.
+(1,5): expected-doctype-but-got-start-tag
+(3,7): unexpected-end-tag
+(3,8): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -21,9 +21,9 @@
 <div>x<div></div>
 </span>x
 #errors
-Line: 1 Col: 5 Unexpected start tag (div). Expected DOCTYPE.
-Line: 2 Col: 7 Unexpected end tag (span). Ignored.
-Line: 2 Col: 8 Expected closing tag. Unexpected end of file.
+(1,5): expected-doctype-but-got-start-tag
+(2,7): unexpected-end-tag
+(2,8): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -37,9 +37,9 @@
 #data
 <div>x<div></div>x</span>x
 #errors
-Line: 1 Col: 5 Unexpected start tag (div). Expected DOCTYPE.
-Line: 1 Col: 25 Unexpected end tag (span). Ignored.
-Line: 1 Col: 26 Expected closing tag. Unexpected end of file.
+(1,5): expected-doctype-but-got-start-tag
+(1,25): unexpected-end-tag
+(1,26): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -52,9 +52,9 @@
 #data
 <div>x<div></div>y</span>z
 #errors
-Line: 1 Col: 5 Unexpected start tag (div). Expected DOCTYPE.
-Line: 1 Col: 25 Unexpected end tag (span). Ignored.
-Line: 1 Col: 26 Expected closing tag. Unexpected end of file.
+(1,5): expected-doctype-but-got-start-tag
+(1,25): unexpected-end-tag
+(1,26): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -67,13 +67,16 @@
 #data
 <table><div>x<div></div>x</span>x
 #errors
-Line: 1 Col: 7 Unexpected start tag (table). Expected DOCTYPE.
-Line: 1 Col: 12 Unexpected start tag (div) in table context caused voodoo mode.
-Line: 1 Col: 18 Unexpected start tag (div) in table context caused voodoo mode.
-Line: 1 Col: 24 Unexpected end tag (div) in table context caused voodoo mode.
-Line: 1 Col: 32 Unexpected end tag (span) in table context caused voodoo mode.
-Line: 1 Col: 32 Unexpected end tag (span). Ignored.
-Line: 1 Col: 33 Unexpected end of file. Expected table content.
+(1,7): expected-doctype-but-got-start-tag
+(1,12): foster-parenting-start-tag
+(1,13): foster-parenting-character
+(1,18): foster-parenting-start-tag
+(1,24): foster-parenting-end-tag
+(1,25): foster-parenting-start-tag
+(1,32): foster-parenting-end-tag
+(1,32): unexpected-end-tag
+(1,33): foster-parenting-character
+(1,33): eof-in-table
 #document
 | <html>
 |   <head>
@@ -87,9 +90,9 @@
 #data
 x<table>x
 #errors
-Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE.
-Line: 1 Col: 9 Unexpected non-space characters in table context caused voodoo mode.
-Line: 1 Col: 9 Unexpected end of file. Expected table content.
+(1,1): expected-doctype-but-got-chars
+(1,9): foster-parenting-character
+(1,9): eof-in-table
 #document
 | <html>
 |   <head>
@@ -100,10 +103,10 @@
 #data
 x<table><table>x
 #errors
-Line: 1 Col: 1 Unexpected non-space characters. Expected DOCTYPE.
-Line: 1 Col: 15 Unexpected start tag (table) implies end tag (table).
-Line: 1 Col: 16 Unexpected non-space characters in table context caused voodoo mode.
-Line: 1 Col: 16 Unexpected end of file. Expected table content.
+(1,1): expected-doctype-but-got-chars
+(1,15): unexpected-start-tag-implies-end-tag
+(1,16): foster-parenting-character
+(1,16): eof-in-table
 #document
 | <html>
 |   <head>
@@ -116,9 +119,9 @@
 #data
 <b>a<div></div><div></b>y
 #errors
-Line: 1 Col: 3 Unexpected start tag (b). Expected DOCTYPE.
-Line: 1 Col: 24 End tag (b) violates step 1, paragraph 3 of the adoption agency algorithm.
-Line: 1 Col: 25 Expected closing tag. Unexpected end of file.
+(1,3): expected-doctype-but-got-start-tag
+(1,24): adoption-agency-1.3
+(1,25): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -133,10 +136,10 @@
 #data
 <a><div><p></a>
 #errors
-Line: 1 Col: 3 Unexpected start tag (a). Expected DOCTYPE.
-Line: 1 Col: 15 End tag (a) violates step 1, paragraph 3 of the adoption agency algorithm.
-Line: 1 Col: 15 End tag (a) violates step 1, paragraph 3 of the adoption agency algorithm.
-Line: 1 Col: 15 Expected closing tag. Unexpected end of file.
+(1,3): expected-doctype-but-got-start-tag
+(1,15): adoption-agency-1.3
+(1,15): adoption-agency-1.3
+(1,15): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
diff --git a/html/testdata/webkit/tests9.dat b/html/testdata/webkit/tests9.dat
index 554e27a..f8d04b2 100644
--- a/html/testdata/webkit/tests9.dat
+++ b/html/testdata/webkit/tests9.dat
@@ -21,7 +21,7 @@
 #data
 <!DOCTYPE html><math><mi>
 #errors
-25: End of file in a foreign namespace context.
+(1,25) expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -33,8 +33,8 @@
 #data
 <!DOCTYPE html><math><annotation-xml><svg><u>
 #errors
-45: HTML start tag “u” in a foreign namespace context.
-45: End of file seen and there were open elements.
+(1,45) unexpected-html-element-in-foreign-content
+(1,45) expected-closing-tag-but-got-eof
 #document
 | <!DOCTYPE html>
 | <html>
@@ -48,8 +48,8 @@
 #data
 <!DOCTYPE html><body><select><math></math></select>
 #errors
-Line: 1 Col: 35 Unexpected start tag token (math) in the select phase. Ignored.
-Line: 1 Col: 42 Unexpected end tag (math) in the select phase. Ignored.
+(1,35) unexpected-start-tag-in-select
+(1,42) unexpected-end-tag-in-select
 #document
 | <!DOCTYPE html>
 | <html>
@@ -60,8 +60,8 @@
 #data
 <!DOCTYPE html><body><select><option><math></math></option></select>
 #errors
-Line: 1 Col: 43 Unexpected start tag token (math) in the select phase. Ignored.
-Line: 1 Col: 50 Unexpected end tag (math) in the select phase. Ignored.
+(1,43) unexpected-start-tag-in-select
+(1,50) unexpected-end-tag-in-select
 #document
 | <!DOCTYPE html>
 | <html>
@@ -73,8 +73,7 @@
 #data
 <!DOCTYPE html><body><table><math></math></table>
 #errors
-Line: 1 Col: 34 Unexpected start tag (math) in table context caused voodoo mode.
-Line: 1 Col: 41 Unexpected end tag (math) in table context caused voodoo mode.
+(1,34) unexpected-start-tag-implies-table-voodoo
 #document
 | <!DOCTYPE html>
 | <html>
@@ -86,9 +85,10 @@
 #data
 <!DOCTYPE html><body><table><math><mi>foo</mi></math></table>
 #errors
-Line: 1 Col: 34 Unexpected start tag (math) in table context caused voodoo mode.
-Line: 1 Col: 46 Unexpected end tag (mi) in table context caused voodoo mode.
-Line: 1 Col: 53 Unexpected end tag (math) in table context caused voodoo mode.
+(1,34) foster-parenting-start-token
+(1,39) foster-parenting-character
+(1,40) foster-parenting-character
+(1,41) foster-parenting-character
 #document
 | <!DOCTYPE html>
 | <html>
@@ -102,10 +102,13 @@
 #data
 <!DOCTYPE html><body><table><math><mi>foo</mi><mi>bar</mi></math></table>
 #errors
-Line: 1 Col: 34 Unexpected start tag (math) in table context caused voodoo mode.
-Line: 1 Col: 46 Unexpected end tag (mi) in table context caused voodoo mode.
-Line: 1 Col: 58 Unexpected end tag (mi) in table context caused voodoo mode.
-Line: 1 Col: 65 Unexpected end tag (math) in table context caused voodoo mode.
+(1,34) foster-parenting-start-tag
+(1,39) foster-parenting-character
+(1,40) foster-parenting-character
+(1,41) foster-parenting-character
+(1,51) foster-parenting-character
+(1,52) foster-parenting-character
+(1,53) foster-parenting-character
 #document
 | <!DOCTYPE html>
 | <html>
@@ -121,10 +124,13 @@
 #data
 <!DOCTYPE html><body><table><tbody><math><mi>foo</mi><mi>bar</mi></math></tbody></table>
 #errors
-Line: 1 Col: 41 Unexpected start tag (math) in table context caused voodoo mode.
-Line: 1 Col: 53 Unexpected end tag (mi) in table context caused voodoo mode.
-Line: 1 Col: 65 Unexpected end tag (mi) in table context caused voodoo mode.
-Line: 1 Col: 72 Unexpected end tag (math) in table context caused voodoo mode.
+(1,41) foster-parenting-start-tag
+(1,46) foster-parenting-character
+(1,47) foster-parenting-character
+(1,48) foster-parenting-character
+(1,58) foster-parenting-character
+(1,59) foster-parenting-character
+(1,60) foster-parenting-character
 #document
 | <!DOCTYPE html>
 | <html>
@@ -141,10 +147,13 @@
 #data
 <!DOCTYPE html><body><table><tbody><tr><math><mi>foo</mi><mi>bar</mi></math></tr></tbody></table>
 #errors
-Line: 1 Col: 45 Unexpected start tag (math) in table context caused voodoo mode.
-Line: 1 Col: 57 Unexpected end tag (mi) in table context caused voodoo mode.
-Line: 1 Col: 69 Unexpected end tag (mi) in table context caused voodoo mode.
-Line: 1 Col: 76 Unexpected end tag (math) in table context caused voodoo mode.
+(1,45) foster-parenting-start-tag
+(1,50) foster-parenting-character
+(1,51) foster-parenting-character
+(1,52) foster-parenting-character
+(1,62) foster-parenting-character
+(1,63) foster-parenting-character
+(1,64) foster-parenting-character
 #document
 | <!DOCTYPE html>
 | <html>
@@ -218,8 +227,7 @@
 #data
 <!DOCTYPE html><body><table><caption><math><mi>foo</mi><mi>bar</mi><p>baz</table><p>quux
 #errors
-Line: 1 Col: 70 HTML start tag "p" in a foreign namespace context.
-Line: 1 Col: 81 Unexpected end table tag in caption. Generates implied end caption.
+(1,70) unexpected-html-element-in-foreign-content
 #document
 | <!DOCTYPE html>
 | <html>
@@ -240,8 +248,8 @@
 #data
 <!DOCTYPE html><body><table><caption><math><mi>foo</mi><mi>bar</mi>baz</table><p>quux
 #errors
-Line: 1 Col: 78 Unexpected end table tag in caption. Generates implied end caption.
-Line: 1 Col: 78 Unexpected end tag (caption). Missing end tag (math).
+(1,78) unexpected-end-tag
+(1,78) expected-one-end-tag-but-got-another
 #document
 | <!DOCTYPE html>
 | <html>
@@ -261,11 +269,18 @@
 #data
 <!DOCTYPE html><body><table><colgroup><math><mi>foo</mi><mi>bar</mi><p>baz</table><p>quux
 #errors
-Line: 1 Col: 44 Unexpected start tag (math) in table context caused voodoo mode.
-Line: 1 Col: 56 Unexpected end tag (mi) in table context caused voodoo mode.
-Line: 1 Col: 68 Unexpected end tag (mi) in table context caused voodoo mode.
-Line: 1 Col: 71 HTML start tag "p" in a foreign namespace context.
-Line: 1 Col: 71 Unexpected start tag (p) in table context caused voodoo mode.
+(1,44) foster-parenting-start-tag
+(1,49) foster-parenting-character
+(1,50) foster-parenting-character
+(1,51) foster-parenting-character
+(1,61) foster-parenting-character
+(1,62) foster-parenting-character
+(1,63) foster-parenting-character
+(1,71) unexpected-html-element-in-foreign-content
+(1,71) foster-parenting-start-tag
+(1,63) foster-parenting-character
+(1,63) foster-parenting-character
+(1,63) foster-parenting-character
 #document
 | <!DOCTYPE html>
 | <html>
@@ -286,13 +301,13 @@
 #data
 <!DOCTYPE html><body><table><tr><td><select><math><mi>foo</mi><mi>bar</mi><p>baz</table><p>quux
 #errors
-Line: 1 Col: 50 Unexpected start tag token (math) in the select phase. Ignored.
-Line: 1 Col: 54 Unexpected start tag token (mi) in the select phase. Ignored.
-Line: 1 Col: 62 Unexpected end tag (mi) in the select phase. Ignored.
-Line: 1 Col: 66 Unexpected start tag token (mi) in the select phase. Ignored.
-Line: 1 Col: 74 Unexpected end tag (mi) in the select phase. Ignored.
-Line: 1 Col: 77 Unexpected start tag token (p) in the select phase. Ignored.
-Line: 1 Col: 88 Unexpected table element end tag (tables) in the select in table phase.
+(1,50) unexpected-start-tag-in-select
+(1,54) unexpected-start-tag-in-select
+(1,62) unexpected-end-tag-in-select
+(1,66) unexpected-start-tag-in-select
+(1,74) unexpected-end-tag-in-select
+(1,77) unexpected-start-tag-in-select
+(1,88) unexpected-table-element-end-tag-in-select-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -310,14 +325,14 @@
 #data
 <!DOCTYPE html><body><table><select><math><mi>foo</mi><mi>bar</mi><p>baz</table><p>quux
 #errors
-Line: 1 Col: 36 Unexpected start tag (select) in table context caused voodoo mode.
-Line: 1 Col: 42 Unexpected start tag token (math) in the select phase. Ignored.
-Line: 1 Col: 46 Unexpected start tag token (mi) in the select phase. Ignored.
-Line: 1 Col: 54 Unexpected end tag (mi) in the select phase. Ignored.
-Line: 1 Col: 58 Unexpected start tag token (mi) in the select phase. Ignored.
-Line: 1 Col: 66 Unexpected end tag (mi) in the select phase. Ignored.
-Line: 1 Col: 69 Unexpected start tag token (p) in the select phase. Ignored.
-Line: 1 Col: 80 Unexpected table element end tag (tables) in the select in table phase.
+(1,36) unexpected-start-tag-implies-table-voodoo
+(1,42) unexpected-start-tag-in-select
+(1,46) unexpected-start-tag-in-select
+(1,54) unexpected-end-tag-in-select
+(1,58) unexpected-start-tag-in-select
+(1,66) unexpected-end-tag-in-select
+(1,69) unexpected-start-tag-in-select
+(1,80) unexpected-table-element-end-tag-in-select-in-table
 #document
 | <!DOCTYPE html>
 | <html>
@@ -332,8 +347,8 @@
 #data
 <!DOCTYPE html><body></body></html><math><mi>foo</mi><mi>bar</mi><p>baz
 #errors
-Line: 1 Col: 41 Unexpected start tag (math).
-Line: 1 Col: 68 HTML start tag "p" in a foreign namespace context.
+(1,41) expected-eof-but-got-start-tag
+(1,68) unexpected-html-element-in-foreign-content
 #document
 | <!DOCTYPE html>
 | <html>
@@ -350,8 +365,8 @@
 #data
 <!DOCTYPE html><body></body><math><mi>foo</mi><mi>bar</mi><p>baz
 #errors
-Line: 1 Col: 34 Unexpected start tag token (math) in the after body phase.
-Line: 1 Col: 61 HTML start tag "p" in a foreign namespace context.
+(1,34) unexpected-start-tag-after-body
+(1,61) unexpected-html-element-in-foreign-content
 #document
 | <!DOCTYPE html>
 | <html>
@@ -368,14 +383,14 @@
 #data
 <!DOCTYPE html><frameset><math><mi></mi><mi></mi><p><span>
 #errors
-Line: 1 Col: 31 Unexpected start tag token (math) in the frameset phase. Ignored.
-Line: 1 Col: 35 Unexpected start tag token (mi) in the frameset phase. Ignored.
-Line: 1 Col: 40 Unexpected end tag token (mi) in the frameset phase. Ignored.
-Line: 1 Col: 44 Unexpected start tag token (mi) in the frameset phase. Ignored.
-Line: 1 Col: 49 Unexpected end tag token (mi) in the frameset phase. Ignored.
-Line: 1 Col: 52 Unexpected start tag token (p) in the frameset phase. Ignored.
-Line: 1 Col: 58 Unexpected start tag token (span) in the frameset phase. Ignored.
-Line: 1 Col: 58 Expected closing tag. Unexpected end of file.
+(1,31) unexpected-start-tag-in-frameset
+(1,35) unexpected-start-tag-in-frameset
+(1,40) unexpected-end-tag-in-frameset
+(1,44) unexpected-start-tag-in-frameset
+(1,49) unexpected-end-tag-in-frameset
+(1,52) unexpected-start-tag-in-frameset
+(1,58) unexpected-start-tag-in-frameset
+(1,58) eof-in-frameset
 #document
 | <!DOCTYPE html>
 | <html>
@@ -385,13 +400,13 @@
 #data
 <!DOCTYPE html><frameset></frameset><math><mi></mi><mi></mi><p><span>
 #errors
-Line: 1 Col: 42 Unexpected start tag (math) in the after frameset phase. Ignored.
-Line: 1 Col: 46 Unexpected start tag (mi) in the after frameset phase. Ignored.
-Line: 1 Col: 51 Unexpected end tag (mi) in the after frameset phase. Ignored.
-Line: 1 Col: 55 Unexpected start tag (mi) in the after frameset phase. Ignored.
-Line: 1 Col: 60 Unexpected end tag (mi) in the after frameset phase. Ignored.
-Line: 1 Col: 63 Unexpected start tag (p) in the after frameset phase. Ignored.
-Line: 1 Col: 69 Unexpected start tag (span) in the after frameset phase. Ignored.
+(1,42) unexpected-start-tag-after-frameset
+(1,46) unexpected-start-tag-after-frameset
+(1,51) unexpected-end-tag-after-frameset
+(1,55) unexpected-start-tag-after-frameset
+(1,60) unexpected-end-tag-after-frameset
+(1,63) unexpected-start-tag-after-frameset
+(1,69) unexpected-start-tag-after-frameset
 #document
 | <!DOCTYPE html>
 | <html>
diff --git a/html/testdata/webkit/tests_innerHTML_1.dat b/html/testdata/webkit/tests_innerHTML_1.dat
index 6c78661..9c5c182 100644
--- a/html/testdata/webkit/tests_innerHTML_1.dat
+++ b/html/testdata/webkit/tests_innerHTML_1.dat
@@ -1,6 +1,8 @@
 #data
 <body><span>
 #errors
+(1,6): unexpected-start-tag
+(1,12): expected-closing-tag-but-got-eof
 #document-fragment
 body
 #document
@@ -9,6 +11,8 @@
 #data
 <span><body>
 #errors
+(1,12): unexpected-start-tag
+(1,12): expected-closing-tag-but-got-eof
 #document-fragment
 body
 #document
@@ -17,6 +21,8 @@
 #data
 <span><body>
 #errors
+(1,12): unexpected-start-tag
+(1,12): expected-closing-tag-but-got-eof
 #document-fragment
 div
 #document
@@ -25,6 +31,7 @@
 #data
 <body><span>
 #errors
+(1,12): expected-closing-tag-but-got-eof
 #document-fragment
 html
 #document
@@ -35,6 +42,8 @@
 #data
 <frameset><span>
 #errors
+(1,10): unexpected-start-tag
+(1,16): expected-closing-tag-but-got-eof
 #document-fragment
 body
 #document
@@ -43,6 +52,8 @@
 #data
 <span><frameset>
 #errors
+(1,16): unexpected-start-tag
+(1,16): expected-closing-tag-but-got-eof
 #document-fragment
 body
 #document
@@ -51,6 +62,8 @@
 #data
 <span><frameset>
 #errors
+(1,16): unexpected-start-tag
+(1,16): expected-closing-tag-but-got-eof
 #document-fragment
 div
 #document
@@ -59,6 +72,8 @@
 #data
 <frameset><span>
 #errors
+(1,16): unexpected-start-tag-in-frameset
+(1,16): eof-in-frameset
 #document-fragment
 html
 #document
@@ -68,6 +83,7 @@
 #data
 <table><tr>
 #errors
+(1,7): unexpected-start-tag
 #document-fragment
 table
 #document
@@ -77,6 +93,7 @@
 #data
 </table><tr>
 #errors
+(1,8): unexpected-end-tag
 #document-fragment
 table
 #document
@@ -86,6 +103,8 @@
 #data
 <a>
 #errors
+(1,3): unexpected-start-tag-implies-table-voodoo
+(1,3): eof-in-table
 #document-fragment
 table
 #document
@@ -94,6 +113,8 @@
 #data
 <a>
 #errors
+(1,3): unexpected-start-tag-implies-table-voodoo
+(1,3): eof-in-table
 #document-fragment
 table
 #document
@@ -102,6 +123,8 @@
 #data
 <a><caption>a
 #errors
+(1,3): unexpected-start-tag-implies-table-voodoo
+(1,13): expected-closing-tag-but-got-eof
 #document-fragment
 table
 #document
@@ -112,6 +135,8 @@
 #data
 <a><colgroup><col>
 #errors
+(1,3): foster-parenting-start-token
+(1,18): expected-closing-tag-but-got-eof
 #document-fragment
 table
 #document
@@ -122,6 +147,7 @@
 #data
 <a><tbody><tr>
 #errors
+(1,3): foster-parenting-start-tag
 #document-fragment
 table
 #document
@@ -132,6 +158,7 @@
 #data
 <a><tfoot><tr>
 #errors
+(1,3): foster-parenting-start-tag
 #document-fragment
 table
 #document
@@ -142,6 +169,7 @@
 #data
 <a><thead><tr>
 #errors
+(1,3): foster-parenting-start-tag
 #document-fragment
 table
 #document
@@ -152,6 +180,7 @@
 #data
 <a><tr>
 #errors
+(1,3): foster-parenting-start-tag
 #document-fragment
 table
 #document
@@ -162,6 +191,8 @@
 #data
 <a><th>
 #errors
+(1,3): unexpected-start-tag-implies-table-voodoo
+(1,7): unexpected-cell-in-table-body
 #document-fragment
 table
 #document
@@ -173,6 +204,8 @@
 #data
 <a><td>
 #errors
+(1,3): unexpected-start-tag-implies-table-voodoo
+(1,7): unexpected-cell-in-table-body
 #document-fragment
 table
 #document
@@ -184,6 +217,7 @@
 #data
 <table></table><tbody>
 #errors
+(1,22): unexpected-start-tag
 #document-fragment
 caption
 #document
@@ -192,6 +226,8 @@
 #data
 </table><span>
 #errors
+(1,8): unexpected-end-tag
+(1,14): expected-closing-tag-but-got-eof
 #document-fragment
 caption
 #document
@@ -200,6 +236,8 @@
 #data
 <span></table>
 #errors
+(1,14): unexpected-end-tag
+(1,14): expected-closing-tag-but-got-eof
 #document-fragment
 caption
 #document
@@ -208,6 +246,8 @@
 #data
 </caption><span>
 #errors
+(1,10): XXX-undefined-error
+(1,16): expected-closing-tag-but-got-eof
 #document-fragment
 caption
 #document
@@ -216,6 +256,8 @@
 #data
 <span></caption><span>
 #errors
+(1,16): XXX-undefined-error
+(1,22): expected-closing-tag-but-got-eof
 #document-fragment
 caption
 #document
@@ -225,6 +267,8 @@
 #data
 <span><caption><span>
 #errors
+(1,15): unexpected-start-tag
+(1,21): expected-closing-tag-but-got-eof
 #document-fragment
 caption
 #document
@@ -234,6 +278,8 @@
 #data
 <span><col><span>
 #errors
+(1,11): unexpected-start-tag
+(1,17): expected-closing-tag-but-got-eof
 #document-fragment
 caption
 #document
@@ -243,6 +289,8 @@
 #data
 <span><colgroup><span>
 #errors
+(1,16): unexpected-start-tag
+(1,22): expected-closing-tag-but-got-eof
 #document-fragment
 caption
 #document
@@ -252,6 +300,8 @@
 #data
 <span><html><span>
 #errors
+(1,12): non-html-root
+(1,18): expected-closing-tag-but-got-eof
 #document-fragment
 caption
 #document
@@ -261,6 +311,8 @@
 #data
 <span><tbody><span>
 #errors
+(1,13): unexpected-start-tag
+(1,19): expected-closing-tag-but-got-eof
 #document-fragment
 caption
 #document
@@ -270,6 +322,8 @@
 #data
 <span><td><span>
 #errors
+(1,10): unexpected-start-tag
+(1,16): expected-closing-tag-but-got-eof
 #document-fragment
 caption
 #document
@@ -279,6 +333,8 @@
 #data
 <span><tfoot><span>
 #errors
+(1,13): unexpected-start-tag
+(1,19): expected-closing-tag-but-got-eof
 #document-fragment
 caption
 #document
@@ -288,6 +344,8 @@
 #data
 <span><thead><span>
 #errors
+(1,13): unexpected-start-tag
+(1,19): expected-closing-tag-but-got-eof
 #document-fragment
 caption
 #document
@@ -297,6 +355,8 @@
 #data
 <span><th><span>
 #errors
+(1,10): unexpected-start-tag
+(1,16): expected-closing-tag-but-got-eof
 #document-fragment
 caption
 #document
@@ -306,6 +366,8 @@
 #data
 <span><tr><span>
 #errors
+(1,10): unexpected-start-tag
+(1,16): expected-closing-tag-but-got-eof
 #document-fragment
 caption
 #document
@@ -315,6 +377,8 @@
 #data
 <span></table><span>
 #errors
+(1,14): unexpected-end-tag
+(1,20): expected-closing-tag-but-got-eof
 #document-fragment
 caption
 #document
@@ -324,6 +388,7 @@
 #data
 </colgroup><col>
 #errors
+(1,11): XXX-undefined-error
 #document-fragment
 colgroup
 #document
@@ -332,6 +397,7 @@
 #data
 <a><col>
 #errors
+(1,3): XXX-undefined-error
 #document-fragment
 colgroup
 #document
@@ -340,6 +406,9 @@
 #data
 <caption><a>
 #errors
+(1,9): XXX-undefined-error
+(1,12): unexpected-start-tag-implies-table-voodoo
+(1,12): eof-in-table
 #document-fragment
 tbody
 #document
@@ -348,6 +417,9 @@
 #data
 <col><a>
 #errors
+(1,5): XXX-undefined-error
+(1,8): unexpected-start-tag-implies-table-voodoo
+(1,8): eof-in-table
 #document-fragment
 tbody
 #document
@@ -356,6 +428,9 @@
 #data
 <colgroup><a>
 #errors
+(1,10): XXX-undefined-error
+(1,13): unexpected-start-tag-implies-table-voodoo
+(1,13): eof-in-table
 #document-fragment
 tbody
 #document
@@ -364,6 +439,9 @@
 #data
 <tbody><a>
 #errors
+(1,7): XXX-undefined-error
+(1,10): unexpected-start-tag-implies-table-voodoo
+(1,10): eof-in-table
 #document-fragment
 tbody
 #document
@@ -372,6 +450,9 @@
 #data
 <tfoot><a>
 #errors
+(1,7): XXX-undefined-error
+(1,10): unexpected-start-tag-implies-table-voodoo
+(1,10): eof-in-table
 #document-fragment
 tbody
 #document
@@ -380,6 +461,9 @@
 #data
 <thead><a>
 #errors
+(1,7): XXX-undefined-error
+(1,10): unexpected-start-tag-implies-table-voodoo
+(1,10): eof-in-table
 #document-fragment
 tbody
 #document
@@ -388,6 +472,9 @@
 #data
 </table><a>
 #errors
+(1,8): XXX-undefined-error
+(1,11): unexpected-start-tag-implies-table-voodoo
+(1,11): eof-in-table
 #document-fragment
 tbody
 #document
@@ -396,6 +483,7 @@
 #data
 <a><tr>
 #errors
+(1,3): unexpected-start-tag-implies-table-voodoo
 #document-fragment
 tbody
 #document
@@ -405,6 +493,8 @@
 #data
 <a><td>
 #errors
+(1,3): unexpected-start-tag-implies-table-voodoo
+(1,7): unexpected-cell-in-table-body
 #document-fragment
 tbody
 #document
@@ -415,6 +505,8 @@
 #data
 <a><td>
 #errors
+(1,3): unexpected-start-tag-implies-table-voodoo
+(1,7): unexpected-cell-in-table-body
 #document-fragment
 tbody
 #document
@@ -425,6 +517,8 @@
 #data
 <a><td>
 #errors
+(1,3): unexpected-start-tag-implies-table-voodoo
+(1,7): unexpected-cell-in-table-body
 #document-fragment
 tbody
 #document
@@ -435,6 +529,9 @@
 #data
 <td><table><tbody><a><tr>
 #errors
+(1,4): unexpected-cell-in-table-body
+(1,21): unexpected-start-tag-implies-table-voodoo
+(1,25): eof-in-table
 #document-fragment
 tbody
 #document
@@ -448,6 +545,7 @@
 #data
 </tr><td>
 #errors
+(1,5): XXX-undefined-error
 #document-fragment
 tr
 #document
@@ -456,6 +554,8 @@
 #data
 <td><table><a><tr></tr><tr>
 #errors
+(1,14): unexpected-start-tag-implies-table-voodoo
+(1,27): eof-in-table
 #document-fragment
 tr
 #document
@@ -469,6 +569,7 @@
 #data
 <caption><td>
 #errors
+(1,9): XXX-undefined-error
 #document-fragment
 tr
 #document
@@ -477,6 +578,7 @@
 #data
 <col><td>
 #errors
+(1,5): XXX-undefined-error
 #document-fragment
 tr
 #document
@@ -485,6 +587,7 @@
 #data
 <colgroup><td>
 #errors
+(1,10): XXX-undefined-error
 #document-fragment
 tr
 #document
@@ -493,6 +596,7 @@
 #data
 <tbody><td>
 #errors
+(1,7): XXX-undefined-error
 #document-fragment
 tr
 #document
@@ -501,6 +605,7 @@
 #data
 <tfoot><td>
 #errors
+(1,7): XXX-undefined-error
 #document-fragment
 tr
 #document
@@ -509,6 +614,7 @@
 #data
 <thead><td>
 #errors
+(1,7): XXX-undefined-error
 #document-fragment
 tr
 #document
@@ -517,6 +623,7 @@
 #data
 <tr><td>
 #errors
+(1,4): XXX-undefined-error
 #document-fragment
 tr
 #document
@@ -525,6 +632,7 @@
 #data
 </table><td>
 #errors
+(1,8): XXX-undefined-error
 #document-fragment
 tr
 #document
@@ -553,6 +661,8 @@
 #data
 <caption><a>
 #errors
+(1,9): XXX-undefined-error
+(1,12): expected-closing-tag-but-got-eof
 #document-fragment
 td
 #document
@@ -561,6 +671,8 @@
 #data
 <col><a>
 #errors
+(1,5): XXX-undefined-error
+(1,8): expected-closing-tag-but-got-eof
 #document-fragment
 td
 #document
@@ -569,6 +681,8 @@
 #data
 <colgroup><a>
 #errors
+(1,10): XXX-undefined-error
+(1,13): expected-closing-tag-but-got-eof
 #document-fragment
 td
 #document
@@ -577,6 +691,8 @@
 #data
 <tbody><a>
 #errors
+(1,7): XXX-undefined-error
+(1,10): expected-closing-tag-but-got-eof
 #document-fragment
 td
 #document
@@ -585,6 +701,8 @@
 #data
 <tfoot><a>
 #errors
+(1,7): XXX-undefined-error
+(1,10): expected-closing-tag-but-got-eof
 #document-fragment
 td
 #document
@@ -593,6 +711,8 @@
 #data
 <th><a>
 #errors
+(1,4): XXX-undefined-error
+(1,7): expected-closing-tag-but-got-eof
 #document-fragment
 td
 #document
@@ -601,6 +721,8 @@
 #data
 <thead><a>
 #errors
+(1,7): XXX-undefined-error
+(1,10): expected-closing-tag-but-got-eof
 #document-fragment
 td
 #document
@@ -609,6 +731,8 @@
 #data
 <tr><a>
 #errors
+(1,4): XXX-undefined-error
+(1,7): expected-closing-tag-but-got-eof
 #document-fragment
 td
 #document
@@ -617,6 +741,8 @@
 #data
 </table><a>
 #errors
+(1,8): XXX-undefined-error
+(1,11): expected-closing-tag-but-got-eof
 #document-fragment
 td
 #document
@@ -625,6 +751,8 @@
 #data
 </tbody><a>
 #errors
+(1,8): XXX-undefined-error
+(1,11): expected-closing-tag-but-got-eof
 #document-fragment
 td
 #document
@@ -633,6 +761,8 @@
 #data
 </td><a>
 #errors
+(1,5): unexpected-end-tag
+(1,8): expected-closing-tag-but-got-eof
 #document-fragment
 td
 #document
@@ -641,6 +771,8 @@
 #data
 </tfoot><a>
 #errors
+(1,8): XXX-undefined-error
+(1,11): expected-closing-tag-but-got-eof
 #document-fragment
 td
 #document
@@ -649,6 +781,8 @@
 #data
 </thead><a>
 #errors
+(1,8): XXX-undefined-error
+(1,11): expected-closing-tag-but-got-eof
 #document-fragment
 td
 #document
@@ -657,6 +791,8 @@
 #data
 </th><a>
 #errors
+(1,5): unexpected-end-tag
+(1,8): expected-closing-tag-but-got-eof
 #document-fragment
 td
 #document
@@ -665,6 +801,8 @@
 #data
 </tr><a>
 #errors
+(1,5): XXX-undefined-error
+(1,8): expected-closing-tag-but-got-eof
 #document-fragment
 td
 #document
@@ -673,6 +811,8 @@
 #data
 <table><td><td>
 #errors
+(1,11): unexpected-cell-in-table-body
+(1,15): expected-closing-tag-but-got-eof
 #document-fragment
 td
 #document
@@ -685,6 +825,8 @@
 #data
 </select><option>
 #errors
+(1,9): XXX-undefined-error
+(1,17): eof-in-select
 #document-fragment
 select
 #document
@@ -693,6 +835,8 @@
 #data
 <input><option>
 #errors
+(1,7): unexpected-input-in-select
+(1,15): eof-in-select
 #document-fragment
 select
 #document
@@ -701,6 +845,8 @@
 #data
 <keygen><option>
 #errors
+(1,8): unexpected-input-in-select
+(1,16): eof-in-select
 #document-fragment
 select
 #document
@@ -709,6 +855,8 @@
 #data
 <textarea><option>
 #errors
+(1,10): unexpected-input-in-select
+(1,18): eof-in-select
 #document-fragment
 select
 #document
@@ -717,6 +865,7 @@
 #data
 </html><!--abc-->
 #errors
+(1,7): unexpected-end-tag-after-body-innerhtml
 #document-fragment
 html
 #document
@@ -727,6 +876,7 @@
 #data
 </frameset><frame>
 #errors
+(1,11): unexpected-frameset-in-frameset-innerhtml
 #document-fragment
 frameset
 #document
diff --git a/html/testdata/webkit/tricky01.dat b/html/testdata/webkit/tricky01.dat
index 0841992..753502a 100644
--- a/html/testdata/webkit/tricky01.dat
+++ b/html/testdata/webkit/tricky01.dat
@@ -2,6 +2,8 @@
 <b><p>Bold </b> Not bold</p>
 Also not bold.
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,15): adoption-agency-1.3
 #document
 | <html>
 |   <head>
@@ -21,6 +23,12 @@
 <p>Italic and red. </i> Red.</font> I should not be red.</p>
 <b>Bold <i>Bold and italic</b> Only Italic </i> Plain
 #errors
+(1,6): expected-doctype-but-got-start-tag
+(2,58): adoption-agency-1.3
+(3,67): unexpected-end-tag
+(4,23): adoption-agency-1.3
+(4,35): adoption-agency-1.3
+(5,30): adoption-agency-1.3
 #document
 | <html>
 |   <head>
@@ -73,6 +81,11 @@
 <p>Second paragraph.</p></font>
 <b><p><i>Bold and Italic</b> Italic</p>
 #errors
+(1,6): expected-doctype-but-got-start-tag
+(2,38): unexpected-end-tag
+(4,28): adoption-agency-1.3
+(4,28): adoption-agency-1.3
+(4,39): unexpected-end-tag
 #document
 | <html>
 |   <head>
@@ -107,6 +120,10 @@
 </dl>
 </html>
 #errors
+(1,6): expected-doctype-but-got-start-tag
+(4,4): end-tag-too-early
+(5,5): end-tag-too-early
+(6,7): expected-one-end-tag-but-got-another
 #document
 | <html>
 |   <head>
@@ -131,6 +148,10 @@
 <label><a><div>Hello<div>World</div></a></label>  
 </body></html>
 #errors
+(1,6): expected-doctype-but-got-start-tag
+(2,40): adoption-agency-1.3
+(2,48): unexpected-end-tag
+(3,7): expected-one-end-tag-but-got-another
 #document
 | <html>
 |   <head>
@@ -150,6 +171,15 @@
 #data
 <table><center> <font>a</center> <img> <tr><td> </td> </tr> </table>
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,15): foster-parenting-start-tag
+(1,16): foster-parenting-character
+(1,22): foster-parenting-start-tag
+(1,23): foster-parenting-character
+(1,32): foster-parenting-end-tag
+(1,32): end-tag-too-early
+(1,33): foster-parenting-character
+(1,38): foster-parenting-start-tag
 #document
 | <html>
 |   <head>
@@ -173,6 +203,37 @@
 #data
 <table><tr><p><a><p>You should see this text.
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(1,14): unexpected-start-tag-implies-table-voodoo
+(1,17): unexpected-start-tag-implies-table-voodoo
+(1,20): unexpected-start-tag-implies-table-voodoo
+(1,20): closing-non-current-p-element
+(1,21): foster-parenting-character
+(1,22): foster-parenting-character
+(1,23): foster-parenting-character
+(1,24): foster-parenting-character
+(1,25): foster-parenting-character
+(1,26): foster-parenting-character
+(1,27): foster-parenting-character
+(1,28): foster-parenting-character
+(1,29): foster-parenting-character
+(1,30): foster-parenting-character
+(1,31): foster-parenting-character
+(1,32): foster-parenting-character
+(1,33): foster-parenting-character
+(1,34): foster-parenting-character
+(1,35): foster-parenting-character
+(1,36): foster-parenting-character
+(1,37): foster-parenting-character
+(1,38): foster-parenting-character
+(1,39): foster-parenting-character
+(1,40): foster-parenting-character
+(1,41): foster-parenting-character
+(1,42): foster-parenting-character
+(1,43): foster-parenting-character
+(1,44): foster-parenting-character
+(1,45): foster-parenting-character
+(1,45): eof-in-table
 #document
 | <html>
 |   <head>
@@ -196,6 +257,16 @@
 <a></font><font></a>
 This page contains an insanely badly-nested tag sequence.
 #errors
+(1,7): expected-doctype-but-got-start-tag
+(3,8): unexpected-start-tag-implies-table-voodoo
+(3,16): unexpected-start-tag-implies-table-voodoo
+(4,6): unexpected-start-tag-implies-table-voodoo
+(4,6): unexpected character token in table (the newline)
+(5,7): unexpected-start-tag-implies-end-tag
+(6,4): unexpected p end tag
+(7,10): adoption-agency-1.3
+(7,20): adoption-agency-1.3
+(8,57): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -240,6 +311,10 @@
 </body>
 </html>
 #errors
+(1,6): expected-doctype-but-got-start-tag
+(3,56): adoption-agency-1.3
+(4,58): adoption-agency-1.3
+(5,7): expected-one-end-tag-but-got-another
 #document
 | <html>
 |   <head>
diff --git a/html/testdata/webkit/webkit01.dat b/html/testdata/webkit/webkit01.dat
index 9d425e9..f1cd858 100644
--- a/html/testdata/webkit/webkit01.dat
+++ b/html/testdata/webkit/webkit01.dat
@@ -1,7 +1,7 @@
 #data
 Test
 #errors
-Line: 1 Col: 4 Unexpected non-space characters. Expected DOCTYPE.
+(1,4): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -11,6 +11,7 @@
 #data
 <div></div>
 #errors
+(1,5): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -20,6 +21,7 @@
 #data
 <div>Test</div>
 #errors
+(1,5): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -30,6 +32,8 @@
 #data
 <di
 #errors
+(1,3): eof-in-tag-name
+(1,3): expected-doctype-but-got-eof
 #document
 | <html>
 |   <head>
@@ -42,6 +46,7 @@
 </script>
 <div>Bye</div>
 #errors
+(1,5): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -62,6 +67,7 @@
 #data
 <div foo="bar">Hello</div>
 #errors
+(1,15): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -77,6 +83,7 @@
 </script>
 <div>Bye</div>
 #errors
+(1,5): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -97,6 +104,7 @@
 #data
 <foo bar="baz"></foo><potato quack="duck"></potato>
 #errors
+(1,15): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -109,6 +117,7 @@
 #data
 <foo bar="baz"><potato quack="duck"></potato></foo>
 #errors
+(1,15): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -121,6 +130,9 @@
 #data
 <foo></foo bar="baz"><potato></potato quack="duck">
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,21): attributes-in-end-tag
+(1,51): attributes-in-end-tag
 #document
 | <html>
 |   <head>
@@ -131,6 +143,8 @@
 #data
 </ tttt>
 #errors
+(1,2): expected-closing-tag-but-got-char
+(1,8): expected-doctype-but-got-eof
 #document
 | <!--  tttt -->
 | <html>
@@ -140,6 +154,7 @@
 #data
 <div FOO ><img><img></div>
 #errors
+(1,10): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -152,6 +167,8 @@
 #data
 <p>Test</p<p>Test2</p>
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,13): unexpected-end-tag
 #document
 | <html>
 |   <head>
@@ -162,6 +179,11 @@
 #data
 <rdar://problem/6869687>
 #errors
+(1,7): unexpected-character-after-solidus-in-tag
+(1,8): unexpected-character-after-solidus-in-tag
+(1,16): unexpected-character-after-solidus-in-tag
+(1,24): expected-doctype-but-got-start-tag
+(1,24): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -173,6 +195,9 @@
 #data
 <A>test< /A>
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,8): expected-tag-name
+(1,12): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -183,6 +208,7 @@
 #data
 &lt;
 #errors
+(1,4): expected-doctype-but-got-chars
 #document
 | <html>
 |   <head>
@@ -192,6 +218,8 @@
 #data
 <body foo='bar'><body foo='baz' yo='mama'>
 #errors
+(1,16): expected-doctype-but-got-start-tag
+(1,42): unexpected-start-tag
 #document
 | <html>
 |   <head>
@@ -202,6 +230,9 @@
 #data
 <body></br foo="bar"></body>
 #errors
+(1,6): expected-doctype-but-got-start-tag
+(1,21): attributes-in-end-tag
+(1,21): unexpected-end-tag-treated-as
 #document
 | <html>
 |   <head>
@@ -211,6 +242,8 @@
 #data
 <bdy><br foo="bar"></body>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,26): expected-one-end-tag-but-got-another
 #document
 | <html>
 |   <head>
@@ -222,6 +255,10 @@
 #data
 <body></body></br foo="bar">
 #errors
+(1,6): expected-doctype-but-got-start-tag
+(1,28): attributes-in-end-tag
+(1,28): unexpected-end-tag-after-body
+(1,28): unexpected-end-tag-treated-as
 #document
 | <html>
 |   <head>
@@ -231,6 +268,10 @@
 #data
 <bdy></body><br foo="bar">
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,12): expected-one-end-tag-but-got-another
+(1,26): unexpected-start-tag-after-body
+(1,26): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -242,6 +283,7 @@
 #data
 <html><body></body></html><!-- Hi there -->
 #errors
+(1,6): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -251,6 +293,8 @@
 #data
 <html><body></body></html>x<!-- Hi there -->
 #errors
+(1,6): expected-doctype-but-got-start-tag
+(1,27): expected-eof-but-got-char
 #document
 | <html>
 |   <head>
@@ -261,6 +305,8 @@
 #data
 <html><body></body></html>x<!-- Hi there --></html><!-- Again -->
 #errors
+(1,6): expected-doctype-but-got-start-tag
+(1,27): expected-eof-but-got-char
 #document
 | <html>
 |   <head>
@@ -272,6 +318,8 @@
 #data
 <html><body></body></html>x<!-- Hi there --></body></html><!-- Again -->
 #errors
+(1,6): expected-doctype-but-got-start-tag
+(1,27): expected-eof-but-got-char
 #document
 | <html>
 |   <head>
@@ -283,6 +331,8 @@
 #data
 <html><body><ruby><div><rp>xx</rp></div></ruby></body></html>
 #errors
+(1,6): expected-doctype-but-got-start-tag
+(1,27): XXX-undefined-error
 #document
 | <html>
 |   <head>
@@ -295,6 +345,8 @@
 #data
 <html><body><ruby><div><rt>xx</rt></div></ruby></body></html>
 #errors
+(1,6): expected-doctype-but-got-start-tag
+(1,27): XXX-undefined-error
 #document
 | <html>
 |   <head>
@@ -307,6 +359,7 @@
 #data
 <html><frameset><!--1--><noframes>A</noframes><!--2--></frameset><!--3--><noframes>B</noframes><!--4--></html><!--5--><noframes>C</noframes><!--6-->
 #errors
+(1,6): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -327,6 +380,12 @@
 #data
 <select><option>A<select><option>B<select><option>C<select><option>D<select><option>E<select><option>F<select><option>G<select>
 #errors
+(1,8): expected-doctype-but-got-start-tag
+(1,25): unexpected-select-in-select
+(1,59): unexpected-select-in-select
+(1,93): unexpected-select-in-select
+(1,127): unexpected-select-in-select
+(1,127): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -353,6 +412,7 @@
 #data
 <dd><dd><dt><dt><dd><li><li>
 #errors
+(1,4): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -368,6 +428,10 @@
 #data
 <div><b></div><div><nobr>a<nobr>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,14): end-tag-too-early
+(1,32): unexpected-start-tag-implies-end-tag
+(1,32): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -384,6 +448,7 @@
 <head></head>
 <body></body>
 #errors
+(1,6): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -394,6 +459,8 @@
 #data
 <head></head> <style></style>ddd
 #errors
+(1,6): expected-doctype-but-got-start-tag
+(1,21): unexpected-start-tag-out-of-my-head
 #document
 | <html>
 |   <head>
@@ -405,6 +472,12 @@
 #data
 <kbd><table></kbd><col><select><tr>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,18): unexpected-end-tag-implies-table-voodoo
+(1,18): unexpected-end-tag
+(1,31): unexpected-start-tag-implies-table-voodoo
+(1,35): unexpected-table-element-start-tag-in-select-in-table
+(1,35): eof-in-table
 #document
 | <html>
 |   <head>
@@ -420,6 +493,12 @@
 #data
 <kbd><table></kbd><col><select><tr></table><div>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,18): unexpected-end-tag-implies-table-voodoo
+(1,18): unexpected-end-tag
+(1,31): unexpected-start-tag-implies-table-voodoo
+(1,35): unexpected-table-element-start-tag-in-select-in-table
+(1,48): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -436,6 +515,8 @@
 #data
 <a><li><style></style><title></title></a>
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,41): adoption-agency-1.3
 #document
 | <html>
 |   <head>
@@ -449,6 +530,9 @@
 #data
 <font></p><p><meta><title></title></font>
 #errors
+(1,6): expected-doctype-but-got-start-tag
+(1,10): unexpected-end-tag
+(1,41): adoption-agency-1.3
 #document
 | <html>
 |   <head>
@@ -463,6 +547,10 @@
 #data
 <a><center><title></title><a>
 #errors
+(1,3): expected-doctype-but-got-start-tag
+(1,29): unexpected-start-tag-implies-end-tag
+(1,29): adoption-agency-1.3
+(1,29): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -476,6 +564,8 @@
 #data
 <svg><title><div>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,17): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -487,6 +577,8 @@
 #data
 <svg><title><rect><div>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,23): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -499,6 +591,9 @@
 #data
 <svg><title><svg><div>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,22): unexpected-html-element-in-foreign-content
+(1,22): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -511,6 +606,8 @@
 #data
 <img <="" FAIL>
 #errors
+(1,6): invalid-character-in-attribute-name
+(1,15): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -522,6 +619,9 @@
 #data
 <ul><li><div id='foo'/>A</li><li>B<div>C</div></li></ul>
 #errors
+(1,4): expected-doctype-but-got-start-tag
+(1,23): non-void-element-with-trailing-solidus
+(1,29): end-tag-too-early
 #document
 | <html>
 |   <head>
@@ -539,6 +639,9 @@
 #data
 <svg><em><desc></em>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,9): unexpected-html-element-in-foreign-content
+(1,20): adoption-agency-1.3
 #document
 | <html>
 |   <head>
@@ -566,6 +669,10 @@
 #data
 <svg><tfoot></mi><td>
 #errors
+(1,5): expected-doctype-but-got-start-tag
+(1,17): unexpected-end-tag
+(1,17): unexpected-end-tag
+(1,21): expected-closing-tag-but-got-eof
 #document
 | <html>
 |   <head>
@@ -577,6 +684,7 @@
 #data
 <math><mrow><mrow><mn>1</mn></mrow><mi>a</mi></mrow></math>
 #errors
+(1,6): expected-doctype-but-got-start-tag
 #document
 | <html>
 |   <head>
@@ -592,6 +700,8 @@
 #data
 <!doctype html><input type="hidden"><frameset>
 #errors
+(1,46): unexpected-start-tag
+(1,46): eof-in-frameset
 #document
 | <!DOCTYPE html>
 | <html>
@@ -601,6 +711,7 @@
 #data
 <!doctype html><input type="button"><frameset>
 #errors
+(1,46): unexpected-start-tag
 #document
 | <!DOCTYPE html>
 | <html>
diff --git a/html/testdata/webkit/webkit02.dat b/html/testdata/webkit/webkit02.dat
index 905783d..87f685d 100644
--- a/html/testdata/webkit/webkit02.dat
+++ b/html/testdata/webkit/webkit02.dat
@@ -157,3 +157,39 @@
 select
 #document
 | <option>
+
+#data
+<svg><foreignObject><div>foo</div><plaintext></foreignObject></svg><div>bar</div>
+#errors
+#document
+| <html>
+|   <head>
+|   <body>
+|     <svg svg>
+|       <svg foreignObject>
+|         <div>
+|           "foo"
+|         <plaintext>
+|           "</foreignObject></svg><div>bar</div>"
+
+#data
+<svg><foreignObject></foreignObject><title></svg>foo
+#errors
+#document
+| <html>
+|   <head>
+|   <body>
+|     <svg svg>
+|       <svg foreignObject>
+|       <svg title>
+|     "foo"
+
+#data
+</foreignObject><plaintext><div>foo</div>
+#errors
+#document
+| <html>
+|   <head>
+|   <body>
+|     <plaintext>
+|       "<div>foo</div>"