Merge "Fix typo in table documentation"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 10 Jul 2019 02:38:59 +0000 (02:38 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 10 Jul 2019 02:38:59 +0000 (02:38 +0000)
179 files changed:
RELEASE-NOTES-1.34
api.php
autoload.php
composer.json
includes/Html.php
includes/actions/DeleteAction.php
includes/actions/EditAction.php
includes/actions/ProtectAction.php
includes/actions/RenderAction.php
includes/actions/UnprotectAction.php
includes/actions/ViewAction.php
includes/api/i18n/es.json
includes/api/i18n/pt-br.json
includes/config/ConfigException.php
includes/export/WikiExporter.php
includes/installer/DatabaseInstaller.php
includes/installer/MssqlInstaller.php
includes/installer/MysqlInstaller.php
includes/installer/OracleInstaller.php
includes/installer/PostgresInstaller.php
includes/installer/SqliteInstaller.php
includes/installer/WebInstaller.php
includes/installer/WebInstallerComplete.php
includes/installer/WebInstallerDBConnect.php
includes/installer/WebInstallerName.php
includes/installer/WebInstallerOutput.php
includes/installer/i18n/ar.json
includes/installer/i18n/be-tarask.json
includes/installer/i18n/cs.json
includes/installer/i18n/en.json
includes/installer/i18n/es.json
includes/installer/i18n/fr.json
includes/installer/i18n/lb.json
includes/installer/i18n/pt.json
includes/installer/i18n/qqq.json
includes/installer/i18n/roa-tara.json
includes/installer/i18n/ru.json
includes/installer/i18n/zh-hant.json
includes/jobqueue/Job.php
includes/jobqueue/JobQueueFederated.php
includes/jobqueue/RunnableJob.php
includes/libs/Xhprof.php
includes/libs/lockmanager/FSLockManager.php
includes/libs/mime/MSCompoundFileReader.php
includes/libs/mime/MimeAnalyzer.php
includes/libs/objectcache/BagOStuff.php
includes/libs/objectcache/CachedBagOStuff.php
includes/libs/objectcache/IExpiringStore.php
includes/libs/objectcache/IStoreKeyEncoder.php [new file with mode: 0644]
includes/libs/objectcache/MultiWriteBagOStuff.php
includes/libs/objectcache/ReplicatedBagOStuff.php
includes/libs/objectcache/WANObjectCache.php
includes/libs/rdbms/database/DBConnRef.php
includes/libs/rdbms/database/Database.php
includes/libs/rdbms/database/IDatabase.php
includes/libs/rdbms/lbfactory/ILBFactory.php
includes/libs/rdbms/lbfactory/LBFactory.php
includes/libs/rdbms/loadbalancer/ILoadBalancer.php
includes/libs/rdbms/loadbalancer/LoadBalancer.php
includes/libs/rdbms/loadmonitor/LoadMonitor.php
includes/libs/rdbms/loadmonitor/LoadMonitorMySQL.php
includes/objectcache/SqlBagOStuff.php
includes/parser/PPDStack.php
includes/parser/PPFrame_DOM.php
includes/parser/PPNode.php
includes/parser/PPNode_DOM.php
includes/parser/PPNode_Hash_Tree.php
includes/parser/Parser.php
includes/parser/Preprocessor_DOM.php
includes/parser/Preprocessor_Hash.php
includes/resourceloader/MessageBlobStore.php
includes/resourceloader/ResourceLoaderLanguageDataModule.php
includes/resourceloader/ResourceLoaderSkinModule.php
includes/specialpage/RedirectSpecialPage.php
languages/i18n/ban.json
languages/i18n/bcc.json
languages/i18n/br.json
languages/i18n/ce.json
languages/i18n/cs.json
languages/i18n/de.json
languages/i18n/exif/lrc.json
languages/i18n/is.json
languages/i18n/km.json
languages/i18n/lrc.json
languages/i18n/my.json
languages/i18n/nqo.json
languages/i18n/pl.json
languages/i18n/pt-br.json
languages/i18n/qqq.json
languages/i18n/ru.json
languages/i18n/sv.json
languages/i18n/ta.json
languages/i18n/tr.json
languages/i18n/tru.json
languages/i18n/trv.json
languages/i18n/zh-hans.json
languages/i18n/zh-hant.json
maintenance/benchmarks/benchmarkCSSMin.php
maintenance/benchmarks/benchmarkJSMinPlus.php
maintenance/benchmarks/benchmarkJavaScriptMinifier.php
maintenance/mwdoc-filter.php
maintenance/purgeModuleDeps.php
opensearch_desc.php
package-lock.json
package.json
resources/Resources.php
resources/src/mediawiki.util.js
resources/src/startup/profiler.js
tests/phpunit/MediaWikiUnitTestCase.php
tests/phpunit/includes/DerivativeRequestTest.php [deleted file]
tests/phpunit/includes/MediaWikiVersionFetcherTest.php [new file with mode: 0644]
tests/phpunit/includes/Revision/RevisionStoreFactoryTest.php [new file with mode: 0644]
tests/phpunit/includes/SanitizerValidateEmailTest.php [deleted file]
tests/phpunit/includes/XmlJsTest.php [deleted file]
tests/phpunit/includes/composer/ComposerVersionNormalizerTest.php [deleted file]
tests/phpunit/includes/config/ConfigFactoryTest.php [new file with mode: 0644]
tests/phpunit/includes/config/EtcdConfigTest.php [deleted file]
tests/phpunit/includes/db/DatabaseOracleTest.php [deleted file]
tests/phpunit/includes/db/LoadBalancerTest.php
tests/phpunit/includes/debug/logger/monolog/LogstashFormatterTest.php [deleted file]
tests/phpunit/includes/deferred/MWCallableUpdateTest.php [deleted file]
tests/phpunit/includes/deferred/TransactionRoundDefiningUpdateTest.php [deleted file]
tests/phpunit/includes/libs/mime/MSCompoundFileReaderTest.php [deleted file]
tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php
tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php
tests/phpunit/includes/media/SVGMetadataExtractorTest.php [new file with mode: 0644]
tests/phpunit/includes/objectcache/RedisBagOStuffTest.php [deleted file]
tests/phpunit/includes/parser/SanitizerTest.php
tests/phpunit/includes/registration/VersionCheckerTest.php [deleted file]
tests/phpunit/includes/search/SearchSuggestionSetTest.php [deleted file]
tests/phpunit/includes/shell/CommandFactoryTest.php [deleted file]
tests/phpunit/includes/site/CachingSiteStoreTest.php [new file with mode: 0644]
tests/phpunit/includes/site/HashSiteStoreTest.php [new file with mode: 0644]
tests/phpunit/includes/site/SiteExporterTest.php [deleted file]
tests/phpunit/includes/site/SiteImporterTest.php [deleted file]
tests/phpunit/includes/site/SiteImporterTest.xml [deleted file]
tests/phpunit/includes/tidy/RemexDriverTest.php [deleted file]
tests/phpunit/includes/tidy/html5lib-tests.json [deleted file]
tests/phpunit/includes/utils/AvroValidatorTest.php [deleted file]
tests/phpunit/includes/utils/ClassCollectorTest.php [deleted file]
tests/phpunit/includes/utils/MWCryptHashTest.php [deleted file]
tests/phpunit/includes/utils/MWRestrictionsTest.php [deleted file]
tests/phpunit/languages/SpecialPageAliasTest.php [deleted file]
tests/phpunit/structure/SpecialPageFatalTest.php
tests/phpunit/unit/includes/DerivativeRequestTest.php [new file with mode: 0644]
tests/phpunit/unit/includes/MediaWikiVersionFetcherTest.php [deleted file]
tests/phpunit/unit/includes/Revision/RevisionStoreFactoryTest.php [deleted file]
tests/phpunit/unit/includes/SanitizerValidateEmailTest.php [new file with mode: 0644]
tests/phpunit/unit/includes/XmlJsTest.php [new file with mode: 0644]
tests/phpunit/unit/includes/composer/ComposerVersionNormalizerTest.php [new file with mode: 0644]
tests/phpunit/unit/includes/config/ConfigFactoryTest.php [deleted file]
tests/phpunit/unit/includes/config/EtcdConfigTest.php [new file with mode: 0644]
tests/phpunit/unit/includes/db/DatabaseOracleTest.php [new file with mode: 0644]
tests/phpunit/unit/includes/debug/logger/monolog/LogstashFormatterTest.php [new file with mode: 0644]
tests/phpunit/unit/includes/deferred/MWCallableUpdateTest.php [new file with mode: 0644]
tests/phpunit/unit/includes/deferred/TransactionRoundDefiningUpdateTest.php [new file with mode: 0644]
tests/phpunit/unit/includes/libs/mime/MSCompoundFileReaderTest.php [new file with mode: 0644]
tests/phpunit/unit/includes/media/SVGMetadataExtractorTest.php [deleted file]
tests/phpunit/unit/includes/objectcache/RedisBagOStuffTest.php [new file with mode: 0644]
tests/phpunit/unit/includes/parser/SanitizerUnitTest.php
tests/phpunit/unit/includes/registration/VersionCheckerTest.php [new file with mode: 0644]
tests/phpunit/unit/includes/search/SearchSuggestionSetTest.php [new file with mode: 0644]
tests/phpunit/unit/includes/shell/CommandFactoryTest.php [new file with mode: 0644]
tests/phpunit/unit/includes/site/CachingSiteStoreTest.php [deleted file]
tests/phpunit/unit/includes/site/HashSiteStoreTest.php [deleted file]
tests/phpunit/unit/includes/site/SiteExporterTest.php [new file with mode: 0644]
tests/phpunit/unit/includes/site/SiteImporterTest.php [new file with mode: 0644]
tests/phpunit/unit/includes/site/SiteImporterTest.xml [new file with mode: 0644]
tests/phpunit/unit/includes/tidy/RemexDriverTest.php [new file with mode: 0644]
tests/phpunit/unit/includes/tidy/html5lib-tests.json [new file with mode: 0644]
tests/phpunit/unit/includes/utils/AvroValidatorTest.php [new file with mode: 0644]
tests/phpunit/unit/includes/utils/ClassCollectorTest.php [new file with mode: 0644]
tests/phpunit/unit/includes/utils/MWCryptHashTest.php [new file with mode: 0644]
tests/phpunit/unit/includes/utils/MWRestrictionsTest.php [new file with mode: 0644]
tests/phpunit/unit/languages/SpecialPageAliasTest.php [new file with mode: 0644]
tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js
tests/selenium/specs/page.js
tests/selenium/specs/rollback.js
tests/selenium/specs/user.js

index 3223948..5e49fc7 100644 (file)
@@ -263,6 +263,8 @@ because of Phabricator reports.
 * ResourceLoader no longer creates the 'mw.legacy' placeholder object. It has
   been unused since 1.16 and was deprecated in 1.22. To deprecate a property
   in JavaScript, use mw.log.deprecate() instead.
+* The 'user.groups' module, deprecated in 1.28, was removed.
+  Use the 'user' module instead.
 * …
 
 === Deprecations in 1.34 ===
diff --git a/api.php b/api.php
index db9de75..0fb674b 100644 (file)
--- a/api.php
+++ b/api.php
@@ -61,10 +61,9 @@ $wgTitle = Title::makeTitle( NS_SPECIAL, 'Badtitle/dummy title for API calls set
 RequestContext::getMain()->setTitle( $wgTitle );
 
 try {
-       /* Construct an ApiMain with the arguments passed via the URL. What we get back
-        * is some form of an ApiMain, possibly even one that produces an error message,
-        * but we don't care here, as that is handled by the constructor.
-        */
+       // Construct an ApiMain with the arguments passed via the URL. What we get back
+       // is some form of an ApiMain, possibly even one that produces an error message,
+       // but we don't care here, as that is handled by the constructor.
        $processor = new ApiMain( RequestContext::getMain(), true );
 
        // Last chance hook before executing the API
index 5eadf79..218c244 100644 (file)
@@ -659,6 +659,7 @@ $wgAutoloadLocalClasses = [
        'IP' => __DIR__ . '/includes/libs/IP.php',
        'IPTC' => __DIR__ . '/includes/media/IPTC.php',
        'IRCColourfulRCFeedFormatter' => __DIR__ . '/includes/rcfeed/IRCColourfulRCFeedFormatter.php',
+       'IStoreKeyEncoder' => __DIR__ . '/includes/libs/objectcache/IStoreKeyEncoder.php',
        'IcuCollation' => __DIR__ . '/includes/collation/IcuCollation.php',
        'IdentityCollation' => __DIR__ . '/includes/collation/IdentityCollation.php',
        'ImageBuilder' => __DIR__ . '/maintenance/rebuildImages.php',
index 9240ace..f7b72f5 100644 (file)
                        "composer lint",
                        "composer phpcs"
                ],
-               "phpunit": "vendor/bin/phpunit",
-               "phpunit:unit": "vendor/bin/phpunit --colors=always --testsuite=core:unit,extensions:unit,skins:unit",
-               "phpunit:integration": "vendor/bin/phpunit --colors=always --testsuite=core:integration,extensions:integration,skins:integration",
-               "phpunit:coverage": "vendor/bin/phpunit --testsuite=core:unit --exclude-group Dump,Broken,ParserFuzz,Stub"
+               "phpunit": "phpunit",
+               "phpunit:unit": "phpunit --colors=always --testsuite=core:unit,extensions:unit,skins:unit",
+               "phpunit:integration": "phpunit --colors=always --testsuite=core:integration,extensions:integration,skins:integration",
+               "phpunit:coverage": "phpunit --testsuite=core:unit --exclude-group Dump,Broken"
        },
        "config": {
                "optimize-autoloader": true,
index 07de58c..d0f9fc6 100644 (file)
@@ -1004,16 +1004,16 @@ class Html {
        }
 
        /**
-        * Get HTML for an info box with an icon.
+        * Get HTML for an information message box with an icon.
         *
-        * @param string $text Wikitext, get this with wfMessage()->plain()
+        * @internal For use by the WebInstaller class.
+        * @param string $rawHtml HTML
         * @param string $icon Path to icon file (used as 'src' attribute)
         * @param string $alt Alternate text for the icon
         * @param string $class Additional class name to add to the wrapper div
-        *
-        * @return string
+        * @return string HTML
         */
-       static function infoBox( $text, $icon, $alt, $class = '' ) {
+       public static function infoBox( $rawHtml, $icon, $alt, $class = '' ) {
                $s = self::openElement( 'div', [ 'class' => "mw-infobox $class" ] );
 
                $s .= self::openElement( 'div', [ 'class' => 'mw-infobox-left' ] ) .
@@ -1026,7 +1026,7 @@ class Html {
                                self::closeElement( 'div' );
 
                $s .= self::openElement( 'div', [ 'class' => 'mw-infobox-right' ] ) .
-                               $text .
+                               $rawHtml .
                                self::closeElement( 'div' );
                $s .= self::element( 'div', [ 'style' => 'clear: left;' ], ' ' );
 
index 6bed59a..6fcb1c8 100644 (file)
@@ -1,9 +1,5 @@
 <?php
 /**
- * Handle page deletion
- *
- * Copyright © 2012 Timo Tijhof
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -20,7 +16,6 @@
  *
  * @file
  * @ingroup Actions
- * @author Timo Tijhof
  */
 
 /**
index f0bc8bf..df48f88 100644 (file)
@@ -1,9 +1,5 @@
 <?php
 /**
- * action=edit handler
- *
- * Copyright © 2012 Timo Tijhof
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  *
  * @file
  * @ingroup Actions
- * @author Timo Tijhof
  */
 
 /**
- * Page edition handler
+ * Page edition handler (action=edit)
  *
  * This is a wrapper that will call the EditPage class or a custom editor from an extension.
  *
index 2e9e093..5c0e2b0 100644 (file)
@@ -1,9 +1,5 @@
 <?php
 /**
- * action=protect handler
- *
- * Copyright © 2012 Timo Tijhof
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  *
  * @file
  * @ingroup Actions
- * @author Timo Tijhof
  */
 
 /**
- * Handle page protection
+ * Handle page protection (action=protect)
  *
  * This is a wrapper that will call Article::protect().
  *
index 16e407f..0dfbeda 100644 (file)
@@ -1,9 +1,5 @@
 <?php
 /**
- * Handle action=render
- *
- * Copyright © 2012 Timo Tijhof
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -20,7 +16,6 @@
  *
  * @file
  * @ingroup Actions
- * @author Timo Tijhof
  */
 
 /**
index 0757e88..4b8e6fc 100644 (file)
@@ -1,9 +1,5 @@
 <?php
 /**
- * action=unprotect handler
- *
- * Copyright © 2012 Timo Tijhof
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  *
  * @file
  * @ingroup Actions
- * @author Timo Tijhof
  */
 
 /**
- * Handle page unprotection
+ * Handle page unprotection (action=unprotect)
  *
  * This is a wrapper that will call Article::unprotect().
  *
index 134b8a4..72d92c3 100644 (file)
@@ -1,9 +1,5 @@
 <?php
 /**
- * An action that views article content
- *
- * Copyright © 2012 Timo Tijhof
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -20,7 +16,6 @@
  *
  * @file
  * @ingroup Actions
- * @author Timo Tijhof
  */
 
 /**
index 6473c35..e9fd0a7 100644 (file)
        "apihelp-query+filearchive-example-simple": "Mostrar una lista de todos los archivos eliminados.",
        "apihelp-query+filerepoinfo-summary": "Devuelve metainformación sobre los repositorios de imágenes configurados en el wiki.",
        "apihelp-query+filerepoinfo-param-prop": "Qué propiedades del repositorio obtener (las propiedades disponibles pueden variar en otras wikis).",
+       "apihelp-query+filerepoinfo-paramvalue-prop-favicon": "URL del favicono del wiki del repositorio, proveniente de <var>[[mw:Special:MyLanguage/Manual:$wgFavicon|$wgFavicon]]</var>.",
        "apihelp-query+filerepoinfo-paramvalue-prop-rootUrl": "Ruta de la URL raíz para las rutas de las imágenes.",
        "apihelp-query+filerepoinfo-paramvalue-prop-scriptDirUrl": "Ruta de la URL raíz para la instalación MediaWiki del wiki del repositorio.",
        "apihelp-query+filerepoinfo-paramvalue-prop-server": "<var>[[mw:Special:MyLanguage/Manual:$wgServer|$wgServer]]</var> o equivalente del wiki del repositorio.",
index ef03a3d..af1596d 100644 (file)
        "api-help-param-templated-var-first": "<var>&#x7B;$1&#x7D;</var> no nome do parâmetro deve ser substituído com os valores de <var>$2</var>",
        "api-help-param-templated-var": "<var>&#x7B;$1&#x7D;</var> com valores de <var>$2</var>",
        "api-help-datatypes-header": "Tipos de dados",
-       "api-help-datatypes": "A entrada para MediaWiki deve ser UTF-8 normalizada pelo NFC. O MediaWiki pode tentar converter outra entrada, mas isso pode causar a falha de algumas operações (como [[Special:ApiHelp/edit|editar]] com verificações MD5).\n\nAlguns tipos de parâmetros em solicitações de API precisam de uma explicação adicional:\n;boolean\n:Os parâmetros booleanos funcionam como caixas de seleção HTML: se o parâmetro for especificado, independentemente do valor, é considerado verdadeiro. Para um valor falso, omita o parâmetro inteiramente.\n;timestamp\n: As marcas de tempo podem ser especificadas em vários formatos. É recomendada a data e a hora ISO 8601. Todos os horários estão em UTC, qualquer fuso horário incluído é ignorado.\n:* Data e hora ISO 8601, <kbd><var>2001</var>-<var>01</var>-<var>15</var>T<var>14</var>:<var>56</var>:<var>00</var>Z</kbd> (pontuação e <kbd>Z</kbd> são opcionais)\n:* ISO 8601 data e hora com segundos fracionados (ignorados), <kbd><var>2001</var>-<var>01</var>-<var>15</var>T<var>14</var>:<var>56</var>:<var>00</var>.<var>00001</var>Z</kbd> (traços, dois pontos e <kbd>Z</kbd> são opcionais)\n:* Formato MediaWiki, <kbd><var>2001</var><var>01</var><var>15</var><var>14</var><var>56</var><var>00</var></kbd>\n:* Formato numérico genérico, <kbd><var>2001</var>-<var>01</var>-<var>15</var> <var>14</var>:<var>56</var>:<var>00</var></kbd> (fuso horário opcional de <kbd>GMT</kbd>, <kbd>+<var>##</var></kbd> ou <kbd>-<var>##</var></kbd> é ignorado)\n:* Formato EXIF, <kbd><var>2001</var>:<var>01</var>:<var>15</var> <var>14</var>:<var>56</var>:<var>00</var></kbd>\n:* Formato RFC 2822 (o fuso horário pode ser omitido), <kbd><var>Mon</var>, <var>15</var> <var>Jan</var> <var>2001</var> <var>14</var>:<var>56</var>:<var>00</var></kbd>\n:* Formato RFC 850 (fuso horário Pode ser omitido), <kbd><var>Monday</var>, <var>15</var>-<var>Jan</var>-<var>2001</var> <var>14</var>:<var>56</var>:<var>00</var></kbd>\n:* C ctime format, <kbd><var>Mon</var> <var>Jan</var> <var>15</var> <var>14</var>:<var>56</var>:<var>00</var> <var>2001</var></kbd>\n:* Segundos desde 1970-01-01T00:00:00Z como um inteiro de 1 a 13 dígitos (excluindo <kbd>0</kbd>)\n:* A string <kbd>now</kbd>\n; valor múltiplo alternativo separador\n: Os parâmetros que levam vários valores são normalmente enviados com os valores separados usando o caractere do pipe, por exemplo <kbd>param=value1|value2</kbd> ou <kbd>param=value1%7Cvalue2</kbd>. Se um valor deve conter o caractere de pipe, use U+001F (separador de unidade) como o separador ''and'' prefixa o valor com U+001F, por exemplo, <kbd>param=%1Fvalue1%1Fvalue2</kbd>.",
+       "api-help-datatypes": "O formato de entrada para o MediaWiki deve ser UTF-8, normalizado de acordo com a norma NFC. O MediaWiki pode converter outros tipos de entrada, mas esta conversão pode originar a falha de algumas operações (tais como as [[Special:ApiHelp/edit|edições]] com verificações MD5).\n\nAlguns tipos de parâmetros nos pedidos à API necessitam de mais explicações:\n;boolean\n:Os parâmetros boolianos funcionam como as caixas de seleção HTML: se o parâmetro for especificado, independentemente do seu valor, é considerado verdadeiro. Para um valor falso, omitir o parâmetro completo.\n;timestamp\n:As datas e horas podem ser especificadas em vários formatos;  para obter detalhes, consulte [[mw:Special:MyLanguage/Timestamp|os formatos de entrada da biblioteca Timestamp documentados em mediawiki.org]].  É recomendado o formato de data e hora ISO 8601: <kbd><var>2001</var>-<var>01</var>-<var>15</var>T<var>14</var>:<var>56</var>:<var>00</var>Z</kbd>. Adicionalmente, pode ser usado o texto <kbd>now</kbd> para especificar a data e hora atuais.\n;separador alternativo de valores múltiplos\n:Os parâmetros que aceitam vários valores são normalmente fornecidos com os valores separados por uma barra vertical (''pipe''), por exemplo <kbd>parâmetro=valor1|valor2</kbd> ou <kbd>parâmetro=valor1%7Cvalor2</kbd>. Se um valor contém a barra vertical, use como separador o U+001F (Separador de Unidades) ''e'' prefixe o valor com U+001F, isto é, <kbd>parâmetro=%1Fvalor1%1Fvalor2</kbd>.",
        "api-help-templatedparams-header": "Parâmetros da predefinição",
        "api-help-templatedparams": "Os parâmetros modelados usam-se nos casos em que um módulo da API necessita de um valor para cada valor de um outro parâmetro. Por exemplo, se existisse um módulo da API para encomendar fruta, poderia ter um parâmetro <var>frutas</var> para especificar as frutas que estão a ser encomendadas e um parâmetro modelado <var>quantidade-de-{fruta}</var> para especificar quanto de cada fruta. Um cliente da API que pretenda 1 maçã, 5 bananas e 20 morangos pode então fazer um pedido como <kbd>frutas=maçãs|bananas|morangos&quantidade-de-maçãs=1&quantidade-de-bananas=5&quantidade-de-morangos=20</kbd>.",
        "api-help-param-type-limit": "Tipo: inteiro ou <kbd>max</kbd>",
index 3b3ba9d..b2d0fc6 100644 (file)
@@ -25,5 +25,5 @@
  *
  * @since 1.23
  */
-class ConfigException extends Exception {
+class ConfigException extends LogicException {
 }
index f834fb1..8b0ed00 100644 (file)
@@ -67,6 +67,15 @@ class WikiExporter {
        /** @var XmlDumpWriter */
        private $writer;
 
+       /** @var IDatabase */
+       protected $db;
+
+       /** @var array|int */
+       protected $history;
+
+       /** @var array|null */
+       protected $limitNamespaces;
+
        /**
         * Returns the default export schema version, as defined by $wgXmlDumpSchemaVersion.
         * @return string
@@ -87,8 +96,11 @@ class WikiExporter {
         * @param null|array $limitNamespaces Comma-separated list of namespace numbers
         *   to limit results
         */
-       function __construct( $db, $history = self::CURRENT, $text = self::TEXT,
-                       $limitNamespaces = null
+       function __construct(
+               $db,
+               $history = self::CURRENT,
+               $text = self::TEXT,
+               $limitNamespaces = null
        ) {
                $this->db = $db;
                $this->history = $history;
index 8590e37..f947979 100644 (file)
@@ -49,7 +49,7 @@ abstract class DatabaseInstaller {
        /**
         * @var string Set by subclasses
         */
-       protected static $notMinimumVerisonMessage;
+       protected static $notMinimumVersionMessage;
 
        /**
         * The database connection.
@@ -82,7 +82,7 @@ abstract class DatabaseInstaller {
        public static function meetsMinimumRequirement( $serverVersion ) {
                if ( version_compare( $serverVersion, static::$minimumVersion ) < 0 ) {
                        return Status::newFatal(
-                               static::$notMinimumVerisonMessage, static::$minimumVersion, $serverVersion
+                               static::$notMinimumVersionMessage, static::$minimumVersion, $serverVersion
                        );
                }
 
index 45d6539..ffa17ed 100644 (file)
@@ -52,7 +52,7 @@ class MssqlInstaller extends DatabaseInstaller {
        // SQL Server 2005 RTM
        // @todo Are SQL Express version numbers different?)
        public static $minimumVersion = '9.00.1399';
-       protected static $notMinimumVerisonMessage = 'config-mssql-old';
+       protected static $notMinimumVersionMessage = 'config-mssql-old';
 
        // These are schema-level privs
        // Note: the web user will be created will full permissions if possible, this permission
index 6837eb8..3013db7 100644 (file)
@@ -51,7 +51,7 @@ class MysqlInstaller extends DatabaseInstaller {
        public $supportedEngines = [ 'InnoDB', 'MyISAM' ];
 
        public static $minimumVersion = '5.5.8';
-       protected static $notMinimumVerisonMessage = 'config-mysql-old';
+       protected static $notMinimumVersionMessage = 'config-mysql-old';
 
        public $webUserPrivs = [
                'DELETE',
index 644eec1..1a4e0f7 100644 (file)
@@ -47,7 +47,7 @@ class OracleInstaller extends DatabaseInstaller {
        ];
 
        public static $minimumVersion = '9.0.1'; // 9iR1
-       protected static $notMinimumVerisonMessage = 'config-oracle-old';
+       protected static $notMinimumVersionMessage = 'config-oracle-old';
 
        protected $connError = null;
 
index 6592c51..d6a5145 100644 (file)
@@ -47,7 +47,7 @@ class PostgresInstaller extends DatabaseInstaller {
        ];
 
        public static $minimumVersion = '9.2';
-       protected static $notMinimumVerisonMessage = 'config-postgres-old';
+       protected static $notMinimumVersionMessage = 'config-postgres-old';
        public $maxRoleSearchDepth = 5;
 
        protected $pgConns = [];
index 37d9153..17332ff 100644 (file)
@@ -34,7 +34,7 @@ use Wikimedia\Rdbms\DBConnectionError;
 class SqliteInstaller extends DatabaseInstaller {
 
        public static $minimumVersion = '3.8.0';
-       protected static $notMinimumVerisonMessage = 'config-outdated-sqlite';
+       protected static $notMinimumVersionMessage = 'config-outdated-sqlite';
 
        /**
         * @var DatabaseSqlite
index 20018d0..33c06fe 100644 (file)
@@ -148,7 +148,6 @@ class WebInstaller extends Installer {
 
                // Add parser hooks
                $parser = MediaWikiServices::getInstance()->getParser();
-               $parser->setHook( 'downloadlink', [ $this, 'downloadLinkHook' ] );
                $parser->setHook( 'doclink', [ $this, 'docLink' ] );
        }
 
@@ -658,22 +657,23 @@ class WebInstaller extends Installer {
        }
 
        /**
-        * Get HTML for an info box with an icon.
+        * Get HTML for an information message box with an icon.
         *
-        * @param string $text Wikitext, get this with wfMessage()->plain()
+        * @param string|HtmlArmor $text Wikitext to be parsed (from Message::plain) or raw HTML.
         * @param string|bool $icon Icon name, file in mw-config/images. Default: false
         * @param string|bool $class Additional class name to add to the wrapper div. Default: false.
-        *
-        * @return string
+        * @return string HTML
         */
        public function getInfoBox( $text, $icon = false, $class = false ) {
-               $text = $this->parse( $text, true );
+               $html = ( $text instanceof HtmlArmor ) ?
+                       HtmlArmor::getHtml( $text ) :
+                       $this->parse( $text, true );
                $icon = ( $icon == false ) ?
                        'images/info-32.png' :
                        'images/' . $icon;
                $alt = wfMessage( 'config-information' )->text();
 
-               return Html::infoBox( $text, $icon, $alt, $class );
+               return Html::infoBox( $html, $icon, $alt, $class );
        }
 
        /**
@@ -1092,11 +1092,11 @@ class WebInstaller extends Installer {
        /**
         * Helper for Installer::docLink()
         *
+        * @internal For use by WebInstallerOutput
         * @param string $page
-        *
         * @return string
         */
-       protected function getDocUrl( $page ) {
+       public function getDocUrl( $page ) {
                $query = [ 'page' => $page ];
 
                if ( in_array( $this->currentPageName, $this->pageSequence ) ) {
@@ -1122,15 +1122,26 @@ class WebInstaller extends Installer {
        }
 
        /**
-        * Helper for "Download LocalSettings" link on WebInstall_Complete
+        * Helper for sidebar links.
         *
-        * @param string $text Unused
-        * @param string[] $attribs Unused
-        * @param Parser $parser Unused
+        * @internal For use in WebInstallerOutput class
+        * @param string $url
+        * @param string $linkText
+        * @return string HTML
+        */
+       public function makeLinkItem( $url, $linkText ) {
+               return Html::rawElement( 'li', [],
+                       Html::element( 'a', [ 'href' => $url ], $linkText )
+               );
+       }
+
+       /**
+        * Helper for "Download LocalSettings" link.
         *
+        * @internal For use in WebInstallerComplete class
         * @return string Html for download link
         */
-       public function downloadLinkHook( $text, $attribs, $parser ) {
+       public function makeDownloadLinkHtml() {
                $anchor = Html::rawElement( 'a',
                        [ 'href' => $this->getUrl( [ 'localsettings' => 1 ] ) ],
                        wfMessage( 'config-download-localsettings' )->parse()
index 9f80489..2512efa 100644 (file)
@@ -45,17 +45,17 @@ class WebInstallerComplete extends WebInstallerPage {
                }
                $this->addHTML(
                        $this->parent->getInfoBox(
-                               wfMessage( $msg,
+                               new HtmlArmor( wfMessage( $msg,
                                        $lsUrl,
                                        $this->getVar( 'wgServer' ) .
-                                       $this->getVar( 'wgScriptPath' ) . '/index.php',
-                                       '<downloadlink/>',
+                                               $this->getVar( 'wgScriptPath' ) . '/index.php',
+                                       Message::rawParam( $this->parent->makeDownloadLinkHtml() ),
                                        $location ?: ''
-                               )->plain(), 'tick-32.png'
+                               )->parse() ), 'tick-32.png'
                        )
                );
                $this->addHTML( $this->parent->getInfoBox(
-                       wfMessage( 'config-extension-link' )->text() ) );
+                       wfMessage( 'config-extension-link' )->plain() ) );
 
                $this->parent->restoreLinkPopups();
                $this->endForm( false, false );
index eb3a52f..7546bdf 100644 (file)
@@ -55,7 +55,7 @@ class WebInstallerDBConnect extends WebInstallerPage {
                        $dbSupport .= wfMessage( "config-dbsupport-$type" )->plain() . "\n";
                }
                $this->addHTML( $this->parent->getInfoBox(
-                       wfMessage( 'config-support-info', trim( $dbSupport ) )->text() ) );
+                       wfMessage( 'config-support-info', trim( $dbSupport ) )->plain() ) );
 
                // It's possible that the library for the default DB type is not compiled in.
                // In that case, instead select the first supported DB type in the list.
index 1222ac2..981e3a8 100644 (file)
@@ -115,7 +115,7 @@ class WebInstallerName extends WebInstallerPage {
                                'value' => true,
                        ] ) .
                        $this->getFieldsetEnd() .
-                       $this->parent->getInfoBox( wfMessage( 'config-almost-done' )->text() ) .
+                       $this->parent->getInfoBox( wfMessage( 'config-almost-done' )->plain() ) .
                        // getRadioSet() builds a set of labeled radio buttons.
                        // For grep: The following messages are used as the item labels:
                        // config-optional-continue, config-optional-skip
index cbb9b57..991e484 100644 (file)
@@ -299,11 +299,27 @@ class WebInstallerOutput {
        </div>
 <?php
        $message = wfMessage( 'config-sidebar' )->plain();
+       // Section 1: External links
+       // @todo FIXME: Migrate to plain link label messages (T227297).
        foreach ( explode( '----', $message ) as $section ) {
                echo '<div class="portal"><div class="body">';
                echo $this->parent->parse( $section, true );
                echo '</div></div>';
        }
+       // Section 2: Installer pages
+       echo '<div class="portal"><div class="body"><ul>';
+       foreach ( [
+               'config-sidebar-readme' => 'Readme',
+               'config-sidebar-relnotes' => 'ReleaseNotes',
+               'config-sidebar-license' => 'Copying',
+               'config-sidebar-upgrade' => 'UpgradeDoc',
+       ] as $msgKey => $pageName ) {
+               echo $this->parent->makeLinkItem(
+                       $this->parent->getDocUrl( $pageName ),
+                       wfMessage( $msgKey )->text()
+               );
+       }
+       echo '</ul></div></div>';
 ?>
 </div>
 
index 0f78c62..60e78b4 100644 (file)
        "config-restart": "نعم، إعادة التشغيل",
        "config-welcome": "=== التحقق من البيئة ===\nسوف يتم الآن التحقق من أن البيئة مناسبة لتنصيب ميديا ويكي.\nتذكر تضمين هذه المعلومات اذا اردت طلب المساعدة عن كيفية إكمال التنصيب.",
        "config-copyright": "=== حقوق النسخ والشروط ===\n\n$1\n\nهذا البرنامج هو برنامج حر؛ يمكنك إعادة توزيعه و/أو تعديله تحت شروط رخصة جنو العامة على أن هذا البرنامج قد نُشر من قِبل مؤسسة البرمجيات الحرة؛ إما النسخة 2 من الرخصة، أو أي نسخة أخرى بعدها (من اختيارك).\n\nتم توزيع هذا البرنامج على أمل ان يكون مفيدًا ولكن <strong>دون أية ضمانات</strong>؛ دون حتى أية ضمانات مفهومة ضمنيًا أو رواجات أو أية أسباب محددة.\nانظر رخصة جنو العامة لمزيد من المعلومات.\n\nمن المفترض أنك استملت <doclink href=Copying> نسخة عن رخصة جنو العامة </doclink> مع هذا البرنامج؛ إذا لم تقعل اكتب رسالة إلى مؤسسة البرمجيات الحرة المحدودة، شارع 51 فرانكلين الطابق الخامس، بوسطن  MA 02110-1301 الولايات المتخدة أو [https://www.gnu.org/copyleft/gpl.html read it online].",
-       "config-sidebar": "* [https://www.mediawiki.org موقع ميدياويكي]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents دليل المستخدم]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Contents دليل الإداري]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ الأسئلة المتكررة]\n----\n* <doclink href=Readme>إقراءني</doclink>\n* <doclink href=ReleaseNotes>ملاحظات الإصدار</doclink>\n* <doclink href=Copying>النسخ</doclink>\n* <doclink href=UpgradeDoc>الترقية</doclink>",
+       "config-sidebar": "* [https://www.mediawiki.org موقع ميدياويكي]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents دليل المستخدم]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Contents دليل الإداري]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ الأسئلة المتكررة]",
+       "config-sidebar-readme": "اقرأني",
+       "config-sidebar-relnotes": "ملاحظات الإصدار",
+       "config-sidebar-license": "نسخ",
+       "config-sidebar-upgrade": "ترقية",
        "config-env-good": "جرى التحقق من البيئة.\nيمكنك تنصيب ميدياويكي.",
        "config-env-bad": "جرى التحقق من البيئة. لا يمكنك تنصيب ميدياويكي.",
        "config-env-php": "بي إتش بي $1 مثبت.",
index 4146ce4..42e7db0 100644 (file)
@@ -48,7 +48,7 @@
        "config-restart": "Так, пачаць зноў",
        "config-welcome": "== Праверка асяродзьдзя ==\nЗараз будуць праведзеныя праверкі для запэўніваньня, што гэтае асяродзьдзе адпаведнае для ўсталяваньня MediaWiki.\nНе забудзьце далучыць гэтую інфармацыю, калі вам спатрэбіцца дапамога для завяршэньня ўсталяваньня.",
        "config-copyright": "== Аўтарскае права і ўмовы ==\n\n$1\n\nThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but '''without any warranty'''; without even the implied warranty of '''merchantability''' or '''fitness for a particular purpose'''.\nSee the GNU General Public License for more details.\n\nYou should have received <doclink href=Copying>a copy of the GNU General Public License</doclink> along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. or [https://www.gnu.org/copyleft/gpl.html read it online].",
-       "config-sidebar": "* [https://www.mediawiki.org Хатняя старонка MediaWiki]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents Даведка для ўдзельнікаў]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Contents Даведка для адміністратараў]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ Адказы на частыя пытаньні]\n----\n* <doclink href=Readme>Прачытайце</doclink>\n* <doclink href=ReleaseNotes>Паляпшэньні ў вэрсіі</doclink>\n* <doclink href=Copying>Капіяваньне</doclink>\n* <doclink href=UpgradeDoc>Абнаўленьне</doclink>",
+       "config-sidebar": "* [https://www.mediawiki.org Хатняя старонка MediaWiki]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents Даведка для ўдзельнікаў]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Contents Даведка для адміністратараў]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ Адказы на частыя пытаньні]",
        "config-env-good": "Асяродзьдзе было праверанае.\nВы можаце ўсталёўваць MediaWiki.",
        "config-env-bad": "Асяродзьдзе было праверанае.\nУсталяваньне MediaWiki немагчымае.",
        "config-env-php": "Усталяваны PHP $1.",
index cf341e4..ad412d7 100644 (file)
        "config-restart": "Ano, restartovat",
        "config-welcome": "=== Kontrola prostředí ===\nNyní se provedou základní kontroly, aby se zjistilo, zda je toto prostředí použitelné k instalaci MediaWiki.\nPokud budete potřebovat k dokončení instalace pomoc, nezapomeňte sdělit výsledky těchto testů.",
        "config-copyright": "=== Licence a podmínky ===\n$1\n\nTento program je svobodný software; můžete jej šířit nebo modifikovat podle podmínek GNU General Public License, vydávané Free Software Foundation; buď verze 2 této licence anebo (podle vašeho uvážení) kterékoli pozdější verze.\n\nTento program je distribuován v naději, že bude užitečný, avšak '''bez jakékoli záruky'''; neposkytují se ani odvozené záruky '''prodejnosti''' anebo '''vhodnosti pro určitý účel'''.\nPodrobnosti se dočtete v textu GNU General Public License.\n\n<doclink href=Copying>Kopii GNU General Public License</doclink> jste měli obdržet spolu s tímto programem; pokud ne, napište na Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA nebo [https://www.gnu.org/copyleft/gpl.html si ji přečtěte online].",
-       "config-sidebar": "* [https://www.mediawiki.org Oficiální web MediaWiki]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents Uživatelská příručka]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Contents Administrátorská příručka]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ FAQ]\n----\n* <doclink href=Readme>Čti mě</doclink>\n* <doclink href=ReleaseNotes>Poznámky k vydání</doclink>\n* <doclink href=Copying>Licence</doclink>\n* <doclink href=UpgradeDoc>Upgrade</doclink>",
+       "config-sidebar": "* [https://www.mediawiki.org Oficiální web MediaWiki]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents Uživatelská příručka]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Contents Administrátorská příručka]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ FAQ]",
+       "config-sidebar-readme": "Čti mě",
+       "config-sidebar-relnotes": "Poznámky k vydání",
+       "config-sidebar-license": "Licence",
+       "config-sidebar-upgrade": "Upgrade",
        "config-env-good": "Prostředí bylo zkontrolováno.\nMůžete nainstalovat MediaWiki.",
        "config-env-bad": "Prostředí bylo zkontrolováno.\nMediaWiki nelze nainstalovat.",
        "config-env-php": "Je nainstalováno PHP $1.",
index 5b9742b..5f5e452 100644 (file)
        "config-restart": "Yes, restart it",
        "config-welcome": "=== Environmental checks ===\nBasic checks will now be performed to see if this environment is suitable for MediaWiki installation.\nRemember to include this information if you seek support on how to complete the installation.",
        "config-copyright": "=== Copyright and Terms ===\n\n$1\n\nThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but <strong>without any warranty</strong>; without even the implied warranty of <strong>merchantability</strong> or <strong>fitness for a particular purpose</strong>.\nSee the GNU General Public License for more details.\n\nYou should have received <doclink href=Copying>a copy of the GNU General Public License</doclink> along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA, or [https://www.gnu.org/copyleft/gpl.html read it online].",
-       "config-sidebar": "* [https://www.mediawiki.org MediaWiki home]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Contents Administrator's Guide]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ FAQ]\n----\n* <doclink href=Readme>Read me</doclink>\n* <doclink href=ReleaseNotes>Release notes</doclink>\n* <doclink href=Copying>Copying</doclink>\n* <doclink href=UpgradeDoc>Upgrading</doclink>",
+       "config-sidebar": "* [https://www.mediawiki.org MediaWiki home]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Contents Administrator's Guide]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ FAQ]",
+       "config-sidebar-readme": "Read me",
+       "config-sidebar-relnotes": "Release notes",
+       "config-sidebar-license": "Copying",
+       "config-sidebar-upgrade": "Upgrading",
        "config-env-good": "The environment has been checked.\nYou can install MediaWiki.",
        "config-env-bad": "The environment has been checked.\nYou cannot install MediaWiki.",
        "config-env-php": "PHP $1 is installed.",
index 6e1d5a2..196e2d4 100644 (file)
@@ -40,7 +40,8 @@
                        "Dschultz",
                        "Carlosmg.dg",
                        "Harvest",
-                       "Anarhistička Maca"
+                       "Anarhistička Maca",
+                       "Johny Weissmuller Jr"
                ]
        },
        "config-desc": "El instalador de MediaWiki",
        "config-restart": "Sí, reiniciarlo",
        "config-welcome": "=== Comprobación del entorno ===\nAhora se van a realizar comprobaciones básicas para ver si el entorno es adecuado para la instalación de MediaWiki.\nRecuerda suministrar los resultados de tales comprobaciones si necesitas ayuda para completar la instalación.",
        "config-copyright": "=== Derechos de autor y Términos de uso ===\n\n$1\n\nEste programa es software libre; puedes redistribuirlo y/o modificarlo en los términos de la Licencia Pública General de GNU, tal como aparece publicada por la Fundación para el Software Libre, tanto la versión 2 de la Licencia, como cualquier versión posterior (según prefieras).\n\nEste programa es distribuido con la esperanza de que sea útil, pero <strong>sin ninguna garantía</strong>; inclusive, sin la garantía implícita de la <strong>posibilidad de ser comercializado</strong> o de <strong>idoneidad para cualquier finalidad específica</strong>.\nConsulta la Licencia Pública General de GNU para más detalles.\n\nEn conjunto con este programa debes haber recibido <doclink href=Copying>una copia de la Licencia Pública General de GNU</doclink>; caso contrario, pídela por escrito a la Fundación para el Software Libre, Inc., 51 Franklin Street, Fifth Floor, Boston, ME La 02110-1301, USA o [https://www.gnu.org/copyleft/gpl.html léela en Internet].",
-       "config-sidebar": "* [https://www.mediawiki.org Página principal de MediaWiki]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents Guía del usuario]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Contents Guía del administrador]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ Preguntas frecuentes]\n----\n* <doclink href=Readme>Léeme</doclink>\n* <doclink href=ReleaseNotes>Notas de la versión</doclink>\n* <doclink href=Copying>Copia</doclink>\n* <doclink href=UpgradeDoc>Actualización</doclink>",
+       "config-sidebar": "* [https://www.mediawiki.org Página principal de MediaWiki]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents Guía de usuario]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Contents Guía para administradores]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ Preguntas frecuentes]",
+       "config-sidebar-readme": "Léeme",
+       "config-sidebar-relnotes": "Informe de novedades",
+       "config-sidebar-license": "Cómo copiar",
+       "config-sidebar-upgrade": "Cómo actualizar",
        "config-env-good": "El entorno ha sido comprobado.\nPuedes instalar MediaWiki.",
        "config-env-bad": "El entorno ha sido comprobado.\nNo puedes instalar MediaWiki.",
        "config-env-php": "PHP $1 está instalado.",
index 1c69e65..697e165 100644 (file)
        "config-restart": "Oui, le relancer",
        "config-welcome": "=== Vérifications liées à l’environnement ===\nDes vérifications de base vont maintenant être effectuées pour voir si cet environnement est adapté à l’installation de MediaWiki.\nRappelez-vous d’inclure ces informations si vous recherchez de l’aide sur la manière de terminer l’installation.",
        "config-copyright": "=== Droit d’auteur et conditions ===\n\n$1\n\nCe programme est un logiciel libre : vous pouvez le redistribuer ou le modifier selon les termes de la Licence Publique Générale GNU telle que publiée par la Free Software Foundation (version 2 de la Licence, ou, à votre choix, toute version ultérieure).\n\nCe programme est distribué dans l’espoir qu’il sera utile, mais '''sans aucune garantie''' : sans même les garanties implicites de '''commercialisabilité''' ou d’'''adéquation à un usage particulier'''.\nVoir la Licence Publique Générale GNU pour plus de détails.\n\nVous devriez avoir reçu <doclink href=Copying>une copie de la Licence Publique Générale GNU</doclink> avec ce programme ; dans le cas contraire, écrivez à la Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ou [https://www.gnu.org/copyleft/gpl.html lisez-la en ligne].",
-       "config-sidebar": "* [https://www.mediawiki.org Accueil MediaWiki]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents Guide de l’utilisateur]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Contents Guide de l’administrateur]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ FAQ]\n----\n* <doclink href=Readme>Lisez-moi</doclink>\n* <doclink href=ReleaseNotes>Notes de publication</doclink>\n* <doclink href=Copying>Copie</doclink>\n* <doclink href=UpgradeDoc>Mise à jour</doclink>",
+       "config-sidebar": "* [https://www.mediawiki.org Accueil MediaWiki]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents Guide de l’utilisateur]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Contents Guide de l’administrateur]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ FAQ]",
+       "config-sidebar-readme": "Me lire",
+       "config-sidebar-relnotes": "Notes de version",
+       "config-sidebar-license": "Copie",
+       "config-sidebar-upgrade": "Mise à jour",
        "config-env-good": "L’environnement a été vérifié.\nVous pouvez installer MediaWiki.",
        "config-env-bad": "L’environnement a été vérifié.\nVous ne pouvez pas installer MediaWiki.",
        "config-env-php": "PHP $1 est installé.",
index 88d13fe..5cd5344 100644 (file)
@@ -42,6 +42,7 @@
        "config-restart": "Jo, neistarten",
        "config-welcome": "=== Iwwerpréifung vum Installatiounsenvironnement ===\nEt gi grondsätzlech Iwwerpréifunge gemaach fir ze kucken ob den Environnment gëeegent ass fir MediaWiki z'installéieren.\nDir sollt d'Resultater vun dëser Iwwerpréifung ugi wann Dir während der Installatioun Hëllef frot wéi Dir D'Installatioun ofschléisse kënnt.",
        "config-sidebar": "* [https://www.mediawiki.org MediaWiki Haaptsäit]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents Benotzerguide]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Contents Guide fir Administrateuren]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ FAQ]\n----\n* <doclink href=Readme>Liest dëst</doclink>\n* <doclink href=ReleaseNotes>Informatioune vun der aktueller Versioun</doclink>\n* <doclink href=Copying>Lizenzbedingungen</doclink>\n* <doclink href=UpgradeDoc>Aktualiséierung</doclink>",
+       "config-sidebar-readme": "Liest dëst",
        "config-env-good": "Den Environement gouf nogekuckt.\nDir kënnt MediaWiki installéieren.",
        "config-env-bad": "Den Environnement gouf iwwerpréift.\nDir kënnt MediWiki net installéieren.",
        "config-env-php": "PHP $1 ass installéiert.",
index 6acd866..93e6f08 100644 (file)
        "config-restart": "Sim, reiniciar",
        "config-welcome": "=== Verificações do ambiente ===\nSerão agora realizadas verificações básicas para determinar se este ambiente é apropriado para instalação do MediaWiki.\nLembre-se de fornecer esta informação se necessitar de pedir ajuda para concluir a instalação.",
        "config-copyright": "=== Direitos de autor e Condições de utilização ===\n\n$1\n\nEste programa é software livre; pode redistribuí-lo e/ou modificá-lo nos termos da licença GNU General Public License, tal como publicada pela Free Software Foundation; tanto a versão 2 da Licença, como (por opção sua) qualquer versão posterior.\n\nEste programa é distribuído na esperança de que seja útil, mas '''sem qualquer garantia'''; inclusive, sem a garantia implícita da '''possibilidade de ser comercializado''' ou de '''adequação para qualquer finalidade específica'''.\nConsulte a licença GNU General Public License para mais detalhes.\n\nEm conjunto com este programa deve ter recebido <doclink href=Copying>uma cópia da licença GNU General Public License</doclink>; se não a recebeu, peça-a por escrito a Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA ou [https://www.gnu.org/copyleft/gpl.html leia-a na Internet].",
-       "config-sidebar": "* [https://www.mediawiki.org/wiki/MediaWiki/pt Página principal do MediaWiki]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents/pt Ajuda]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Contents/pt Manual técnico]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ FAQ]\n----\n* <doclink href=Readme>Leia-me</doclink>\n* <doclink href=ReleaseNotes>Notas de lançamento</doclink>\n* <doclink href=Copying>Cópia</doclink>\n* <doclink href=UpgradeDoc>Atualização</doclink>",
+       "config-sidebar": "* [https://www.mediawiki.org/wiki/MediaWiki/pt Página principal do MediaWiki]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents/pt Ajuda]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Contents/pt Manual técnico]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ/pt FAQ]",
+       "config-sidebar-readme": "Leia-me",
+       "config-sidebar-relnotes": "Notas de lançamento",
+       "config-sidebar-license": "Copiar",
+       "config-sidebar-upgrade": "Atualizar",
        "config-env-good": "O ambiente foi verificado.\nPode instalar o MediaWiki.",
        "config-env-bad": "O ambiente foi verificado.\nNão pode instalar o MediaWiki.",
        "config-env-php": "O PHP $1 está instalado.",
        "config-env-hhvm": "HHVM $1 está instalado.",
-       "config-unicode-using-intl": "A usar a [https://pecl.php.net/intl extensão intl PECL] para a normalização Unicode.",
-       "config-unicode-pure-php-warning": "<strong>Aviso:</strong> A [https://pecl.php.net/intl extensão intl PECL] não está disponível para efetuar a normalização Unicode. Irá recorrer-se à implementação em PHP puro, que é mais lenta.\nSe o seu sítio tem alto volume de tráfego, devia informar-se um pouco sobre a [https://www.mediawiki.org/wiki/Special:MyLanguage/Unicode_normalization_considerations/pt normalização Unicode].",
+       "config-unicode-using-intl": "A usar a [https://php.net/manual/en/book.intl.php extensão intl do PHP] para a normalização Unicode.",
+       "config-unicode-pure-php-warning": "<strong>Aviso:</strong> A [https://php.net/manual/en/book.intl.php extensão intl do PHP] não está disponível para efetuar a normalização Unicode. Irá recorrer-se à implementação em PHP puro, que é mais lenta.\nSe o seu sítio tem alto volume de tráfego, devia informar-se sobre a [https://www.mediawiki.org/wiki/Special:MyLanguage/Unicode_normalization_considerations/pt normalização Unicode].",
        "config-unicode-update-warning": "<strong>Aviso:</strong> A versão instalada do wrapper de normalização Unicode usa uma versão mais antiga da biblioteca do [http://site.icu-project.org/ projeto ICU].\nDevia [https://www.mediawiki.org/wiki/Special:MyLanguage/Unicode_normalization_considerations atualizá-la] se tem quaisquer preocupações sobre o uso do Unicode.",
        "config-no-db": "Não foi possível encontrar um controlador apropriado da base de dados! Precisa de instalar um controlador da base de dados para o PHP. {{PLURAL:$2|É aceite o seguinte tipo|São aceites os seguintes tipos}} de base de dados: $1.\n\nSe fez a compilação do PHP, reconfigure-o com um cliente de base de dados ativado; por exemplo, usando <code>./configure --with-mysqli</code>.\nSe instalou o PHP a partir de um pacote Debian ou Ubuntu, então precisa de instalar também, por exemplo, o pacote <code>php-mysql</code>.",
-       "config-outdated-sqlite": "<strong>Aviso:</strong> Tem a versão $1 do SQLite, que é anterior à versão mínima necessária, a $2. O SQLite não estará disponível.",
+       "config-outdated-sqlite": "<strong>Aviso:</strong> Tem a versão $2 do SQLite, que é anterior à versão mínima necessária, a $1. O SQLite não estará disponível.",
        "config-no-fts3": "<strong>Aviso:</strong> O SQLite foi compilado sem o módulo [//sqlite.org/fts3.html FTS3]; as funcionalidades de pesquisa não estarão disponíveis nesta instalação.",
        "config-pcre-old": "<strong>Erro fatal:</strong> É necessário o PCRE $1 ou versão posterior.\nO seu binário PHP foi linkado com o PCRE $2.\n[https://www.mediawiki.org/wiki/Manual:Errors_and_symptoms/PCRE Mais informações].",
        "config-pcre-no-utf8": "'''Erro fatal''': O módulo PCRE do PHP parece ter sido compilado sem suporte PCRE_UTF8.\nO MediaWiki necessita do suporte UTF-8 para funcionar corretamente.",
index ceb7586..6a821b8 100644 (file)
        "config-welcome": "Notice that the installer is about to check as to whether MediaWiki can be installed.",
        "config-copyright": "This message follows {{msg-mw|config-env-good}}.\n\nParameters:\n* $1 - copyright and author list",
        "config-sidebar": "Maximum width for words is 24 characters. Only visible part of the translation counts to this limit.",
+       "config-sidebar-readme": "Link in sidebar to read the README documentation",
+       "config-sidebar-relnotes": "Link in sidebar to read the RELEASE-NOTES documentation",
+       "config-sidebar-license": "Link in sidebar to read the COPYING file, containing the full license text",
+       "config-sidebar-upgrade": "Link in sidebar to read the UPGRADE documentation",
        "config-env-good": "See also:\n* {{msg-mw|Config-env-bad}}",
        "config-env-bad": "See also:\n* {{msg-mw|Config-env-good}}",
        "config-env-php": "Parameters:\n* $1 - the version of PHP that has been installed\nSee also:\n* {{msg-mw|config-env-php-toolow}}",
index 6f6e003..1c0ec86 100644 (file)
        "config-page-upgradedoc": "Aggiornamende",
        "config-page-existingwiki": "Uicchi esistende",
        "config-restart": "Sìne, falle repartì",
+       "config-sidebar": "* [https://www.mediawiki.org Pàgena Prengepàle MediaUicchi]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents Guide de l'utende]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Contents Guide de l'amministratore]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ FAQ]",
+       "config-sidebar-readme": "Liggeme",
+       "config-sidebar-relnotes": "Note de rilasce",
+       "config-sidebar-license": "Stoche a copie",
+       "config-sidebar-upgrade": "Aggiornamende",
        "config-env-php": "PHP $1 ha state installate.",
        "config-env-hhvm": "HHVM $1 ha state installate.",
        "config-outdated-sqlite": "<strong>Iapre l'uecchjie:</strong> tu è SQLite $2, ca jè 'na versione troppe vecchie respette a quedda minime $1. SQLite non g'è disponibbele.",
index 4943e72..a34db5f 100644 (file)
        "config-restart": "Да, начать заново",
        "config-welcome": "=== Проверка окружения ===\nБудут проведены базовые проверки с целью определить, подходит ли данная система для установки MediaWiki.\nНе забудьте включить эту информацию, если вам потребуется помощь для завершения установки.",
        "config-copyright": "=== Авторские права и условия ===\n\n$1\n\nMediaWiki — свободное программное обеспечение, которое вы можете распространять и/или изменять в соответствии с условиями лицензии GNU General Public License, опубликованной фондом свободного программного обеспечения; второй версии, либо любой более поздней версии.\n\nMediaWiki распространяется в надежде, что она будет полезной, но <strong>без каких-либо гарантий</strong>, даже без подразумеваемых гарантий <strong>коммерческой ценности</strong> или <strong>пригодности для определённой цели</strong>. См. лицензию GNU General Public License для более подробной информации.\n\nВы должны были получить <doclink href=Copying>копию GNU General Public License</doclink> вместе с этой программой, если нет, то напишите Free Software Foundation, Inc., по адресу: 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA или [https://www.gnu.org/copyleft/gpl.html прочтите её онлайн].",
-       "config-sidebar": "* [https://www.mediawiki.org Сайт MediaWiki]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents/ru Справка для пользователей]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Contents/ru Справка для администраторов]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ/ru FAQ]\n----\n* <doclink href=Readme>Readme-файл</doclink>\n* <doclink href=ReleaseNotes>Информация о выпуске</doclink>\n* <doclink href=Copying>Лицензия</doclink>\n* <doclink href=UpgradeDoc>Обновление</doclink>",
+       "config-sidebar": "* [https://www.mediawiki.org Сайт MediaWiki]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents Справка для пользователей]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Contents Справка для администраторов]\n* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ FAQ]",
+       "config-sidebar-readme": "Прочти меня",
+       "config-sidebar-relnotes": "Информация о версии",
+       "config-sidebar-license": "Копирование",
+       "config-sidebar-upgrade": "Обновление",
        "config-env-good": "Проверка внешней среды была успешно проведена.\nВы можете установить MediaWiki.",
        "config-env-bad": "Была проведена проверка внешней среды.\nВы не можете установить MediaWiki.",
        "config-env-php": "Установленная версия PHP: $1.",
index 7a30492..13a9241 100644 (file)
@@ -71,7 +71,7 @@
        "config-unicode-pure-php-warning": "<strong>警告:</strong> 無法使用 [https://pecl.php.net/intl intl PECL 擴充套件] 處理 Unicode 正規化,故回退使用純 PHP 實作的正規化程式,此方式處理速度較緩慢。\n\n如果您的網站瀏覽人次很高,您應先閱讀 [https://www.mediawiki.org/wiki/Special:MyLanguage/Unicode_normalization_considerations/zh Unicode 正規化]。",
        "config-unicode-update-warning": "<strong>警告</strong>:目前安裝的 Unicode 正規化包裝程式使用了舊版 [http://site.icu-project.org/ ICU 計劃] 的程式庫。\n若您需要使用 Unicode,您應先進行 [https://www.mediawiki.org/wiki/Special:MyLanguage/Unicode_normalization_considerations 升級]。",
        "config-no-db": "找不到合適的資料庫驅動程式!您需要安裝 PHP 資料庫驅動程式。\n目前支援以下{{PLURAL:$2|類型|類型}}的資料庫: $1 。\n\n如果您是自行編譯 PHP,您必須重新設定並開啟資料庫客戶端,例:使用 <code>./configure --with-mysqli</code> 指令參數。\n如果您是使用 Debian 或 Ubuntu 的套件安裝 PHP ,您則需要額外安裝,例:<code>php-mysql</code> 套件。",
-       "config-outdated-sqlite": "<strong>警告:</strong>您已安裝 SQLite $1,但是它的版本低於最低需求版本 $2。 因此您無法使用 SQLite。",
+       "config-outdated-sqlite": "<strong>警告:</strong>您已安裝 SQLite $2,但是它的版本低於最低需求版本 $1。 因此您無法使用 SQLite。",
        "config-no-fts3": "<strong>警告:</strong> SQLite 編譯時未包含 [//sqlite.org/fts3.html FTS3 模組],後台搜尋功能將無法使用。",
        "config-pcre-old": "<strong>嚴重:</strong> 需要使用 PCRE $1 或更新的版本。\n您的 PHP 執行檔使用的是 PCRE $2。\n[https://www.mediawiki.org/wiki/Manual:Errors_and_symptoms/PCRE 詳細資訊]。",
        "config-pcre-no-utf8": "<strong>嚴重:</strong> PHP 的 PCRE 模組在編譯時未包含 PCRE_UTF8 支援。\nMediaWiki 需要支援 UTF-8 才可正常運作。",
index 2f98d53..c87dedc 100644 (file)
@@ -52,9 +52,6 @@ abstract class Job implements RunnableJob {
        /** @var int Bitfield of JOB_* class constants */
        protected $executionFlags = 0;
 
-       /** @var int Job must not be wrapped in the usual explicit LBFactory transaction round */
-       const JOB_NO_EXPLICIT_TRX_ROUND = 1;
-
        /**
         * Create the appropriate object to handle a specific job
         *
@@ -154,11 +151,6 @@ abstract class Job implements RunnableJob {
                }
        }
 
-       /**
-        * @param int $flag JOB_* class constant
-        * @return bool
-        * @since 1.31
-        */
        public function hasExecutionFlag( $flag ) {
                return ( $this->executionFlags & $flag ) === $flag;
        }
@@ -234,20 +226,10 @@ abstract class Job implements RunnableJob {
                        : null;
        }
 
-       /**
-        * @return string|null Id of the request that created this job. Follows
-        *  jobs recursively, allowing to track the id of the request that started a
-        *  job when jobs insert jobs which insert other jobs.
-        * @since 1.27
-        */
        public function getRequestId() {
                return $this->params['requestId'] ?? null;
        }
 
-       /**
-        * @return int|null UNIX timestamp of when the job was runnable, or null
-        * @since 1.26
-        */
        public function getReadyTimestamp() {
                return $this->getReleaseTimestamp() ?: $this->getQueuedTimestamp();
        }
@@ -267,19 +249,10 @@ abstract class Job implements RunnableJob {
                return $this->removeDuplicates;
        }
 
-       /**
-        * @return bool Whether this job can be retried on failure by job runners
-        * @since 1.21
-        */
        public function allowRetries() {
                return true;
        }
 
-       /**
-        * @return int Number of actually "work items" handled in this job
-        * @see $wgJobBackoffThrottling
-        * @since 1.23
-        */
        public function workItemCount() {
                return 1;
        }
@@ -380,20 +353,12 @@ abstract class Job implements RunnableJob {
                $this->teardownCallbacks[] = $callback;
        }
 
-       /**
-        * Do any final cleanup after run(), deferred updates, and all DB commits happen
-        * @param bool $status Whether the job, its deferred updates, and DB commit all succeeded
-        * @since 1.27
-        */
        public function teardown( $status ) {
                foreach ( $this->teardownCallbacks as $callback ) {
                        call_user_func( $callback, $status );
                }
        }
 
-       /**
-        * @return string
-        */
        public function toString() {
                $paramString = '';
                if ( $this->params ) {
index 8b5a62e..beab4c6 100644 (file)
@@ -88,8 +88,6 @@ class JobQueueFederated extends JobQueue {
                ) {
                        unset( $baseConfig[$o] ); // partition queue doesn't care about this
                }
-               // The class handles all aggregator calls already
-               unset( $baseConfig['aggregator'] );
                // Get the partition queue objects
                foreach ( $partitionMap as $partition => $w ) {
                        if ( !isset( $params['configByPartition'][$partition] ) ) {
index e477b12..dba2ae9 100644 (file)
@@ -33,6 +33,9 @@
  * @since 1.33
  */
 interface RunnableJob extends IJobSpecification {
+       /** @var int Job must not be wrapped in the usual explicit LBFactory transaction round */
+       const JOB_NO_EXPLICIT_TRX_ROUND = 1;
+
        /**
         * Run the job
         * @return bool Success
@@ -51,4 +54,55 @@ interface RunnableJob extends IJobSpecification {
         * @return mixed|null The prior field value; null if missing
         */
        public function setMetadata( $field, $value );
+
+       /**
+        * @param int $flag JOB_* class constant
+        * @return bool
+        * @since 1.31
+        */
+       public function hasExecutionFlag( $flag );
+
+       /**
+        * @return string|null Id of the request that created this job. Follows
+        *  jobs recursively, allowing to track the id of the request that started a
+        *  job when jobs insert jobs which insert other jobs.
+        * @since 1.27
+        */
+       public function getRequestId();
+
+       /**
+        * @return bool Whether this job can be retried on failure by job runners
+        * @since 1.21
+        */
+       public function allowRetries();
+
+       /**
+        * @return int Number of actually "work items" handled in this job
+        * @see $wgJobBackoffThrottling
+        * @since 1.23
+        */
+       public function workItemCount();
+
+       /**
+        * @return int|null UNIX timestamp of when the job was runnable, or null
+        * @since 1.26
+        */
+       public function getReadyTimestamp();
+
+       /**
+        * Do any final cleanup after run(), deferred updates, and all DB commits happen
+        * @param bool $status Whether the job, its deferred updates, and DB commit all succeeded
+        * @since 1.27
+        */
+       public function tearDown( $status );
+
+       /**
+        * @return string
+        */
+       public function getLastError();
+
+       /**
+        * @return string Debugging string describing the job
+        */
+       public function toString();
 }
index 8175427..a1ddfd0 100644 (file)
@@ -77,6 +77,8 @@ class Xhprof {
                                'tideways_disable',
                                'tideways_xhprof_disable'
                        ] );
+               } else {
+                       return null;
                }
        }
 
@@ -84,6 +86,7 @@ class Xhprof {
         * Call the first available function from $functions.
         * @param array $functions
         * @param array $args
+        * @return mixed
         * @throws Exception
         */
        protected static function callAny( array $functions, array $args = [] ) {
index 019029c..c00b041 100644 (file)
@@ -124,9 +124,13 @@ class FSLockManager extends LockManager {
                        } else {
                                Wikimedia\suppressWarnings();
                                $handle = fopen( $this->getLockPath( $path ), 'a+' );
-                               if ( !$handle ) { // lock dir missing?
-                                       mkdir( $this->lockDir, 0777, true );
-                                       $handle = fopen( $this->getLockPath( $path ), 'a+' ); // try again
+                               if ( !$handle && !is_dir( $this->lockDir ) ) {
+                                       // Create the lock directory in case it is missing
+                                       if ( mkdir( $this->lockDir, 0777, true ) ) {
+                                               $handle = fopen( $this->getLockPath( $path ), 'a+' ); // try again
+                                       } else {
+                                               $this->logger->error( "Cannot create directory '{$this->lockDir}'." );
+                                       }
                                }
                                Wikimedia\restoreWarnings();
                        }
index aea0a02..8afaa38 100644 (file)
@@ -333,7 +333,7 @@ class MSCompoundFileReader {
                                continue;
                        }
 
-                       $name = iconv( 'UTF-16', 'UTF-8', substr( $entry['name_raw'], 0, $entry['name_length'] - 2 ) );
+                       $name = iconv( 'UTF-16LE', 'UTF-8', substr( $entry['name_raw'], 0, $entry['name_length'] - 2 ) );
 
                        $clsid = $this->decodeClsid( $entry['clsid'] );
                        if ( $type == self::TYPE_ROOT && isset( self::$mimesByClsid[$clsid] ) ) {
index f493769..42146f4 100644 (file)
@@ -878,6 +878,14 @@ EOT;
 
                $mime = 'application/zip';
                $opendocTypes = [
+                       # In OASIS Open Document Format v1.2, Database front end document
+                       # has a recommended MIME type of:
+                       # application/vnd.oasis.opendocument.base
+                       # Despite the type registered at the IANA being 'database' which is
+                       # supposed to be normative.
+                       # T35515
+                       'base',
+
                        'chart-template',
                        'chart',
                        'formula-template',
@@ -895,7 +903,10 @@ EOT;
                        'text-web',
                        'text' ];
 
-               // https://lists.oasis-open.org/archives/office/200505/msg00006.html
+               // The list of document types is available in OASIS Open Document
+               // Format version 1.2 under Appendix C. It is not normative though,
+               // supposedly types registered at the IANA should be.
+               // http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html
                $types = '(?:' . implode( '|', $opendocTypes ) . ')';
                $opendocRegex = "/^mimetype(application\/vnd\.oasis\.opendocument\.$types)/";
 
index 7759947..7ebbe8b 100644 (file)
@@ -61,7 +61,7 @@ use Wikimedia\WaitConditionLoop;
  *
  * @ingroup Cache
  */
-abstract class BagOStuff implements IExpiringStore, LoggerAwareInterface {
+abstract class BagOStuff implements IExpiringStore, IStoreKeyEncoder, LoggerAwareInterface {
        /** @var array[] Lock tracking */
        protected $locks = [];
        /** @var int ERR_* class constant */
@@ -652,14 +652,19 @@ abstract class BagOStuff implements IExpiringStore, LoggerAwareInterface {
 
        /**
         * Delete all objects expiring before a certain date.
-        * @param string $date The reference date in MW format
-        * @param callable|bool $progressCallback Optional, a function which will be called
+        * @param string|int $timestamp The reference date in MW or TS_UNIX format
+        * @param callable|null $progressCallback Optional, a function which will be called
         *     regularly during long-running operations with the percentage progress
-        *     as the first parameter.
+        *     as the first parameter. [optional]
+        * @param int $limit Maximum number of keys to delete [default: INF]
         *
         * @return bool Success, false if unimplemented
         */
-       public function deleteObjectsExpiringBefore( $date, $progressCallback = false ) {
+       public function deleteObjectsExpiringBefore(
+               $timestamp,
+               callable $progressCallback = null,
+               $limit = INF
+       ) {
                // stub
                return false;
        }
index 8892f73..e193497 100644 (file)
@@ -82,9 +82,18 @@ class CachedBagOStuff extends HashBagOStuff {
                $this->backend->setDebug( $bool );
        }
 
-       public function deleteObjectsExpiringBefore( $date, $progressCallback = false ) {
-               parent::deleteObjectsExpiringBefore( $date, $progressCallback );
-               return $this->backend->deleteObjectsExpiringBefore( $date, $progressCallback );
+       public function deleteObjectsExpiringBefore(
+               $timestamp,
+               callable $progressCallback = null,
+               $limit = INF
+       ) {
+               parent::deleteObjectsExpiringBefore( $timestamp, $progressCallback, $limit );
+
+               return $this->backend->deleteObjectsExpiringBefore(
+                       $timestamp,
+                       $progressCallback,
+                       $limit
+               );
        }
 
        public function makeKeyInternal( $keyspace, $args ) {
index 61a4c61..1566c07 100644 (file)
@@ -17,7 +17,6 @@
  *
  * @file
  * @ingroup Cache
- * @author 2015 Timo Tijhof
  */
 
 /**
diff --git a/includes/libs/objectcache/IStoreKeyEncoder.php b/includes/libs/objectcache/IStoreKeyEncoder.php
new file mode 100644 (file)
index 0000000..da0686e
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+
+/**
+ * Generic interface for object stores with key encoding methods.
+ *
+ * @ingroup Cache
+ * @since 1.34
+ */
+interface IStoreKeyEncoder {
+       /**
+        * Make a global cache key.
+        *
+        * @param string $class Key class
+        * @param string|null $component [optional] Key component (starting with a key collection name)
+        * @return string Colon-delimited list of $keyspace followed by escaped components of $args
+        */
+       public function makeGlobalKey( $class, $component = null );
+
+       /**
+        * Make a cache key, scoped to this instance's keyspace.
+        *
+        * @param string $class Key class
+        * @param string|null $component [optional] Key component (starting with a key collection name)
+        * @return string Colon-delimited list of $keyspace followed by escaped components of $args
+        */
+       public function makeKey( $class, $component = null );
+}
index e832734..4c6750f 100644 (file)
@@ -208,18 +208,14 @@ class MultiWriteBagOStuff extends BagOStuff {
                return $this->caches[0]->unlock( $key );
        }
 
-       /**
-        * Delete objects expiring before a certain date.
-        *
-        * Succeed if any of the child caches succeed.
-        * @param string $date
-        * @param bool|callable $progressCallback
-        * @return bool
-        */
-       public function deleteObjectsExpiringBefore( $date, $progressCallback = false ) {
+       public function deleteObjectsExpiringBefore(
+               $timestamp,
+               callable $progressCallback = null,
+               $limit = INF
+       ) {
                $ret = false;
                foreach ( $this->caches as $cache ) {
-                       if ( $cache->deleteObjectsExpiringBefore( $date, $progressCallback ) ) {
+                       if ( $cache->deleteObjectsExpiringBefore( $timestamp, $progressCallback, $limit ) ) {
                                $ret = true;
                        }
                }
index f79c1ff..8502ce2 100644 (file)
@@ -108,8 +108,16 @@ class ReplicatedBagOStuff extends BagOStuff {
                return $this->writeStore->unlock( $key );
        }
 
-       public function deleteObjectsExpiringBefore( $date, $progressCallback = false ) {
-               return $this->writeStore->deleteObjectsExpiringBefore( $date, $progressCallback );
+       public function deleteObjectsExpiringBefore(
+               $timestamp,
+               callable $progressCallback = null,
+               $limit = INF
+       ) {
+               return $this->writeStore->deleteObjectsExpiringBefore(
+                       $timestamp,
+                       $progressCallback,
+                       $limit
+               );
        }
 
        public function getMulti( array $keys, $flags = 0 ) {
index 1d8662a..2c533b9 100644 (file)
@@ -113,7 +113,7 @@ use Psr\Log\NullLogger;
  * @ingroup Cache
  * @since 1.26
  */
-class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
+class WANObjectCache implements IExpiringStore, IStoreKeyEncoder, LoggerAwareInterface {
        /** @var BagOStuff The local datacenter cache */
        protected $cache;
        /** @var MapCacheLRU[] Map of group PHP instance caches */
@@ -163,6 +163,8 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
        const COOLOFF_TTL = 1;
        /** Default remaining TTL at which to consider pre-emptive regeneration */
        const LOW_TTL = 30;
+       /** Max TTL to store keys when a data sourced is lagged */
+       const TTL_LAGGED = 30;
 
        /** Never consider performing "popularity" refreshes until a key reaches this age */
        const AGE_NEW = 60;
@@ -173,20 +175,18 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
        /** Seconds to ramp up to the "popularity" refresh chance after a key is no longer new */
        const RAMPUP_TTL = 30;
 
-       /** Idiom for getWithSetCallback() callbacks to avoid calling set() */
+       /** Idiom for getWithSetCallback() meaning "do not store the callback result" */
        const TTL_UNCACHEABLE = -1;
-       /** Idiom for getWithSetCallback() callbacks to 'lockTSE' logic */
+       /** Idiom for getWithSetCallback() meaning "no regeneration mutex based on key hotness" */
        const TSE_NONE = -1;
-       /** Max TTL to store keys when a data sourced is lagged */
-       const TTL_LAGGED = 30;
-       /** Idiom for delete() for "no hold-off" */
-       const HOLDOFF_NONE = 0;
-       /** Idiom for set()/getWithSetCallback() for "do not augment the storage medium TTL" */
+       /** Idiom for set()/getWithSetCallback() meaning "no post-expiration persistence" */
        const STALE_TTL_NONE = 0;
-       /** Idiom for set()/getWithSetCallback() for "no post-expired grace period" */
+       /** Idiom for set()/getWithSetCallback() meaning "no post-expiration grace period" */
        const GRACE_TTL_NONE = 0;
+       /** Idiom for delete()/touchCheckKey() meaning "no hold-off period for cache writes" */
+       const HOLDOFF_NONE = 0;
 
-       /** Idiom for getWithSetCallback() for "no minimum required as-of timestamp" */
+       /** Idiom for getWithSetCallback() meaning "no minimum required as-of timestamp" */
        const MIN_TIMESTAMP_NONE = 0.0;
 
        /** Tiny negative float to use when CTL comes up >= 0 due to clock skew */
@@ -1213,72 +1213,65 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
         * @note Callable type hints are not used to avoid class-autoloading
         */
        final public function getWithSetCallback( $key, $ttl, $callback, array $opts = [] ) {
+               $version = $opts['version'] ?? null;
                $pcTTL = $opts['pcTTL'] ?? self::TTL_UNCACHEABLE;
 
                // Try the process cache if enabled and the cache callback is not within a cache callback.
                // Process cache use in nested callbacks is not lag-safe with regard to HOLDOFF_TTL since
                // the in-memory value is further lagged than the shared one since it uses a blind TTL.
                if ( $pcTTL >= 0 && $this->callbackDepth == 0 ) {
-                       $group = $opts['pcGroup'] ?? self::PC_PRIMARY;
-                       $procCache = $this->getProcessCache( $group );
-                       $value = $procCache->has( $key, $pcTTL ) ? $procCache->get( $key ) : false;
+                       $procCache = $this->getProcessCache( $opts['pcGroup'] ?? self::PC_PRIMARY );
+                       if ( $procCache->has( $key, $pcTTL ) ) {
+                               return $procCache->get( $key );
+                       }
                } else {
-                       $procCache = false;
-                       $value = false;
+                       $procCache = null;
                }
 
-               if ( $value === false ) {
-                       // Fetch the value over the network
-                       if ( isset( $opts['version'] ) ) {
-                               $version = $opts['version'];
-                               $asOf = null;
-                               $cur = $this->doGetWithSetCallback(
-                                       $key,
+               if ( $version !== null ) {
+                       $curAsOf = self::PASS_BY_REF;
+                       $curValue = $this->doGetWithSetCallback(
+                               $key,
+                               $ttl,
+                               // Wrap the value in an array with version metadata but hide it from $callback
+                               function ( $oldValue, &$ttl, &$setOpts, $oldAsOf ) use ( $callback, $version ) {
+                                       if ( $this->isVersionedValue( $oldValue, $version ) ) {
+                                               $oldData = $oldValue[self::VFLD_DATA];
+                                       } else {
+                                               // VFLD_DATA is not set if an old, unversioned, key is present
+                                               $oldData = false;
+                                               $oldAsOf = null;
+                                       }
+
+                                       return [
+                                               self::VFLD_DATA => $callback( $oldData, $ttl, $setOpts, $oldAsOf ),
+                                               self::VFLD_VERSION => $version
+                                       ];
+                               },
+                               $opts,
+                               $curAsOf
+                       );
+                       if ( $this->isVersionedValue( $curValue, $version ) ) {
+                               // Current value has the requested version; use it
+                               $value = $curValue[self::VFLD_DATA];
+                       } else {
+                               // Current value has a different version; use the variant key for this version.
+                               // Regenerate the variant value if it is not newer than the main value at $key
+                               // so that purges to they key propagate to the variant value.
+                               $value = $this->doGetWithSetCallback(
+                                       $this->makeGlobalKey( 'WANCache-key-variant', md5( $key ), $version ),
                                        $ttl,
-                                       function ( $oldValue, &$ttl, &$setOpts, $oldAsOf )
-                                       use ( $callback, $version ) {
-                                               if ( is_array( $oldValue )
-                                                       && array_key_exists( self::VFLD_DATA, $oldValue )
-                                                       && array_key_exists( self::VFLD_VERSION, $oldValue )
-                                                       && $oldValue[self::VFLD_VERSION] === $version
-                                               ) {
-                                                       $oldData = $oldValue[self::VFLD_DATA];
-                                               } else {
-                                                       // VFLD_DATA is not set if an old, unversioned, key is present
-                                                       $oldData = false;
-                                                       $oldAsOf = null;
-                                               }
-
-                                               return [
-                                                       self::VFLD_DATA => $callback( $oldData, $ttl, $setOpts, $oldAsOf ),
-                                                       self::VFLD_VERSION => $version
-                                               ];
-                                       },
-                                       $opts,
-                                       $asOf
+                                       $callback,
+                                       [ 'version' => null, 'minAsOf' => $curAsOf ] + $opts
                                );
-                               if ( $cur[self::VFLD_VERSION] === $version ) {
-                                       // Value created or existed before with version; use it
-                                       $value = $cur[self::VFLD_DATA];
-                               } else {
-                                       // Value existed before with a different version; use variant key.
-                                       // Reflect purges to $key by requiring that this key value be newer.
-                                       $value = $this->doGetWithSetCallback(
-                                               $this->makeGlobalKey( 'WANCache-key-variant', md5( $key ), $version ),
-                                               $ttl,
-                                               $callback,
-                                               // Regenerate value if not newer than $key
-                                               [ 'version' => null, 'minAsOf' => $asOf ] + $opts
-                                       );
-                               }
-                       } else {
-                               $value = $this->doGetWithSetCallback( $key, $ttl, $callback, $opts );
                        }
+               } else {
+                       $value = $this->doGetWithSetCallback( $key, $ttl, $callback, $opts );
+               }
 
-                       // Update the process cache if enabled
-                       if ( $procCache && $value !== false ) {
-                               $procCache->set( $key, $value );
-                       }
+               // Update the process cache if enabled
+               if ( $procCache && $value !== false ) {
+                       $procCache->set( $key, $value );
                }
 
                return $value;
@@ -1306,26 +1299,25 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
                $busyValue = $opts['busyValue'] ?? null;
                $popWindow = $opts['hotTTR'] ?? self::HOT_TTR;
                $ageNew = $opts['ageNew'] ?? self::AGE_NEW;
-               $minTime = $opts['minAsOf'] ?? self::MIN_TIMESTAMP_NONE;
-               $needsVersion = isset( $opts['version'] );
+               $minAsOf = $opts['minAsOf'] ?? self::MIN_TIMESTAMP_NONE;
                $touchedCb = $opts['touchedCallback'] ?? null;
                $initialTime = $this->getCurrentTime();
 
                $kClass = $this->determineKeyClassForStats( $key );
 
-               // Get the current key value
+               // Get the current key value and metadata
                $curTTL = self::PASS_BY_REF;
                $curInfo = self::PASS_BY_REF; /** @var array $curInfo */
                $curValue = $this->get( $key, $curTTL, $checkKeys, $curInfo );
                // Apply any $touchedCb invalidation timestamp to get the "last purge timestamp"
                list( $curTTL, $LPT ) = $this->resolveCTL( $curValue, $curTTL, $curInfo, $touchedCb );
-               // Keep track of the best candidate value and its timestamp
-               $value = $curValue; // return value
-               $asOf = $curInfo['asOf']; // return value timestamp
+               // Best possible return value and its corresponding "as of" timestamp
+               $value = $curValue;
+               $asOf = $curInfo['asOf'];
 
                // Determine if a cached value regeneration is needed or desired
                if (
-                       $this->isValid( $value, $needsVersion, $asOf, $minTime ) &&
+                       $this->isValid( $value, $asOf, $minAsOf ) &&
                        $this->isAliveOrInGracePeriod( $curTTL, $graceTTL )
                ) {
                        $preemptiveRefresh = (
@@ -1347,7 +1339,7 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
                $isKeyTombstoned = ( $curInfo['tombAsOf'] !== null );
                if ( $isKeyTombstoned ) {
                        // Get the interim key value since the key is tombstoned (write-holed)
-                       list( $value, $asOf ) = $this->getInterimValue( $key, $needsVersion, $minTime );
+                       list( $value, $asOf ) = $this->getInterimValue( $key, $minAsOf );
                        // Update the "last purge time" since the $touchedCb timestamp depends on $value
                        $LPT = $this->resolveTouched( $value, $LPT, $touchedCb );
                }
@@ -1355,7 +1347,7 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
                // Reduce mutex and cache set spam while keys are in the tombstone/holdoff period by
                // checking if $value was genereated by a recent thread much less than a second ago.
                if (
-                       $this->isValid( $value, $needsVersion, $asOf, $minTime, $LPT ) &&
+                       $this->isValid( $value, $asOf, $minAsOf, $LPT ) &&
                        $this->isVolatileValueAgeNegligible( $initialTime - $asOf )
                ) {
                        $this->stats->increment( "wanobjectcache.$kClass.hit.volatile" );
@@ -1381,12 +1373,12 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
 
                $hasLock = false;
                if ( $useMutex ) {
-                       // Acquire a datacenter-local non-blocking lock
+                       // Attempt to acquire a non-blocking lock specific to the local datacenter
                        if ( $this->cache->add( self::MUTEX_KEY_PREFIX . $key, 1, self::LOCK_TTL ) ) {
                                // Lock acquired; this thread will recompute the value and update cache
                                $hasLock = true;
-                       } elseif ( $this->isValid( $value, $needsVersion, $asOf, $minTime ) ) {
-                               // Lock not acquired and a stale value exists; use the stale value
+                       } elseif ( $this->isValid( $value, $asOf, $minAsOf ) ) {
+                               // Not acquired and stale cache value exists; use the stale value
                                $this->stats->increment( "wanobjectcache.$kClass.hit.stale" );
 
                                return $value;
@@ -1394,7 +1386,7 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
                                // Lock not acquired and no stale value exists
                                if ( $busyValue !== null ) {
                                        // Use the busy fallback value if nothing else
-                                       $miss = is_infinite( $minTime ) ? 'renew' : 'miss';
+                                       $miss = is_infinite( $minAsOf ) ? 'renew' : 'miss';
                                        $this->stats->increment( "wanobjectcache.$kClass.$miss.busy" );
 
                                        return is_callable( $busyValue ) ? $busyValue() : $busyValue;
@@ -1419,7 +1411,7 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
 
                if ( $valueIsCacheable ) {
                        $ago = max( $this->getCurrentTime() - $initialTime, 0.0 );
-                       $this->stats->timing( "wanobjectcache.$kClass.regen_set_delay", 1000 * $ago );
+                       $this->stats->timing( "wanobjectcache.$kClass.regen_set_delay", 1e3 * $ago );
 
                        if ( $isKeyTombstoned ) {
                                if ( $this->checkAndSetCooloff( $key, $kClass, $ago, $lockTSE, $hasLock ) ) {
@@ -1445,7 +1437,7 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
                        $this->cache->changeTTL( self::MUTEX_KEY_PREFIX . $key, (int)$initialTime - 60 );
                }
 
-               $miss = is_infinite( $minTime ) ? 'renew' : 'miss';
+               $miss = is_infinite( $minAsOf ) ? 'renew' : 'miss';
                $this->stats->increment( "wanobjectcache.$kClass.$miss.compute" );
 
                return $value;
@@ -1540,11 +1532,10 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
 
        /**
         * @param string $key
-        * @param bool $versioned
-        * @param float $minTime
+        * @param float $minAsOf Minimum acceptable "as of" timestamp
         * @return array (cached value or false, cached value timestamp or null)
         */
-       protected function getInterimValue( $key, $versioned, $minTime ) {
+       protected function getInterimValue( $key, $minAsOf ) {
                if ( !$this->useInterimHoldOffCaching ) {
                        return [ false, null ]; // disabled
                }
@@ -1552,7 +1543,7 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
                $wrapped = $this->cache->get( self::INTERIM_KEY_PREFIX . $key );
                list( $value ) = $this->unwrap( $wrapped, $this->getCurrentTime() );
                $valueAsOf = $wrapped[self::FLD_TIME] ?? null;
-               if ( $this->isValid( $value, $versioned, $valueAsOf, $minTime ) ) {
+               if ( $this->isValid( $value, $valueAsOf, $minAsOf ) ) {
                        return [ $value, $valueAsOf ];
                }
 
@@ -2116,9 +2107,8 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
                // Update the cache value later, such during post-send of an HTTP request
                $func = $this->asyncHandler;
                $func( function () use ( $key, $ttl, $callback, $opts ) {
-                       $asOf = null; // unused
                        $opts['minAsOf'] = INF; // force a refresh
-                       $this->doGetWithSetCallback( $key, $ttl, $callback, $opts, $asOf );
+                       $this->doGetWithSetCallback( $key, $ttl, $callback, $opts );
                } );
 
                return true;
@@ -2226,21 +2216,18 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
         * Check if $value is not false, versioned (if needed), and not older than $minTime (if set)
         *
         * @param array|bool $value
-        * @param bool $versioned
         * @param float $asOf The time $value was generated
-        * @param float $minTime The last time the main value was generated (0.0 if unknown)
+        * @param float $minAsOf Minimum acceptable "as of" timestamp
         * @param float|null $purgeTime The last time the value was invalidated
         * @return bool
         */
-       protected function isValid( $value, $versioned, $asOf, $minTime, $purgeTime = null ) {
+       protected function isValid( $value, $asOf, $minAsOf, $purgeTime = null ) {
                // Avoid reading any key not generated after the latest delete() or touch
-               $safeMinTime = max( $minTime, $purgeTime + self::TINY_POSTIVE );
+               $safeMinAsOf = max( $minAsOf, $purgeTime + self::TINY_POSTIVE );
 
                if ( $value === false ) {
                        return false;
-               } elseif ( $versioned && !isset( $value[self::VFLD_VERSION] ) ) {
-                       return false;
-               } elseif ( $safeMinTime > 0 && $asOf < $minTime ) {
+               } elseif ( $safeMinAsOf > 0 && $asOf < $minAsOf ) {
                        return false;
                }
 
@@ -2372,6 +2359,20 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
                return self::PURGE_VAL_PREFIX . (float)$timestamp . ':' . (int)$holdoff;
        }
 
+       /**
+        * @param mixed $value
+        * @param int $version
+        * @return bool
+        */
+       protected function isVersionedValue( $value, $version ) {
+               return (
+                       is_array( $value ) &&
+                       array_key_exists( self::VFLD_DATA, $value ) &&
+                       array_key_exists( self::VFLD_VERSION, $value ) &&
+                       $value[self::VFLD_VERSION] === $version
+               );
+       }
+
        /**
         * @param string $group
         * @return MapCacheLRU
index 76701f8..2cc2c90 100644 (file)
@@ -649,15 +649,15 @@ class DBConnRef implements IDatabase {
                return $this->__call( __FUNCTION__, func_get_args() );
        }
 
-       public function commit( $fname = __METHOD__, $flush = '' ) {
+       public function commit( $fname = __METHOD__, $flush = self::FLUSHING_ONE ) {
                return $this->__call( __FUNCTION__, func_get_args() );
        }
 
-       public function rollback( $fname = __METHOD__, $flush = '' ) {
+       public function rollback( $fname = __METHOD__, $flush = self::FLUSHING_ONE ) {
                return $this->__call( __FUNCTION__, func_get_args() );
        }
 
-       public function flushSnapshot( $fname = __METHOD__ ) {
+       public function flushSnapshot( $fname = __METHOD__, $flush = self::FLUSHING_ONE ) {
                return $this->__call( __FUNCTION__, func_get_args() );
        }
 
index 92b9471..e3c15fb 100644 (file)
@@ -270,7 +270,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
         */
        final public function initConnection() {
                if ( $this->isOpen() ) {
-                       throw new LogicException( __METHOD__ . ': already connected.' );
+                       throw new LogicException( __METHOD__ . ': already connected' );
                }
                // Establish the connection
                $this->doInitConnection();
@@ -294,7 +294,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                                $this->connectionParams['tablePrefix']
                        );
                } else {
-                       throw new InvalidArgumentException( "No database user provided." );
+                       throw new InvalidArgumentException( "No database user provided" );
                }
        }
 
@@ -541,7 +541,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
 
        public function dbSchema( $schema = null ) {
                if ( strlen( $schema ) && $this->getDBname() === null ) {
-                       throw new DBUnexpectedError( $this, "Cannot set schema to '$schema'; no database set." );
+                       throw new DBUnexpectedError( $this, "Cannot set schema to '$schema'; no database set" );
                }
 
                $old = $this->currentDomain->getSchema();
@@ -726,7 +726,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
 
        public function setFlag( $flag, $remember = self::REMEMBER_NOTHING ) {
                if ( ( $flag & self::DBO_IGNORE ) ) {
-                       throw new UnexpectedValueException( "Modifying DBO_IGNORE is not allowed." );
+                       throw new UnexpectedValueException( "Modifying DBO_IGNORE is not allowed" );
                }
 
                if ( $remember === self::REMEMBER_PRIOR ) {
@@ -737,7 +737,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
 
        public function clearFlag( $flag, $remember = self::REMEMBER_NOTHING ) {
                if ( ( $flag & self::DBO_IGNORE ) ) {
-                       throw new UnexpectedValueException( "Modifying DBO_IGNORE is not allowed." );
+                       throw new UnexpectedValueException( "Modifying DBO_IGNORE is not allowed" );
                }
 
                if ( $remember === self::REMEMBER_PRIOR ) {
@@ -875,7 +875,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                                        $levels = $this->flatAtomicSectionList();
                                        $exception = new DBUnexpectedError(
                                                $this,
-                                               __METHOD__ . ": atomic sections $levels are still open."
+                                               __METHOD__ . ": atomic sections $levels are still open"
                                        );
                                } elseif ( $this->trxAutomatic ) {
                                        // Only the connection manager can commit non-empty DBO_TRX transactions
@@ -884,7 +884,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                                                $exception = new DBUnexpectedError(
                                                        $this,
                                                        __METHOD__ .
-                                                       ": mass commit/rollback of peer transaction required (DBO_TRX set)."
+                                                       ": mass commit/rollback of peer transaction required (DBO_TRX set)"
                                                );
                                        }
                                } else {
@@ -892,14 +892,14 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                                        // back, even if empty.
                                        $exception = new DBUnexpectedError(
                                                $this,
-                                               __METHOD__ . ": transaction is still open (from {$this->trxFname})."
+                                               __METHOD__ . ": transaction is still open (from {$this->trxFname})"
                                        );
                                }
 
                                if ( $this->trxEndCallbacksSuppressed ) {
                                        $exception = $exception ?: new DBUnexpectedError(
                                                $this,
-                                               __METHOD__ . ': callbacks are suppressed; cannot properly commit.'
+                                               __METHOD__ . ': callbacks are suppressed; cannot properly commit'
                                        );
                                }
 
@@ -929,7 +929,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                        $fnames = $this->pendingWriteAndCallbackCallers();
                        if ( $fnames ) {
                                throw new RuntimeException(
-                                       "Transaction callbacks are still pending:\n" . implode( ', ', $fnames )
+                                       "Transaction callbacks are still pending: " . implode( ', ', $fnames )
                                );
                        }
                }
@@ -947,7 +947,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
         */
        final protected function assertHasConnectionHandle() {
                if ( !$this->isOpen() ) {
-                       throw new DBUnexpectedError( $this, "DB connection was already closed." );
+                       throw new DBUnexpectedError( $this, "DB connection was already closed" );
                }
        }
 
@@ -961,7 +961,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                if ( $this->getLBInfo( 'replica' ) === true ) {
                        throw new DBReadOnlyRoleError(
                                $this,
-                               'Write operations are not allowed on replica database connections.'
+                               'Write operations are not allowed on replica database connections'
                        );
                }
                $reason = $this->getReadOnlyReason();
@@ -1401,7 +1401,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
        private function assertQueryIsCurrentlyAllowed( $sql, $fname ) {
                $verb = $this->getQueryVerb( $sql );
                if ( $verb === 'USE' ) {
-                       throw new DBUnexpectedError( $this, "Got USE query; use selectDomain() instead." );
+                       throw new DBUnexpectedError( $this, "Got USE query; use selectDomain() instead" );
                }
 
                if ( $verb === 'ROLLBACK' ) { // transaction/savepoint
@@ -1411,7 +1411,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                if ( $this->trxStatus < self::STATUS_TRX_OK ) {
                        throw new DBTransactionStateError(
                                $this,
-                               "Cannot execute query from $fname while transaction status is ERROR.",
+                               "Cannot execute query from $fname while transaction status is ERROR",
                                [],
                                $this->trxStatusCause
                        );
@@ -1552,7 +1552,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
         */
        public function reportQueryError( $error, $errno, $sql, $fname, $ignore = false ) {
                if ( $ignore ) {
-                       $this->queryLogger->debug( "SQL ERROR (ignored): $error\n" );
+                       $this->queryLogger->debug( "SQL ERROR (ignored): $error" );
                } else {
                        $exception = $this->getQueryExceptionAndLog( $error, $errno, $sql, $fname );
 
@@ -1580,7 +1580,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                                'trace' => ( new RuntimeException() )->getTraceAsString()
                        ] )
                );
-               $this->queryLogger->debug( "SQL ERROR: " . $error . "\n" );
+               $this->queryLogger->debug( "SQL ERROR: " . $error . "" );
                if ( $this->wasQueryTimeout( $error, $errno ) ) {
                        $e = new DBQueryTimeoutError( $this, $error, $errno, $sql, $fname );
                } elseif ( $this->wasConnectionError( $errno ) ) {
@@ -1813,7 +1813,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                        // functions. Discourage use of such queries to encourage compatibility.
                        call_user_func(
                                $this->deprecationLogger,
-                               __METHOD__ . ": aggregation used with a locking SELECT ($fname)."
+                               __METHOD__ . ": aggregation used with a locking SELECT ($fname)"
                        );
                }
 
@@ -2010,7 +2010,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                        } elseif ( count( $var ) == 1 ) {
                                $column = $var[0] ?? reset( $var );
                        } else {
-                               throw new DBUnexpectedError( $this, __METHOD__ . ': got multiple columns.' );
+                               throw new DBUnexpectedError( $this, __METHOD__ . ': got multiple columns' );
                        }
                } else {
                        $column = $var;
@@ -2380,7 +2380,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                if ( $name instanceof Subquery ) {
                        throw new DBUnexpectedError(
                                $this,
-                               __METHOD__ . ': got Subquery instance when expecting a string.'
+                               __METHOD__ . ': got Subquery instance when expecting a string'
                        );
                }
 
@@ -2401,7 +2401,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                # surrounded by symbols which may be considered word breaks.
                if ( preg_match( '/(^|\s)(DISTINCT|JOIN|ON|AS)(\s|$)/i', $name ) !== 0 ) {
                        $this->queryLogger->warning(
-                               __METHOD__ . ": use of subqueries is not supported this way.",
+                               __METHOD__ . ": use of subqueries is not supported this way",
                                [ 'trace' => ( new RuntimeException() )->getTraceAsString() ]
                        );
 
@@ -2524,12 +2524,12 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                } elseif ( $table instanceof Subquery ) {
                        $quotedTable = (string)$table;
                } else {
-                       throw new InvalidArgumentException( "Table must be a string or Subquery." );
+                       throw new InvalidArgumentException( "Table must be a string or Subquery" );
                }
 
                if ( $alias === false || $alias === $table ) {
                        if ( $table instanceof Subquery ) {
-                               throw new InvalidArgumentException( "Subquery table missing alias." );
+                               throw new InvalidArgumentException( "Subquery table missing alias" );
                        }
 
                        return $quotedTable;
@@ -3162,8 +3162,10 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
 
        public function limitResult( $sql, $limit, $offset = false ) {
                if ( !is_numeric( $limit ) ) {
-                       throw new DBUnexpectedError( $this,
-                               "Invalid non-numeric limit passed to limitResult()\n" );
+                       throw new DBUnexpectedError(
+                               $this,
+                               "Invalid non-numeric limit passed to " . __METHOD__
+                       );
                }
                // This version works in MySQL and SQLite. It will very likely need to be
                // overridden for most other RDBMS subclasses.
@@ -3370,7 +3372,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
 
        final public function onTransactionResolution( callable $callback, $fname = __METHOD__ ) {
                if ( !$this->trxLevel() ) {
-                       throw new DBUnexpectedError( $this, "No transaction is active." );
+                       throw new DBUnexpectedError( $this, "No transaction is active" );
                }
                $this->trxEndCallbacks[] = [ $callback, $fname, $this->currentAtomicSectionId() ];
        }
@@ -3416,7 +3418,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
 
        final public function onAtomicSectionCancel( callable $callback, $fname = __METHOD__ ) {
                if ( !$this->trxLevel() || !$this->trxAtomicLevels ) {
-                       throw new DBUnexpectedError( $this, "No atomic section is open (got $fname)." );
+                       throw new DBUnexpectedError( $this, "No atomic section is open (got $fname)" );
                }
                $this->trxSectionCancelCallbacks[] = [ $callback, $fname, $this->currentAtomicSectionId() ];
        }
@@ -3552,7 +3554,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
         */
        public function runOnTransactionIdleCallbacks( $trigger ) {
                if ( $this->trxLevel() ) { // sanity
-                       throw new DBUnexpectedError( $this, __METHOD__ . ': a transaction is still open.' );
+                       throw new DBUnexpectedError( $this, __METHOD__ . ': a transaction is still open' );
                }
 
                if ( $this->trxEndCallbacksSuppressed ) {
@@ -3809,7 +3811,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
 
        final public function endAtomic( $fname = __METHOD__ ) {
                if ( !$this->trxLevel() || !$this->trxAtomicLevels ) {
-                       throw new DBUnexpectedError( $this, "No atomic section is open (got $fname)." );
+                       throw new DBUnexpectedError( $this, "No atomic section is open (got $fname)" );
                }
 
                // Check if the current section matches $fname
@@ -3820,7 +3822,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                if ( $savedFname !== $fname ) {
                        throw new DBUnexpectedError(
                                $this,
-                               "Invalid atomic section ended (got $fname but expected $savedFname)."
+                               "Invalid atomic section ended (got $fname but expected $savedFname)"
                        );
                }
 
@@ -3845,7 +3847,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                $fname = __METHOD__, AtomicSectionIdentifier $sectionId = null
        ) {
                if ( !$this->trxLevel() || !$this->trxAtomicLevels ) {
-                       throw new DBUnexpectedError( $this, "No atomic section is open (got $fname)." );
+                       throw new DBUnexpectedError( $this, "No atomic section is open (got $fname)" );
                }
 
                $excisedIds = [];
@@ -3887,7 +3889,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                        if ( $savedFname !== $fname ) {
                                throw new DBUnexpectedError(
                                        $this,
-                                       "Invalid atomic section ended (got $fname but expected $savedFname)."
+                                       "Invalid atomic section ended (got $fname but expected $savedFname)"
                                );
                        }
 
@@ -3914,7 +3916,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                                $this->trxStatus = self::STATUS_TRX_ERROR;
                                $this->trxStatusCause = new DBUnexpectedError(
                                        $this,
-                                       "Uncancelable atomic section canceled (got $fname)."
+                                       "Uncancelable atomic section canceled (got $fname)"
                                );
                        }
                } finally {
@@ -3945,24 +3947,24 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
        final public function begin( $fname = __METHOD__, $mode = self::TRANSACTION_EXPLICIT ) {
                static $modes = [ self::TRANSACTION_EXPLICIT, self::TRANSACTION_INTERNAL ];
                if ( !in_array( $mode, $modes, true ) ) {
-                       throw new DBUnexpectedError( $this, "$fname: invalid mode parameter '$mode'." );
+                       throw new DBUnexpectedError( $this, "$fname: invalid mode parameter '$mode'" );
                }
 
                // Protect against mismatched atomic section, transaction nesting, and snapshot loss
                if ( $this->trxLevel() ) {
                        if ( $this->trxAtomicLevels ) {
                                $levels = $this->flatAtomicSectionList();
-                               $msg = "$fname: Got explicit BEGIN while atomic section(s) $levels are open.";
+                               $msg = "$fname: Got explicit BEGIN while atomic section(s) $levels are open";
                                throw new DBUnexpectedError( $this, $msg );
                        } elseif ( !$this->trxAutomatic ) {
-                               $msg = "$fname: Explicit transaction already active (from {$this->trxFname}).";
+                               $msg = "$fname: Explicit transaction already active (from {$this->trxFname})";
                                throw new DBUnexpectedError( $this, $msg );
                        } else {
-                               $msg = "$fname: Implicit transaction already active (from {$this->trxFname}).";
+                               $msg = "$fname: Implicit transaction already active (from {$this->trxFname})";
                                throw new DBUnexpectedError( $this, $msg );
                        }
                } elseif ( $this->getFlag( self::DBO_TRX ) && $mode !== self::TRANSACTION_INTERNAL ) {
-                       $msg = "$fname: Implicit transaction expected (DBO_TRX set).";
+                       $msg = "$fname: Implicit transaction expected (DBO_TRX set)";
                        throw new DBUnexpectedError( $this, $msg );
                }
 
@@ -4008,7 +4010,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
        final public function commit( $fname = __METHOD__, $flush = self::FLUSHING_ONE ) {
                static $modes = [ self::FLUSHING_ONE, self::FLUSHING_ALL_PEERS, self::FLUSHING_INTERNAL ];
                if ( !in_array( $flush, $modes, true ) ) {
-                       throw new DBUnexpectedError( $this, "$fname: invalid flush parameter '$flush'." );
+                       throw new DBUnexpectedError( $this, "$fname: invalid flush parameter '$flush'" );
                }
 
                if ( $this->trxLevel() && $this->trxAtomicLevels ) {
@@ -4016,7 +4018,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                        $levels = $this->flatAtomicSectionList();
                        throw new DBUnexpectedError(
                                $this,
-                               "$fname: Got COMMIT while atomic sections $levels are still open."
+                               "$fname: Got COMMIT while atomic sections $levels are still open"
                        );
                }
 
@@ -4026,17 +4028,17 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                        } elseif ( !$this->trxAutomatic ) {
                                throw new DBUnexpectedError(
                                        $this,
-                                       "$fname: Flushing an explicit transaction, getting out of sync."
+                                       "$fname: Flushing an explicit transaction, getting out of sync"
                                );
                        }
                } elseif ( !$this->trxLevel() ) {
                        $this->queryLogger->error(
-                               "$fname: No transaction to commit, something got out of sync." );
+                               "$fname: No transaction to commit, something got out of sync" );
                        return; // nothing to do
                } elseif ( $this->trxAutomatic ) {
                        throw new DBUnexpectedError(
                                $this,
-                               "$fname: Expected mass commit of all peer transactions (DBO_TRX set)."
+                               "$fname: Expected mass commit of all peer transactions (DBO_TRX set)"
                        );
                }
 
@@ -4089,7 +4091,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                ) {
                        throw new DBUnexpectedError(
                                $this,
-                               "$fname: Expected mass rollback of all peer transactions (DBO_TRX set)."
+                               "$fname: Expected mass rollback of all peer transactions (DBO_TRX set)"
                        );
                }
 
@@ -4151,13 +4153,32 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                }
        }
 
-       public function flushSnapshot( $fname = __METHOD__ ) {
-               if ( $this->writesOrCallbacksPending() || $this->explicitTrxActive() ) {
+       public function flushSnapshot( $fname = __METHOD__, $flush = self::FLUSHING_ONE ) {
+               if ( $this->explicitTrxActive() ) {
+                       // Committing this transaction would break callers that assume it is still open
+                       throw new DBUnexpectedError(
+                               $this,
+                               "$fname: Cannot flush snapshot; " .
+                               "explicit transaction '{$this->trxFname}' is still open"
+                       );
+               } elseif ( $this->writesOrCallbacksPending() ) {
                        // This only flushes transactions to clear snapshots, not to write data
                        $fnames = implode( ', ', $this->pendingWriteAndCallbackCallers() );
                        throw new DBUnexpectedError(
                                $this,
-                               "$fname: Cannot flush snapshot because writes are pending ($fnames)."
+                               "$fname: Cannot flush snapshot; " .
+                               "writes from transaction {$this->trxFname} are still pending ($fnames)"
+                       );
+               } elseif (
+                       $this->trxLevel() &&
+                       $this->getTransactionRoundId() &&
+                       $flush !== self::FLUSHING_INTERNAL &&
+                       $flush !== self::FLUSHING_ALL_PEERS
+               ) {
+                       $this->queryLogger->warning(
+                               "$fname: Expected mass snapshot flush of all peer transactions " .
+                               "in the explicit transactions round '{$this->getTransactionRoundId()}'",
+                               [ 'trace' => ( new RuntimeException() )->getTraceAsString() ]
                        );
                }
 
@@ -4413,7 +4434,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                Wikimedia\restoreWarnings();
 
                if ( $fp === false ) {
-                       throw new RuntimeException( "Could not open \"{$filename}\".\n" );
+                       throw new RuntimeException( "Could not open \"{$filename}\"" );
                }
 
                if ( !$fname ) {
@@ -4630,7 +4651,8 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                        $fnames = implode( ', ', $this->pendingWriteAndCallbackCallers() );
                        throw new DBUnexpectedError(
                                $this,
-                               "$fname: Cannot flush pre-lock snapshot because writes are pending ($fnames)."
+                               "$fname: Cannot flush pre-lock snapshot; " .
+                               "writes from transaction {$this->trxFname} are still pending ($fnames)"
                        );
                }
 
@@ -4669,7 +4691,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
 
        final public function lockTables( array $read, array $write, $method ) {
                if ( $this->writesOrCallbacksPending() ) {
-                       throw new DBUnexpectedError( $this, "Transaction writes or callbacks still pending." );
+                       throw new DBUnexpectedError( $this, "Transaction writes or callbacks still pending" );
                }
 
                if ( $this->tableLocksHaveTransactionScope() ) {
@@ -4794,7 +4816,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                if ( !$this->conn ) {
                        throw new DBUnexpectedError(
                                $this,
-                               'DB connection was already closed or the connection dropped.'
+                               'DB connection was already closed or the connection dropped'
                        );
                }
 
@@ -4827,8 +4849,8 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
         */
        public function __clone() {
                $this->connLogger->warning(
-                       "Cloning " . static::class . " is not recommended; forking connection:\n" .
-                       ( new RuntimeException() )->getTraceAsString()
+                       "Cloning " . static::class . " is not recommended; forking connection",
+                       [ 'trace' => ( new RuntimeException() )->getTraceAsString() ]
                );
 
                if ( $this->isOpen() ) {
@@ -4856,7 +4878,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
         */
        public function __sleep() {
                throw new RuntimeException( 'Database serialization may cause problems, since ' .
-                       'the connection is not restored on wakeup.' );
+                       'the connection is not restored on wakeup' );
        }
 
        /**
@@ -4864,13 +4886,13 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
         */
        public function __destruct() {
                if ( $this->trxLevel() && $this->trxDoneWrites ) {
-                       trigger_error( "Uncommitted DB writes (transaction from {$this->trxFname})." );
+                       trigger_error( "Uncommitted DB writes (transaction from {$this->trxFname})" );
                }
 
                $danglingWriters = $this->pendingWriteAndCallbackCallers();
                if ( $danglingWriters ) {
                        $fnames = implode( ', ', $danglingWriters );
-                       trigger_error( "DB transaction writes or callbacks still pending ($fnames)." );
+                       trigger_error( "DB transaction writes or callbacks still pending ($fnames)" );
                }
 
                if ( $this->conn ) {
index ad6d4d2..3b9d1af 100644 (file)
@@ -1944,7 +1944,7 @@ interface IDatabase {
         *
         * @throws DBError
         */
-       public function commit( $fname = __METHOD__, $flush = '' );
+       public function commit( $fname = __METHOD__, $flush = self::FLUSHING_ONE );
 
        /**
         * Rollback a transaction previously started using begin().
@@ -1966,7 +1966,7 @@ interface IDatabase {
         * @throws DBError
         * @since 1.23 Added $flush parameter
         */
-       public function rollback( $fname = __METHOD__, $flush = '' );
+       public function rollback( $fname = __METHOD__, $flush = self::FLUSHING_ONE );
 
        /**
         * Commit any transaction but error out if writes or callbacks are pending
@@ -1977,10 +1977,20 @@ interface IDatabase {
         * useful to call on a replica DB after waiting on replication to catch up to the master.
         *
         * @param string $fname Calling function name
+        * @param string $flush Flush flag, set to situationally valid IDatabase::FLUSHING_*
+        *   constant to disable warnings about explicitly committing implicit transactions,
+        *   or calling commit when no transaction is in progress.
+        *
+        *   This will trigger an exception if there is an ongoing explicit transaction.
+        *
+        *   Only set the flush flag if you are sure that these warnings are not applicable,
+        *   and no explicit transactions are open.
+        *
         * @throws DBError
         * @since 1.28
+        * @since 1.34 Added $flush parameter
         */
-       public function flushSnapshot( $fname = __METHOD__ );
+       public function flushSnapshot( $fname = __METHOD__, $flush = self::FLUSHING_ONE );
 
        /**
         * Convert a timestamp in one of the formats accepted by wfTimestamp()
index 35c9539..812064a 100644 (file)
@@ -180,6 +180,8 @@ interface ILBFactory {
        /**
         * Commit all replica DB transactions so as to flush any REPEATABLE-READ or SSI snapshot
         *
+        * This is useful for getting rid of stale data from an implicit transaction round
+        *
         * @param string $fname Caller name
         */
        public function flushReplicaSnapshots( $fname = __METHOD__ );
index e20f6de..d94d24d 100644 (file)
@@ -234,6 +234,12 @@ abstract class LBFactory implements ILBFactory {
        }
 
        public function flushReplicaSnapshots( $fname = __METHOD__ ) {
+               if ( $this->trxRoundId !== false && $this->trxRoundId !== $fname ) {
+                       $this->queryLogger->warning(
+                               "$fname: transaction round '{$this->trxRoundId}' still running",
+                               [ 'trace' => ( new RuntimeException() )->getTraceAsString() ]
+                       );
+               }
                $this->forEachLBCallMethod( 'flushReplicaSnapshots', [ $fname ] );
        }
 
@@ -249,7 +255,7 @@ abstract class LBFactory implements ILBFactory {
                if ( $this->trxRoundId !== false ) {
                        throw new DBTransactionError(
                                null,
-                               "$fname: transaction round '{$this->trxRoundId}' already started."
+                               "$fname: transaction round '{$this->trxRoundId}' already started"
                        );
                }
                $this->trxRoundId = $fname;
@@ -264,7 +270,7 @@ abstract class LBFactory implements ILBFactory {
                if ( $this->trxRoundId !== false && $this->trxRoundId !== $fname ) {
                        throw new DBTransactionError(
                                null,
-                               "$fname: transaction round '{$this->trxRoundId}' still running."
+                               "$fname: transaction round '{$this->trxRoundId}' still running"
                        );
                }
                /** @noinspection PhpUnusedLocalVariableInspection */
@@ -456,8 +462,10 @@ abstract class LBFactory implements ILBFactory {
 
        public function getEmptyTransactionTicket( $fname ) {
                if ( $this->hasMasterChanges() ) {
-                       $this->queryLogger->error( __METHOD__ . ": $fname does not have outer scope.\n" .
-                               ( new RuntimeException() )->getTraceAsString() );
+                       $this->queryLogger->error(
+                               __METHOD__ . ": $fname does not have outer scope",
+                               [ 'trace' => ( new RuntimeException() )->getTraceAsString() ]
+                       );
 
                        return null;
                }
@@ -467,8 +475,10 @@ abstract class LBFactory implements ILBFactory {
 
        final public function commitAndWaitForReplication( $fname, $ticket, array $opts = [] ) {
                if ( $ticket !== $this->ticket ) {
-                       $this->perfLogger->error( __METHOD__ . ": $fname does not have outer scope.\n" .
-                               ( new RuntimeException() )->getTraceAsString() );
+                       $this->perfLogger->error(
+                               __METHOD__ . ": $fname does not have outer scope",
+                               [ 'trace' => ( new RuntimeException() )->getTraceAsString() ]
+                       );
 
                        return false;
                }
@@ -476,7 +486,7 @@ abstract class LBFactory implements ILBFactory {
                // The transaction owner and any caller with the empty transaction ticket can commit
                // so that getEmptyTransactionTicket() callers don't risk seeing DBTransactionError.
                if ( $this->trxRoundId !== false && $fname !== $this->trxRoundId ) {
-                       $this->queryLogger->info( "$fname: committing on behalf of {$this->trxRoundId}." );
+                       $this->queryLogger->info( "$fname: committing on behalf of {$this->trxRoundId}" );
                        $fnameEffective = $this->trxRoundId;
                } else {
                        $fnameEffective = $fname;
@@ -530,11 +540,13 @@ abstract class LBFactory implements ILBFactory {
                } elseif ( $this->memStash instanceof EmptyBagOStuff ) {
                        // No where to store any DB positions and wait for them to appear
                        $this->chronProt->setEnabled( false );
-                       $this->replLogger->info( 'Cannot use ChronologyProtector with EmptyBagOStuff.' );
+                       $this->replLogger->info( 'Cannot use ChronologyProtector with EmptyBagOStuff' );
                }
 
-               $this->replLogger->debug( __METHOD__ . ': using request info ' .
-                       json_encode( $this->requestInfo, JSON_PRETTY_PRINT ) );
+               $this->replLogger->debug(
+                       __METHOD__ . ': request info ' .
+                       json_encode( $this->requestInfo, JSON_PRETTY_PRINT )
+               );
 
                return $this->chronProt;
        }
@@ -726,7 +738,7 @@ abstract class LBFactory implements ILBFactory {
 
        public function setRequestInfo( array $info ) {
                if ( $this->chronProt ) {
-                       throw new LogicException( 'ChronologyProtector already initialized.' );
+                       throw new LogicException( 'ChronologyProtector already initialized' );
                }
 
                $this->requestInfo = $info + $this->requestInfo;
index 2f9857f..ba0b4a0 100644 (file)
@@ -93,6 +93,8 @@ interface ILoadBalancer {
        const CONN_TRX_AUTOCOMMIT = 1;
        /** @var int Return null on connection failure instead of throwing an exception */
        const CONN_SILENCE_ERRORS = 2;
+       /** @var int Caller is requesting the master DB server for possibly writes */
+       const CONN_INTENT_WRITABLE = 4;
 
        /** @var string Manager of ILoadBalancer instances is running post-commit callbacks */
        const STAGE_POSTCOMMIT_CALLBACKS = 'stage-postcommit-callbacks';
@@ -271,12 +273,33 @@ interface ILoadBalancer {
         * @param string[]|string $groups Query group(s) or [] to use the default group
         * @param string|bool $domain DB domain ID or false for the local domain
         * @param int $flags Bitfield of CONN_* class constants
-        * @return IDatabase|bool Live connection handle or false on failure
+        *
+        * @note This method throws DBAccessError if ILoadBalancer::disable() was called
+        *
+        * @return IDatabase|bool This returns false on failure if CONN_SILENCE_ERRORS is set
         * @throws DBError If no live handle can be obtained and CONN_SILENCE_ERRORS is not set
         * @throws DBAccessError If disable() was previously called
+        * @throws InvalidArgumentException
         */
        public function getConnection( $i, $groups = [], $domain = false, $flags = 0 );
 
+       /**
+        * Get a live handle for a server index
+        *
+        * This is a simpler version of getConnection() that does not accept virtual server
+        * indexes (e.g. DB_MASTER/DB_REPLICA), does not assure that master DB handles have
+        * read-only mode when there is high replication lag, and can only trigger attempts
+        * to connect to a single server (the one with the specified server index).
+        *
+        * @see ILoadBalancer::getConnection()
+        *
+        * @param int $i Specific server index
+        * @param string $domain Resolved DB domain
+        * @param int $flags Bitfield of class CONN_* constants
+        * @return IDatabase|bool
+        */
+       public function getServerConnection( $i, $domain, $flags = 0 );
+
        /**
         * Mark a live handle as being available for reuse under a different database domain
         *
@@ -673,7 +696,9 @@ interface ILoadBalancer {
        /**
         * Wait for a replica DB to reach a specified master position
         *
-        * This will connect to the master to get an accurate position if $pos is not given
+        * If $conn is not a replica server connection, then this will return true.
+        * Otherwise, if $pos is not provided, this will connect to the master server
+        * to get an accurate position.
         *
         * @param IDatabase $conn Replica DB
         * @param DBMasterPos|bool $pos Master position; default: current position
index b640dc0..184cb0e 100644 (file)
@@ -114,9 +114,7 @@ class LoadBalancer implements ILoadBalancer {
        private $waitForPos;
        /** @var bool Whether the generic reader fell back to a lagged replica DB */
        private $laggedReplicaMode = false;
-       /** @var bool Whether the generic reader fell back to a lagged replica DB */
-       private $allReplicasDownMode = false;
-       /** @var string The last DB domain selection or connection error */
+       /** @var string The last DB selection or connection error */
        private $lastError = 'Unknown error';
        /** @var string|bool Reason this instance is read-only or false if not */
        private $readOnlyReason = false;
@@ -127,9 +125,9 @@ class LoadBalancer implements ILoadBalancer {
        /** @var bool Whether any connection has been attempted yet */
        private $connectionAttempted = false;
 
-       /** @var int|null An integer ID of the managing LBFactory instance or null */
+       /** @var int|null Integer ID of the managing LBFactory instance or null if none */
        private $ownerId;
-       /** @var string|bool String if a requested DBO_TRX transaction round is active */
+       /** @var string|bool Explicit DBO_TRX transaction round active or false if none */
        private $trxRoundId = false;
        /** @var string Stage of the current transaction round in the transaction round life-cycle */
        private $trxRoundStage = self::ROUND_CURSORY;
@@ -141,7 +139,7 @@ class LoadBalancer implements ILoadBalancer {
        const MAX_LAG_DEFAULT = 6;
        /** @var int Default 'waitTimeout' when unspecified */
        const MAX_WAIT_DEFAULT = 10;
-       /** @var int Seconds to cache master server read-only status */
+       /** @var int Seconds to cache master DB server read-only status */
        const TTL_CACHE_READONLY = 5;
 
        const KEY_LOCAL = 'local';
@@ -290,7 +288,7 @@ class LoadBalancer implements ILoadBalancer {
                        throw new InvalidArgumentException( "Invalid query groups provided" );
                }
 
-               if ( $groups && $i > 0 ) {
+               if ( $groups !== [] && $groups !== false && $i > 0 ) {
                        $groupList = implode( ', ', $groups );
                        throw new LogicException( "Got query groups ($groupList) with a server index (#$i)" );
                }
@@ -299,24 +297,31 @@ class LoadBalancer implements ILoadBalancer {
        }
 
        /**
-        * @param int $flags
-        * @return bool
+        * @param int $flags Bitfield of class CONN_* constants
+        * @param int $i Specific server index or DB_MASTER/DB_REPLICA
+        * @return int Sanitized bitfield
         */
-       private function sanitizeConnectionFlags( $flags ) {
-               if ( ( $flags & self::CONN_TRX_AUTOCOMMIT ) === self::CONN_TRX_AUTOCOMMIT ) {
-                       // Assuming all servers are of the same type (or similar), which is overwhelmingly
-                       // the case, use the master server information to get the attributes. The information
-                       // for $i cannot be used since it might be DB_REPLICA, which might require connection
-                       // attempts in order to be resolved into a real server index.
+       private function sanitizeConnectionFlags( $flags, $i ) {
+               // Whether an outside caller is explicitly requesting the master database server
+               if ( $i === self::DB_MASTER || $i === $this->getWriterIndex() ) {
+                       $flags |= self::CONN_INTENT_WRITABLE;
+               }
+
+               if ( ( $flags & self::CONN_TRX_AUTOCOMMIT ) == self::CONN_TRX_AUTOCOMMIT ) {
+                       // Callers use CONN_TRX_AUTOCOMMIT to bypass REPEATABLE-READ staleness without
+                       // resorting to row locks (e.g. FOR UPDATE) or to make small out-of-band commits
+                       // during larger transactions. This is useful for avoiding lock contention.
+
+                       // Master DB server attributes (should match those of the replica DB servers)
                        $attributes = $this->getServerAttributes( $this->getWriterIndex() );
                        if ( $attributes[Database::ATTR_DB_LEVEL_LOCKING] ) {
-                               // Callers sometimes want to (a) escape REPEATABLE-READ stateness without locking
-                               // rows (e.g. FOR UPDATE) or (b) make small commits during a larger transactions
-                               // to reduce lock contention. None of these apply for sqlite and using separate
-                               // connections just causes self-deadlocks.
+                               // The RDBMS does not support concurrent writes (e.g. SQLite), so attempts
+                               // to use separate connections would just cause self-deadlocks. Note that
+                               // REPEATABLE-READ staleness is not an issue since DB-level locking means
+                               // that transactions are Strict Serializable anyway.
                                $flags &= ~self::CONN_TRX_AUTOCOMMIT;
-                               $this->connLogger->info( __METHOD__ .
-                                       ': ignoring CONN_TRX_AUTOCOMMIT to avoid deadlocks.' );
+                               $type = $this->getServerType( $this->getWriterIndex() );
+                               $this->connLogger->info( __METHOD__ . ": CONN_TRX_AUTOCOMMIT disallowed ($type)" );
                        }
                }
 
@@ -341,7 +346,7 @@ class LoadBalancer implements ILoadBalancer {
                }
        }
 
-               /**
+       /**
         * Get a LoadMonitor instance
         *
         * @return ILoadMonitor
@@ -562,7 +567,7 @@ class LoadBalancer implements ILoadBalancer {
        /**
         * @param array $loads List of server weights
         * @param string|bool $domain
-        * @return array (reader index, lagged replica mode) or false on failure
+        * @return array (reader index, lagged replica mode) or (false, false) on failure
         */
        private function pickReaderIndex( array $loads, $domain = false ) {
                if ( $loads === [] ) {
@@ -615,7 +620,9 @@ class LoadBalancer implements ILoadBalancer {
                        $serverName = $this->getServerName( $i );
                        $this->connLogger->debug( __METHOD__ . ": Using reader #$i: $serverName..." );
 
-                       $conn = $this->getConnection( $i, [], $domain, self::CONN_SILENCE_ERRORS );
+                       // Get a connection to this server without triggering other server connections
+                       $flags = self::CONN_SILENCE_ERRORS;
+                       $conn = $this->getServerConnection( $i, $domain, $flags );
                        if ( !$conn ) {
                                $this->connLogger->warning( __METHOD__ . ": Failed connecting to $i/$domain" );
                                unset( $currentLoads[$i] ); // avoid this server next iteration
@@ -725,6 +732,8 @@ class LoadBalancer implements ILoadBalancer {
 
        public function getAnyOpenConnection( $i, $flags = 0 ) {
                $i = ( $i === self::DB_MASTER ) ? $this->getWriterIndex() : $i;
+               // Connection handles required to be in auto-commit mode use a separate connection
+               // pool since the main pool is effected by implicit and explicit transaction rounds
                $autocommit = ( ( $flags & self::CONN_TRX_AUTOCOMMIT ) == self::CONN_TRX_AUTOCOMMIT );
 
                $conn = false;
@@ -782,7 +791,7 @@ class LoadBalancer implements ILoadBalancer {
 
        /**
         * Wait for a given replica DB to catch up to the master pos stored in "waitForPos"
-        * @param int $index Server index
+        * @param int $index Specific server index
         * @param bool $open Check the server even if a new connection has to be made
         * @param int|null $timeout Max seconds to wait; default is "waitTimeout"
         * @return bool
@@ -809,7 +818,8 @@ class LoadBalancer implements ILoadBalancer {
 
                // Find a connection to wait on, creating one if needed and allowed
                $close = false; // close the connection afterwards
-               $conn = $this->getAnyOpenConnection( $index );
+               $flags = self::CONN_SILENCE_ERRORS;
+               $conn = $this->getAnyOpenConnection( $index, $flags );
                if ( !$conn ) {
                        if ( !$open ) {
                                $this->replLogger->debug(
@@ -819,8 +829,8 @@ class LoadBalancer implements ILoadBalancer {
 
                                return false;
                        }
-                       // Open a temporary new connection in order to wait for replication
-                       $conn = $this->getConnection( $index, [], self::DOMAIN_ANY, self::CONN_SILENCE_ERRORS );
+                       // Get a connection to this server without triggering other server connections
+                       $conn = $this->getServerConnection( $index, self::DOMAIN_ANY, $flags );
                        if ( !$conn ) {
                                $this->replLogger->warning(
                                        __METHOD__ . ': failed to connect to {dbserver}',
@@ -877,20 +887,42 @@ class LoadBalancer implements ILoadBalancer {
        }
 
        public function getConnection( $i, $groups = [], $domain = false, $flags = 0 ) {
-               $groups = $this->resolveGroups( $groups, $i );
                $domain = $this->resolveDomainID( $domain );
-               $flags = $this->sanitizeConnectionFlags( $flags );
-               $masterOnly = ( $i === self::DB_MASTER || $i === $this->getWriterIndex() );
+               $groups = $this->resolveGroups( $groups, $i );
+               $flags = $this->sanitizeConnectionFlags( $flags, $i );
+               // If given DB_MASTER/DB_REPLICA, resolve it to a specific server index. Resolving
+               // DB_REPLICA might trigger getServerConnection() calls due to the getReaderIndex()
+               // connectivity checks or LoadMonitor::scaleLoads() server state cache regeneration.
+               // The use of getServerConnection() instead of getConnection() avoids infinite loops.
+               $serverIndex = $this->getConnectionIndex( $i, $groups, $domain );
+               // Get an open connection to that server (might trigger a new connection)
+               $conn = $this->getServerConnection( $serverIndex, $domain, $flags );
+               // Set master DB handles as read-only if there is high replication lag
+               if ( $serverIndex === $this->getWriterIndex() && $this->getLaggedReplicaMode( $domain ) ) {
+                       $reason = ( $this->getExistingReaderIndex( self::GROUP_GENERIC ) >= 0 )
+                               ? 'The database is read-only until replication lag decreases.'
+                               : 'The database is read-only until replica database servers becomes reachable.';
+                       $conn->setLBInfo( 'readOnlyReason', $reason );
+               }
+
+               return $conn;
+       }
 
+       /**
+        * @param int $i Specific server index
+        * @param string $domain Resolved DB domain
+        * @param int $flags Bitfield of class CONN_* constants
+        * @return IDatabase|bool
+        * @throws InvalidArgumentException When the server index is invalid
+        */
+       public function getServerConnection( $i, $domain, $flags = 0 ) {
                // Number of connections made before getting the server index and handle
                $priorConnectionsMade = $this->connectionCounter;
-               // Choose a server if $i is DB_MASTER/DB_REPLICA (might trigger new connections)
-               $serverIndex = $this->getConnectionIndex( $i, $groups, $domain );
-               // Get an open connection to that server (might trigger a new connection)
+               // Get an open connection to this server (might trigger a new connection)
                $conn = $this->localDomain->equals( $domain )
-                       ? $this->getLocalConnection( $serverIndex, $flags )
-                       : $this->getForeignConnection( $serverIndex, $domain, $flags );
-               // Throw an error or bail out if the connection attempt failed
+                       ? $this->getLocalConnection( $i, $flags )
+                       : $this->getForeignConnection( $i, $domain, $flags );
+               // Throw an error or otherwise bail out if the connection attempt failed
                if ( !( $conn instanceof IDatabase ) ) {
                        if ( ( $flags & self::CONN_SILENCE_ERRORS ) != self::CONN_SILENCE_ERRORS ) {
                                $this->reportConnectionError();
@@ -901,25 +933,36 @@ class LoadBalancer implements ILoadBalancer {
 
                // Profile any new connections caused by this method
                if ( $this->connectionCounter > $priorConnectionsMade ) {
-                       $host = $conn->getServer();
-                       $dbname = $conn->getDBname();
-                       $this->trxProfiler->recordConnection( $host, $dbname, $masterOnly );
+                       $this->trxProfiler->recordConnection(
+                               $conn->getServer(),
+                               $conn->getDBname(),
+                               ( ( $flags & self::CONN_INTENT_WRITABLE ) == self::CONN_INTENT_WRITABLE )
+                       );
                }
 
                if ( !$conn->isOpen() ) {
-                       // Connection was made but later unrecoverably lost for some reason.
-                       // Do not return a handle that will just throw exceptions on use,
-                       // but let the calling code (e.g. getReaderIndex) try another server.
                        $this->errorConnection = $conn;
+                       // Connection was made but later unrecoverably lost for some reason.
+                       // Do not return a handle that will just throw exceptions on use, but
+                       // let the calling code, e.g. getReaderIndex(), try another server.
                        return false;
                }
 
+               // Make sure that flags like CONN_TRX_AUTOCOMMIT are respected by this handle
                $this->enforceConnectionFlags( $conn, $flags );
-               if ( $serverIndex === $this->getWriterIndex() ) {
-                       // If the load balancer is read-only, perhaps due to replication lag, then master
-                       // DB handles will reflect that. Note that Database::assertIsWritableMaster() takes
-                       // care of replica DB handles whereas getReadOnlyReason() would cause infinite loops.
-                       $conn->setLBInfo( 'readOnlyReason', $this->getReadOnlyReason( $domain, $conn ) );
+               // Set master DB handles as read-only if the load balancer is configured as read-only
+               // or the master database server is running in server-side read-only mode. Note that
+               // replica DB handles are always read-only via Database::assertIsWritableMaster().
+               // Read-only mode due to replication lag is *avoided* here to avoid recursion.
+               if ( $conn->getLBInfo( 'serverIndex' ) === $this->getWriterIndex() ) {
+                       if ( $this->readOnlyReason !== false ) {
+                               $conn->setLBInfo( 'readOnlyReason', $this->readOnlyReason );
+                       } elseif ( $this->masterRunningReadOnly( $domain, $conn ) ) {
+                               $conn->setLBInfo(
+                                       'readOnlyReason',
+                                       'The master database server is running in read-only mode.'
+                               );
+                       }
                }
 
                return $conn;
@@ -1019,7 +1062,7 @@ class LoadBalancer implements ILoadBalancer {
 
        /**
         * @param int $i
-        * @param bool $domain
+        * @param string|bool $domain
         * @param int $flags
         * @return Database|bool Live database handle or false on failure
         * @deprecated Since 1.34 Use getConnection() instead
@@ -1039,6 +1082,8 @@ class LoadBalancer implements ILoadBalancer {
         * @param int $i Server index
         * @param int $flags Class CONN_* constant bitfield
         * @return Database
+        * @throws InvalidArgumentException When the server index is invalid
+        * @throws UnexpectedValueException When the DB domain of the connection is corrupted
         */
        private function getLocalConnection( $i, $flags = 0 ) {
                // Connection handles required to be in auto-commit mode use a separate connection
@@ -1101,6 +1146,8 @@ class LoadBalancer implements ILoadBalancer {
         * @param int $flags Class CONN_* constant bitfield
         * @return Database|bool Returns false on connection error
         * @throws DBError When database selection fails
+        * @throws InvalidArgumentException When the server index is invalid
+        * @throws UnexpectedValueException When the DB domain of the connection is corrupted
         */
        private function getForeignConnection( $i, $domain, $flags = 0 ) {
                $domainInstance = DatabaseDomain::newFromId( $domain );
@@ -1847,20 +1894,16 @@ class LoadBalancer implements ILoadBalancer {
        }
 
        public function getLaggedReplicaMode( $domain = false ) {
-               if (
-                       // Avoid recursion if there is only one DB
-                       $this->hasStreamingReplicaServers() &&
-                       // Avoid recursion if the (non-zero load) master DB was picked for generic reads
-                       $this->genericReadIndex !== $this->getWriterIndex() &&
-                       // Stay in lagged replica mode during the load balancer instance lifetime
-                       !$this->laggedReplicaMode
-               ) {
+               if ( $this->laggedReplicaMode ) {
+                       return true; // stay in lagged replica mode
+               }
+
+               if ( $this->hasStreamingReplicaServers() ) {
                        try {
-                               // Calling this method will set "laggedReplicaMode" as needed
-                               $this->getReaderIndex( false, $domain );
+                               // Set "laggedReplicaMode"
+                               $this->getReaderIndex( self::GROUP_GENERIC, $domain );
                        } catch ( DBConnectionError $e ) {
-                               // Avoid expensive re-connect attempts and failures
-                               $this->allReplicasDownMode = true;
+                               // Sanity: avoid expensive re-connect attempts and failures
                                $this->laggedReplicaMode = true;
                        }
                }
@@ -1884,16 +1927,12 @@ class LoadBalancer implements ILoadBalancer {
        public function getReadOnlyReason( $domain = false, IDatabase $conn = null ) {
                if ( $this->readOnlyReason !== false ) {
                        return $this->readOnlyReason;
-               } elseif ( $this->getLaggedReplicaMode( $domain ) ) {
-                       if ( $this->allReplicasDownMode ) {
-                               return 'The database has been automatically locked ' .
-                                       'until the replica database servers become available';
-                       } else {
-                               return 'The database has been automatically locked ' .
-                                       'while the replica database servers catch up to the master.';
-                       }
                } elseif ( $this->masterRunningReadOnly( $domain, $conn ) ) {
-                       return 'The database master is running in read-only mode.';
+                       return 'The master database server is running in read-only mode.';
+               } elseif ( $this->getLaggedReplicaMode( $domain ) ) {
+                       return ( $this->getExistingReaderIndex( self::GROUP_GENERIC ) >= 0 )
+                               ? 'The database is read-only until replication lag decreases.'
+                               : 'The database is read-only until a replica database server becomes reachable.';
                }
 
                return false;
@@ -1914,7 +1953,8 @@ class LoadBalancer implements ILoadBalancer {
                        function () use ( $domain, $conn ) {
                                $old = $this->trxProfiler->setSilenced( true );
                                try {
-                                       $dbw = $conn ?: $this->getConnection( self::DB_MASTER, [], $domain );
+                                       $index = $this->getWriterIndex();
+                                       $dbw = $conn ?: $this->getServerConnection( $index, $domain );
                                        $readOnly = (int)$dbw->serverIsReadOnly();
                                        if ( !$conn ) {
                                                $this->reuseConnection( $dbw );
@@ -1923,6 +1963,7 @@ class LoadBalancer implements ILoadBalancer {
                                        $readOnly = 0;
                                }
                                $this->trxProfiler->setSilenced( $old );
+
                                return $readOnly;
                        },
                        [ 'pcTTL' => $cache::TTL_PROC_LONG, 'busyValue' => 0 ]
@@ -2070,12 +2111,12 @@ class LoadBalancer implements ILoadBalancer {
                if ( !$pos ) {
                        // Get the current master position, opening a connection if needed
                        $index = $this->getWriterIndex();
-                       $masterConn = $this->getAnyOpenConnection( $index );
+                       $flags = self::CONN_SILENCE_ERRORS;
+                       $masterConn = $this->getAnyOpenConnection( $index, $flags );
                        if ( $masterConn ) {
                                $pos = $masterConn->getMasterPos();
                        } else {
-                               $flags = self::CONN_SILENCE_ERRORS;
-                               $masterConn = $this->getConnection( $index, [], self::DOMAIN_ANY, $flags );
+                               $masterConn = $this->getServerConnection( $index, self::DOMAIN_ANY, $flags );
                                if ( !$masterConn ) {
                                        throw new DBReplicationWaitError(
                                                null,
index 1666c27..19550f4 100644 (file)
@@ -35,7 +35,7 @@ use WANObjectCache;
  */
 class LoadMonitor implements ILoadMonitor {
        /** @var ILoadBalancer */
-       protected $parent;
+       protected $lb;
        /** @var BagOStuff */
        protected $srvCache;
        /** @var WANObjectCache */
@@ -64,7 +64,7 @@ class LoadMonitor implements ILoadMonitor {
        public function __construct(
                ILoadBalancer $lb, BagOStuff $srvCache, WANObjectCache $wCache, array $options = []
        ) {
-               $this->parent = $lb;
+               $this->lb = $lb;
                $this->srvCache = $srvCache;
                $this->wanCache = $wCache;
                $this->replLogger = new NullLogger();
@@ -85,7 +85,7 @@ class LoadMonitor implements ILoadMonitor {
                        if ( isset( $newScalesByServer[$i] ) ) {
                                $weightByServer[$i] = $weight * $newScalesByServer[$i];
                        } else { // server recently added to config?
-                               $host = $this->parent->getServerName( $i );
+                               $host = $this->lb->getServerName( $i );
                                $this->replLogger->error( __METHOD__ . ": host $host not in cache" );
                        }
                }
@@ -96,7 +96,7 @@ class LoadMonitor implements ILoadMonitor {
        }
 
        protected function getServerStates( array $serverIndexes, $domain ) {
-               $writerIndex = $this->parent->getWriterIndex();
+               $writerIndex = $this->lb->getWriterIndex();
                if ( count( $serverIndexes ) == 1 && reset( $serverIndexes ) == $writerIndex ) {
                        # Single server only, just return zero without caching
                        return [
@@ -146,7 +146,7 @@ class LoadMonitor implements ILoadMonitor {
                $weightScales = [];
                $movAveRatio = $this->movingAveRatio;
                foreach ( $serverIndexes as $i ) {
-                       if ( $i == $this->parent->getWriterIndex() ) {
+                       if ( $i == $this->lb->getWriterIndex() ) {
                                $lagTimes[$i] = 0; // master always has no lag
                                $weightScales[$i] = 1.0; // nominal weight
                                continue;
@@ -155,11 +155,12 @@ class LoadMonitor implements ILoadMonitor {
                        # Handles with open transactions are avoided since they might be subject
                        # to REPEATABLE-READ snapshots, which could affect the lag estimate query.
                        $flags = ILoadBalancer::CONN_TRX_AUTOCOMMIT | ILoadBalancer::CONN_SILENCE_ERRORS;
-                       $conn = $this->parent->getAnyOpenConnection( $i, $flags );
+                       $conn = $this->lb->getAnyOpenConnection( $i, $flags );
                        if ( $conn ) {
                                $close = false; // already open
                        } else {
-                               $conn = $this->parent->getConnection( $i, [], ILoadBalancer::DOMAIN_ANY, $flags );
+                               // Get a connection to this server without triggering other server connections
+                               $conn = $this->lb->getServerConnection( $i, ILoadBalancer::DOMAIN_ANY, $flags );
                                $close = true; // new connection
                        }
 
@@ -170,7 +171,7 @@ class LoadMonitor implements ILoadMonitor {
                        // Scale from 10% to 100% of nominal weight
                        $weightScales[$i] = max( $newWeight, 0.10 );
 
-                       $host = $this->parent->getServerName( $i );
+                       $host = $this->lb->getServerName( $i );
 
                        if ( !$conn ) {
                                $lagTimes[$i] = false;
@@ -203,7 +204,7 @@ class LoadMonitor implements ILoadMonitor {
                                # Note that the caller will pick one of these DBs and reconnect,
                                # which is slightly inefficient, but this only matters for the lag
                                # time cache miss cache, which is far less common that cache hits.
-                               $this->parent->closeConnection( $conn );
+                               $this->lb->closeConnection( $conn );
                        }
                }
 
@@ -235,7 +236,7 @@ class LoadMonitor implements ILoadMonitor {
                return $this->srvCache->makeGlobalKey(
                        'lag-times',
                        self::VERSION,
-                       $this->parent->getServerName( $this->parent->getWriterIndex() ),
+                       $this->lb->getServerName( $this->lb->getWriterIndex() ),
                        implode( '-', $serverIndexes )
                );
        }
index dda980c..5ae5bbd 100644 (file)
@@ -52,7 +52,7 @@ class LoadMonitorMySQL extends LoadMonitor {
                        $res = $conn->query( 'SHOW STATUS', __METHOD__ );
                        $s = $res ? $conn->fetchObject( $res ) : false;
                        if ( $s === false ) {
-                               $host = $this->parent->getServerName( $index );
+                               $host = $this->lb->getServerName( $index );
                                $this->replLogger->error( __METHOD__ . ": could not get status for $host" );
                        } else {
                                // https://dev.mysql.com/doc/refman/5.7/en/server-status-variables.html
index 39d0353..c3a5897 100644 (file)
@@ -43,10 +43,12 @@ class SqlBagOStuff extends BagOStuff {
        protected $serverTags;
        /** @var int */
        protected $numServers;
+       /** @var int UNIX timestamp */
+       protected $lastGarbageCollect = 0;
        /** @var int */
-       protected $lastExpireAll = 0;
+       protected $purgePeriod = 10;
        /** @var int */
-       protected $purgePeriod = 100;
+       protected $purgeLimit = 100;
        /** @var int */
        protected $shards = 1;
        /** @var string */
@@ -65,6 +67,9 @@ class SqlBagOStuff extends BagOStuff {
        /** @var array Exceptions */
        protected $connFailureErrors = [];
 
+       /** @var int */
+       const GARBAGE_COLLECT_DELAY_SEC = 1;
+
        /**
         * Constructor. Parameters are:
         *   - server:      A server info structure in the format required by each
@@ -77,12 +82,13 @@ class SqlBagOStuff extends BagOStuff {
         *                  when a cluster is replicated to another site (with different host names)
         *                  but each server has a corresponding replica in the other cluster.
         *
-        *   - purgePeriod: The average number of object cache requests in between
+        *   - purgePeriod: The average number of object cache writes in between
         *                  garbage collection operations, where expired entries
         *                  are removed from the database. Or in other words, the
         *                  reciprocal of the probability of purging on any given
-        *                  request. If this is set to zero, purging will never be
-        *                  done.
+        *                  write. If this is set to zero, purging will never be done.
+        *
+        *   - purgeLimit:  Maximum number of rows to purge at once.
         *
         *   - tableName:   The table name to use, default is "objectcache".
         *
@@ -135,6 +141,9 @@ class SqlBagOStuff extends BagOStuff {
                if ( isset( $params['purgePeriod'] ) ) {
                        $this->purgePeriod = intval( $params['purgePeriod'] );
                }
+               if ( isset( $params['purgeLimit'] ) ) {
+                       $this->purgeLimit = intval( $params['purgeLimit'] );
+               }
                if ( isset( $params['tableName'] ) ) {
                        $this->tableName = $params['tableName'];
                }
@@ -270,8 +279,6 @@ class SqlBagOStuff extends BagOStuff {
                        $keysByTable[$serverIndex][$tableName][] = $key;
                }
 
-               $this->garbageCollect(); // expire old entries if any
-
                $dataRows = [];
                foreach ( $keysByTable as $serverIndex => $serverKeys ) {
                        try {
@@ -334,8 +341,6 @@ class SqlBagOStuff extends BagOStuff {
                        $keysByTable[$serverIndex][$tableName][] = $key;
                }
 
-               $this->garbageCollect(); // expire old entries if any
-
                $result = true;
                $exptime = (int)$expiry;
                /** @noinspection PhpUnusedLocalVariableInspection */
@@ -344,6 +349,7 @@ class SqlBagOStuff extends BagOStuff {
                        $db = null;
                        try {
                                $db = $this->getDB( $serverIndex );
+                               $this->occasionallyGarbageCollect( $db );
                        } catch ( DBError $e ) {
                                $this->handleWriteError( $e, $db, $serverIndex );
                                $result = false;
@@ -597,7 +603,10 @@ class SqlBagOStuff extends BagOStuff {
         * @return bool
         */
        protected function isExpired( $db, $exptime ) {
-               return $exptime != $this->getMaxDateTime( $db ) && wfTimestamp( TS_UNIX, $exptime ) < time();
+               return (
+                       $exptime != $this->getMaxDateTime( $db ) &&
+                       wfTimestamp( TS_UNIX, $exptime ) < time()
+               );
        }
 
        /**
@@ -612,105 +621,147 @@ class SqlBagOStuff extends BagOStuff {
                }
        }
 
-       protected function garbageCollect() {
-               if ( !$this->purgePeriod || $this->replicaOnly ) {
-                       // Disabled
-                       return;
-               }
-               // Only purge on one in every $this->purgePeriod requests.
-               if ( $this->purgePeriod !== 1 && mt_rand( 0, $this->purgePeriod - 1 ) ) {
-                       return;
-               }
-               $now = time();
-               // Avoid repeating the delete within a few seconds
-               if ( $now > ( $this->lastExpireAll + 1 ) ) {
-                       $this->lastExpireAll = $now;
-                       $this->expireAll();
+       /**
+        * @param IDatabase $db
+        * @throws DBError
+        */
+       protected function occasionallyGarbageCollect( IDatabase $db ) {
+               if (
+                       // Random purging is enabled
+                       $this->purgePeriod &&
+                       // This is not using a replica DB
+                       !$this->replicaOnly &&
+                       // Only purge on one in every $this->purgePeriod writes
+                       mt_rand( 0, $this->purgePeriod - 1 ) == 0 &&
+                       // Avoid repeating the delete within a few seconds
+                       ( time() - $this->lastGarbageCollect ) > self::GARBAGE_COLLECT_DELAY_SEC
+               ) {
+                       $garbageCollector = function () use ( $db ) {
+                               $this->deleteServerObjectsExpiringBefore( $db, time(), null, $this->purgeLimit );
+                               $this->lastGarbageCollect = time();
+                       };
+                       if ( $this->asyncHandler ) {
+                               $this->lastGarbageCollect = time(); // avoid duplicate enqueues
+                               ( $this->asyncHandler )( $garbageCollector );
+                       } else {
+                               $garbageCollector();
+                       }
                }
        }
 
        public function expireAll() {
-               $this->deleteObjectsExpiringBefore( wfTimestampNow() );
+               $this->deleteObjectsExpiringBefore( time() );
        }
 
-       /**
-        * Delete objects from the database which expire before a certain date.
-        * @param string $timestamp
-        * @param bool|callable $progressCallback
-        * @return bool
-        */
-       public function deleteObjectsExpiringBefore( $timestamp, $progressCallback = false ) {
+       public function deleteObjectsExpiringBefore(
+               $timestamp,
+               callable $progressCallback = null,
+               $limit = INF
+       ) {
                /** @noinspection PhpUnusedLocalVariableInspection */
                $silenceScope = $this->silenceTransactionProfiler();
-               for ( $serverIndex = 0; $serverIndex < $this->numServers; $serverIndex++ ) {
+
+               $serverIndexes = range( 0, $this->numServers - 1 );
+               shuffle( $serverIndexes );
+
+               $ok = true;
+
+               $keysDeletedCount = 0;
+               foreach ( $serverIndexes as $numServersDone => $serverIndex ) {
                        $db = null;
                        try {
                                $db = $this->getDB( $serverIndex );
-                               $dbTimestamp = $db->timestamp( $timestamp );
-                               $totalSeconds = false;
-                               $baseConds = [ 'exptime < ' . $db->addQuotes( $dbTimestamp ) ];
-                               for ( $i = 0; $i < $this->shards; $i++ ) {
-                                       $maxExpTime = false;
-                                       while ( true ) {
-                                               $conds = $baseConds;
-                                               if ( $maxExpTime !== false ) {
-                                                       $conds[] = 'exptime >= ' . $db->addQuotes( $maxExpTime );
-                                               }
-                                               $rows = $db->select(
-                                                       $this->getTableNameByShard( $i ),
-                                                       [ 'keyname', 'exptime' ],
-                                                       $conds,
-                                                       __METHOD__,
-                                                       [ 'LIMIT' => 100, 'ORDER BY' => 'exptime' ] );
-                                               if ( $rows === false || !$rows->numRows() ) {
-                                                       break;
-                                               }
-                                               $keys = [];
-                                               $row = $rows->current();
-                                               $minExpTime = $row->exptime;
-                                               if ( $totalSeconds === false ) {
-                                                       $totalSeconds = wfTimestamp( TS_UNIX, $timestamp )
-                                                               - wfTimestamp( TS_UNIX, $minExpTime );
-                                               }
-                                               foreach ( $rows as $row ) {
-                                                       $keys[] = $row->keyname;
-                                                       $maxExpTime = $row->exptime;
-                                               }
-
-                                               $db->delete(
-                                                       $this->getTableNameByShard( $i ),
-                                                       [
-                                                               'exptime >= ' . $db->addQuotes( $minExpTime ),
-                                                               'exptime < ' . $db->addQuotes( $dbTimestamp ),
-                                                               'keyname' => $keys
-                                                       ],
-                                                       __METHOD__ );
-
-                                               if ( $progressCallback ) {
-                                                       if ( intval( $totalSeconds ) === 0 ) {
-                                                               $percent = 0;
-                                                       } else {
-                                                               $remainingSeconds = wfTimestamp( TS_UNIX, $timestamp )
-                                                                       - wfTimestamp( TS_UNIX, $maxExpTime );
-                                                               if ( $remainingSeconds > $totalSeconds ) {
-                                                                       $totalSeconds = $remainingSeconds;
-                                                               }
-                                                               $processedSeconds = $totalSeconds - $remainingSeconds;
-                                                               $percent = ( $i + $processedSeconds / $totalSeconds )
-                                                                       / $this->shards * 100;
-                                                       }
-                                                       $percent = ( $percent / $this->numServers )
-                                                               + ( $serverIndex / $this->numServers * 100 );
-                                                       call_user_func( $progressCallback, $percent );
-                                               }
-                                       }
-                               }
+                               $this->deleteServerObjectsExpiringBefore(
+                                       $db,
+                                       $timestamp,
+                                       $progressCallback,
+                                       $limit,
+                                       $numServersDone,
+                                       $keysDeletedCount
+                               );
                        } catch ( DBError $e ) {
                                $this->handleWriteError( $e, $db, $serverIndex );
-                               return false;
+                               $ok = false;
                        }
                }
-               return true;
+
+               return $ok;
+       }
+
+       /**
+        * @param IDatabase $db
+        * @param string|int $timestamp
+        * @param callable|null $progressCallback
+        * @param int $limit
+        * @param int $serversDoneCount
+        * @param int &$keysDeletedCount
+        * @throws DBError
+        */
+       private function deleteServerObjectsExpiringBefore(
+               IDatabase $db,
+               $timestamp,
+               $progressCallback,
+               $limit,
+               $serversDoneCount = 0,
+               &$keysDeletedCount = 0
+       ) {
+               $cutoffUnix = wfTimestamp( TS_UNIX, $timestamp );
+               $shardIndexes = range( 0, $this->shards - 1 );
+               shuffle( $shardIndexes );
+
+               foreach ( $shardIndexes as $numShardsDone => $shardIndex ) {
+                       $continue = null; // last exptime
+                       $lag = null; // purge lag
+                       do {
+                               $res = $db->select(
+                                       $this->getTableNameByShard( $shardIndex ),
+                                       [ 'keyname', 'exptime' ],
+                                       array_merge(
+                                               [ 'exptime < ' . $db->addQuotes( $db->timestamp( $cutoffUnix ) ) ],
+                                               $continue ? [ 'exptime >= ' . $db->addQuotes( $continue ) ] : []
+                                       ),
+                                       __METHOD__,
+                                       [ 'LIMIT' => min( $limit, 100 ), 'ORDER BY' => 'exptime' ]
+                               );
+
+                               if ( $res->numRows() ) {
+                                       $row = $res->current();
+                                       if ( $lag === null ) {
+                                               $lag = max( $cutoffUnix - wfTimestamp( TS_UNIX, $row->exptime ), 1 );
+                                       }
+
+                                       $keys = [];
+                                       foreach ( $res as $row ) {
+                                               $keys[] = $row->keyname;
+                                               $continue = $row->exptime;
+                                       }
+
+                                       $db->delete(
+                                               $this->getTableNameByShard( $shardIndex ),
+                                               [
+                                                       'exptime < ' . $db->addQuotes( $db->timestamp( $cutoffUnix ) ),
+                                                       'keyname' => $keys
+                                               ],
+                                               __METHOD__
+                                       );
+                                       $keysDeletedCount += $db->affectedRows();
+                               }
+
+                               if ( is_callable( $progressCallback ) ) {
+                                       if ( $lag ) {
+                                               $remainingLag = $cutoffUnix - wfTimestamp( TS_UNIX, $continue );
+                                               $processedLag = max( $lag - $remainingLag, 0 );
+                                               $doneRatio = ( $numShardsDone + $processedLag / $lag ) / $this->shards;
+                                       } else {
+                                               $doneRatio = 1;
+                                       }
+
+                                       $overallRatio = ( $doneRatio / $this->numServers )
+                                               + ( $serversDoneCount / $this->numServers );
+                                       call_user_func( $progressCallback, $overallRatio * 100 );
+                               }
+                       } while ( $res->numRows() && $keysDeletedCount < $limit );
+               }
        }
 
        /**
@@ -748,6 +799,8 @@ class SqlBagOStuff extends BagOStuff {
                }
 
                list( $serverIndex ) = $this->getTableByKey( $key );
+
+               $db = null;
                try {
                        $db = $this->getDB( $serverIndex );
                        $ok = $db->lock( $key, __METHOD__, $timeout );
@@ -778,6 +831,8 @@ class SqlBagOStuff extends BagOStuff {
                        unset( $this->locks[$key] );
 
                        list( $serverIndex ) = $this->getTableByKey( $key );
+
+                       $db = null;
                        try {
                                $db = $this->getDB( $serverIndex );
                                $ok = $db->unlock( $key, __METHOD__ );
index 4108bd7..adc0bc0 100644 (file)
@@ -27,7 +27,7 @@ class PPDStack {
        public $stack, $rootAccum;
 
        /**
-        * @var PPDStack
+        * @var PPDStack|false
         */
        public $top;
        public $out;
index 03ee6d9..452bab1 100644 (file)
@@ -141,7 +141,7 @@ class PPFrame_DOM implements PPFrame {
        /**
         * @throws MWException
         * @param string|int $key
-        * @param string|PPNode_DOM|DOMDocument $root
+        * @param string|PPNode_DOM|DOMNode|DOMNodeList $root
         * @param int $flags
         * @return string
         */
@@ -152,7 +152,7 @@ class PPFrame_DOM implements PPFrame {
 
        /**
         * @throws MWException
-        * @param string|PPNode_DOM|DOMDocument $root
+        * @param string|PPNode_DOM|DOMNode $root
         * @param int $flags
         * @return string
         */
@@ -396,7 +396,7 @@ class PPFrame_DOM implements PPFrame {
        /**
         * @param string $sep
         * @param int $flags
-        * @param string|PPNode_DOM|DOMDocument ...$args
+        * @param string|PPNode_DOM|DOMNode ...$args
         * @return string
         */
        public function implodeWithFlags( $sep, $flags, ...$args ) {
@@ -426,7 +426,7 @@ class PPFrame_DOM implements PPFrame {
         * This previously called implodeWithFlags but has now been inlined to reduce stack depth
         *
         * @param string $sep
-        * @param string|PPNode_DOM|DOMDocument ...$args
+        * @param string|PPNode_DOM|DOMNode ...$args
         * @return string
         */
        public function implode( $sep, ...$args ) {
@@ -456,7 +456,7 @@ class PPFrame_DOM implements PPFrame {
         * with implode()
         *
         * @param string $sep
-        * @param string|PPNode_DOM|DOMDocument ...$args
+        * @param string|PPNode_DOM|DOMNode ...$args
         * @return array
         */
        public function virtualImplode( $sep, ...$args ) {
@@ -487,7 +487,7 @@ class PPFrame_DOM implements PPFrame {
         * @param string $start
         * @param string $sep
         * @param string $end
-        * @param string|PPNode_DOM|DOMDocument ...$args
+        * @param string|PPNode_DOM|DOMNode ...$args
         * @return array
         */
        public function virtualBracketedImplode( $start, $sep, $end, ...$args ) {
index 2b6cf7c..4561657 100644 (file)
@@ -36,20 +36,20 @@ interface PPNode {
        /**
         * Get an array-type node containing the children of this node.
         * Returns false if this is not a tree node.
-        * @return PPNode
+        * @return false|PPNode
         */
        public function getChildren();
 
        /**
         * Get the first child of a tree node. False if there isn't one.
         *
-        * @return PPNode
+        * @return false|PPNode
         */
        public function getFirstChild();
 
        /**
         * Get the next sibling of any node. False if there isn't one
-        * @return PPNode
+        * @return false|PPNode
         */
        public function getNextSibling();
 
@@ -57,7 +57,7 @@ interface PPNode {
         * Get all children of this tree node which have a given name.
         * Returns an array-type node, or false if this is not a tree node.
         * @param string $type
-        * @return bool|PPNode
+        * @return false|PPNode
         */
        public function getChildrenOfType( $type );
 
index 26a4791..53b1761 100644 (file)
@@ -27,7 +27,7 @@
 class PPNode_DOM implements PPNode {
 
        /**
-        * @var DOMElement
+        * @var DOMElement|DOMNodeList
         */
        public $node;
        public $xpath;
@@ -59,21 +59,21 @@ class PPNode_DOM implements PPNode {
        }
 
        /**
-        * @return bool|PPNode_DOM
+        * @return false|PPNode_DOM
         */
        public function getChildren() {
                return $this->node->childNodes ? new self( $this->node->childNodes ) : false;
        }
 
        /**
-        * @return bool|PPNode_DOM
+        * @return false|PPNode_DOM
         */
        public function getFirstChild() {
                return $this->node->firstChild ? new self( $this->node->firstChild ) : false;
        }
 
        /**
-        * @return bool|PPNode_DOM
+        * @return false|PPNode_DOM
         */
        public function getNextSibling() {
                return $this->node->nextSibling ? new self( $this->node->nextSibling ) : false;
@@ -82,7 +82,7 @@ class PPNode_DOM implements PPNode {
        /**
         * @param string $type
         *
-        * @return bool|PPNode_DOM
+        * @return false|PPNode_DOM
         */
        public function getChildrenOfType( $type ) {
                return new self( $this->getXPath()->query( $type, $this->node ) );
index e6cabf8..7782894 100644 (file)
@@ -135,7 +135,7 @@ class PPNode_Hash_Tree implements PPNode {
         * return a temporary proxy object: different instances will be returned
         * if this is called more than once on the same node.
         *
-        * @return PPNode_Hash_Tree|PPNode_Hash_Attr|PPNode_Hash_Text|bool
+        * @return PPNode_Hash_Tree|PPNode_Hash_Attr|PPNode_Hash_Text|false
         */
        public function getFirstChild() {
                if ( !isset( $this->rawChildren[0] ) ) {
@@ -150,7 +150,7 @@ class PPNode_Hash_Tree implements PPNode {
         * return a temporary proxy object: different instances will be returned
         * if this is called more than once on the same node.
         *
-        * @return PPNode_Hash_Tree|PPNode_Hash_Attr|PPNode_Hash_Text|bool
+        * @return PPNode_Hash_Tree|PPNode_Hash_Attr|PPNode_Hash_Text|false
         */
        public function getNextSibling() {
                return self::factory( $this->store, $this->index + 1 );
index 4808caf..a2c5eec 100644 (file)
@@ -205,9 +205,11 @@ class Parser {
        public $mLinkID;
        public $mIncludeSizes, $mPPNodeCount, $mGeneratedPPNodeCount, $mHighestExpansionDepth;
        public $mDefaultSort;
-       public $mTplRedirCache, $mTplDomCache, $mHeadings, $mDoubleUnderscores;
+       public $mTplRedirCache, $mHeadings, $mDoubleUnderscores;
        public $mExpensiveFunctionCount; # number of expensive parser function calls
        public $mShowToc, $mForceTocPosition;
+       /** @var array */
+       public $mTplDomCache;
 
        /**
         * @var User
@@ -3084,7 +3086,7 @@ class Parser {
         *  self::OT_HTML: all templates and extension tags
         *
         * @param string $text The text to transform
-        * @param bool|PPFrame $frame Object describing the arguments passed to the
+        * @param false|PPFrame|array $frame Object describing the arguments passed to the
         *   template. Arguments may also be provided as an associative array, as
         *   was the usual case before MW1.12. Providing arguments this way may be
         *   useful for extensions wishing to perform variable replacement
@@ -3190,7 +3192,7 @@ class Parser {
         *   $piece['lineStart']: whether the brace was at the start of a line
         * @param PPFrame $frame The current frame, contains template arguments
         * @throws Exception
-        * @return string The text of the template
+        * @return string|array The text of the template
         */
        public function braceSubstitution( $piece, $frame ) {
                // Flags
index 9e510d2..fb8a1dc 100644 (file)
@@ -37,6 +37,9 @@ class Preprocessor_DOM extends Preprocessor {
 
        const CACHE_PREFIX = 'preprocess-xml';
 
+       /**
+        * @param Parser $parser
+        */
        public function __construct( $parser ) {
                wfDeprecated( __METHOD__, '1.34' ); // T204945
                $this->parser = $parser;
index 66f081f..f7f37ac 100644 (file)
@@ -50,6 +50,9 @@ class Preprocessor_Hash extends Preprocessor {
        const CACHE_PREFIX = 'preprocess-hash';
        const CACHE_VERSION = 2;
 
+       /**
+        * @param Parser $parser
+        */
        public function __construct( $parser ) {
                $this->parser = $parser;
        }
index 74d0616..457648a 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * Message blobs storage used by ResourceLoader.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -20,7 +18,6 @@
  * @file
  * @author Roan Kattouw
  * @author Trevor Parscal
- * @author Timo Tijhof
  */
 
 use MediaWiki\MediaWikiServices;
index f718e5f..7a7ab89 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * ResourceLoader module for populating language specific data.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -19,7 +17,6 @@
  *
  * @file
  * @author Santhosh Thottingal
- * @author Timo Tijhof
  */
 
 /**
index 2dd6c17..0f33666 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * ResourceLoader module for skin stylesheets.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * http://www.gnu.org/copyleft/gpl.html
  *
  * @file
- * @author Timo Tijhof
  */
 
+/**
+ * ResourceLoader module for skin stylesheets.
+ */
 class ResourceLoaderSkinModule extends ResourceLoaderFileModule {
        /**
         * All skins are assumed to be compatible with mobile
index c28b89e..c1b21e6 100644 (file)
@@ -74,7 +74,7 @@ abstract class RedirectSpecialPage extends UnlistedSpecialPage {
                $request = $this->getRequest();
 
                foreach ( array_merge( $this->mAllowedRedirectParams,
-                               [ 'uselang', 'useskin', 'debug' ] // parameters which can be passed to all pages
+                               [ 'uselang', 'useskin', 'debug', 'safemode' ] // parameters which can be passed to all pages
                        ) as $arg ) {
                        if ( $request->getVal( $arg, null ) !== null ) {
                                $params[$arg] = $request->getVal( $arg );
index 0ce63b5..776008e 100644 (file)
        "recentchanges-feed-description": "molihang pagentosan anyar ring wiki ring \"umpan\" puniki",
        "recentchanges-label-newpage": "Uahan puniki makarya kaca anyar",
        "recentchanges-label-minor": "Punika uahan alit",
-       "recentchanges-label-bot": "penguwahan puniki kalaksanayang antuk bot",
+       "recentchanges-label-bot": "Uahan puniki kalaksanayang antuk bot",
        "recentchanges-label-unpatrolled": "Uahan puniki durung kapatroli",
        "recentchanges-legend-heading": "<strong>Legenda:</strong>",
        "recentchanges-legend-newpage": "{{int:recentchanges-label-newpage}} (taler cingak [[Special:NewPages|bacakan kaca anyar]])",
index 318f24c..7ca94c7 100644 (file)
        "media_tip": "لینک فایل",
        "sig_tip": "شمی امضا گون مهر زمان",
        "hr_tip": "خط افقی",
-       "summary": "خلاصه:",
+       "summary": "کمݔں:",
        "subject": "موضوع/سرخط:",
        "minoredit": "ای شی یک هوردین اصلاحیت",
-       "watchthis": "اÛ\8c ØµÙ\81Ø­Ù\87 Ø¨چار",
+       "watchthis": "اÛ\92 ØªØ§Ú©Ø§ Ø¨Û\81 چار",
        "savearticle": "تاکدیمِ ذخیره کورتین",
        "preview": "دیستین",
        "showpreview": "بازبین پیش دار",
        "search-suggest": "شما را منظور ات: $1",
        "search-interwiki-caption": "پروژه آن گوهار",
        "search-interwiki-default": "نتایج چه $1 :",
-       "search-interwiki-more": "(گݔشتر)",
-       "search-interwiki-more-results": "گݔشتر",
+       "search-interwiki-more": "(گݔشتِر)",
+       "search-interwiki-more-results": "گݔشترݔں نتیجہ",
        "search-relatedarticle": "مربوطین",
        "searchrelated": "مربوط",
        "searchall": "کل",
        "uploadlogpage": "آپلود ورودان",
        "uploadlogpagetext": "جهلء یک لیست چه نوکترین آپلودان قایل هست.\n[[Special:NewFiles|گالری نوکین فایلان]]",
        "filename": "نام فایل",
-       "filedesc": "خلاصه",
-       "fileuploadsummary": "خلاصه:",
+       "filedesc": "کمݔں",
+       "fileuploadsummary": "پائلء باروا:",
        "filereuploadsummary": "تغییرات فایل:",
        "filestatus": "وضعیت حق کپی:",
        "filesource": "منبع:",
index c4aa322..bbaf678 100644 (file)
        "history-fieldset-title": "Silañ an adweladennoù",
        "history-show-deleted": "Stumm diverket hepken",
        "histfirst": "koshañ",
-       "histlast": "nevezañ",
+       "histlast": "nevesañ",
        "historysize": "({{PLURAL:$1|$1 okted|$1 okted}})",
        "historyempty": "goullo",
        "history-feed-title": "Istor ar c'hemmoù",
index 448ddb8..b87811a 100644 (file)
        "histlegend": "Кхетор: (хӀинцалера.) — йолучу башхон къастам; (хьалх.) — хьалхалерчу башхон къастам; '''ж''' — жимо бозалца болу хийцам.",
        "history-fieldset-title": "АгӀона хийцамаш",
        "history-show-deleted": "ДӀаяьхнарш",
-       "histfirst": "ширниш",
-       "histlast": "хьалхарниш",
+       "histfirst": "Ñ\88иÑ\80аниÑ\88",
+       "histlast": "керланиш",
        "historysize": "($1 {{PLURAL:$1|байт}})",
        "historyempty": "(еса)",
        "history-feed-title": "Хийцаман истори",
index a4b4b79..babd4a1 100644 (file)
        "systemblockedtext": "Vaše IP adresa byla automaticky zablokována softwarem MediaWiki.\nUdaný důvod blokování:\n\n:<em>$2</em>\n\n* Začátek blokování: $8\n* Konec blokování: $6\n* Původně blokovaný uživatel: $7\n\nVaše současná IP adresa je $3.\nProsíme, uveďte tyto údaje při komunikaci se správci.",
        "blockednoreason": "důvod nebyl zadán",
        "blockedtext-composite": "<strong>Vaše uživatelské jméno nebo IP adresa byla zablokována.</strong>\n\nUdaný důvod blokování:\n\n:<em>$2</em>\n\n* Začátek blokování: $8\n* Konec nejdelšího blokování: $6\n\nVaše současná IP adresa je $3.\nProsíme, uveďte tyto údaje při komunikaci se správci.",
+       "blockedtext-composite-reason": "Na váš účet a/nebo vaši IP adresu se vztahuje více blokování.",
        "whitelistedittext": "Pro editaci se musíte $1.",
        "confirmedittext": "Pro editaci stránek je vyžadováno potvrzení vaší e-mailové adresy.\nNa stránce [[Special:Preferences|nastavení]] zadejte a nechte potvrdit svou e-mailovou adresu.",
        "nosuchsectiontitle": "Sekce nenalezena",
index fb7dd16..ee787a3 100644 (file)
        "passwordpolicies-policyflag-suggestchangeonlogin": "Änderung bei der Anmeldung vorschlagen",
        "easydeflate-invaliddeflate": "Der angegebene Inhalt ist nicht ordnungsgemäß komprimiert",
        "unprotected-js": "Aus Sicherheitsgründen kann JavaScript-Code nicht mehr von ungeschützten Seiten geladen werden. Erstelle die JavaScript-Seite bitte ausschließlich im Namensraum „MediaWiki“ oder als Benutzerunterseite.",
-       "userlogout-continue": "Falls du dich abmelden möchtest, [$1 fahre bitte auf der Abmeldeseite fort]."
+       "userlogout-continue": "Möchtest du dich abmelden?"
 }
index 43c77e8..c9a6fc8 100644 (file)
        "exif-iimcategory-edu": "آموختاری",
        "exif-iimcategory-evn": "زئشت گه",
        "exif-iimcategory-hth": "تن آزایی",
-       "exif-iimcategory-hum": "حاستنی انسانی",
+       "exif-iimcategory-hum": "هاستنی اْنسانی",
        "exif-iimcategory-lab": "کار",
        "exif-iimcategory-lif": "گواردن زئشت و شادی کردن",
        "exif-iimcategory-pol": "سیاستا",
index 8fdd0d7..a8c88a5 100644 (file)
        "history": "Breytingaskrá síðu",
        "history_short": "Breytingaskrá",
        "history_small": "breytingaskrá",
-       "updatedmarker": "uppfært frá síðustu heimsókn minni",
+       "updatedmarker": "uppfært frá síðustu heimsókn þinni",
        "printableversion": "Prentvæn útgáfa",
        "permalink": "Varanlegur tengill",
        "print": "Prenta",
        "page_first": "fyrsta",
        "page_last": "síðasta",
        "histlegend": "Mismunarval: merktu við einvalshnappanna fyrir þær útgáfur sem á að bera saman og styddu svo á færsluhnappinn.<br />\nSkýringartexti: (nú) = skoðanamunur á núverandi útgáfu,\n(síðast) = skoðanamunur á undanfarandi útgáfu, M = minniháttar breyting.",
-       "history-fieldset-title": "Skoða breytingaskrá",
+       "history-fieldset-title": "Sía breytingar",
        "history-show-deleted": "Eingöngu eyddar breytingar",
        "histfirst": "elstu",
        "histlast": "nýjustu",
        "historysize": "({{PLURAL:$1|1 bæti|$1 bæti}})",
-       "historyempty": "(tóm)",
+       "historyempty": "tóm",
        "history-feed-title": "Breytingaskrá",
        "history-feed-description": "Breytingaskrá fyrir þessa síðu á wiki-síðunni",
        "history-feed-item-nocomment": "$1 á $2",
        "right-reupload-own": "Yfirrita fyrirliggjandi skrár sem að ég hlóð inn sjálf(ur)",
        "right-reupload-shared": "Hunsa skrár á sameiginlegu myndasafni staðbundið",
        "right-upload_by_url": "Hlaða inn skrám af vefslóð",
-       "right-purge": "Hreinsa skyndiminni síðu án staðfestingar",
+       "right-purge": "Hreinsa skyndiminni vefþjónsins fyrir síðuna",
        "right-autoconfirmed": "Sneiða hjá takmörkunum vistfanga",
        "right-bot": "Eru meðhöndlaðir eins og sjálfvirk aðgerð",
        "right-nominornewtalk": "Ekki láta minniháttar breytingar á spjallsíðum kveða upp áminningu um ný skilaboð",
        "rcfilters-savedqueries-already-saved": "Þessar síur hafa þegar verið vistaðar. Breyttu þínum stillingum til þess að búa til nýja vistaða síu.",
        "rcfilters-restore-default-filters": "Endurreisa sjálfgefnar síur",
        "rcfilters-clear-all-filters": "Hreinsa allar síur",
-       "rcfilters-show-new-changes": "Skoða nýjustu breytingarnar",
+       "rcfilters-show-new-changes": "Skoða nýjustu breytingar síðan $1",
        "rcfilters-search-placeholder": "Sía breytingar (notaðu valmyndina eða leitaðu að síuheiti)",
        "rcfilters-invalid-filter": "Ógild sía",
        "rcfilters-empty-filter": "Engar virkar síur. Öll framlög eru sýnileg.",
        "delete-confirm": "Eyða „$1“",
        "delete-legend": "Eyða",
        "historywarning": "<strong>Viðvörun:</strong> Síðan sem þú ert um það bil að eyða hefur breytingaskrá með $1 {{PLURAL:$1|breytingu|breytingum}}:",
-       "historyaction-submit": "Birta",
+       "historyaction-submit": "Birta breytingar",
        "confirmdeletetext": "Þú ert um það bil að eyða síðu ásamt breytingaskrá hennar.\nStaðfestu það að þú ætlir að gera svo, það að þú skiljir afleiðingarnar, og að þú sért að gera þetta í samræmi við [[{{MediaWiki:Policy-url}}|samþykktir]].",
        "actioncomplete": "Aðgerð lokið",
        "actionfailed": "Aðgerð mistókst",
        "blocklist-editing-page": "síður",
        "blocklist-editing-ns": "nafnrými",
        "ipblocklist-empty": "Bannlistinn er tómur.",
-       "ipblocklist-no-results": "Umbeðið vistfang eða notandanafn er ekki í banni.",
+       "ipblocklist-no-results": "Engin samsvarandi bönn fundust fyrir umbeðið vistfang eða notandanafn.",
        "blocklink": "banna",
        "unblocklink": "afbanna",
        "change-blocklink": "breyta bönnun",
        "autosumm-replace": "Skipti út innihaldi með „$1“",
        "autoredircomment": "Tilvísun á [[$1]]",
        "autosumm-removed-redirect": "Fjarlægði endurbeiningu á [[$1]]",
+       "autosumm-changed-redirect-target": "Breytti tilvísun frá [[$1]] til [[$2]]",
        "autosumm-new": "Ný síða: $1",
        "autosumm-newblank": "Bjó til tóma síðu",
        "size-bytes": "$1 {{PLURAL:$1|bæt|bæti}}",
        "logentry-rights-autopromote": "$1 fékk sjálfvirkt {{GENDER:$2|aukin}} réttindi frá $4 til $5",
        "logentry-upload-upload": "$1 {{GENDER:$2|hlóð inn}} $3",
        "logentry-upload-overwrite": "$1 {{GENDER:$2|hlóð inn}} nýrri útgáfu af $3",
-       "logentry-upload-revert": "$1 {{GENDER:$2|hlóð inn}} $3",
+       "logentry-upload-revert": "$1 {{GENDER:$2|tók til baka}} $3 til eldri útgáfu",
        "log-name-managetags": "Breytingaskrá yfir sýsl með merki",
        "logentry-managetags-create": "$1 {{GENDER:$2|bjó til}} merkið \"$4\"",
        "rightsnone": "(engum)",
index 370d98e..f5ca1fe 100644 (file)
@@ -18,7 +18,8 @@
                        "Macofe",
                        "Dcljr",
                        "Aefgh39622",
-                       "Vlad5250"
+                       "Vlad5250",
+                       "Y.snsqr"
                ]
        },
        "tog-underline": "គូសបន្ទាត់ក្រោម​តំណភ្ជាប់៖",
        "hist": "ប្រវត្តិ",
        "hide": "លាក់",
        "show": "បង្ហាញ",
-       "minoreditletter": "តិច",
+       "minoreditletter": "ត",
        "newpageletter": "ថ្មី",
-       "boteditletter": "យន្ត",
+       "boteditletter": "យ",
        "rc-change-size": "$1",
        "rc-change-size-new": "$1 {{PLURAL:$1|បៃ|បៃ}} បន្ទាប់ពីបន្លាស់ប្ដូរ",
        "newsectionsummary": "/* $1 */ ផ្នែកថ្មី",
        "rc-old-title": "បង្កើតឡើងដំបូងដោយ «$1»",
        "recentchangeslinked": "បន្លាស់ប្ដូរពាក់ព័ន្ធ",
        "recentchangeslinked-feed": "បន្លាស់ប្ដូរពាក់ព័ន្ធ",
-       "recentchangeslinked-toolbox": "បន្លាស់ប្ដូរពាក់ព័ន្ធ",
+       "recentchangeslinked-toolbox": "á\9e\94á\9e\93á\9f\92á\9e\9bá\9e¶á\9e\9fá\9f\8bá\9e\94á\9f\92á\9e\8aá\9e¼á\9e\9aá\9e\8aá\9f\82á\9e\9bá\9e\96á\9e¶á\9e\80á\9f\8bá\9e\96á\9f\90á\9e\93á\9f\92á\9e\92",
        "recentchangeslinked-title": "បន្លាស់ប្ដូរ​ពាក់ព័ន្ធនឹង «$1»",
        "recentchangeslinked-summary": "នេះជាបញ្ជីបន្លាស់ប្ដូរនានា ដែលត្រូវបានធ្វើឡើងនៅលើទំព័រទាំងឡាយ ដែលមានតំណភ្ជាប់ពីទំព័រកំណត់មួយ(ឬ មានតំណភ្ជាប់ទៅទំព័រ ដែលមានក្នុងចំណាត់ថ្នាក់ក្រុមណាមួយ) នាពេលថ្មីៗនេះ ។ ទំព័រ​នានាក្នុង[[Special:Watchlist|បញ្ជីតាមដាន​របស់អ្នក]]ត្រូវបានសរសេរជា '''អក្សរដិត''' ។",
        "recentchangeslinked-page": "ឈ្មោះទំព័រ៖",
        "tooltip-t-contributions": "បញ្ជីនៃការរួមចំណែករបស់{{GENDER:$1|អ្នកប្រើប្រាស់នេះ}}",
        "tooltip-t-emailuser": "ផ្ញើអ៊ីមែលទៅកាន់{{GENDER:$1|អ្នកប្រើប្រាស់នេះ}}",
        "tooltip-t-info": "ព័ត៌មានបន្ថែមអំពីទំព័រនេះ",
-       "tooltip-t-upload": "á\9e¯á\9e\80á\9e\9fá\9e¶á\9e\9aá\9e\95á\9f\92á\9e\91á\9e»á\9e\80ឡើង",
-       "tooltip-t-specialpages": "á\9e\94á\9e\89á\9f\92á\9e\87á\9e¸á\9e\91á\9f\86á\9e\96á\9f\90á\9e\9aá\9e\96á\9e·á\9e\9fá\9f\81á\9e\9fá\9f\97á\9e\91á\9e¶á\9f\86á\9e\84á\9e\98á\9e¼á\9e\9b",
+       "tooltip-t-upload": "á\9e\95á\9f\92á\9e\91á\9e»á\9e\80á\9e¯á\9e\80á\9e\9fá\9e¶á\9e\9aឡើង",
+       "tooltip-t-specialpages": "á\9e\94á\9e\89á\9f\92á\9e\87á\9e¸á\9e\93á\9f\83á\9e\91á\9f\86á\9e\96á\9f\90á\9e\9aá\9e\96á\9e·á\9e\9fá\9f\81á\9e\9fá\9e\91á\9e¶á\9f\86á\9e\84á\9e¢á\9e\9fá\9f\8b",
        "tooltip-t-print": "ទម្រង់សម្រាប់បោះពុម្ភរបស់ទំព័រនេះ",
        "tooltip-t-permalink": "តំណភ្ជាប់អចិន្ត្រៃយ៍ដែលភ្ជាប់មកកំណែនៃទំព័រនេះ",
        "tooltip-ca-nstab-main": "មើលទំព័រមាតិកា",
index 58fd776..c8c8e15 100644 (file)
        "filetype-mime-mismatch": "دمادیس جانیا «$1.‎» وا نوع MIME وه($2) یکی نئ.",
        "filetype-badmime": "جانیایی که نوع MIME ونو $1 بوئه سی سوارکرد اجازه دار نیئن.",
        "filetype-bad-ie-mime": "نبوئه ای جانیانه سوار بکیت سی یه که اینترنت اکسپلورر ونه چی «$1» میشناسه، سی یه که وه یه گل جانیا ناصلادار و شات خطردار با.",
-       "filetype-unwanted-type": "'''«‎.‎$1»''' یÙ\87 Ú¯Ù\84 Ø¬Ø§Ù\86Û\8cا Ø­Ø§Ø³ØªÙ\86Û\8c Ù\86ئ.\n{{PLURAL:$3|جاÙ\86Û\8cا Ù\88رتÛ\8cÙ\87 Ú¯Ø±|جاÙ\86Û\8cاÛ\8cا Ù\88رتÛ\8cÙ\87 Ú¯Ø±}} Ø¯ Ø§Û\8c Ù\82رارÙ\86: $2 .",
+       "filetype-unwanted-type": "'''«‎.‎$1»''' یاÙ\9b Ø¬Ø§Ù\86ؽا Ù\87استÙ\86Û\8c Ù\86ؽ.\n{{PLURAL:$3|جاÙ\86ؽا Ú¤Ù±ØªÛ\8cٱگؽر|جاÙ\86ؽاÛ\8cا Ú¤Ù±Ø±ØªÛ\8cٱگر}} Ø¯ Ø§Ø½ Ù\82رارٱÙ\86: $2 .",
        "filetype-banned-type": "&lrm;'''\".$1\"''' {{PLURAL:$4|یه گل جانیا ناصلاداره|جانیایایی که صلادار نیئن}}.\n{{PLURAL:$3|جانیا صلادار|جانیایا صلادار}} د ای قرارن: $2.",
        "filetype-missing": "ای جانیا هیچ اضاف کردی ناره(چی \"جی پی جی\")",
        "empty-file": "جانیایی که دئی ته حالی بیه.",
        "backend-fail-internal": "خطا نادیاری د حامین دار اماییه «$1»  پیش اوما.",
        "backend-fail-contenttype": "دیارکرد نوع مینونه جانیا سی اماییه «$1» د انجومشیو بی.",
        "backend-fail-batchsize": "یه گل دسه مینونه دار $1 {{PLURAL:$1|انجومگری|انجومگری}} جانیا وه حامین اماییه دئه بیه؛ بیشترونه مجاز $2 {{PLURAL:$2|انجومگر|انجومگر}} ئه.",
-       "backend-fail-usable": "اÙ\85کاÙ\86 Ø­Ù\86Ù\86 Û\8cا Ù\86Û\8cسÙ\86Ù\86 Ø¬Ø§Ù\86Û\8cا $1 Ù\88جÙ\88د Ù\86اشت Ø³Û\8c Û\8cÙ\87 Ú©Ù\87 Ø±Û\8c ØªØ±Ø§Ø² Ø¯Ø³Ø±Ø³Û\8c Ø®Ù\88 Ù\86ئ Û\8cا Ù\84Ø´Ú©/اÙ\85اÛ\8cÛ\8cÙ\87 Ø¯Ø§Ø± Ø­Ø§Ø³ØªÙ\86Û\8c Ù\86Û\8cئش.",
+       "backend-fail-usable": "اÙ\92Ù\85کاÙ\86 Ú¤Ù±Ù\86Ù\86 Û\8cا Ù\86Û\8cسٱÙ\86Ù\86 Ø¬Ø§Ù\86ؽا $1 Ú¤Ù\88جÛ\8aد Ù\86اشت Ø³Û\8c Û\8cÙ± Ú©Ø§Ù\92 Ø±Û\8cتراز Ø¯Ù±Ø³Ø±Ø³Û\8c Ø®Ù\88 Ù\86ؽ Û\8cا Ù\84Ù\9bØ´Ú©/Ø¢Ù\85اÛ\8cÙ± Ø¯Ø§Ø± Ù\87استÙ\86Û\8c Ù\86ؽسش.",
        "filejournal-fail-dbconnect": "امکان وصل بیئن د رسینه گا نوشتگه سی حامین داری د اماییه کاری «$1» وجود ناشت.",
        "filejournal-fail-dbquery": "امکان وصل بیئن د رسینه گا نوشتگه سی حامین داری د اماییه کاری «$1» وجود ناشت.",
        "lockmanager-notlocked": "نبوئه قلف $1 نه وا بکیت؛ سی یه که وه قلف نبیه.",
        "uncategorizedtemplates": "قالویا دسه بنی نبیه",
        "unusedcategories": "دسه یا استفاده نبیه",
        "unusedimages": "فایلیا استفاده نبیه",
-       "wantedcategories": "بÙ\84Ú¯Ù\87 Û\8cا Ø­استنی",
-       "wantedpages": "بÙ\84Ú¯Ù\87 Û\8cا Ø­استنی",
+       "wantedcategories": "بٱÙ\84Ú¯Ù±Û\8cا Ù\87استنی",
+       "wantedpages": "بٱÙ\84Ú¯Ù±Û\8cا Ù\87استنی",
        "wantedpages-summary": "نومگە بألگە یایی کئ نیئشوٙ ڤا بیشتئری ھومپئیڤأند د ڤئنوٙ،  ، ڤئ جوز بألگە یایی کئ فأقأط آلئشتکاری لا د ڤئنوٙنە دأرئن. سی یئ گئل نومگە د بألگە یایی کئ نیئشوٙ و آلئشتکاری لا د ڤئنوٙنە دارئن،[[{{#special:BrokenRedirects}}]] نە سئیل بأکیت.",
        "wantedpages-badtitle": "سرون نامعتور د کومله نتیجه یا:$1",
-       "wantedfiles": "فایلیا حاستنی",
+       "wantedfiles": "فایلٛؽا هاستنی",
        "wantedfiletext-cat": "جانیایا هاری وه کار گرته بوئن ولی وجود نارن. همچنو شایت جانیایا وه دری وا یه که ایچه هیئشون نومگه کاری بینه.هر گرینج مثبت دورویی  <del>خط مئوره.</del> به اضافه یه، بلگه یایی که که جانیایا بی وجودن نه د خوشو دارن د [[:$1]] نومگه کاری بینه.",
        "wantedfiletext-cat-noforeign": "جانیایا هاری وه کار گرته بوئن ولی نیئشو. اضافه وه یه بلگه یایی که جانیایا نادیار د خوشو دارن هان د [[:$1]].",
        "wantedfiletext-nocat": "جانیایا هاری که وه کار گرته بوئن نیئشو. همچنو شایت جانیا اماییه داریا خارجی وه شرطی که بان وه کار گرته بوئن. هر گرینج خو ولی الکی <del> خط مئوره. <del>",
        "wantedfiletext-nocat-noforeign": "جانیایا هاری وه کار گرته بوئن ولی نیئشو.",
-       "wantedtemplates": "قالویا حاستنی",
+       "wantedtemplates": "قالوؽا هاستنی",
        "mostlinked": "بلگه یا که بیشتر هوم پیوند بینه",
        "mostlinkedcategories": "دسه یایی که بیشتر هوم پیوند بیه",
        "mostlinkedtemplates": "چوئه یایی که بیشتر هوم پیوند بینه",
        "notargettitle": "رسینه جایی نئ",
        "notargettext": "شما بلگه یا کاریاری مقصدی سی انجوم دئن ای کنشت ریش انتخاو نکردیته.",
        "nopagetitle": "چنی بلگه ای نیئش",
-       "nopagetext": "بÙ\84Ú¯Ù\87 Ø­Ø§Ø³ØªÙ\86Û\8c Ú©Ù\87 Ø´Ù\85ا Ø¯Û\8cارÛ\8c Ú©Ø±Ø¯Û\8cتÙ\87 Ù\88جÙ\88د Ù\86ارÙ\87.",
+       "nopagetext": "بٱÙ\84Ú¯Ù± Ù\87استÙ\86Û\8c Ú©Ø§Ù\92 Ø´Ù\85ا Ø¯Ø½Ø§Ø±Û\8c Ú©Ø±Ø¯Ø½ØªÙ± Ú¤Ù\88جÛ\8aد Ù\86ارٱ.",
        "pager-newer-n": "{{PLURAL:$1|ڤانوئاتر 1ڤانوئاتر $1}}",
        "pager-older-n": "{{PLURAL:$1|گٱپسالتر 1|گٱپسالتر $1}}",
        "suppress": "پائیئن",
        "booksources-search-legend": "پاٛ جۊری سی سرچشمٱیا کتاو",
        "booksources-isbn": "آی اس بی ان:",
        "booksources-search": "پاٛ جۊری",
-       "booksources-text": "د Ù\87ار Ù\86Ù\88Ù\85Ú¯Ù\87 Ø§Û\8c Ø¯ Ù\87Ù\88Ù\85 Ù¾Û\8cÙ\88Ù\86دÛ\8cا Ø¯ Ø¯Û\8cارگÙ\87 Û\8cا Ù\87Ù\86Û\8c Ø§Ù\88Ù\85ائÙ\87 Ú©Ù\87 Ú©ØªØ§Ù\88Û\8cا Ù\86Ù\88 Ù\88 Ø¯Ø³ Ø¯Ù\88ئÙ\85 Ù\85Û\8c Ù\81رÙ\88Ø´Ù\86Ø\8c Ù\88 Ù\87Ù\85Ú\86Ù\86Ù\88 Ø´Ø§Û\8cت Ø¯Ù\88Ù\86سÙ\85Ù\86Û\8cا Ø¨Û\8cشترÛ\8c Ø±Ø§Ø¬Ø¹ Ù\88Ù\87 Ú©ØªØ§Ù\88 Ø­Ø§Ø³ØªÙ\86Û\8c Ø´Ù\85ا Ø¯Ø§Ø´ØªÙ\88ئن:",
+       "booksources-text": "د Ù\87ار Ù\86Ù\88Ù\85Ú¯Ù± Ø§Ø½ Ù\87Ù\88Ù\85 Ù¾Ø§Ù\9bÚ¤Ù±Ù\86ؽا Ø¯ Ø¯Ø½Ø§Ø±Ú¯Ù±Û\8cا Ù\87Ù\86Û\8c Ø§Ù\88Ù\85اÛ\8cÙ± Ú©Ø§Ù\92 Ú©ØªØ§Ù\88Û\8cا Ù\86Û\8a Û\89 Ø¯Ù±Ø³ Ø¯Û\8fئÙ\85 Ù\85ؽ Ù\81رÛ\8aشٱÙ\86Ø\8c Û\89 Ù\87Ù±Ù\85Ú\86Ù\86Ù\88 Ø´Ø§Û\8cٱد Ø¯Ù\88Ù\86سÙ\85Ù±Ù\86Û\8cا Ø¨Ø½Ø´ØªØ±Ø½ Ø±Ø§Ø¬Ø¹ Ú¤ Ú©ØªØ§Ù\88 Ù\87استÙ\86Û\8c Ø´Ù\85ا Ø¯Ø§Ø´ØªÛ\8aئٱن:",
        "booksources-invalid-isbn": "شازک که دئه بیه معتور نئ؛ وارسی خطایا د گات ؤرداشتن د سرچشمه اولی وه کار گرته بوئه.",
        "specialloguserlabel": "ٱنجومکار:",
        "speciallogtitlelabel": "هاستنی(داسون یا نوم کاریاری سی کاریار):",
        "cant-move-category-page": "شما صلا ینه که دسه یا نه ناریت.",
        "cant-move-to-category-page": "شما صلا ینه که یه بلگه نه بوریت وه بلگه دسه ناریت.",
        "newtitle": "سی سرون هنی:",
-       "move-watch": "دÛ\8cئÙ\86 Ø¨Ù\84Ú¯Ù\87 Ø³Ø±Ú\86Ø´Ù\85Ù\87 Ù\88 Ø¨Ù\84Ú¯Ù\87 Ø­استنی",
+       "move-watch": "دÛ\8cئÙ\86 Ø¨Ù±Ù\84Ú¯Ù± Ø³Ø±Ú\86Ø´Ù\85Ù± Û\89 Ø¨Ù±Ù\84Ú¯Ù± Ù\87استنی",
        "movepagebtn": "بٱلگٱ جا ڤ جا کو",
        "pagemovedsub": "د خوئی جا وه جا بیه",
        "movepage-moved": "<strong>\"$1\" جا وه جا بیه سی \"$2\"</strong>",
        "selfmove": "داسونؽا بٱلگٱ ٱڤٱل ۉ بٱلگٱ مٱقسٱد یٱکؽ هؽسن؛\nنمۊئٱ بٱلگٱناْ ڤ خوش جا ڤ جا کاری کرد.",
        "immobile-source-namespace": "نبوئه بلگه یا نه وه نومجا \"$1\" جا وه جا با",
        "immobile-target-namespace": "نبوئه بلگه یا نه وه نومجا \"$1\" جا وه جا با",
-       "immobile-target-namespace-iw": "هوم پیوند مینجاویکی حاستنی مجازی سی جا وه جا کردن بلگه نئ.",
+       "immobile-target-namespace-iw": "هوم پاٛڤٱن ؽنجاڤیکی هاستنی موجازؽ سی جا ڤ جا کردن بٱلگٱ نؽ.",
        "immobile-source-page": "ای بلگه جا وه جا کردنی نئ.",
        "immobile-target-page": "نبوئه وه ای مقصد چنی سرونی جا وه جا بوئه.",
-       "bad-target-model": "Ù\85Ù\82صد Ø­Ø§Ø³ØªÙ\86Û\8c Ù\85دÙ\84 Ù\85Û\8cÙ\86Ù\88Ù\86Ù\87 Ø¯Ø§Ø± Ù\81رخدارÛ\8c Ù\86Ù\87 Ù\88Ù\87 Ú©Ø§Ø± Ú¯Ø±ØªÙ\87. Ù\86بÙ\88ئÙ\87$1 Ù\86Ù\87 Ø¨Ú©Û\8cت Ù\88Ù\87 $2.",
+       "bad-target-model": "Ù\85Ù±Ù\82سٱد Ù\87استÙ\86Û\8c Ù\85Ù\88دÙ\84 Ù\85Û\8cÙ\86Ù\88Ù\86Ù± Ø¯Ø§Ø± Ù\81ٱرخدارؽ Ù\86اÙ\92 Ú¤ Ú©Ø§Ø± Ú¯Ø±ØªÙ±. Ù\86Ù\85Û\8aئٱ$1 Ù\86اÙ\92 Ø¨Ù±Ú©Ø½Øª Ú¤ $2.",
        "imagenocrossnamespace": "نبوئه جانیانه وه یه گل نومجا غیرجانیایی جا وه جا بکیت",
        "nonfile-cannot-move-to-file": "نبوئه جانیانه وه یه گل نومجا غیرجانیایی جا وه جا بکیت",
        "imagetypemismatch": "دماون جانیا تازه وا نوع وه سازگاری ناره",
        "tags-edit-logentry-submit": "وه کار گرتن سردیسیا د {{PLURAL:$1|د ای پهرستنومه|پهرستنومه یا $1}}",
        "tags-edit-success": "آلشتکاریا وا خوش سرانجومی وه کار گرته بیین.",
        "tags-edit-failure": "نبوئه آلشتکاریا وه کار گرته بان.",
-       "tags-edit-nooldid-title": "وانیری حاستنی نامعتوره",
+       "tags-edit-nooldid-title": "ڤانیری هاستنی نامعتبٱرٱ",
        "tags-edit-nooldid-text": "شما یه گل وانئری دالکاری بیه سی یه که ای پیوندگر نه انجوم بیه تیار کاری نکردیته، یا وانئری که تیار کاری نبیه.",
        "tags-edit-none-selected": "لطف بکیت یه حداقل یه گل سردیسی سی اضاف کردن یا جا وه جاکاری انتخاو بکیت.",
        "comparepages": "کنار یک نیاین بلگه یا",
        "dberr-info": "(نبوئه وه رسینه جا:$1 دسرسی داشتوئیت)",
        "dberr-info-hidden": "(نبوئه د رسینه گا دسرسی داشت)",
        "htmlform-invalid-input": "یه قری مشگل ها د پاره یی د درینده یا شما.",
-       "htmlform-select-badoption": "ارزایشتی که دئیته یه گل گزینه حاستنی نئ.",
+       "htmlform-select-badoption": "ٱرزایشتؽ کاْ داٛیؽتٱ یاٛ گوزیٱ هاستنی نؽ.",
        "htmlform-int-invalid": "ارزایشتی که دئیته یه گل عدد صحیح نئ.",
        "htmlform-float-invalid": "ارزایشتی که دئیته یه گل عدد نئ.",
        "htmlform-int-toolow": "انازه یی که شما دئیته د کمترونه $1 فره کمتره.",
index 2410063..3f36ff2 100644 (file)
        "blockedtitle": "အသုံးပြုသူကို ပိတ်ပင်ထားသည်",
        "blockedtext": "<strong>သင်၏ အသုံးပြုသူအမည် သို့မဟုတ် အိုင်ပီလိပ်စာသည် ပိတ်ပင်ခြင်း ခံထားရသည်။</strong>\n\nဤပိတ်ပင်မှုအား $1 က ဆောင်ရွက်ခဲ့သည်။\nအကြောင်းရင်းမှာ <em>$2</em> ဖြစ်သည်။\n\n* ပိတ်ပင်ခြင်း စတင်ချိန်: $8\n* ပိတ်ပင်ခြင်း သက်တမ်းကုန်ချိန်: $6\n* ရည်ရွယ်ရာ blockee: $7\n\nသင်သည် ပိတ်ပင်မှုအတွက် ဆွေးနွေးရန် $1 သို့မဟုတ် အခြား [[{{MediaWiki:Grouppage-sysop}}|စီမံခန့်ခွဲသူ]] အား ဆက်သွယ်နိုင်သည်။\nသင့်အနေဖြင့် [[Special:Preferences|အကောင့်၏ ရွေးချယ်စရာများ]]ထဲတွင် ရေရာသော အီးမေးလိပ်စာအား မထည့်သွင်းထားပါက \"{{int:emailuser}}\" လုပ်ဆောင်ချက်ကို အသုံးပြုနိုင်မည် မဟုတ်ပါ။ အလားတူ ယင်းလုပ်ဆောင်ချက်ကို ပိတ်ပင်မခံရမှ လုပ်ဆောင်နိုင်မည်ဖြစ်သည်။\nသင်၏ လက်ရှိ အိုင်ပီလိပ်စာမှာ $3 ဖြစ်ပြီး၊ ပိတ်ပင်မှုအိုင်ဒီမှာ #$5 ဖြစ်သည်။\nသင်ပြုလုပ်မည့် စုံစမ်းမေးမြန်းမှုများတွင် အထက်ပါ အချက်များ အားလုံး ပါဝင်နေပါစေ။",
        "blockednoreason": "အကြောင်းပြချက် မပေးထားပါ",
+       "blockedtext-composite": "<strong>သင်၏အသုံးပြုသူအမည် သို့ အိုင်ပီလိပ်စာကို ပိတ်ပင်ထားပါသည်။</strong>\n\nပေးထားသော အကြောင်းပြချက်မှာ:\n\n:<em>$2</em>။\n\n* စတင်ပိတ်ပင်ခြင်း: $8\n* ပိတ်ပင်မှု ကုန်ဆုံးရက်: $6\n\nသင်၏လက်ရှိအိုင်ပီလိပ်စာမှာ $3 ဖြစ်သည်။\nသင် တောင်းဆိုချက်များလုပ်ဆောင်ပါက အထက်ပါအချက်အလက်များကို ထည့်သွင်းပါ။",
        "whitelistedittext": "စာမျက်နှာများကို တည်းဖြတ်ရန် $1ရမည်။",
        "nosuchsectiontitle": "အပိုင်းကို ရှာမရနိုင်ပါ",
        "loginreqtitle": "လော့ဂ်အင်ဝင်ထားရန် လိုသည်",
index 50b9aaf..dfd9e1e 100644 (file)
        "unusedimages": "ߞߐߕߐ߯ ߟߊߓߊ߯ߙߊߓߊߟߌ",
        "wantedcategories": "ߦߌߟߡߊ߫ ߞߊ߬ߣߌ߲߬ߣߍ߲ ߠߎ߬",
        "wantedpages": "ߞߐߜߍ߫ ߜߋ߬ߟߎ߲߬ߣߍ߲ ߠߎ߬",
+       "wantedtemplates": "ߞߙߊߞߏ ߞߊ߬ߣߌ߲߬ߣߍ߲ ߠߎ߬",
+       "mostlinked": "ߛߘߌ߬ߜߋ߲߬ ߦߙߌߞߊ߫ ߦߋ߫ ߞߐߜߍ ߡߍ߲ ߠߎ߬ ߘߐ߫",
+       "mostlinkedcategories": "ߛߘߌ߬ߜߋ߲߬ ߦߙߌߞߊ߫ ߦߋ߫ ߦߌߟߡߊ ߡߍ߲ ߠߎ߬ ߘߐ߫",
+       "mostcategories": "ߦߌߟߡߊ߫ ߦߙߌߞߊ߫ ߦߋ߫ ߞߐߜߍ ߡߍ߲ ߠߎ߬ ߘߐ߫",
+       "mostimages": "ߛߘߌ߬ߜߋ߲߬ ߦߙߌߞߊ߫ ߦߋ߫ ߞߐߕߐ߮ ߡߍ߲ ߠߎ߬ ߘߐ߫",
        "mostinterwikis": "ߞߐߜߍ ߡߍ߲ ߠߎ߬ ߦߋ߫ ߥߞߌ ߣߌ߫ ߢߐ߲ߕߍ ߝߊ߲߬ߓߊ ߘߐ߫",
+       "mostrevisions": "ߟߢߊ߬ߟߌ߬ ߦߙߌߞߊ߫ ߦߋ߫ ߞߐߜߍ ߡߍ߲ ߠߎ߬ ߘߐ߫",
        "prefixindex": "ߞߐߜߍ ߡߍ߲ ߠߎ߬ ߓߍ߯ ߟߊߝߟߐߣߍ߲߫",
        "prefixindex-submit": "ߊ߬ ߦߌ߬ߘߊ߬",
        "shortpages": "ߞߐߜߍ߫ ߛߎߘߎ߲ ߠߎ߬",
        "protectedpages": "ߞߐߜߍ߫ ߟߊߞߊ߲ߘߊߣߍ߲ ߠߎ߬",
        "protectedpages-filters": "ߛߍ߲ߛߍ߲ߟߊ߲ ߠߎ߬:",
        "protectedpages-page": "ߞߐߜߍ",
+       "protectedpages-expiry": "ߊ߬ ߛߕߊ ߓߘߊ߫ ߝߊ߫",
        "protectedpages-performer": "ߟߊ߬ߓߊ߰ߙߊ߬ߟߊ߫ ߟߊߞߊ߲ߘߊߣߍ߲",
        "protectedpages-params": "ߟߊ߬ߓߍ߲߬ߢߐ߲߰ߡߊ ߟߊ߬ߞߊ߲߬ߘߊ߬ߟߌ",
        "protectedpages-reason": "ߊ߬ ߛߊߓߎ",
        "protectedtitles": "ߞߎ߲߬ߕߐ߰ ߟߊߞߊ߲ߘߊߣߍ߲ ߠߎ߬",
        "protectedtitles-submit": "ߞߎ߲߬ߕߐ߮ ߦߌ߬ߘߊ߬ߟߌ",
        "listusers": "ߟߊ߬ߓߊ߰ߙߊ߬ߟߊ ߛߙߍߘߍ",
+       "listusers-editsonly": "ߟߊ߬ߓߊ߰ߙߊ߬ߟߊ ߟߎ߬ ߦߌ߬ߘߊ߬ ߡߊ߬ߦߟߍ߬ߡߊ߲߬ߠߌ߲ ߠߎ߬ ߘߐߙߐ߲߫ ߡߊ߬",
        "listusers-creationsort": "ߊ߬ ߦߋ߫ ߛߌ߲ߘߟߌ ߕߎ߬ߡߊ߬ߘߊ ߡߊ߬",
        "usereditcount": "$1 {{PLURAL:$1|ߡߊ߬ߦߟߍ߬ߡߊ߲߬ߠߌ߲|ߡߊ߬ߦߟߍ߬ߡߊ߲߬ߠߌ߲ ߠߎ߬}}",
        "usercreated": "{{GENDER:$3|ߛߌ߲ߘߟߌߣߐ ߟߋ߬}} $2 $1 ߡߊ߬",
        "nopagetext": "ߌ ߣߊ߬ ߞߏ߲߰ ߞߐߜߍ ߡߍ߲ ߡߊߕߍ߰ ߟߊ߫ ߣߌ߲߬߸ ߊ߬ ߕߴߦߋ߲߬.",
        "pager-newer-n": "{{PLURAL:$1|ߞߎߘߡߊ1|ߞߎߘߡߊ$1}}",
        "pager-older-n": "{{PLURAL:$1|ߞߘߐ߬ߡߊ߲ ߁|ߞߘߐ߬ߡߊ߲ ߠߎ߬ $1}}",
+       "apihelp": "API ߘߍ߬ߡߍ߲߬ߠߌ߲",
        "apisandbox-submit": "ߡߊ߬ߢߌ߬ߣߌ߲߬ߞߊ߬ߟߌ ߘߏ߫ ߞߍ߫",
        "apisandbox-reset": "ߊ߬ ߖߏ߰ߛߌ߬",
        "apisandbox-retry": "ߊ߬ ߡߊߝߍߣߍ߲߫ ߕߎ߲߯",
        "apisandbox-request-url-label": "URL ߡߊ߬ߢߌ߬ߣߌ߲߬ߞߊ߬ߟߌ:",
        "apisandbox-request-json-label": "JSON ߡߊ߬ߢߌ߬ߣߌ߲߬ߞߊ߬ߟߌ:",
        "apisandbox-request-time": "ߡߊ߬ߢߌ߬ߣߌ߲߬ߞߊ߬ߟߌ ߕߎ߬ߡߊ: {{PLURAL:$1|$1 ms}}",
+       "apisandbox-continue": "ߘߊߓߊ߲ߠߌ߲",
+       "apisandbox-continue-clear": "ߊ߬ ߖߏ߰ߛߌ߬",
+       "apisandbox-multivalue-all-namespaces": "$1 (ߕߐ߯ ߛߓߍ ߞߣߍ ߟߎ߬ ߓߍ߯)",
+       "apisandbox-multivalue-all-values": "$1 (ߡߐ߬ߟߐ߲ ߠߎ߬ ߓߍ߯)",
        "booksources": "ߞߊ߬ߝߊ ߛߎ߲",
        "booksources-search-legend": "ߞߊ߬ߝߊ ߛߎ߲ ߕߌߙߌ߲߫",
        "booksources-search": "ߢߌߣߌ߲ߠߌ߲",
        "specialloguserlabel": "ߞߍߓߊ߮ :",
        "speciallogtitlelabel": "ߞߏ߲߭ (ߞߎ߲߬ߕߐ߮ ߥߟߊ߫  {{ns:user}}: ߟߊ߬ߓߊ߰ߙߊ߬ߟߊ ߟߊ߫ ߟߊ߬ߓߊ߰ߙߊ߬ ߕߐ߮):",
        "log": "ߘߏ߲߬",
+       "logeventslist-submit": "ߊ߬ ߦߌ߬ߘߊ߬",
        "all-logs-page": "ߝߘߏ߬ߓߊ߬ ߜߊ߲ߞߎ߲ߠߌ߲ ߠߎ߬ ߓߍ߯",
        "alllogstext": "ߓߟߏߞߘߐ߫ ߘߐߛߙߋ ߡߎ߰ߡߍ ߦߌ߬ߘߊ߬ߟߌ ߣߌ߲߬ ߞߣߐ߫ {{SITENAME}}.\nߌ ߘߌ߫ ߛߋ߫ ߛߙߍߘߍ ߘߊ߲߬ߠߊߕߍ߰ ߟߊ߫ ߓߘߍߞߍ߭ ߞߊ߬ ߢߊ߬߸ ߏ߬ ߛߋ߲߬ߝߍ߬ ߞߊ߬ ߘߐ߬ߛߙߋ ߛߎ߯ߦߊ ߡߊߡߌ߬ߘߊ߬߸ ߊ߬ ߣߌ߫ ߟߊߓߊ߯ߙߟߊ ߕߐ߮ (ߛߏ߬ߓߌ߬ߟߊ߲߬ߘߌ ߟߋ߬ ߛߓߍߘߋ߲ ߗߏ߯ߦߊ ߝߍ߬)߸ ߥߟߴߊ߬ ߥߟߏߣߍ߲߫ ߞߐߜߍ ߡߍ߲ ߞߊ߲߬ (ߛߏ߬ߓߌ߬ߟߊ߲߬ߘߌ ߟߋ߬ ߝߣߊ߫ ߛߓߍߘߋ߲ ߠߎ߬ ߗߏ߯ߦߊ ߝߍ߬).",
        "logempty": "ߞߍߞߏ ߛߌ߫ ߣߌ߫ ߘߐ߬ߛߙߋ ߡߊ ߓߍ߲߬ ߢߐ߲߮ ߡߊ߬.",
        "allpages-hide-redirects": "ߟߊ߬ߞߎ߲߬ߛߌ߲߬ߠߌ߲ ߢߡߊߘߏ߲߰",
        "categories": "ߦߌߟߡߊ ߟߎ߬",
        "linksearch": "ߞߐߞߊ߲ߠߊ ߛߘߌ߬ߜߋ߲ ߢߌߣߌ߲ߠߌ߲",
+       "activeusers-noresult": "ߟߊ߬ߓߊ߰ߙߊ߬ߟߊ ߕߴߦߋ߲߬",
        "listgrouprights-members": "(ߛߌ߲߬ߝߏ߲ ߠߎ߫ ߛߙߍߘߍ)",
        "emailuser": "ߗߋߛߓߍ ߗߋ߫ ߣߌ߲߬ ߕߌ߭ ߡߊ߬",
+       "emailusername": "ߟߊߓߊ߯ߙߊߟߊߕߐ߮:",
+       "email-legend": "ߢߎߡߍߙߋ߲ ߗߋ߫  {{SITENAME}} ߜߘߍ ߟߊ߬ߓߊ߰ߙߊ߬ߟߊ ߘߏ ߟߎ߬ ߡߊ߬",
+       "emailfrom": "ߞߊ߬ ߝߘߊ߫",
+       "emailto": "ߞߊ߬ ߕߊ߯:",
+       "emailsubject": "ߝߐߡߊ:",
+       "emailmessage": "ߗߋߛߓߍ:",
+       "emailsend": "ߗߋߟߌ",
+       "emailccme": "ߒ ߠߊ߫ ߗߋߛߓߍ ߓߊ߫ ߞߎߘߊ ߘߏ߫ ߗߋ߫ ߒ ߡߊ߬.",
+       "emailccsubject": "ߌ ߟߊ߫ ߗߋߛߓߍ ߓߊߞߎߘߊ ߗߋ߫ $1: $2 ߡߊ߬",
+       "emailsent": "ߢߎߡߍߙߋ߲ ߓߘߊ߫ ߗߋ߫",
+       "emailsenttext": "ߌ ߟߊ߫ ߢߎߡߍߙߋ߲߫ ߗߋߛߓߍ ߓߘߊ߫ ߓߊ߲߫ ߗߋ߫ ߟߊ߫.",
+       "emailuserfooter": "ߢߎߡߍߙߋ߲ ߣߌ߲߬ ߦߋ߫ {{GENDER:$1|ߗߋߟߌߣߐ ߟߋ߬ ߘߌ߫}} ߞߊ߬ ߝߘߊ߫ $1 ߟߊ߫ ߞߊ߬ ߥߊ߫{{GENDER:$2|$2}} \"{{int:emailuser}}\" ߓߟߏ߫߸ ߦߋ߫ ߓߊ߯ߙߊ߫ ߟߊ߫ {{SITENAME}}. ߣߌ߫ {{GENDER:$2|ߌ߫}} ߞߵߊ߬ ߖߋ߬ߓߌ߬ ߢߎߡߍߙߋ߲ߞߏ߲ߘߏ ߣߌ߲߬ ߠߊ߫߸ {{GENDER:$2|ߌ ߟߊ߫}} ߢߎߡߍߙߋ߲ ߘߌ߫ ߗߋ߫ {{GENDER:$1|ߗߋߟߌߟߊ ߛߎ߲}} ߠߊ߫߸ ߊ߬ ߘߌ߫ ߖߊ߬ߕߋ߫ {{GENDER:$2|ߌ ߟߊ߫}} ߢߎߡߍߙߋ߲ߞߏ߲ߘߏ ߛߊ߲߬ߓߊ߬ߕߐ߮ ߘߌ߫ ߞߊ߬ ߕߊ߯ {{GENDER:$2|ߞߎߡߘߊ}} ߟߊ߫.",
        "usermessage-editor": "ߞߊ߲ߞߋ߫ ߗߋߛߓߍ ߡߊߦߟߍ߬ߡߊ߲߬ߓߊ߮",
        "watchlist": "ߣߐ߬ߝߍ߬ߜߍ߲߬ߛߙߍߘߍ",
        "mywatchlist": "ߘߐߜߍ߫ ߘ߲ߜߍߕߊ",
index 459f346..cc77368 100644 (file)
        "ipbreason-dropdown": "*Najczęstsze przyczyny blokad\n** Ataki na innych użytkowników\n** Naruszenie praw autorskich\n** Niedozwolona nazwa użytkownika\n** Open proxy lub Tor\n** Spamowanie\n** Usuwanie treści stron\n** Wprowadzanie fałszywych informacji\n** Wulgaryzmy\n** Wypisywanie bzdur na stronach",
        "ipb-hardblock": "Zablokuj możliwość edytowania przez zalogowanych użytkowników z tego adresu IP.",
        "ipbcreateaccount": "Utworzenie konta",
-       "ipbemailban": "Wysyłanie e‐mailów",
+       "ipbemailban": "Wysyłanie e‐maili",
        "ipbenableautoblock": "Zablokuj ostatni adres IP tego użytkownika i automatycznie wszystkie kolejne, z których będzie próbował edytować",
        "ipbsubmit": "Zablokuj użytkownika",
        "ipbother": "Inny okres",
index 9401e14..18d850a 100644 (file)
        "watchlisttools-view": "Ver alterações relevantes",
        "watchlisttools-edit": "Ver e editar a lista de páginas vigiadas",
        "watchlisttools-raw": "Edição crua da lista de páginas vigiadas",
+       "hebrew-calendar-m7-gen": "Nissan",
        "signature": "[[{{ns:user}}:$1|$2]] ([[{{ns:user_talk}}:$1|discussão]])",
        "timezone-local": "Local",
        "duplicate-defaultsort": "Aviso: A chave de ordenação padrão \"$2\" sobrepõe-se à anterior chave de ordenação padrão \"$1\".",
index 39b462a..6ba308b 100644 (file)
        "specialmute-error-invalid-user": "Error displayed when the username cannot be found.",
        "specialmute-error-email-blacklist-disabled": "Error displayed when email blacklist is not enabled.",
        "specialmute-error-email-preferences": "Error displayed when the user has not confirmed their email address.",
-       "specialmute-email-footer": "Email footer linking to [[Special:Mute]] preselecting the sender to manage muting options.\n* $1 - Url linking to [[Special:Mute]].\n* $2 - The user sending the email.",
+       "specialmute-email-footer": "Email footer in plain text linking to [[Special:Mute]] preselecting the sender to manage muting options.\n* $1 - Url linking to [[Special:Mute]].\n* $2 - The user sending the email.",
        "specialmute-login-required": "Error displayed when a user tries to access [[Special:Mute]] before logging in.",
        "revid": "Used to format a revision ID number in text. Parameters:\n* $1 - Revision ID number.\n{{Identical|Revision}}",
        "pageid": "Used to format a page ID number in text. Parameters:\n* $1 - Page ID number.",
index fc1efcf..7a5671a 100644 (file)
                        "1233qwer1234qwer4",
                        "Саша Волохов",
                        "Serhio Magpie",
-                       "ЛингвоЧел"
+                       "ЛингвоЧел",
+                       "OlegVeliky"
                ]
        },
        "tog-underline": "Подчёркивание ссылок:",
        "search-file-match": "(совпадает с содержимым файла)",
        "search-suggest": "Возможно, вы имели в виду «$1».",
        "search-rewritten": "Показаны результаты для $1. Искать вместо этого $2.",
-       "search-interwiki-caption": "Результаты братских проектов",
+       "search-interwiki-caption": "Результаты родственных проектов",
        "search-interwiki-default": "Результаты из $1:",
        "search-interwiki-more": "(ещё)",
        "search-interwiki-more-results": "ещё результаты",
        "edit-error-short": "Ошибка: $1",
        "edit-error-long": "Ошибки:\n\n$1",
        "specialmute": "Откл. уведомления",
-       "specialmute-success": "Изменения были успешно сделаны. Просмотрите всех отключённых участников на [[Special:Preferences]].",
+       "specialmute-success": "Изменения были успешно сделаны. Просмотрите всех отключённых участников на [[Special:Preferences|ваших настройках]].",
        "specialmute-submit": "Подтвердить",
        "specialmute-label-mute-email": "Отключить эл. почту от этого участника",
        "specialmute-header": "Пожалуйста, выберите настройки уведомлений от {{BIDI:[[User:$1]]}}.",
index af4bd1e..5dd7c1b 100644 (file)
        "edit-error-short": "Fel: $1",
        "edit-error-long": "Fel:\n\n$1",
        "specialmute": "Tyst",
-       "specialmute-success": "Dina tystnadsinställningar har uppdateras. Se alla tystade användare i [[Special:Preferences|inställningarna]].",
+       "specialmute-success": "Dina tystnadsinställningar har uppdateras. Se alla tystade användare i [[Special:Preferences|dina inställningarna]].",
        "specialmute-submit": "Bekräfta",
        "specialmute-label-mute-email": "Tysta e-post från denna användare",
        "specialmute-header": "Välj dina tystnadsinställningar för {{BIDI:[[User:$1]]}}.",
        "specialmute-error-invalid-user": "Det begärda användarnamnet kunde inte hittas.",
        "specialmute-error-email-blacklist-disabled": "Att förhindra användare från att skicka e-post till dig har inte aktiverats.",
        "specialmute-error-email-preferences": "Du måste bekräfta din e-postadress innan du kan tysta en användare. Du kan göra det i [[Special:Preferences|inställningarna]].",
-       "specialmute-email-footer": "[$1 Hantera e-postinställningar för {{BIDI:$2}}.]",
+       "specialmute-email-footer": "För att hantera e-postinställningar för {{BIDI:$2}}, besök <$1>.",
        "specialmute-login-required": "Logga in för att ändra dina tystnadsinställningar.",
        "revid": "sidversion $1",
        "pageid": "sid-ID $1",
index ae882f2..92d8094 100644 (file)
        "group-autoconfirmed": "தானாக உறுதியளிக்கப்பட்ட பயனர்கள்",
        "group-bot": "தானியங்கிகள்",
        "group-sysop": "நிர்வாகிகள்",
+       "group-interface-admin": "இடைமுக நிர்வாகிகள்",
        "group-bureaucrat": "அதிகாரிகள்",
        "group-suppress": "கவனக்குறைவுகள்",
        "group-all": "(அனைத்து)",
index b89b619..2eb7bdb 100644 (file)
                        "Hedda",
                        "Fitoschido",
                        "TmY e12",
-                       "Dual"
+                       "Dual",
+                       "ToprakM"
                ]
        },
        "tog-underline": "Bağlantıların altını çizme:",
index 635f99d..80a70bd 100644 (file)
        "gender-male": "Dekronoyo",
        "gender-female": "Neqıbṭonoyo",
        "email": "Email",
-       "prefs-help-email": "Latat majbur dkıṭwat uEmail-Adresayḍox, elo glozam inaqla ṫo³at uQliḍayḍox u hakka dlozam dmişadar lox Qliḍo ḥaṭo.",
+       "prefs-help-email": "Latat majbur dkıṭwat uEmail-Adresayḍox, elo glozam inaqla ṫo³at uQliḍayḍox u hakka dlozam dmişadar lox qliḍo ḥaṭo.",
        "prefs-help-email-others": "Kibux mijğolat 3am Hadome ğer biFaṭo duMamlo u luglozam dumat Işmux.",
        "prefs-signature": "Imḍa",
        "group-user": "Hadome",
index 66341a6..b3b48cc 100644 (file)
@@ -4,42 +4,58 @@
                        "Iyuqciyang"
                ]
        },
-       "sunday": "jiyax sngayan",
+       "sunday": "Jiyax sngayan",
        "monday": "Tg1 jiyax iyax sngayan",
        "tuesday": "Tg2 jiyax iyax sngayan",
        "wednesday": "Tg3 jiyax iyax sngayan",
        "thursday": "Tg4 jiyax iyax sngayan",
        "friday": "Tg5 jiyax iyax sngayan",
-       "saturday": "tg6 jiyax iyax sngayan",
-       "mon": "Tg1jiyax iyax sngayan",
-       "january": "tg1 idas",
-       "february": "tg2 idas",
+       "saturday": "Tg6 jiyax iyax sngayan",
+       "sun": "Js",
+       "mon": "J1",
+       "tue": "J2",
+       "wed": "J3",
+       "thu": "J4",
+       "fri": "J5",
+       "sat": "J6",
+       "january": "Tg1 idas",
+       "february": "Tg2 idas",
        "march": "Tg3 idas",
        "april": "Tg4 idas",
        "may_long": "Tg5 idas",
        "june": "Tg6 idas",
-       "july": "empitu idas",
+       "july": "Tg7 idas",
        "august": "Tg8 idas",
        "september": "Tg9 idas",
        "october": "Tg10 idas",
        "november": "Tg11 idas",
        "december": "Tg12 idas",
-       "january-gen": "tg1 idas",
-       "february-gen": "tg2 idas",
+       "january-gen": "Tg1 idas",
+       "february-gen": "Tg2 idas",
        "march-gen": "Tg3 idas",
        "april-gen": "Tg4 idas",
        "may-gen": "Tg5 idas",
        "june-gen": "Tg6 idas",
-       "july-gen": "empitu idas",
+       "july-gen": "Tg7 idas",
        "august-gen": "Tg8 idas",
        "september-gen": "Tg9 idas",
        "october-gen": "Tg10 idas",
        "november-gen": "Tg11 idas",
        "december-gen": "Tg12 idas",
-       "feb": "tg2 idas",
-       "may": "Tg5 idas",
+       "jan": "1id",
+       "feb": "2id",
+       "mar": "3id",
+       "apr": "4id",
+       "may": "5id",
+       "jun": "6id",
+       "jul": "7id",
+       "aug": "8id",
+       "sep": "9id",
+       "oct": "10id",
+       "nov": "11id",
+       "dec": "12id",
        "january-date": "tg1 idas $1",
-       "february-date": "tg2 idas $1",
+       "february-date": "Tg2 idas $1",
        "march-date": "Tg3 idas $1",
        "april-date": "Tg4 idas $1",
        "may-date": "Tg5 idas $1",
        "october-date": "Tg10 idas $1",
        "november-date": "Tg11 idas $1",
        "december-date": "Tg12 idas $1",
-       "pagecategories": "{{PLURAL:$1| keelgan |$1 sspug kingal keelgan }}",
-       "category_header": "keelgan \"$1\" kska ruwahan patas",
-       "subcategories": "spiq keelgan",
-       "category-media-header": "keelgan \"$1\" kaka psaput kari",
-       "category-empty": "<em>keelgan nii bitaq saying ini supu kana ruwahan patas aji uri o psaput kari.</em>",
-       "hidden-categories": "{{PLURAL:$1|keelgan lniing }}",
-       "category-subcat-count": "{PLURAL:$2| keelgan nii wana supu kana truma nii 1 kngkingal spiqkeelgan. | keelgan mseupu kana truma nii $1 keelgan kngkingal, mseupu $2 sspug kingal. }}. }}",
-       "category-article-count": "{PLURAL:$2| keelgan o supu kana truma ruwahan patas nii. | keelgan supu kana truma nii $1 kngkingal ruwahan patas, suupu $2 sspugkingal }}",
-       "category-file-count": "{{PLURAL:$2| keelgan nii wana supu kana truma kingal pusu patas. | keelgan supu kana truma patas nii, seupu $2 sspug kingal. }}",
+       "pagecategories": "{{PLURAL:$1|keelgan|$1 sspug kingal keelgan}}",
+       "category_header": "Keelgan \"$1\" kska ruwahan patas",
+       "subcategories": "Spiq keelgan",
+       "category-media-header": "Keelgan \"$1\" kaka psaput kari",
+       "category-empty": "<em>Keelgan nii bitaq saying ini supu kana ruwahan patas aji uri o psaput kari.</em>",
+       "hidden-categories": "{{PLURAL:$1|keelgan lniing}}",
+       "category-subcat-count": "{{PLURAL:$2|Keelgan nii wana supu kana truma nii 1 kngkingal spiqkeelgan.|Keelgan mseupu kana truma nii {{PLURAL:$1|$1}} keelgan kngkingal, mseupu $2 sspug kingal.}}",
+       "category-article-count": "{{PLURAL:$2|Keelgan o supu kana truma ruwahan patas nii.|Keelgan supu kana truma nii {{PLURAL:$1|$1}} kngkingal ruwahan patas, suupu $2 sspugkingal}}.",
+       "category-file-count": "{{PLURAL:$2|Keelgan nii wana supu kana truma kingal pusu patas.|Keelgan supu kana truma {{PLURAL:$1|$1 patas}} nii, seupu $2 sspug kingal.}}",
        "listingcontinuesabbrev": "lmutut",
        "noindex-category": "Ini bkgi patas pnslbu na ka ruwahan patas",
-       "broken-file-category": "pusu patas mggaluk  wada naqih ka ruwahan patas",
-       "newwindow": "(saw ruwahan bgurah lihaw qtaan )",
-       "cancel": "pkungat",
+       "broken-file-category": "Pusu patas mggaluk  wada naqih ka ruwahan patas",
+       "about": "Quri",
+       "article": "Kari ruwan ruwahan patas",
+       "newwindow": "(saw ruwahan bgurah lihaw qtaan)",
+       "cancel": "Pkungat",
        "moredotdotdot": "knlala...",
        "mypage": "ruwahan patas",
-       "mytalk": "empprngaw",
-       "anontalk": "empprngaw",
-       "navigation": "powda qmita",
-       "and": "&#32;ni &#32;",
-       "namespaces": "iyax ptngahan",
-       "variants": "kmpriyux hiyi",
-       "navigation-heading": "powda qmita patas gneegan",
-       "returnto": "embrinah miyah bitaq $1.",
-       "tagline": "pnyahan {{SITENAME}}",
-       "help": "pgkla",
+       "mytalk": "Empprngaw",
+       "anontalk": "Empprngaw",
+       "navigation": "Powda qmita",
+       "and": "&#32;ni",
+       "namespaces": "Iyax ptngahan",
+       "variants": "Kmpriyux hiyi",
+       "navigation-heading": "Powda qmita patas gneegan",
+       "returnto": "Embrinah miyah bitaq $1.",
+       "tagline": "Pnyahan {{SITENAME}}",
+       "help": "Pgkla",
+       "search": "Miying",
+       "searchbutton": "Miying",
        "go": "muda",
-       "searcharticle": "muda",
-       "history": "endaan ruwahan patas",
-       "printableversion": "mtduwa psreeru patas pusu",
-       "permalink": "mggaluk ini kglglug\n(mggaluk mgdhug,mggaluk ana bitaq knuwan)",
-       "view-foreign": "ga $1 qmita",
-       "edit": "smmalu patas",
-       "create": "phiyug",
+       "searcharticle": "Muda",
+       "history": "Endaan ruwahan patas",
+       "history_short": "Endaan",
+       "history_small": "endaan",
+       "printableversion": "Mtduwa psreeru patas pusu",
+       "permalink": "Mggaluk ini kglglug",
+       "view": "Qmita",
+       "view-foreign": "Ga $1 qmita",
+       "edit": "Smmalu patas",
+       "create": "Phiyug",
        "create-local": "Pgkla tnpusu mnrana",
-       "newpage": "bgurah ruwahan patas",
+       "newpage": "Bgurah ruwahan patas",
        "talkpagelinktext": "empprngaw",
-       "specialpage": "ruwahan patas knmalu",
-       "personaltools": "qnqaya taxa",
-       "talk": "empprngaw",
-       "views": "qmita",
-       "toolbox": "qngqaya",
-       "otherlanguages": "kari duma",
-       "redirectedfrom": "(wada brahan dmudul paah $1)",
-       "redirectpagesub": "psbgurah muda ruwahan patas",
-       "redirectto": "psbgurah muda quri bitaq:",
-       "lastmodifiedat": "ruwahan patas nii ka nhdaan smmalu patas o ga $1 $2.",
-       "jumpto": "pquri brah",
+       "specialpage": "Ruwahan patas knmalu",
+       "personaltools": "Qnqaya taxa",
+       "talk": "Empprngaw",
+       "views": "Qmita",
+       "toolbox": "Qngqaya",
+       "otherlanguages": "Kari duma",
+       "redirectedfrom": "(Wada brahan dmudul paah $1)",
+       "redirectpagesub": "Psbgurah muda ruwahan patas",
+       "redirectto": "Psbgurah muda quri bitaq:",
+       "lastmodifiedat": "Ruwahan patas nii ka nhdaan smmalu patas o ga $1, $2.",
+       "jumpto": "Pquri brah:",
        "jumptonavigation": "powda qmita",
-       "aboutsite": "quri  {{SITENAME}}",
-       "aboutpage": "quri",
-       "copyrightpage": "{{ns:project}}: biyax kklawa pnatas",
-       "currentevents": "mlglug ka psaput",
-       "currentevents-url": "Project: euda kari psaput",
-       "disclaimers": "pgkla pnspadaw",
-       "disclaimerpage": "Pnegkla ungat hmutan smriq",
-       "edithelp": "pgkla smmalu patas",
-       "mainpage": "ruwahan patas",
-       "mainpage-description": "ruwahan patas",
-       "portal": "tmayan qmpringan seejiq",
-       "portal-url": "tmayan qmpringan seejiq",
-       "privacy": "euda qmpah lniing",
-       "privacypage": "Euda qmpah lning",
+       "jumptosearch": "miying",
+       "aboutsite": "Quri {{SITENAME}}",
+       "aboutpage": "Project:Quri",
+       "copyrightpage": "{{ns:project}}: Biyax kklawa pnatas",
+       "currentevents": "Mlglug ka psaput",
+       "currentevents-url": "Project:Euda kari psaput",
+       "disclaimers": "Pgkla pnspadaw",
+       "disclaimerpage": "Project:Pnegkla ungat hmutan smriq",
+       "edithelp": "Pgkla smmalu patas",
+       "mainpage": "Ruwahan patas",
+       "mainpage-description": "Ruwahan patas",
+       "portal": "Tmayan qmpringan seejiq",
+       "portal-url": "Project:Tmayan qmpringan seejiq",
+       "privacy": "Euda qmpah lniing",
+       "privacypage": "Project:Euda qmpah lning",
        "retrievedfrom": "Nangal paah \"$1\"",
-       "youhavenewmessages": "Niqan nnisu$1 ($2).",
-       "youhavenewmessagesfromusers": "{{PLURAL:$4|su}}niqan pnaah {{PLURAL:$3|taxa duri empduuy\n|$3 hnigan empduuy }}ka $1 ($2).",
-       "newmessagesdifflinkplural": "{{PLURAL:$1| kmpriyux}} snii",
+       "youhavenewmessages": "{{PLURAL:$3|}}Niqan nnisu $1 ($2).",
+       "youhavenewmessagesfromusers": "{{PLURAL:$4|Su}} niqan pnaah {{PLURAL:$3|taxa duri empduuy|$3 hnigan empduuy}} ka $1 ($2).",
+       "newmessagesdifflinkplural": "{{PLURAL:$1|kmpriyux}} snii",
        "editsection": "smmalu patas",
        "editold": "smmalu patas",
        "viewsourceold": "ida nkiya patas sspgan ka qtai",
-       "editlink": "smmalu patas",
+       "editlink": "Smmalu patas",
        "viewsourcelink": "ida nkiya patas sspgan ka qtai",
-       "editsectionhint": "smmalu patas spgan",
-       "toc": "patas bngkgan",
+       "editsectionhint": "Smmalu patas spgan: $1",
+       "toc": "Patas bngkgan",
        "showtoc": "pqita",
        "hidetoc": "lmiying",
        "collapsible-expand": "muda",
        "site-atom-feed": "$1ka Atom pnyahan",
-       "red-link-title": "$1(ungat ruwahan patas)",
-       "nstab-main": "ruwahan patas",
-       "nstab-user": "empduuy ruwahan patas",
-       "nstab-special": "ruwahan patas knmalu",
-       "nstab-project": "pusu qpahun ruwahan patas",
-       "nstab-image": "pusu patas",
-       "nstab-template": "ptasan",
-       "nstab-category": "keelgan",
-       "mainpage-nstab": "ruwahan patas",
-       "nospecialpagetext": "<strong>brahaw misuu ruwahan patas knmalu ungat brihan. </strong> nasi mkmangal mangal brihan ka knmalu ruwahan patas leexan usa bitaq [[Special:SpecialPages|{{int:specialpages}}]].",
-       "badtitle": "ungat brih ka pusu kari",
-       "badtitletext": "tmiyu ka pusu kari ruwahan patas o ungat brih, kbrhuanl, aji uri o ini muda qmangaw kari aji uri o qmangaw Wiki ka pusu kari.\nkska pusu kari o yaa bi mseupu kana ungat klaan dmuuy mniq pusu kari ka cuyen.",
-       "viewsource": "ida nkiya patas sspgan ka qtai",
-       "viewsource-title": "pqita $1 ka ida nkiya sspgan patas",
-       "viewsourcetext": "Mtduwa su  pqita kiya o pnsreeru ruwahan patas nii ka sspgan patas",
+       "red-link-title": "$1 (ungat ruwahan patas)",
+       "nstab-main": "Ruwahan patas",
+       "nstab-user": "Empduuy ruwahan patas",
+       "nstab-special": "Ruwahan patas knmalu",
+       "nstab-project": "Pusu qpahun ruwahan patas",
+       "nstab-image": "Pusu patas",
+       "nstab-template": "Ptasan",
+       "nstab-category": "Keelgan",
+       "mainpage-nstab": "Ruwahan patas",
+       "nospecialpagetext": "<strong>Brahaw misuu ruwahan patas knmalu ungat brihan.</strong>\n\nNasi mkmangal mangal brihan ka knmalu ruwahan patas leexan usa bitaq [[Special:SpecialPages|{{int:specialpages}}]].",
+       "badtitle": "Ungat brih ka pusu kari",
+       "badtitletext": "Tmiyu ka pusu kari ruwahan patas o ungat brih, kbrhuanl, aji uri o ini muda qmangaw kari aji uri o qmangaw Wiki ka pusu kari.\nKska pusu kari o yaa bi mseupu kana ungat klaan dmuuy mniq pusu kari ka cuyen.",
+       "viewsource": "Ida nkiya patas sspgan ka qtai",
+       "viewsource-title": "Pqita $1 ka ida nkiya sspgan patas",
+       "viewsourcetext": "Mtduwa su  pqita kiya o pnsreeru ruwahan patas nii ka sspgan patas.",
        "yourname": "seejiq mduuy hangan:",
-       "userlogin-yourname-ph": "pstmay matas su mduuy hangan",
+       "userlogin-yourname-ph": "Pstmay matas su mduuy hangan",
        "yourpassword": "sspgan lniing:",
-       "userlogin-yourpassword": "sspgan lniing",
-       "userlogin-yourpassword-ph": "pstmay su sspgan lniing",
+       "userlogin-yourpassword": "Sspgan lniing",
+       "userlogin-yourpassword-ph": "Pstmay su sspgan lniing",
        "createacct-yourpassword-ph": "Pstymay matas sspgan lniing",
-       "createacct-yourpasswordagain": "pgkla sspgan lniing",
+       "createacct-yourpasswordagain": "Pgkla sspgan lniing",
        "createacct-yourpasswordagain-ph": "Pxal duri pstmay matas sspgan lniing",
-       "userlogin-remembermypassword": "\" iya shngii \" saw nii pstmay ku",
-       "login": "pstmay patas.",
+       "userlogin-remembermypassword": "\"Iya shngii\" saw nii pstmay ku",
+       "login": "Pstmay patas",
        "nav-login-createaccount": "pstmay patas. /phiyug patas sspgan",
-       "logout": "latat",
-       "userlogin-noaccount": "ungat patas sspgan hug?",
-       "userlogin-joinproject": "teumal {{SITENAME}}",
-       "createaccount": "phiyug patas sspgan",
-       "userlogin-resetpassword-link": "smhungi sspgan lniing?",
-       "userlogin-helplink2": "dmayaw pstmay",
-       "createacct-emailoptional": "nniqan guban patas samaw ( geegun )",
-       "createacct-email-ph": "pstmay su nniqan gluban patas samaw",
-       "createacct-submit": "phiyug su sspgan patas",
+       "logout": "Latat",
+       "userlogin-noaccount": "Ungat patas sspgan hug?",
+       "userlogin-joinproject": "Teumal {{SITENAME}}",
+       "createaccount": "Phiyug patas sspgan",
+       "userlogin-resetpassword-link": "Smhungi sspgan lniing?",
+       "userlogin-helplink2": "Dmayaw pstmay",
+       "createacct-emailoptional": "Nniqan guban patas samaw (geegun)",
+       "createacct-email-ph": "Pstmay su nniqan gluban patas samaw",
+       "createacct-submit": "Phiyug su sspgan patas",
        "createacct-another-submit": "phiyug patas sspgan",
        "createacct-benefit-heading": "{{SITENAME}} paah saw isumdka seejiq suyang qnpahan saw phiyug da.",
-       "createacct-benefit-body1": "{{PLURAL:$1|smsul smmalu patas }}",
-       "createacct-benefit-body2": "$1 ruwahan",
-       "createacct-benefit-body3": "Hnigan snii {{PLURAL:$1| seejiq suyang qnpahan }}",
+       "createacct-benefit-body1": "{{PLURAL:$1|smsul smmalu patas}}",
+       "createacct-benefit-body2": "{{PLURAL:$1|ruwahan}}",
+       "createacct-benefit-body3": "Hnigan snii {{PLURAL:$1|seejiq suyang qnpahan}}",
        "mailmypassword": "psbgurah powsa sspgan lniing",
-       "loginlanguagelabel": "kari:$1",
-       "pt-login": "pstmay patas.",
-       "pt-login-button": "pstmay patas.",
-       "pt-createaccount": "phiyug patas sspgan",
-       "pt-userlogout": "latat",
-       "botpasswords-label-cancel": "pkungat",
-       "resetpass-submit-cancel": "pkungat",
-       "passwordreset": "psbgurah powsa sspgan lniing",
+       "loginlanguagelabel": "Kari: $1",
+       "pt-login": "Pstmay patas",
+       "pt-login-button": "Pstmay patas",
+       "pt-createaccount": "Phiyug patas sspgan",
+       "pt-userlogout": "Latat",
+       "botpasswords-label-cancel": "Pkungat",
+       "resetpass-submit-cancel": "Pkungat",
+       "passwordreset": "Psbgurah powsa sspgan lniing",
        "passwordreset-username": "seejiq mduuy hangan:",
-       "bold_sample": "patas qthur",
-       "bold_tip": "patas qthur",
-       "italic_sample": "atas gmisil",
-       "italic_tip": "atas gmisil",
-       "link_sample": "mggaluk pusu kari",
-       "link_tip": "mggaluk ruwan",
-       "extlink_sample": "http://www.example.com mggaluk pusu kari",
-       "extlink_tip": "lipax mggaluk ( saw peeniq qsahur http:// pnrjingan)",
+       "bold_sample": "Patas qthur",
+       "bold_tip": "Patas qthur",
+       "italic_sample": "Atas gmisil",
+       "italic_tip": "Atas gmisil",
+       "link_sample": "Mggaluk pusu kari",
+       "link_tip": "Mggaluk ruwan",
+       "extlink_sample": "http://www.example.com/ mggaluk pusu kari",
+       "extlink_tip": "Lipax mggaluk (saw peeniq qsahur http:// pnrjingan)",
        "headline_sample": "Tg1 tntunan patas pusu kari",
        "headline_tip": "Tg2 tntunan patas pusu kari",
-       "nowiki_sample": "maat kska aji smmalu iyax ptasan patas",
-       "nowiki_tip": "brkagan Wiki smmalu iyax ptasan elug kari",
-       "image_tip": "numal pusu patas",
-       "media_tip": "mggaluk pusu patas",
-       "sig_tip": "patas hangan su ni jiyax",
-       "hr_tip": "qtaan ayus msbalay (bilaq bi dmuuy)",
-       "summary": "ramas kari:",
+       "nowiki_sample": "Maat kska aji smmalu iyax ptasan patas",
+       "nowiki_tip": "Brkagan Wiki smmalu iyax ptasan elug kari",
+       "image_tip": "Numal pusu patas",
+       "media_tip": "Mggaluk pusu patas",
+       "sig_tip": "Patas hangan su ni jiyax",
+       "hr_tip": "Qtaan ayus msbalay (bilaq bi dmuuy)",
+       "summary": "Ramas kari:",
        "minoredit": "Asaw nii snsul smmalu patas",
        "watchthis": "Gmraka qmita ruwahan patas nii",
-       "savearticle": "skuun ruwahan patas",
+       "savearticle": "Skuun ruwahan patas",
        "savearticle-start": "skuun ruwahan patas...",
-       "showpreview": "pqita daan qmita",
-       "showdiff": "kmpriyux pqita",
-       "anoneditwarning": "<strong> ptqlahang :</strong> Ini su pstmay matas na. nasi su muda ana manu smmalu patas su ga niqan IP mha wada traun. nasi su <strong>[$1 pstmay matas ]</strong> aji uri o <strong>[$2 phiyug patas sspgan </strong>, smmalu patas su o saw nnisu mha seejiq mduuy hangan pnskraya, niqan duma ka tgmalu.",
-       "blockedtext": "<strong> empduuy hangansu\n Aji uri o nniqan IP wada tna shmuk. </strong> wada su powda $1 hmuk, pusu asaw <em>$2</em>. * jiyax prajing hmuk:$8 * jiyaxqmhdu hmuk :$6 * quri hmuk seejiq:$7 mtduwa su mggaluk $1 aji uri o duma ka [[{{MediaWiki:Grouppage-sysop}}| seejiq kmlawa ]] pprngaw hmuk ka quri msriquu. Nasi tna su ga mniq [[Special:Preferences|smkuxul powsa ]] kska pha kingal brihan ka gluban patas samaw patas nniqan, aji o ini powda hmuk nabrihan bluban patas samaw, kiya do mtduwa su powda \" mggaluk samaw nii empduuy \" ka brihan nii mggaluk quri seejiq kmlawa. bitaq saying ka isu ga niqan IP o $3, saw nii hmuk ka ID asaw #$5. Eniq jiyax sslingan umal patas plxani bi pngkla kari.",
-       "loginreqlink": "pstmay patas.",
-       "newarticletext": "Nii su mggaluk bitaq kingal ruwahan patas aji mha ungat ruwahan patas.\nDai phiyug ruwahan patas nii,ga su mniq truma ka smmalu patas qpuruh mangal  kska kari ruwan ( leexan balay powda qtaan patas [$1 dmuuy pgkla ruwahan patas ]) .\nNasi su ini qlahang iyah hini ruwahan patas, powda gmaaw daan qmita ka <strong> embrinah miyah </strong> gluban.",
-       "anontalkpagetext": "---- <em> empprngaw ruwahan pusu nii ka ini bqani na phiyug sspgan patas pnskuan pila ka hangan lniing empduuy dmuuy </em> kiya do asi su ka dmuuy ga niqan IP miyah psenak hnigan, kiya kaq kiyta ni snruwayan ga niqan IPyaa bipaah lala bi ini pndkaempduuy saw pnspuan dmuuy. Nasi isu ka hangan lniing empduuy saw lnglungan suu rmngaw qntaan ka kari ruwan ungat pngluban, powda [[Special:CreateAccount| phiyug bgurah Sspgan patas ]]aji uri o[[Special:UserLogin|pstmay]] saw aji mha mdka duma mduuy hangan lniing mgamax.",
-       "noarticletext": "ruwahan patas nii bitaq sayang ungat kari ruwan, mtduwa su mniq kska duma ruwahan patas [[Special:Search/{{PAGENAME}}| miying pnskraya ruwahan patas nii ]]、<span class=\"plainlinks\">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} miying quri jiyax rnisuh patas ]aji uri o [{{fullurl:{{FULLPAGENAME}}|action=edit}} phiyug ruwahan patas nii]</span>.",
-       "noarticletext-nopermission": "ruwahan patas nii bitaq sayang ungat kari ruwan,\nmtduwa su mniq kska duma ruwahan patas [[Special:Search/{{PAGENAME}}| miying pnskraya ruwahan patas nii ], aji uri o <span class=\"plainlinks\">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} miying quri saw jiyax rnisuh patas ]</span>, kiya ka kiya ni ungat su dduy biyax phiyug ruwahan patas nii.",
-       "userpage-userdoesnotexist-view": "seejiq mduuy patas sspgan \"$1\" ini ppatas na.",
-       "clearyourcache": "<strong> qlahang:</strong> ga mnmiq skuun su babaw na do asi su ka srsan daan qmita qngqaya rait bi mangal kika mtduwa qtaan kmpriyux. * <strong>Firefox / Safari:</strong>prci ni <em>Shift</em> 時 gmaaw <em> psbgurah smmalu </em>,aji uri o <em>Ctrl-F5</em> aji uri o <em>Ctrl-R</em> (Mac saw kiya do <em>⌘-R</em>) * <strong>Google Chrome:</strong>prci <em>Ctrl-Shift-R</em> (Mac saw kiya do <em>⌘-Shift-R</em>) * <strong>Internet Explorer:</strong>prci <em>Ctrl</em> 時 gmaaw <em> psbgurah smmalu </em>, aji uri o prci <em>Ctrl-F5</em> * <strong>Opera:</strong> pquri brah <em> gmaaw → pha </em> (mniq Mac asaw <em>Opera → smkuxul powsa </em>) babaw na duri o<em> lniing & aji hhuya → srsi qmita patas → wada rait mangal ka patas ni pusu patas </em>.",
-       "previewnote": "<strong>bitaq saying ni su qtaan, kmpriyux su ini skui na!</strong>",
-       "editing": "pida smmalu patas $1",
-       "creating": "nii muda phiyug $1",
-       "editingsection": "nii muda smmalu patas $1 ( spugan )",
-       "templatesused": "dmuuy ruwahan patas nii ka truma {{PLURAL:$1| qtaan }}:",
-       "templatesusedpreview": "plealay qmita nii o dmuuy truuma nii{{PLURAL:$1| qtaan pprgun }}:",
+       "showpreview": "Pqita daan qmita",
+       "showdiff": "Kmpriyux pqita",
+       "anoneditwarning": "<strong>Ptqlahang:</strong> Ini su pstmay matas na. Nasi su muda ana manu smmalu patas su ga niqan IP mha wada traun. Nasi su <strong>[$1 pstmay matas]</strong> aji uri o <strong>[$2 phiyug patas sspgan]</strong>, smmalu patas su o saw nnisu mha seejiq mduuy hangan pnskraya, niqan duma ka tgmalu.",
+       "blockedtext": "<strong>Empduuy hangansu aji uri o nniqan IP wada tna shmuk.</strong>\n\nWada su powda $1 hmuk.\nPusu asaw <em>$2</em>.\n\n* Jiyax prajing hmuk: 8\n* Jiyaxqmhdu hmuk: $6\n* Quri hmuk seejiq: $7\n\nMtduwa su mggaluk $1 aji uri o duma ka [[{{MediaWiki:Grouppage-sysop}}|seejiq kmlawa]] pprngaw hmuk ka quri msriquu.\nNasi tna su ga mniq [[Special:Preferences|smkuxul powsa]] kska pha kingal brihan ka gluban patas samaw patas nniqan, aji o ini powda hmuk nabrihan bluban patas samaw, kiya do mtduwa su powda \"{{int:emailuser}}\" ka brihan nii mggaluk quri seejiq kmlawa.\nBitaq saying ka isu ga niqan IP o $3, saw nii hmuk ka ID asaw #$5.\nEniq jiyax sslingan umal patas plxani bi pngkla kari.",
+       "loginreqlink": "pstmay patas",
+       "newarticletext": "Nii su mggaluk bitaq kingal ruwahan patas aji mha ungat ruwahan patas.\nDai phiyug ruwahan patas nii, ga su mniq truma ka smmalu patas qpuruh mangal  kska kari ruwan (leexan balay powda qtaan patas [$1 dmuuy pgkla ruwahan patas]).\nNasi su ini qlahang iyah hini ruwahan patas, powda gmaaw daan qmita ka <strong>embrinah miyah</strong> gluban.",
+       "anontalkpagetext": "----\n<em>Empprngaw ruwahan pusu nii ka ini bqani na phiyug sspgan patas pnskuan pila ka hangan lniing empduuy dmuuy.</em>\nKiya do asi su ka dmuuy ga niqan IP miyah psenak hnigan.\nKiya kaq kiyta ni snruwayan ga niqan IPyaa bipaah lala bi ini pndkaempduuy saw pnspuan dmuuy.\nNasi isu ka hangan lniing empduuy saw lnglungan suu rmngaw qntaan ka kari ruwan ungat pngluban, powda [[Special:CreateAccount|phiyug bgurah Sspgan patas]] aji uri o [[Special:UserLogin|pstmay]] saw aji mha mdka duma mduuy hangan lniing mgamax.",
+       "noarticletext": "Ruwahan patas nii bitaq sayang ungat kari ruwan.\nMtduwa su mniq kska duma ruwahan patas [[Special:Search/{{PAGENAME}}|miying pnskraya ruwahan patas nii]],\n<span class=\"plainlinks\">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} miying quri jiyax rnisuh patas] aji uri\no [{{fullurl:{{FULLPAGENAME}}|action=edit}} phiyug ruwahan patas nii]</span>.",
+       "noarticletext-nopermission": "Ruwahan patas nii bitaq sayang ungat kari ruwan.\nMtduwa su mniq kska duma ruwahan patas [[Special:Search/{{PAGENAME}}|miying pnskraya ruwahan patas nii]], aji uri o <span class=\"plainlinks\">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} miying quri saw jiyax rnisuh patas]</span>, kiya ka kiya ni ungat su dduy biyax phiyug ruwahan patas nii.",
+       "userpage-userdoesnotexist-view": "Seejiq mduuy patas sspgan \"$1\" ini ppatas na.",
+       "clearyourcache": "<strong>Qlahang:</strong> Ga mnmiq skuun su babaw na do asi su ka srsan daan qmita qngqaya rait bi mangal kika mtduwa qtaan kmpriyux.\n* <strong>Firefox / Safari:</strong> Prci ni <em>Shift</em> 時 gmaaw <em> psbgurah smmalu </em>, aji uri o <em>Ctrl-F5</em> aji uri o <em>Ctrl-R</em> (Mac saw kiya do <em>⌘-R</em>).\n* <strong>Google Chrome:</strong> Prci <em>Ctrl-Shift-R</em> (Mac saw kiya do <em>⌘-Shift-R</em>).\n* <strong>Internet Explorer:</strong> Prci <em>Ctrl</em>, gmaaw <em>Psbgurah smmalu</em>, aji uri o prci <em>Ctrl-F5</em>.\n* <strong>Opera:</strong> Pquri brah <em>Gmaaw → Pha</em> (mniq Mac asaw <em>Opera → smkuxul powsa</em>) babaw na duri o <em>Lniing & aji hhuya → Srsi qmita patas → Wada rait mangal ka patas ni pusu patas</em>.",
+       "previewnote": "<strong>Bitaq saying ni su qtaan.</strong>\nKmpriyux su ini skui na!",
+       "editing": "Pida smmalu patas $1",
+       "creating": "Nii muda phiyug $1",
+       "editingsection": "Nii muda smmalu patas $1 (spugan)",
+       "templatesused": "Dmuuy ruwahan patas nii ka truma {{PLURAL:$1|qtaan}}:",
+       "templatesusedpreview": "Plealay qmita nii o dmuuy truuma nii {{PLURAL:$1|qtaan pprgun}}:",
        "template-protected": "(ga klwaun)",
-       "template-semiprotected": "(Smka bi knlwaan )",
-       "hiddencategories": "nruwahan patas nii {{PLURAL:$1|1 sspug kingal lmiing keelgan |$1 sspug kingal lmiing keelgan}} seejiq :",
-       "permissionserrorstext-withaction": "Saw nii truma {{PLURAL:$1| pusu }}, ungat biyax dduuy su muda $2 ka muda :",
-       "recreate-moveddeleted-warn": "<strong> ptqlahang :nii su psbgurah phiyug brah han o wada srsan ka ruwahan patas. </strong> naa su lmnglungyayaa aji mlutut smmalu patas ruwahan patas nii。 Ga hini mgay snrus ni hdlun jiyax rnisuh patas tai saw msleexan qtaan patas:",
-       "moveddeleted-notice": "ruwahan patas nii wada srsan.\ntruma mgay ruwahan patas nii ka wada srsan ni hdlun jiyax rnisuh patas tai saw qtaan patas.",
+       "template-semiprotected": "(smka bi knlwaan)",
+       "hiddencategories": "Nruwahan patas nii {{PLURAL:$1|$1 sspug kingal lmiing keelgan}} seejiq:",
+       "permissionserrorstext-withaction": "Saw nii truma {{PLURAL:$1|pusu}}, ungat biyax dduuy su muda $2 ka muda:",
+       "recreate-moveddeleted-warn": "<strong>Ptqlahang: Nii su psbgurah phiyug brah han o wada srsan ka ruwahan patas.</strong>\n\nNaa su lmnglungyayaa aji mlutut smmalu patas ruwahan patas nii.\nGa hini mgay snrus ni hdlun jiyax rnisuh patas tai saw msleexan qtaan patas:",
+       "moveddeleted-notice": "Ruwahan patas nii wada srsan.\nTruma mgay ruwahan patas nii ka wada srsan, ni hdlun jiyax rnisuh patas tai saw qtaan patas.",
        "undo-failure": "Paah nii smmalu patas ka muda smalu iyax o niqan mkeekan, smalu patas nii ini tduwa psnbrih.",
-       "viewpagelogs": "pqita ruwahan patas nii ka jiyax rnisuh patas",
+       "viewpagelogs": "Pqita ruwahan patas nii ka jiyax rnisuh patas",
        "currentrev": "Bgurah bi muda smalu",
-       "currentrev-asof": "mniq $1 ka Bgurah bi muda smmalu",
+       "currentrev-asof": "Mniq $1 ka Bgurah bi muda smmalu",
        "revisionasof": "nii $1 ka muda smalu",
-       "revision-info": "mniq $1 paah {{GENDER:$6|$2}} saw muda qmpah smalu $7",
-       "previousrevision": "←muda smmalu brah nii",
-       "nextrevision": "muda smmalu truma nii→",
+       "revision-info": "Mniq $1 paah {{GENDER:$6|$2}} saw muda qmpah smalu $7",
+       "previousrevision": "← Muda smmalu brah nii",
+       "nextrevision": "Muda smmalu truma nii →",
        "currentrevisionlink": "Bgurah bi muda smalu",
        "cur": "bitaq sayang",
        "last": "brah gntuan",
-       "histlegend": "pdkaun gmaaw ka ini pndka patas pusu : asi ka gmaaw pdkaun muda smmalu patas pusu gmaaw kinga qaya duri o gmaaw sulay gluban muda psdka. <br /> pgkla patas pnskraya :<strong>({{int:cur}})</strong> = ni bi pdkaun bgurah muda smmalu patas pusu, <strong>({{int:last}})</strong> = mseupu gntuan brah pdkaun muda smalu patas pusu, <strong>{{int:minoreditletter}}</strong> = smsul na muda smalu",
-       "history-feed-description": "patas Wiki powsa ruwahan patas nii ka endaan muda smmalu",
+       "histlegend": "Pdkaun gmaaw ka ini pndka patas pusu: Asi ka gmaaw pdkaun muda smmalu patas pusu gmaaw kinga qaya duri o gmaaw sulay gluban muda psdka.<br />\nPgkla patas pnskraya: <strong>({{int:cur}})</strong> = ni bi pdkaun bgurah muda smmalu patas pusu, <strong>({{int:last}})</strong> = mseupu gntuan brah pdkaun muda smalu patas pusu, <strong>{{int:minoreditletter}}</strong> = smsul na muda smalu.",
+       "history-feed-description": "Patas Wiki powsa ruwahan patas nii ka endaan muda smmalu",
        "history-feed-item-nocomment": "$1 ga $2",
        "rev-delundel": "kmpriyux mtduwa qtaan",
        "rev-showdeleted": "pqita",
        "pagehist": "endaan ruwahan patas",
        "history-title": "\"$1\" ka endaan muda smalu",
        "difference-title": "\"$1\" muda smmalu siida ka ini kndka",
-       "lineno": "qnay patas $1:",
-       "compareselectedversions": "psdka wada gmaaw ka muda smalu",
+       "lineno": "Qnay patas $1:",
+       "compareselectedversions": "Psdka wada gmaaw ka muda smalu",
        "editundo": "pkbrih",
-       "diff-multi-sameuser": "(ini pqita mdka kingak seejiq mduuy saw qnpahan kska na $1 smsul muda smalu )",
-       "diff-multi-otherusers": "(ini pqita ni paah $2 hnigan empduuy ka ruwam saw q11npahan $1 snsul muda smmalu )",
-       "searchresults-title": "$1 ka miying endaan qmpah",
-       "prevn": "Brah $1 gntuan",
-       "nextn": "Bukuy {{PLURAL:$1|$1}}gntuan",
-       "prevn-title": "brah $1 gntuan endaan qmpah",
-       "nextn-title": "babaw $1 gntuan endaan qmpah",
-       "shown-title": "qtaan kngkingal uwahan patas $1 gntuan endaan qmpah",
-       "viewprevnext": "pqita ($1 {{int:pipe-separator}} $2) ($3)",
-       "searchmenu-exists": "<strong>nii Wiki wada niqan hangan asaw bi \"[[:$1]]\" ka ruwahan patas. </strong> {{PLURAL:$2|0=|aji uri o powda qmita patas duma miying endaan qmpah.}}",
-       "searchmenu-new": "<strong>nii hini Wiki phiyug ruwahan patas \"[[:$1]]\"!</strong>{{PLURAL:$2|0=|powda qtaan patas su pstmay mataska pusu hlayan ka miying endaan qmpah. |aji uri o powda qtaan patas duma miying endaan qmpah. }}",
-       "searchprofile-articles": "kari ruwan ruwahan patas",
-       "searchprofile-images": "knlala samaw psaput",
-       "searchprofile-everything": "kana",
+       "diff-multi-sameuser": "(Ini pqita mdka kingak seejiq mduuy saw qnpahan kska na {{PLURAL:$1|$1}} smsul muda smalu)",
+       "diff-multi-otherusers": "(Ini pqita ni paah {{PLURAL:$2|}}$2 hnigan empduuy ka ruwam saw qnpahan {{PLURAL:$1|}}$1 snsul muda smmalu)",
+       "searchresults-title": "\"$1\" ka miying endaan qmpah",
+       "prevn": "brah {{PLURAL:$1|$1}} gntuan",
+       "nextn": "bukuy {{PLURAL:$1|$1}} gntuan",
+       "prevn-title": "Brah $1 {{PLURAL:$1|gntuan endaan qmpah}}",
+       "nextn-title": "Babaw $1 {{PLURAL:$1|gntuan endaan qmpah}}",
+       "shown-title": "Qtaan kngkingal uwahan patas {{PLURAL:$1|}}$1 gntuan endaan qmpah",
+       "viewprevnext": "Pqita ($1 {{int:pipe-separator}} $2) ($3)",
+       "searchmenu-exists": "<strong>Nii Wiki wada niqan hangan asaw bi \"[[:$1]]\" ka ruwahan patas.</strong> {{PLURAL:$2|0=|Aji uri o powda qmita patas duma miying endaan qmpah.}}",
+       "searchmenu-new": "<strong>Nii hini Wiki phiyug ruwahan patas \"[[:$1]]\"!</strong> {{PLURAL:$2|0=|Powda qtaan patas su pstmay mataska pusu hlayan ka miying endaan qmpah.|Aji uri o powda qtaan patas duma miying endaan qmpah.}}",
+       "searchprofile-articles": "Kari ruwan ruwahan patas",
+       "searchprofile-images": "Knlala samaw psaput",
+       "searchprofile-everything": "Kana",
        "searchprofile-advanced": "Mtmay quri brah",
-       "searchprofile-articles-tooltip": "ga $1 kska miying",
-       "searchprofile-images-tooltip": "miying pusu patas",
-       "searchprofile-everything-tooltip": "miying kana ruwan pntasan ( supu kana pprngagan ruwahan patas )",
-       "searchprofile-advanced-tooltip": "miying iyax ptngahan pnhiyug nanak",
-       "search-result-size": "$1 ({{PLURAL:$2|1 kingal patas |$2 kingal patas }})",
-       "search-result-category-size": "$1 hnigan hiyi ($2 kngkingal spiq keelgan, $3kngkingal pusu patas )",
+       "searchprofile-articles-tooltip": "Ga $1 kska miying",
+       "searchprofile-images-tooltip": "Miying pusu patas",
+       "searchprofile-everything-tooltip": "Miying kana ruwan pntasan (supu kana pprngagan ruwahan patas)",
+       "searchprofile-advanced-tooltip": "Miying iyax ptngahan pnhiyug nanak",
+       "search-result-size": "$1 ({{PLURAL:$2|1 kingal patas|$2 kingal patas}})",
+       "search-result-category-size": "{{PLURAL:$1|$1 hnigan hiyi}} ({{PLURAL:$2|$2 kngkingal spiq keelgan}}, {{PLURAL:$3|$3 kngkingal pusu patas}})",
        "search-redirect": "(brahan dmudul paah $1)",
        "search-section": "(spgan $1)",
        "search-category": "(keelgan $1)",
-       "search-file-match": "( mlngu kari ruwan pusu patas )",
-       "search-suggest": "aji isu ka tmniyu na :$1",
+       "search-file-match": "(mlngu kari ruwan pusu patas)",
+       "search-suggest": "Aji isu ka tmniyu na: $1",
        "search-interwiki-more": "(knlala)",
        "searchall": "kana",
-       "search-showingresults": "{{PLURAL:$4|tg <strong>$1</strong> gntuan endaan qmpah, seupu do <strong>$3</strong> gntuan|tg <strong>$1 - $2</strong> gntuan endaan qmpah, mseupu kana <strong>$3</strong> gntuan}}",
-       "search-nonefound": "ungat mlngu smiling pusu ka endaan qmpah.",
-       "powersearch-toggleall": "kana",
+       "search-showingresults": "{{PLURAL:$4|Tg <strong>$1</strong> gntuan endaan qmpah, seupu do <strong>$3</strong> gntuan|Tg <strong>$1 – $2</strong> gntuan endaan qmpah, mseupu kana <strong>$3</strong> gntuan}}",
+       "search-nonefound": "Ungat mlngu smiling pusu ka endaan qmpah.",
+       "powersearch-toggleall": "Kana",
        "preferences": "Smkuxul bi powsa",
        "mypreferences": "Smkuxul bi powsa",
        "prefs-user-pages": "empduuy ruwahan patas",
        "prefs-rc": "Kmpriyux snii",
        "prefs-watchlist": "Patas leexan gmraka",
        "prefs-editwatchlist-raw": "leexan patas gmraka ida nkiya smmalu patas",
+       "searchresultshead": "Miying",
+       "prefs-searchoptions": "Miying",
        "prefs-namespaces": "iyax ptngahan",
        "prefs-files": "pusu patas",
        "group-user": "Seejiq mduuy",
        "group-all": "(kana)",
        "right-upload": "wada pdsun brah pusu patas",
-       "right-writeapi": "ptasi dmuuy API",
+       "right-writeapi": "Ptasi dmuuy API",
        "grant-createaccount": "phiyug patas sspgan",
-       "newuserlogpage": "phiyug jiyax rnisuh patas seejiq mduuy",
-       "rightslog": "seejiq mduuy biyax kklawa jiyax rnisuh patas",
-       "action-edit": "smmalu patas ruwahan patas nii",
+       "newuserlogpage": "Phiyug jiyax rnisuh patas seejiq mduuy",
+       "rightslog": "Seejiq mduuy biyax kklawa jiyax rnisuh patas",
+       "action-edit": "Smmalu patas ruwahan patas nii",
        "action-createaccount": "phiyug seejiq mduuy patas sspgan nii",
        "action-move": "hdlun ruwahan patas nii",
+       "enhancedrc-history": "endaan",
        "recentchanges": "Kmpriyux snii",
-       "recentchanges-legend": "kmpriyux snii ka gneegan",
-       "recentchanges-summary": "murug Wiki nii kska ruwahan patas ka kmpriyux snii.",
-       "recentchanges-noresult": "mniq kiya kska jiyax ungat mlngu pusu ka kmpriyux",
-       "recentchanges-feed-description": "muurug kska Wiki nii ramas kari kmpriyux snii balay",
-       "recentchanges-label-newpage": "smmalu patas nii o phiyug bgurah ruwahan patas da",
+       "recentchanges-legend": "Kmpriyux snii ka gneegan",
+       "recentchanges-summary": "Murug Wiki nii kska ruwahan patas ka kmpriyux snii.",
+       "recentchanges-noresult": "Mniq kiya kska jiyax ungat mlngu pusu ka kmpriyux.",
+       "recentchanges-feed-description": "Muurug kska Wiki nii ramas kari kmpriyux snii balay.",
+       "recentchanges-label-newpage": "Smmalu patas nii o phiyug bgurah ruwahan patas da",
        "recentchanges-label-minor": "Asaw nii snsul smmalu patas",
-       "recentchanges-label-bot": "smmalu patas nii o  paah seejiq luqi samaw mowda",
-       "recentchanges-label-unpatrolled": "smmalu patas nii o ini dai qmita na",
-       "recentchanges-label-plusminus": "ruwahan patas kmpriyux nii ka prparu ni blbila ( pnspuan wiyiyeyn)",
-       "recentchanges-legend-newpage": "{{int:recentchanges-label-newpage}} (powda qita patas [[Special:NewPages| bgurah ruwahan patas ]])",
+       "recentchanges-label-bot": "Smmalu patas nii o  paah seejiq luqi samaw mowda",
+       "recentchanges-label-unpatrolled": "Smmalu patas nii o ini dai qmita na",
+       "recentchanges-label-plusminus": "Ruwahan patas kmpriyux nii ka prparu ni blbila (pnspuan wiyiyeyn)",
+       "recentchanges-legend-newpage": "{{int:recentchanges-label-newpage}} (powda qita patas [[Special:NewPages|bgurah ruwahan patas]])",
        "recentchanges-submit": "pqita",
-       "rcfilters-tag-remove": "hdlun pkungat '$1'",
+       "rcfilters-tag-remove": "Hdlun pkungat '$1'",
        "rcfilters-activefilters-hide": "lmiying",
        "rcfilters-activefilters-show": "pqita",
-       "rcfilters-days-show-days": "jiyax",
-       "rcfilters-savedqueries-cancel-label": "pkungat",
+       "rcfilters-days-show-days": "$1 {{PLURAL:$1|}}jiyax",
+       "rcfilters-savedqueries-cancel-label": "Pkungat",
        "rcfilters-filtergroup-lastrevision": "Bgurah bi muda smalu",
-       "rcnotefrom": "truma nii {{PLURAL:$5asaw }}hiya nanak <strong>$3 $4</strong> paah na niya kmpriyux (lala bi pqita <strong>$1</strong> gntuan).",
-       "rclistfrom": "pqita paah $3 $2 kmpriyux bgurah siida",
+       "rcnotefrom": "Truma nii {{PLURAL:$5|asaw}} hiya nanak <strong>$3, $4</strong> paah na niya kmpriyux (lala bi pqita <strong>$1</strong> gntuan).",
+       "rclistfrom": "Pqita paah $3, $2 kmpriyux bgurah siida",
        "rcshowhideminor": "$1 smsul smmalu patas",
-       "rcshowhideminor-show": "pqita",
-       "rcshowhideminor-hide": "lmiying",
+       "rcshowhideminor-show": "Pqita",
+       "rcshowhideminor-hide": "Lmiying",
        "rcshowhidebots": "$1 seejiq luqi samaw",
-       "rcshowhidebots-show": "pqita",
-       "rcshowhidebots-hide": "lmiying",
+       "rcshowhidebots-show": "Pqita",
+       "rcshowhidebots-hide": "Lmiying",
        "rcshowhideliu": "$1 wada matas patas ka seejiq mduuy",
-       "rcshowhideliu-show": "pqita",
-       "rcshowhideliu-hide": "lmiying",
+       "rcshowhideliu-show": "Pqita",
+       "rcshowhideliu-hide": "Lmiying",
        "rcshowhideanons": "$1 seejiq mduuy lniing hangan",
-       "rcshowhideanons-show": "pqita",
-       "rcshowhideanons-hide": "lmiying",
+       "rcshowhideanons-show": "Pqita",
+       "rcshowhideanons-hide": "Lmiying",
        "rcshowhidepatr": "$1 rmigaw qmita wada smmalu patas",
        "rcshowhidepatr-show": "pqita",
        "rcshowhidepatr-hide": "lmiying",
        "rcshowhidemine": "$1 smmalu patas nnaku",
-       "rcshowhidemine-show": "pqita",
-       "rcshowhidemine-hide": "lmiying",
+       "rcshowhidemine-show": "Pqita",
+       "rcshowhidemine-hide": "Lmiying",
        "rcshowhidecategorization-show": "pqita",
        "rcshowhidecategorization-hide": "lmiying",
-       "rclinks": "pqita snii $3 $2 snsul kmpriyux siida",
+       "rclinks": "Pqita snii $1, $2 snsul kmpriyux siida",
        "hist": "endaan",
-       "hide": "lmiying",
-       "show": "pqita",
-       "minoreditletter": "bilaq",
-       "newpageletter": "bgurah",
-       "boteditletter": "qaya",
-       "rc-change-size-new": "babaw kmpriyux $1 pnspuan wiyeyn",
-       "rc-old-title": "Plealay bi  phiyug ka hangan asaw bi \"$1\"",
-       "recentchangeslinked": "kmpriyux quri",
-       "recentchangeslinked-feed": "kmpriyux quri",
-       "recentchangeslinked-toolbox": "kmpriyux quri",
-       "recentchangeslinked-title": "mseupu \"$1\" quri ka kmpriyux",
-       "recentchangeslinked-page": "hangan ruwahan patas:",
-       "recentchangeslinked-to": "kmpriyux pqita mgaluk bitaq tniyu ruwahan patas ka kmpriyux",
-       "upload": "wada pdsun brah pusu patas",
-       "filedesc": "ramas kari",
+       "hide": "Lmiying",
+       "show": "Pqita",
+       "minoreditletter": "bi",
+       "newpageletter": "Bg",
+       "boteditletter": "qa",
+       "rc-change-size-new": "Babaw kmpriyux {{PLURAL:$1|}}$1 pnspuan wiyeyn",
+       "rc-old-title": "plealay bi  phiyug ka hangan asaw bi \"$1\"",
+       "recentchangeslinked": "Kmpriyux quri",
+       "recentchangeslinked-feed": "Kmpriyux quri",
+       "recentchangeslinked-toolbox": "Kmpriyux quri",
+       "recentchangeslinked-title": "Mseupu \"$1\" quri ka kmpriyux",
+       "recentchangeslinked-page": "Hangan ruwahan patas:",
+       "recentchangeslinked-to": "Kmpriyux pqita mgaluk bitaq tniyu ruwahan patas ka kmpriyux",
+       "upload": "Wada pdsun brah pusu patas",
+       "filedesc": "Ramas kari",
        "filesource": "pnyahan:",
        "upload-dialog-title": "wada pdsun brah pusu patas",
-       "upload-dialog-button-cancel": "pkungat",
+       "upload-dialog-button-cancel": "Pkungat",
        "upload-form-label-infoform-description": "Pgkla rmngaw",
        "upload-form-label-infoform-categories": "keelgan",
        "upload-form-label-infoform-date": "jiyax",
-       "license": "gaya mgay biyax kklawa:",
-       "license-header": "gaya mgay biyax kklawa",
+       "license": "Gaya mgay biyax kklawa:",
+       "license-header": "Gaya mgay biyax kklawa",
        "listfiles-userdoesnotexist": "seejiq mduuy patas sspgan \"$1\" ini ppatas na.",
        "imgfile": "pusu patas",
        "listfiles_thumb": "patas snblaqan",
        "listfiles_date": "jiyax",
        "listfiles_user": "Seejiq mduuy",
        "listfiles_description": "Pgkla rmngaw",
-       "file-anchor-link": "pusu patas",
-       "filehist": "endaan pusu patas",
-       "filehist-help": "gmaaw jiyax /saw jiyax pqita jiyax siida ka pusu patas.",
+       "file-anchor-link": "Pusu patas",
+       "filehist": "Endaan pusu patas",
+       "filehist-help": "Gmaaw jiyax/saw jiyax pqita jiyax siida ka pusu patas.",
        "filehist-current": "sayang",
-       "filehist-datetime": "jiyax / jiyax",
-       "filehist-thumb": "patas snblaqan",
-       "filehist-thumbtext": "nii $1 patas pusu ka patas snblaqan",
+       "filehist-datetime": "Jiyax/Jiyax",
+       "filehist-thumb": "Patas snblaqan",
+       "filehist-thumbtext": "Nii $1 patas pusu ka patas snblaqan",
        "filehist-user": "Seejiq mduuy",
-       "filehist-dimensions": "sspngan knbragan",
-       "filehist-comment": "patas numal pgkla",
-       "imagelinks": "djiyun pusu patas",
-       "linkstoimage-more": "mgkala $1 kngkingal{{PLURAL:$1| mggaluk ruwahan patas | mggaluk ruwahan patas }}bitaq hini pusu patas. leexan bi trumanii o wana pteeura brah {{PLURAL:$1|1 gntuan mggaluk |$1 gntuan mggaluk }}bitaq hin i pusu patas ka ruwahan patas ka pusu patas. mtduwa su uri pqita  [[Special:WhatLinksHere/$2| mttuku  leexan patas ]].",
-       "linkstoimage-redirect": "$1 (brahan muda pusu patas ) $2",
-       "sharedupload-desc-here": "pusu patas nii o pnaah $1 duri ni yaa bi wada jiyun duma saw pusu qpahun.\npnqita truma pusu patasnii ga [$2 pgkla pusu patas saw seerngaw ruwahan patas ] ka ruwan rnngaw kari",
-       "filepage-nofile": "ungat hangan nii ka pusu patas.",
-       "upload-disallowed-here": "ungat klaan su mubung pusu patas nii.",
-       "randompage": "ruwahan patas hmut dsdsun.",
+       "filehist-dimensions": "Sspngan knbragan",
+       "filehist-comment": "Patas numal pgkla",
+       "imagelinks": "Djiyun pusu patas",
+       "linkstoimage-more": "Mgkala $1 {{PLURAL:$1|kngkingal mggaluk ruwahan patas}} bitaq hini pusu patas.\nLeexan bi trumanii o wana pteeura brah $1 {{PLURAL:$1|gntuan mggaluk}} bitaq hin i pusu patas ka ruwahan patas ka pusu patas.\nMtduwa su uri pqita [[Special:WhatLinksHere/$2|mttuku leexan patas]].",
+       "linkstoimage-redirect": "$1 (brahan muda pusu patas) $2",
+       "sharedupload-desc-here": "Pusu patas nii o pnaah $1 duri ni yaa bi wada jiyun duma saw pusu qpahun.\nPnqita truma pusu patasnii ga [$2 pgkla pusu patas saw seerngaw ruwahan patas] ka ruwan rnngaw kari.",
+       "filepage-nofile": "Ungat hangan nii ka pusu patas.",
+       "upload-disallowed-here": "Ungat klaan su mubung pusu patas nii.",
+       "randompage": "Ruwahan patas hmut dsdsun.",
        "randomincategory": "ruwahan patas hmut dsdsun.",
        "randomincategory-submit": "muda",
-       "statistics-articles": "kari ruwan ruwahan patas",
+       "statistics-articles": "Kari ruwan ruwahan patas",
        "pageswithprop-submit": "muda",
        "double-redirect-fixer": "Psbgurah muda seejiq muda smalu",
        "brokenredirects-edit": "smmalu patas",
        "withoutinterwiki-submit": "pqita",
-       "nbytes": "$1 sspug kingal pnspuan wiyeyn",
+       "nbytes": "$1 {{PLURAL:$1|sspug kingal pnspuan wiyeyn}}",
        "ncategories": "$1 {{PLURAL:$1| keelgan |$1 sspug kingal keelgan }}",
-       "nmembers": "$1 seejiq sspug hiyi",
+       "nmembers": "$1 {{PLURAL:$1|seejiq sspug hiyi}}",
        "prefixindex": "Purug saw plealay kari smiling ruwahan patas",
        "prefixindex-submit": "pqita",
        "protectedpages-noredirect": "brahan muuda lniing ruwahan patas",
        "protectedpages-page": "ruwahan patas",
        "usereditcount": "$1 {{PLURAL:$1|smsul smmalu patas }}",
-       "newpages": "bgurah ruwahan patas",
+       "newpages": "Bgurah ruwahan patas",
        "newpages-submit": "pqita",
        "newpages-username": "seejiq mduuy hangan:",
-       "move": "hdlun",
+       "move": "Hdlun",
        "movethispage": "hdlun ruwahan patas nii",
-       "pager-newer-n": "{PLURAL:$1| bgurah hari $1 gntuan}}",
-       "pager-older-n": "smudal hari $1 gntuan",
+       "pager-newer-n": "{{PLURAL:$1|bgurah hari gntuan|bgurah hari $1 gntuan}}",
+       "pager-older-n": "{{PLURAL:$1|smudal hari gntuan|smudal hari $1 gntuan}}",
        "apisandbox-add-multi": "Mrana bgurah",
-       "booksources": "patas pnyahan",
-       "booksources-search-legend": "miying pnyahan patas",
-       "speciallogtitlelabel": "Saw dngusun( pusu kari aji uri o {{ns:user}}: seejiq mduuy pnqita seejiq mduuy):",
+       "booksources": "Patas pnyahan",
+       "booksources-search-legend": "Miying pnyahan patas",
+       "booksources-search": "Miying",
+       "speciallogtitlelabel": "Saw dngusun (pusu kari aji uri o {{ns:user}}: seejiq mduuy pnqita seejiq mduuy):",
        "log": "Jiyax rnisuh patas",
        "logeventslist-submit": "pqita",
-       "alllogstext": "pspuun pqita kana {{SITENAME}} kaka mdka hnigan kana ka jiyax rnisuh patas. mtduwa su gmaaw blbil quri truma patas gnaaw jiyax rnisuh patas ka mdka hnigan, kiya ka hangan mduuy (patas pnsnakan paru ni blbilq) aji uri o dmayak ruwahan patas (patas pnsnakan paru ni blbilq)",
-       "logempty": "ungat mlngu pusu ka jiyax rnisuh patas.",
-       "checkbox-all": "kana",
-       "allpages": "kana ruwahan patas",
-       "allarticles": "kana ruwahan patas",
-       "allpagessubmit": "muda",
-       "allpages-hide-redirects": "brahan muuda lniing ruwahan patas",
-       "categories": "keelgan",
+       "alllogstext": "Pspuun pqita kana {{SITENAME}} kaka mdka hnigan kana ka jiyax rnisuh patas.\nMtduwa su gmaaw blbil quri truma patas gnaaw jiyax rnisuh patas ka mdka hnigan, kiya ka hangan mduuy (patas pnsnakan paru ni blbilq) aji uri o dmayak ruwahan patas (patas pnsnakan paru ni blbilq).",
+       "logempty": "Ungat mlngu pusu ka jiyax rnisuh patas.",
+       "checkbox-all": "Kana",
+       "allpages": "Kana ruwahan patas",
+       "allarticles": "Kana ruwahan patas",
+       "allpagessubmit": "Muda",
+       "allpages-hide-redirects": "Brahan muuda lniing ruwahan patas",
+       "categories": "Keelgan",
        "categories-submit": "pqita",
        "sp-deletedcontributions-contribs": "suyang qnpahan",
        "linksearch-ns": "iyax ptngahan:",
+       "linksearch-ok": "Miying",
        "listusers-submit": "pqita",
        "emailuser": "Email mggaluk seejiq mduuy nii",
        "emailusername": "seejiq mduuy hangan:",
        "mywatchlist": "Patas leexan gmraka",
        "watchlistfor2": "$1 ka leexan patas gmraka $2",
        "watchthispage": "Gmraka qmita ruwahan patas nii",
-       "watchlist-details": "leexan patas gmraka su mseupu kana o niqan $1 kngkingal ruwahan patas(supu kana pprngaw ruwahan patas).",
-       "wlheader-showupdated": "Ga su mniq tnhici bi kingal babaw qmita wada kmpriyux smalu ruwahan patas mha saw muda <strong> patas qthur </strong> pqita.",
-       "wlnote": "Truma nii asaw paah $3 $4 brah na <strong>$2</strong> kska iyax tuki snluuan <strong>$1</strong> snsul kmpriyux.",
-       "wlshowlast": "pqita snii $1 iyax tuki $2 jiyax",
+       "watchlist-details": "Leexan patas gmraka su mseupu kana o niqan {{PLURAL:$1|$1 kngkingal ruwahan patas}} (supu kana pprngaw ruwahan patas).",
+       "wlheader-showupdated": "Ga su mniq tnhici bi kingal babaw qmita wada kmpriyux smalu ruwahan patas mha saw muda <strong>patas qthur</strong> pqita.",
+       "wlnote": "Truma nii asaw paah $3 $4 brah na {{PLURAL:$2|<strong>$2</strong> kska iyax}} tuki snluuan {{PLURAL:$1|<strong>$1</strong> snsul kmpriyux}}.",
+       "wlshowlast": "Pqita snii $1 {{PLURAL:$1|iyax}} tuki $2 {{PLURAL:$2|jiyax}}",
        "watchlist-hide": "lmiying",
        "watchlist-submit": "pqita",
-       "enotif_reset": "pnskraya kana ruwahan patas asaw wada pqita",
+       "enotif_reset": "Pnskraya kana ruwahan patas asaw wada pqita",
        "enotif_minoredit": "Asaw nii snsul smmalu patas",
-       "historyaction-submit": "pqita",
+       "historyaction-submit": "Pqita",
        "dellogpage": "Srsi jiyax rnisuh patas",
        "deletionlog": "Srsi jiyax rnisuh patas",
        "rollbacklink": "gbrih duri",
-       "rollbacklinkcount": "psnbrih $1 smsul smmalu patas",
-       "protectlogpage": "kmlawa jiyax rnisuh matas",
-       "protectedarticle": "kmlawa \"[[$1]]\"",
+       "rollbacklinkcount": "psnbrih $1 {{PLURAL:$1|smsul smmalu patas}}",
+       "protectlogpage": "Kmlawa jiyax rnisuh matas",
+       "protectedarticle": "Kmlawa \"[[$1]]\"",
        "modifiedarticleprotection": "Wada psbgurah smmalu \"[[$1]]\" ka kmlawa knparu hnigan",
-       "protect-default": "mtduwa kana ka nduuy",
+       "protect-default": "Mtduwa kana ka nduuy",
        "restriction-type": "mgay biyax kklawa snruwaan:",
-       "restriction-edit": "smmalu patas",
-       "restriction-move": "hdlun",
+       "restriction-edit": "Smmalu patas",
+       "restriction-move": "Hdlun",
+       "undeleteviewlink": "qmita",
        "undeleteinvert": "mspgriq embrinah gmaaw",
-       "namespace": "iyax ptngahan:",
-       "invert": "mspgriq embrinah gmaaw",
-       "tooltip-invert": "geegi gmaaw qpuruh nii, saw kska lmiing gmaaw iyax ptngahan ruwahan patas kmpriyux (nasi gneegan quri iyax ptngahan, aji saw kiya do jiyax siida lmiing quri iyax ptngahan )",
-       "namespace_association": "quri iyax ptngahan",
-       "tooltip-namespace_association": "geegi nii ka gmaaw saw patas 4 muhing supu kana ni gmaaw iyax ptngahan quri ka empprngaw aji uri o iyax ptngahan pusu kari",
-       "blanknamespace": "( pusu bi )",
-       "contributions": "{{GENDER:$1| empduuy }} suyang qnpahan",
+       "undelete-search-submit": "Miying",
+       "namespace": "Iyax ptngahan:",
+       "invert": "Mspgriq embrinah gmaaw",
+       "tooltip-invert": "Geegi gmaaw qpuruh nii, saw kska lmiing gmaaw iyax ptngahan ruwahan patas kmpriyux (nasi gneegan quri iyax ptngahan, aji saw kiya do jiyax siida lmiing quri iyax ptngahan)",
+       "namespace_association": "Quri iyax ptngahan",
+       "tooltip-namespace_association": "Geegi nii ka gmaaw saw patas 4 muhing supu kana ni gmaaw iyax ptngahan quri ka empprngaw aji uri o iyax ptngahan pusu kari",
+       "blanknamespace": "(pusu bi)",
+       "contributions": "{{GENDER:$1|Empduuy}} suyang qnpahan",
        "contributions-title": "$1 ka seejiq mduuy suyang qnpahan",
-       "mycontris": "suyang qnpahan",
-       "contribsub2": "{{GENDER:$3|$1}}ka suyang qnpahan ($2)",
+       "mycontris": "Suyang qnpahan",
+       "anoncontribs": "Suyang qnpahan",
+       "contribsub2": "{{GENDER:$3|$1}} ka suyang qnpahan ($2)",
        "contributions-userdoesnotexist": "seejiq mduuy patas sspgan \"$1\" ini ppatas na.",
-       "nocontribs": "ini hjiyal pusu mlngu kaq kmpriyux.",
+       "nocontribs": "Ini hjiyal pusu mlngu kaq kmpriyux.",
        "uctop": "sayang",
-       "month": "jiyax nhdaan kngkingal idas :",
-       "year": "jiyax bitaq hngkawas :",
+       "month": "Jiyax nhdaan kngkingal idas:",
+       "year": "Jiyax bitaq hngkawas:",
        "sp-contributions-newbies": "Wana pqita bgurah sspgan patas ka suyang qnpahan",
        "sp-contributions-blocklog": "hmuk jiyax rnisuh patas",
-       "sp-contributions-logs": "Jiyax rnisuh patas",
+       "sp-contributions-uploads": "",
+       "sp-contributions-logs": "jiyax rnisuh patas",
        "sp-contributions-talk": "empprngaw",
-       "sp-contributions-username": "nniqan IP aji uri o seejiq mduuy hangan :",
-       "sp-contributions-toponly": "wana pqita bgurah bi muda smalu ka smmalu patas",
-       "sp-contributions-newonly": "wana pqita phiyug ruwahan patas ka smmalu patas",
+       "sp-contributions-username": "Nniqan IP aji uri o seejiq mduuy hangan!",
+       "sp-contributions-toponly": "Wana pqita bgurah bi muda smalu ka smmalu patas",
+       "sp-contributions-newonly": "Wana pqita phiyug ruwahan patas ka smmalu patas",
+       "sp-contributions-submit": "Miying",
        "whatlinkshere": "Mggaluk bitaq ruwahan patas nii",
-       "whatlinkshere-title": "mgaluk bitaq \"$1\" ka ruwahan patas",
-       "whatlinkshere-page": "ruwahan patas:",
+       "whatlinkshere-title": "Mgaluk bitaq \"$1\" ka ruwahan patas",
+       "whatlinkshere-page": "Ruwahan patas:",
        "isredirect": "psbgurah muda ruwahan patas",
        "istemplate": "dmuuy",
        "isimage": "mggaluk pusu patas",
-       "whatlinkshere-prev": "brah $1gntuan",
+       "whatlinkshere-prev": "{{PLURAL:$1|brah gntuan|brah $1 gntuan}}",
        "whatlinkshere-next": "{{PLURAL:$1|truma gntuan|babaw na $1 gntuan}}",
-       "whatlinkshere-links": "←mggaluk",
+       "whatlinkshere-links": "← mggaluk",
        "whatlinkshere-hideredirs": "$1 psbgurah muda",
        "whatlinkshere-hidetrans": "$1 dmuuy",
        "whatlinkshere-hidelinks": "$1 mggaluk",
-       "whatlinkshere-hideimages": "$1 mggaluk pusu patas",
+       "whatlinkshere-hideimages": "$1 {{PLURAL:$1|mggaluk pusu patas}}",
        "whatlinkshere-submit": "muda",
        "ipaddressorusername": "nniqan IP aji uri o seejiq mduuy hangan :",
-       "ipboptions": "2:2 iyax tuki 2 hours,,1 jiyax:1 day,3 jiyax:3 days,1 iyax sngyan:1 week,2 iyax sngyan:2 weeks,1 idas:1 month,3 idas:3 months,6 idas:6 months,1 hngkawas:1 year, ungat nhdaan :infinite",
+       "ipboptions": "2 iyax tuki:2 hours,1 jiyax:1 day,3 jiyax:3 days,1 iyax sngyan:1 week,2 iyax sngyan:2 weeks,1 idas:1 month,3 idas:3 months,6 idas:6 months,1 hngkawas:1 year,ungat nhdaan:infinite",
        "ipb-pages-label": "ruwahan patas",
        "ipb-namespaces-label": "iyax ptngahan",
+       "autoblocklist-submit": "Miying",
+       "ipblocklist-submit": "Miying",
        "createaccountblock": "phiyug tndu dmuuy patas sspgan",
        "blocklist-editing-ns": "iyax ptngahan",
-       "blocklink": "hmuk",
-       "contribslink": "suyang qnpahan",
-       "blocklogpage": "hmuk jiyax rnisuh patas",
-       "blocklogentry": "wada shmuk [[$1]] ka",
+       "blocklink": "Hmuk",
+       "contribslink": "Suyang qnpahan",
+       "blocklogpage": "Hmuk jiyax rnisuh patas",
+       "blocklogentry": "Wada shmuk [[$1]] ka ''(with an expiration time of $2 $3)''",
        "reblock-logentry": "kmpriyux [[$1]] ka jiyax hmuk nhdaan jiyaxbitaq $2 $3",
        "block-log-flags-nocreate": "phiyug tndu dmuuy patas sspgan",
-       "proxyblocker": "pririh hmuk qaya suhuci",
+       "proxyblocker": "Pririh hmuk qaya suhuci",
        "move-page": "hdlun $1",
-       "movelogpage": "hdlun jiyax rnisuh patas",
-       "export": "wada paadas ruwahan patas",
-       "allmessages-filter-all": "kana",
-       "thumbnail-more": "pkparu",
-       "import-comment": "patas numal pgkla:",
+       "movelogpage": "Hdlun jiyax rnisuh patas",
+       "export": "Wada paadas ruwahan patas",
+       "allmessages-filter-all": "Kana",
+       "thumbnail-more": "Pkparu",
+       "import-comment": "Patas numal pgkla:",
        "tooltip-pt-userpage": "{{GENDER:| seejiq mduuy }} ruwahan patas su",
-       "tooltip-pt-mytalk": "{{GENDER:|su}} empprngaw ruwahan patas",
-       "tooltip-pt-preferences": "{{GENDER:|su}} smkuxul powsa",
-       "tooltip-pt-watchlist": "pida sugmraka kmpriyux ka ruwahan patas leexan patas\n( nasi niqan duma wada muda smnalu ruwahan patas (patas bnkgan), nii ruwahan patas mtduwa mniq mkug spgan brah wada miyah pqita.\npusu kari nii o:pida su pqita niqan wada psbgurah smmalu ruwahan patas ka mkug snpgan. )",
-       "tooltip-pt-mycontris": "{GENDER:|su}} suyang qnpahan leexan patas",
-       "tooltip-pt-login": "pstmay patas han msa dmdug rmngaw sunan , kiya ni aji ida saw kiya.",
-       "tooltip-pt-logout": "latat",
-       "tooltip-pt-createaccount": "Mha name dmudug sunan phiyug patas sspgan. Kiya o pstmay matas, ana yaa asi ka ka muda",
+       "tooltip-pt-mytalk": "{{GENDER:|Su}} empprngaw ruwahan patas",
+       "tooltip-pt-preferences": "{{GENDER:|Su}} smkuxul powsa",
+       "tooltip-pt-watchlist": "Pida sugmraka kmpriyux ka ruwahan patas leexan patas",
+       "tooltip-pt-mycontris": "{{GENDER:|Su}} suyang qnpahan leexan patas",
+       "tooltip-pt-login": "Pstmay patas han msa dmdug rmngaw sunan, kiya ni aji ida saw kiya",
+       "tooltip-pt-logout": "Latat",
+       "tooltip-pt-createaccount": "Mha name dmudug sunan phiyug patas sspgan; kiya o pstmay matas, ana yaa asi ka ka muda",
        "tooltip-ca-talk": "Empprngaw quri ruwan ruwahan patas",
-       "tooltip-ca-edit": "smmalu patas ruwahan patas nii",
-       "tooltip-ca-addsection": "prajing bgurah spugan",
-       "tooltip-ca-viewsource": "ruwahan patas nii wada kmlawa. sunan mtduwa qmita ruwahan patas sspgan nii",
-       "tooltip-ca-history": "ruwahan patas nii o wada psmuun smmalu da",
-       "tooltip-ca-move": "hdlun ruwahan patas nii",
-       "tooltip-ca-watch": "ngali ka ruwahan patas nii mali leexan patas gmraka su.",
-       "tooltip-ca-unwatch": "ruwahan patas nii paah leexan patas gmraka kska hdlun pkungat",
-       "tooltip-search": "miying {{SITENAME}}",
-       "tooltip-search-go": "Nasi niqan mndka hangan nii ka ruwahan patas o naa mquri ruwahan patas nii.",
-       "tooltip-search-fulltext": "miying dmuuy su patas nii ka ruwahan patas.",
-       "tooltip-p-logo": "pquri ruwahan patas pusu",
-       "tooltip-n-mainpage": "pquri ruwahan patas pusu",
-       "tooltip-n-mainpage-description": "pquri ruwahan patas pusu",
-       "tooltip-n-portal": "quri pusu qpahun, mtduwa su qmpah manu, inu ka mtduwa hlayan au smulu ka qaya nii",
-       "tooltip-n-currentevents": "ga kska pnsaput kari hlayan quri patas bukuy",
-       "tooltip-n-recentchanges": "kmpriyux patas leexamn snii ka Wiki nii o peiyah patas na.",
+       "tooltip-ca-edit": "Smmalu patas ruwahan patas nii",
+       "tooltip-ca-addsection": "Prajing bgurah spugan",
+       "tooltip-ca-viewsource": "Ruwahan patas nii wada kmlawa.\nSunan mtduwa qmita ruwahan patas sspgan nii.",
+       "tooltip-ca-history": "Ruwahan patas nii o wada psmuun smmalu da",
+       "tooltip-ca-move": "Hdlun ruwahan patas nii",
+       "tooltip-ca-watch": "Ngali ka ruwahan patas nii mali leexan patas gmraka su.",
+       "tooltip-ca-unwatch": "Ruwahan patas nii paah leexan patas gmraka kska hdlun pkungat",
+       "tooltip-search": "Miying {{SITENAME}}",
+       "tooltip-search-go": "Nasi niqan mndka hangan nii ka ruwahan patas o naa mquri ruwahan patas nii",
+       "tooltip-search-fulltext": "Miying dmuuy su patas nii ka ruwahan patas",
+       "tooltip-p-logo": "Pquri ruwahan patas pusu",
+       "tooltip-n-mainpage": "Pquri ruwahan patas pusu",
+       "tooltip-n-mainpage-description": "Pquri ruwahan patas pusu",
+       "tooltip-n-portal": "Quri pusu qpahun, mtduwa su qmpah manu, inu ka mtduwa hlayan au smulu ka qaya nii",
+       "tooltip-n-currentevents": "Ga kska pnsaput kari hlayan quri patas bukuy",
+       "tooltip-n-recentchanges": "Kmpriyux patas leexamn snii ka Wiki nii o peiyah patas na.",
        "tooltip-n-randompage": "Hmut ana knuwan mtmay kingal ruwahan patas",
        "tooltip-n-help": "Miying meysa ddjyagan",
-       "tooltip-t-whatlinkshere": "ngali patas kana ka mggaluk ruwahan patas nii ka ruwan patas.",
-       "tooltip-t-recentchangeslinked": "kmpriyux snii ka mggaluk ruwahan patas nii bitaq duma na ruwahan pataskpriyux snii",
+       "tooltip-t-whatlinkshere": "Ngali patas kana ka mggaluk ruwahan patas nii ka ruwan patas",
+       "tooltip-t-recentchangeslinked": "Kmpriyux snii ka mggaluk ruwahan patas nii bitaq duma na ruwahan pataskpriyux snii",
        "tooltip-feed-atom": "ruwahan patas nii ka Atom pnyahan",
-       "tooltip-t-contributions": "{{GENDER:$1| seejiq mduuy nii }}ka leexan patas suyang qnpahan",
-       "tooltip-t-emailuser": "peadas mggaluk {{ gluban patas samaw GENDER:$1| seejiq mduuy nii }}",
-       "tooltip-t-upload": "wada pdsun brah pusu patas",
-       "tooltip-t-specialpages": "patas kana leexan qmita ruwahan patas pnseanak",
-       "tooltip-t-print": "peiyah patas na ka ruwahan patas nii",
-       "tooltip-t-permalink": "ruwahan patas ka muda smmalu ini klglug mggaluk\n(mgdhug mggaluk /ana bitaq knuwan mggaluk )",
-       "tooltip-ca-nstab-main": "qmita ruwan ruwahan patas.",
-       "tooltip-ca-nstab-user": "pqita empduuy ruwahan patas",
-       "tooltip-ca-nstab-special": "ruwahan patas nii asaw knmalu ruwahan patas, ungat klaan smmalu patas",
-       "tooltip-ca-nstab-project": "pqita pusu qpahun ruwahan patas",
-       "tooltip-ca-nstab-image": "qmita pusu patas ruwahan patas",
-       "tooltip-ca-nstab-mediawiki": "pqita daan kari pngkla",
-       "tooltip-ca-nstab-template": "pqita qtaan",
+       "tooltip-t-contributions": "{{GENDER:$1|Seejiq mduuy nii}} ka leexan patas suyang qnpahan",
+       "tooltip-t-emailuser": "Peadas mggaluk gluban patas samaw {{GENDER:$1|seejiq mduuy nii}}",
+       "tooltip-t-upload": "Wada pdsun brah pusu patas",
+       "tooltip-t-specialpages": "Patas kana leexan qmita ruwahan patas pnseanak",
+       "tooltip-t-print": "Piyah patas na ka ruwahan patas nii",
+       "tooltip-t-permalink": "Ruwahan patas ka muda smmalu ini klglug mggaluk",
+       "tooltip-ca-nstab-main": "Qmita ruwan ruwahan patas.",
+       "tooltip-ca-nstab-user": "Pqita empduuy ruwahan patas",
+       "tooltip-ca-nstab-special": "Ruwahan patas nii asaw knmalu ruwahan patas, ungat klaan smmalu patas",
+       "tooltip-ca-nstab-project": "Pqita pusu qpahun ruwahan patas",
+       "tooltip-ca-nstab-image": "Qmita pusu patas ruwahan patas",
+       "tooltip-ca-nstab-mediawiki": "Pqita daan kari pngkla",
+       "tooltip-ca-nstab-template": "Pqita qtaan",
        "tooltip-ca-nstab-category": "Muda qmitaa keelgan ruwahan patas",
-       "tooltip-minoredit": "pnskraya muda saw nii jiyax  snsul smmalu patas",
-       "tooltip-save": "smku kmpriyux su",
-       "tooltip-preview": "Powda ga brah smku qmita sunan kmpriyux",
-       "tooltip-diff": "pqita su quri saw kmpriyux ruwan",
+       "tooltip-minoredit": "Pnskraya muda saw nii jiyax  snsul smmalu patas",
+       "tooltip-save": "Smku kmpriyux su",
+       "tooltip-preview": "Powda ga brah smku qmita sunan kmpriyux.",
+       "tooltip-diff": "Pqita su quri saw kmpriyux ruwan",
        "tooltip-compareselectedversions": "Qtai paah ruwahan patas nii, 2 ka wada gmaaw ka muda smmalu iyax ini kndka",
-       "tooltip-watch": "ngali ka ruwahan patas nii mali leexan patas gmraka su.",
-       "tooltip-rollback": "gmaaw \" psnbrih \" kiya o mggaluk mtduwa psnbrih bitaq kingal brah seejiq suyang qnpahan quri saw nii ruwahan patas ka smmalu patas",
-       "tooltip-undo": "\" psnbrih \" mtduwa psnbrih smmalu patas nii kiya o qtaan plealay ruwahan smmalu patas lblak patas, mtduwa powda sunan mniq ramas kari kska teumal pusu.",
+       "tooltip-watch": "Ngali ka ruwahan patas nii mali leexan patas gmraka su.",
+       "tooltip-rollback": "Gmaaw \"psnbrih\" kiya o mggaluk mtduwa psnbrih bitaq kingal brah seejiq suyang qnpahan quri saw nii ruwahan patas ka smmalu patas",
+       "tooltip-undo": "\"Psnbrih\" mtduwa psnbrih smmalu patas nii kiya o qtaan plealay ruwahan smmalu patas lblak patas. Mtduwa powda sunan mniq ramas kari kska teumal pusu.",
        "tooltip-summary": "Powda pstmay matas ramas kari",
-       "simpleantispam-label": "Qlhangi pnegkla enlaxan dmuuy pqita.\npowda <strong>aji</strong> ptasi iyax ptasan nii!",
-       "pageinfo-default-sort": "gnama psbkug euda:",
-       "pageinfo-length": "knbragan ruwahan patas ( pnspuan wiyeyn )",
-       "pageinfo-robot-policy": "paah seejiq luqi samaw phiyug patas pnslbu",
-       "pageinfo-few-watchers": "bilaq na $1 seejiq gmraka",
+       "simpleantispam-label": "Qlhangi pnegkla enlaxan dmuuy pqita.\nPowda <strong>aji</strong> ptasi iyax ptasan nii!",
+       "pageinfo-title": "Quri \"$1\"",
+       "pageinfo-default-sort": "Gnama psbkug euda",
+       "pageinfo-length": "Knbragan ruwahan patas (pnspuan wiyeyn)",
+       "pageinfo-robot-policy": "Paah seejiq luqi samaw phiyug patas pnslbu",
+       "pageinfo-few-watchers": "Bilaq na {{PLURAL:$1|$1 seejiq gmraka}}",
        "pageinfo-redirects-name": "Ciyu paah ruwahan patas hini ka psbgurah muda knlala ruwahan patas",
-       "pageinfo-subpages-name": "ruwahan patas nii ka sspug ruwahan patas",
-       "pageinfo-subpages-value": "1 ($2 kngkingal{{PLURAL:$2| brahan muda }}; $3 kngkingal{{PLURAL:$3|aji brahan mudal }})",
+       "pageinfo-subpages-name": "Ruwahan patas nii ka sspug ruwahan patas",
+       "pageinfo-subpages-value": "$1 ($2 kngkingal {{PLURAL:$2|brahan muda}}; $3 kngkingal {{PLURAL:$3|aji brahan mudal}})",
        "pageinfo-recent-edits": "s mnpiya ka smmalu patas snii bi (endaan $1 ruwan)",
-       "pageinfo-magic-words": "psteutux {{PLURAL:$1| patas  }} ($1)",
-       "pageinfo-hidden-categories": "Keelgan lmiing ($1)",
-       "pageinfo-templates": "dmuuy qaya qtaan ($1)",
+       "pageinfo-magic-words": "Psteutux {{PLURAL:$1|patas}} ($1)",
+       "pageinfo-hidden-categories": "{{PLURAL:$1|Keelgan lmiing}} ($1)",
+       "pageinfo-templates": "{{PLURAL:$1|Dmuuy qaya qtaan}} ($1)",
        "pageinfo-toolboxlink": "Kari patas ruwahan patas",
        "pageinfo-contentpage": "Saw endaan kari ruwan ppspug ruwahan patas",
-       "previousdiff": "←smudal hari smmalu patas",
-       "nextdiff": "smmalu patas snii→",
-       "widthheightpage": "$1 × $2, $3 ruwahan patas",
-       "file-info-size": "$1 × $2 patas hnigan, pusu patas prparu ni blbila :$3, MIME mdka hnigan :$4",
-       "file-info-size-pages": "$1 × $2 patas hnigan, pusu patas prparu ni blbila :$3, MIME keelgan hnigan :$4, $5 {{PLURAL:$5| ruwahan patas }}",
-       "file-nohires": "umtduwa mgay ngat mndka msleexan qtaan.",
-       "svg-long-desc": "SVG pusu patas, lipax prparu ni blbila:$1 × $2 patas hnigan, pusu patas prparu ni blbila:$3",
+       "pageinfo-contentpage-yes": "Kiya",
+       "previousdiff": "← Smudal hari smmalu patas",
+       "nextdiff": "Smmalu patas snii →",
+       "widthheightpage": "$1 × $2, $3 {{PLURAL:$3|ruwahan patas}}",
+       "file-info-size": "$1 × $2 patas hnigan, pusu patas prparu ni blbila: $3, MIME mdka hnigan: $4",
+       "file-info-size-pages": "$1 × $2 patas hnigan, pusu patas prparu ni blbila: $3, MIME keelgan hnigan: $4, $5 {{PLURAL:$5|ruwahan patas}}",
+       "file-nohires": "Umtduwa mgay ngat mndka msleexan qtaan.",
+       "svg-long-desc": "SVG pusu patas, lipax prparu ni blbila: $1 × $2 patas hnigan, pusu patas prparu ni blbila: $3",
        "show-big-image": "Ida nkiya pusu patas",
-       "show-big-image-preview": "Muda qmita prparu ni blbila :$1.",
-       "show-big-image-other": "duma {{PLURAL:$2||}} msleexan qtaan:$1",
-       "show-big-image-size": "$1 × $2 patas hnigan",
+       "show-big-image-preview": "Muda qmita prparu ni blbila$1.",
+       "show-big-image-other": "Duma {{PLURAL:$2|msleexan qtaan}}: $1.",
+       "show-big-image-size": "$1 × $2 patas hnigan",
        "newimages-newbies": "Wana pqita bgurah sspgan patas ka suyang qnpahan",
-       "metadata-help": "Kska pusu patas nii supu kana duma pniyahan kari, pniyahan kari nii o yaa bi paah suwi kikay mangal hnigan aji uri o kikay powda miing rnisuh patas ga phiyug aji uri o saw kska suwi endaan mrana da. nasi pusu patas paah balay bi npusu na o wada psbgrahan smmalu\n, duma leexan balay patas o yaa bi ungat klaan mttuku tkkla wada psbgrahan smmalu pusu patas.",
-       "metadata-fields": "Ga kska ka saw pngkla kari bngkgan ka EXIF patas pngkla ngali ka nniqan nii supu kana ka patas pqita ruwahan patas, pida patas pgkla ka smeeliq siida wana pqita truma nii pngkla .\nduma ka patas pngkla o gnama asaw lmiing\n* make\n* model\n* datetimeoriginal\n* exposuretime\n* fnumber\n* isospeedratings\n* focallength\n* artist\n* copyright\n* imagedescription\n* gpslatitude\n* gpslongitude\n* gpsaltitude",
+       "ilsubmit": "Miying",
+       "metadata-help": "Kska pusu patas nii supu kana duma pniyahan kari, pniyahan kari nii o yaa bi paah suwi kikay mangal hnigan aji uri o kikay powda miing rnisuh patas ga phiyug aji uri o saw kska suwi endaan mrana da.\nNasi pusu patas paah balay bi npusu na o wada psbgrahan smmalu, duma leexan balay patas o yaa bi ungat klaan mttuku tkkla wada psbgrahan smmalu pusu patas.",
+       "metadata-fields": "Ga kska ka saw pngkla kari bngkgan ka EXIF patas pngkla ngali ka nniqan nii supu kana ka patas pqita ruwahan patas, pida patas pgkla ka smeeliq siida wana pqita truma nii pngkla.\nDuma ka patas pngkla o gnama asaw lmiing.\n* make\n* model\n* datetimeoriginal\n* exposuretime\n* fnumber\n* isospeedratings\n* focallength\n* artist\n* copyright\n* imagedescription\n* gpslatitude\n* gpslongitude\n* gpsaltitude",
        "namespacesall": "kana",
        "monthsall": "kana",
        "confirm-watch-top": "ngali ka ruwahan patas nii mali leexan patas gmraka su?",
-       "confirm-unwatch-top": "ruwahan patas nii paah leexan patas gmraka kska hdlun pkungat?",
-       "imgmultigo": "muda!",
-       "imgmultigoto": "pquri brah tg $1 ruwahan",
+       "confirm-unwatch-top": "Ruwahan patas nii paah leexan patas gmraka kska hdlun pkungat?",
+       "imgmultigo": "Muda!",
+       "imgmultigoto": "Pquri brah tg $1 ruwahan",
        "img-lang-go": "muda",
        "table_pager_limit_submit": "muda",
        "watchlistedit-raw-title": "leexan patas gmraka ida nkiya smmalu patas",
-       "watchlisttools-view": "qmitaa quri kmpriyux",
-       "watchlisttools-edit": "pqita kiya do smmalu patas leexan patas gmraka",
-       "watchlisttools-raw": "leexan patas gmraka ida nkiya smmalu patas",
-       "signature": "[[{{ns:user}}:$1|$2]] ([[{{ns:user_talk}}:$1| empprngaw ]])",
-       "version-specialpages": "ruwahan patas kmalu",
+       "watchlisttools-view": "Qmitaa quri kmpriyux",
+       "watchlisttools-edit": "Vqita kiya do smmalu patas leexan patas gmraka",
+       "watchlisttools-raw": "Leexan patas gmraka ida nkiya smmalu patas",
+       "signature": "[[{{ns:user}}:$1|$2]] ([[{{ns:user_talk}}:$1|empprngaw]])",
+       "version-specialpages": "Ruwahan patas kmalu",
        "version-ext-colheader-description": "Pgkla rmngaw",
        "version-ext-colheader-credits": "seejiq pnatas",
        "version-libraries-description": "Pgkla rmngaw",
        "version-libraries-authors": "seejiq pnatas",
        "redirect": "Saw pusu patas, seejiq mduuy, ruwahan patas, muda smalu aji uri o jiyax rnisuh patas ID iyah psbgurah muda",
-       "redirect-summary": "ruwahan patas knmalu nii o mtduwa sduuy psbgurah muda bitaq pusu patas ( tmiyuu hangan pusu patas ), ruwahan patas ( tmiyu smalu ID aji uri ruwahan patas ID), seejiq mduuy ruwahan patas ( tmiyu seejiq mduuy ID), aji uri o seejiq keelgan jiyax rnisuh patas ( tmiyu jiyax rnisuh patas ID). dduy[[{{#Special:Redirect}}/file/Example.jpg]], [[{{#Special:Redirect}}/page/64308]], [[{{#Special:Redirect}}/revision/328429]],",
-       "redirect-submit": "muda",
-       "redirect-revision": "muda smalu ruwahan patas ID",
-       "specialpages": "ruwahan patas kmalu",
+       "redirect-summary": "Ruwahan patas knmalu nii o mtduwa sduuy psbgurah muda bitaq pusu patas (tmiyuu hangan pusu patas), ruwahan patas (tmiyu smalu ID aji uri ruwahan patas ID), seejiq mduuy ruwahan patas (tmiyu seejiq mduuy ID), aji uri o seejiq keelgan jiyax rnisuh patas (tmiyu jiyax rnisuh patas ID). Dduy [[{{#Special:Redirect}}/file/Example.jpg]], [[{{#Special:Redirect}}/page/64308]], [[{{#Special:Redirect}}/revision/328429]], [[{{#Special:Redirect}}/user/101]], o [[{{#Special:Redirect}}/logid/186]].",
+       "redirect-submit": "Muda",
+       "redirect-lookup": "Mying:",
+       "redirect-revision": "Muda smalu ruwahan patas ID",
+       "fileduplicatesearch-submit": "Miying",
+       "specialpages": "Ruwahan patas kmalu",
        "specialpages-group-login": "pstmay patas. /phiyug patas sspgan",
-       "tag-filter": "[[Special:Tags| rqci pnskraya ]] miying:",
-       "tag-list-wrapper": "([[Special:Tags|$1 kngkingal rqci pnskraya ]]:$2)",
+       "tag-filter": "[[Special:Tags|Rqci pnskraya]] miying:",
+       "tag-list-wrapper": "[[Special:Tags|{{PLURAL:$1|Kngkingal rqci pnskraya}}]]: $2",
        "tag-mw-rollback": "gbrih duri",
        "tag-mw-undo": "pkbrih",
        "tags-source-header": "pnyahan",
+       "tags-active-yes": "Kiya",
+       "tags-active-no": "Aji",
        "tags-edit": "smmalu patas",
-       "permanentlink": "mggaluk ini kglglug\n(mggaluk mgdhug,mggaluk ana bitaq knuwan)",
-       "htmlform-cloner-delete": "hdlun pkungat",
-       "logentry-delete-delete": "$1 pkungat ruwahan patas $3",
-       "logentry-delete-restore": "$1{{GENDER:$2| psnbrih }} ruwahan patas $3($4)",
-       "logentry-delete-revision": "$1 {{GENDER:$2| wada priyuxan}} ruwahan patas $3 kska {{PLURAL:$5|1 gntuan muda smmalu |$5 gntuan muda smmalu }}ka mtduwa qtaan:$4",
-       "logentry-move-move": "$1 {{GENDER:$2|wada hdlun }} ruwahan patas $3 bitaq $4",
-       "logentry-move-move-noredirect": "$1 {{GENDER:$2| wada hdlun }} ruwahan patas $3 bityaq $4,ini rangi brahan muda",
+       "permanentlink": "Mggaluk ini kglglug",
+       "htmlform-cloner-delete": "Hdlun pkungat",
+       "logentry-delete-delete": "$1 {{GENDER:$2|}}pkungat ruwahan patas $3",
+       "logentry-delete-restore": "$1 {{GENDER:$2|psnbrih}} ruwahan patas $3 ($4)",
+       "logentry-delete-revision": "$1 {{GENDER:$2|wada priyuxan}} ruwahan patas $3 kska {{PLURAL:|$5 gntuan muda smmalu}} ka mtduwa qtaan: $4",
+       "logentry-move-move": "$1 {{GENDER:$2|wada hdlun}} ruwahan patas $3 bitaq $4",
+       "logentry-move-move-noredirect": "$1 {{GENDER:$2|wada hdlun}} ruwahan patas $3 bityaq $4,ini rangi brahan muda",
        "logentry-move-move_redir": "$1 wada hdlun ruwahan patas $3 bitaq $4 kiya o mubung ida nniqan psbgurah muda",
-       "logentry-patrol-patrol-auto": "$1 wada hiya nanak mlglug{{GENDER:$2| pnskraya }} ruwahan patas $3 ka muda smmalu $4 asaw wada daan rmigaw qmita",
+       "logentry-patrol-patrol-auto": "$1 wada hiya nanak mlglug {{GENDER:$2|pnskraya}} ruwahan patas $3 ka muda smmalu $4 asaw wada daan rmigaw qmita",
        "logentry-newusers-newusers": "wada{{GENDER:$2| phiyug }} empduuy patas sspgan $1",
-       "logentry-newusers-create": "wada{{GENDER:$2| phiyug }} empduuy patas sspgan $1",
-       "logentry-newusers-autocreate": "Wada hiya nanak mlglug{{GENDER:$2| phiyug }} mduuy patas sspgan $1",
-       "logentry-upload-upload": "$1 {{GENDER:$2|wada wada pdsun brah }} $3",
-       "logentry-upload-overwrite": "$1 {{GENDER:$2| wada pdsun brah da}}bgurah patas da $3",
-       "logentry-upload-revert": "$1 {{GENDER:$2|wada wada pdsun brah }} $3",
-       "feedback-cancel": "pkungat",
-       "searchsuggest-search": "miying {{SITENAME}}",
-       "duration-days": "jiyax",
-       "log-action-filter-all": "kana",
+       "logentry-newusers-create": "Wada {{GENDER:$2|phiyug}} empduuy patas sspgan $1",
+       "logentry-newusers-autocreate": "Wada hiya nanak mlglug {{GENDER:$2|phiyug}} mduuy patas sspgan $1",
+       "logentry-upload-upload": "$1 {{GENDER:$2|wada wada pdsun brah}} $3",
+       "logentry-upload-overwrite": "$1 {{GENDER:$2|wada pdsun brah da}} bgurah patas da $3",
+       "logentry-upload-revert": "$1 {{GENDER:$2|wada wada pdsun brah}} $3",
+       "feedback-cancel": "Pkungat",
+       "searchsuggest-search": "Miying {{SITENAME}}",
+       "duration-days": "$1 {{PLURAL:$1|jiyax}}",
+       "log-action-filter-all": "Kana",
        "log-action-filter-block-block": "hmuk",
        "authmanager-userdoesnotexist": "seejiq mduuy patas sspgan \"$1\" ini ppatas na."
 }
index 4ea707f..be09343 100644 (file)
        "anontalkpagetext": "----\n<em>这是一个还未建立账户的匿名用户的讨论页, 因此我们只能用IP地址来与他们联络。</em>该IP地址可能由几名用户共享。如果您是一名匿名用户并认为此页上的评语与您无关,请[[Special:CreateAccount|创建新账户]]或[[Special:UserLogin|登录]]以避免在未来与其他匿名用户混淆。",
        "noarticletext": "本页面目前没有内容。您可以在其他页面中[[Special:Search/{{PAGENAME}}|搜索本页标题]]、<span class=\"plainlinks\">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} 搜索相关日志]或[{{fullurl:{{FULLPAGENAME}}|action=edit}} 创建本页面]</span>。",
        "noarticletext-nopermission": "本页面目前没有内容。您可以在其他页面中[[Special:Search/{{PAGENAME}}|搜索本页标题]]或<span class=\"plainlinks\">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} 搜索相关日志]</span>,但您没有权限创建本页面。",
-       "missing-revision": "“{{FULLPAGENAME}}”的版本#$1不存在。\n\n这通常是因为进入了一个已被删除的页面的历史链接。\n详细信息可以在[{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} 删除日志]中找到。",
+       "missing-revision": "“{{FULLPAGENAME}}”的版本#$1不存在。\n\n这通常是因为进入了一个已被删除的页面的历史链接。详细信息可以在[{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} 删除日志]中找到。",
        "userpage-userdoesnotexist": "用户账户“$1”没有注册。请在创建/编辑本页前检查。",
        "userpage-userdoesnotexist-view": "用户账户“$1”没有被注册。",
        "blocked-notice-logextract": "这位用户目前已被封禁。以下提供最近的封禁日志以供参考:",
        "passwordpolicies-policyflag-suggestchangeonlogin": "建议在登录时更改",
        "easydeflate-invaliddeflate": "提供的内容未被适当缩小",
        "unprotected-js": "基于安全原因,JavaScript不能在未保护页面中载入。请在“MediaWiki:”名字空间或者用户子页面中添加JavaScript。",
-       "userlogout-continue": "您确定要登出吗?"
+       "userlogout-continue": "您确定要退出登录吗?"
 }
index 966c9d3..1506e55 100644 (file)
        "anontalkpagetext": "----\n<em>此討論頁面是給尚未建立帳號的匿名使用者使用</em>\n因此我們必須使用 IP 位址來辨識對方,但相同的 IP 位址可能是由許多不同的使用者所共用。\n如果您是匿名使用者並且覺得評論的內容與您無關,請[[Special:CreateAccount|建立新帳號]]或[[Special:UserLogin|登入]]避免與其他匿名使用者混淆。",
        "noarticletext": "此頁面目前沒有內容,您可以在其它頁面中[[Special:Search/{{PAGENAME}}|搜尋此頁面標題]]、<span class=\"plainlinks\">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} 搜尋相關日誌]或[{{fullurl:{{FULLPAGENAME}}|action=edit}} 建立此頁面]</span>。",
        "noarticletext-nopermission": "此頁面目前沒有內容,\n您可以在其它頁面中 [[Special:Search/{{PAGENAME}}|搜尋此頁面標題]],或 <span class=\"plainlinks\">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} 搜尋相關日誌]</span>,但您沒有權限建立此頁面。",
-       "missing-revision": "頁面名稱 \"{{FULLPAGENAME}}\" 的 #$1 修訂版本不存在。\n\n通常是因連結到過期的歷史頁面,該頁面已被刪除。\n詳情請參考 [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} 刪除日誌]。",
+       "missing-revision": "頁面名稱「{{FULLPAGENAME}}」的#$1修訂版本不存在。\n\n通常是因連結到過期的歷史頁面,該頁面已被刪除。詳情請參考[{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} 刪除日誌]。",
        "userpage-userdoesnotexist": "使用者帳號 \"$1\" 尚未註冊。\n若要建立或編輯此頁面,請先檢查清楚。",
        "userpage-userdoesnotexist-view": "使用者帳號 \"$1\" 尚未註冊。",
        "blocked-notice-logextract": "此使用者目前已被封鎖。\n以下為最近的封鎖紀錄以供參考:",
        "tags-deactivate-not-allowed": "無法停用標籤 \"$1\"。",
        "tags-deactivate-submit": "停用",
        "tags-apply-no-permission": "您沒有權限連同您的變更一起套用標籤。",
-       "tags-apply-blocked": "您無法在{{GENDER:$1|您}}被封鎖的情況下套用變更標籤為您的變更。",
+       "tags-apply-blocked": "{{GENDER:$1|您}}無法在被封鎖的情況下套用變更標籤到您的變更中。",
        "tags-apply-not-allowed-one": "不允許手動套用標籤 \"$1\"。",
        "tags-apply-not-allowed-multi": "不允許手動套用以下{{PLURAL:$2|標籤|標籤}}:$1",
        "tags-update-no-permission": "您沒有權限加入與移除任何於各別修訂與日誌項目的標籤",
index 8e2acb2..30982e0 100644 (file)
@@ -17,7 +17,6 @@
  *
  * @file
  * @ingroup Benchmark
- * @author Timo Tijhof
  */
 
 require_once __DIR__ . '/Benchmarker.php';
index 3aa7af7..189da08 100644 (file)
@@ -17,7 +17,6 @@
  *
  * @file
  * @ingroup Benchmark
- * @author Timo Tijhof
  */
 
 require_once __DIR__ . '/Benchmarker.php';
index bb75660..d042fb7 100644 (file)
@@ -17,7 +17,6 @@
  *
  * @file
  * @ingroup Benchmark
- * @author Timo Tijhof
  */
 
 require_once __DIR__ . '/Benchmarker.php';
index 89fc44b..1da805e 100644 (file)
@@ -17,7 +17,6 @@
  *   symbols being documented but not declared or defined.
  *
  * Copyright (C) 2012 Tamas Imrei <tamas.imrei@gmail.com> https://virtualtee.blogspot.com/
- * Copyright (C) 2015 Timo Tijhof
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the "Software"),
index 3b25629..683c319 100644 (file)
@@ -1,7 +1,5 @@
 <?php
 /**
- * Remove all cache entries for ResourceLoader modules from the database.
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -19,7 +17,6 @@
  *
  * @file
  * @ingroup Maintenance
- * @author Timo Tijhof
  */
 
 use Wikimedia\Rdbms\IDatabase;
@@ -27,7 +24,7 @@ use Wikimedia\Rdbms\IDatabase;
 require_once __DIR__ . '/Maintenance.php';
 
 /**
- * Maintenance script to purge the module_deps database cache table.
+ * Maintenance script to purge the module_deps database cache table for ResourceLoader.
  *
  * @ingroup Maintenance
  */
index 15ec62d..b546cbf 100644 (file)
@@ -48,17 +48,16 @@ print Xml::openElement( 'OpenSearchDescription',
                'xmlns' => 'http://a9.com/-/spec/opensearch/1.1/',
                'xmlns:moz' => 'http://www.mozilla.org/2006/browser/search/' ] );
 
-/* The spec says the ShortName must be no longer than 16 characters,
- * but 16 is *realllly* short. In practice, browsers don't appear to care
- * when we give them a longer string, so we're no longer attempting to trim.
- *
- * Note: ShortName and the <link title=""> need to match; they are used as
- * a key for identifying if the search engine has been added already, *and*
- * as the display name presented to the end-user.
- *
- * Behavior seems about the same between Firefox and IE 7/8 here.
- * 'Description' doesn't appear to be used by either.
- */
+// The spec says the ShortName must be no longer than 16 characters,
+// but 16 is *realllly* short. In practice, browsers don't appear to care
+// when we give them a longer string, so we're no longer attempting to trim.
+//
+// Note: ShortName and the <link title=""> need to match; they are used as
+// a key for identifying if the search engine has been added already, *and*
+// as the display name presented to the end-user.
+//
+// Behavior seems about the same between Firefox and IE 7/8 here.
+// 'Description' doesn't appear to be used by either.
 $fullName = wfMessage( 'opensearch-desc' )->inContentLanguage()->text();
 print Xml::element( 'ShortName', null, $fullName );
 print Xml::element( 'Description', null, $fullName );
index 7286812..044b9be 100644 (file)
       "dev": true
     },
     "agent-base": {
-      "version": "4.2.1",
-      "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz",
-      "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==",
+      "version": "4.3.0",
+      "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz",
+      "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==",
       "dev": true,
       "requires": {
         "es6-promisify": "^5.0.0"
       "version": "1.0.10",
       "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
       "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
+      "dev": true,
       "requires": {
         "sprintf-js": "~1.0.2"
       }
       "dev": true
     },
     "babel-runtime": {
-      "version": "5.8.38",
-      "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-5.8.38.tgz",
-      "integrity": "sha1-HAsC62MxL18If/IEUIJ7QlydTBk=",
+      "version": "6.26.0",
+      "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
+      "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
       "dev": true,
       "requires": {
-        "core-js": "^1.0.0"
-      },
-      "dependencies": {
-        "core-js": {
-          "version": "1.2.7",
-          "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz",
-          "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=",
-          "dev": true
-        }
+        "core-js": "^2.4.0",
+        "regenerator-runtime": "^0.11.0"
       }
     },
     "backo2": {
       "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=",
       "dev": true
     },
-    "boom": {
-      "version": "4.3.1",
-      "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz",
-      "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=",
-      "dev": true,
-      "requires": {
-        "hoek": "4.x.x"
-      }
-    },
     "brace-expansion": {
       "version": "1.1.11",
       "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
         "is-supported-regexp-flag": "^1.0.0"
       }
     },
-    "co": {
-      "version": "4.6.0",
-      "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
-      "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=",
-      "dev": true
-    },
     "coa": {
       "version": "2.0.2",
       "resolved": "https://registry.npmjs.org/coa/-/coa-2.0.2.tgz",
         "which": "^1.2.9"
       }
     },
-    "cryptiles": {
-      "version": "3.1.4",
-      "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.4.tgz",
-      "integrity": "sha512-8I1sgZHfVwcSOY6mSGpVU3lw/GSIZvusg8dD2+OGehCJpOhQRLNcH0qb9upQnOH4XhgxxFJSg6E2kx95deb1Tw==",
-      "dev": true,
-      "requires": {
-        "boom": "5.x.x"
-      },
-      "dependencies": {
-        "boom": {
-          "version": "5.2.0",
-          "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz",
-          "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==",
-          "dev": true,
-          "requires": {
-            "hoek": "4.x.x"
-          }
-        }
-      }
-    },
     "css": {
       "version": "2.2.4",
       "resolved": "https://registry.npmjs.org/css/-/css-2.2.4.tgz",
       }
     },
     "es6-promise": {
-      "version": "4.2.6",
-      "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz",
-      "integrity": "sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q==",
+      "version": "4.2.8",
+      "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
+      "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==",
       "dev": true
     },
     "es6-promisify": {
     "esprima": {
       "version": "4.0.1",
       "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
-      "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
+      "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
+      "dev": true
     },
     "esquery": {
       "version": "1.0.1",
           "version": "2.1.1",
           "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
           "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "aproba": {
           "version": "1.2.0",
           "version": "1.0.0",
           "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
           "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "brace-expansion": {
           "version": "1.1.11",
           "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
           "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
           "dev": true,
+          "optional": true,
           "requires": {
             "balanced-match": "^1.0.0",
             "concat-map": "0.0.1"
           "version": "1.1.0",
           "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
           "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "concat-map": {
           "version": "0.0.1",
           "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
           "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "console-control-strings": {
           "version": "1.1.0",
           "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
           "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "core-util-is": {
           "version": "1.0.2",
           "version": "2.0.3",
           "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
           "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "ini": {
           "version": "1.3.5",
           "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
           "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
           "dev": true,
+          "optional": true,
           "requires": {
             "number-is-nan": "^1.0.0"
           }
           "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
           "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
           "dev": true,
+          "optional": true,
           "requires": {
             "brace-expansion": "^1.1.7"
           }
           "version": "0.0.8",
           "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
           "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "minipass": {
           "version": "2.3.5",
           "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz",
           "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==",
           "dev": true,
+          "optional": true,
           "requires": {
             "safe-buffer": "^5.1.2",
             "yallist": "^3.0.0"
           "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
           "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
           "dev": true,
+          "optional": true,
           "requires": {
             "minimist": "0.0.8"
           }
           "version": "1.0.1",
           "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
           "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "object-assign": {
           "version": "4.1.1",
           "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
           "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
           "dev": true,
+          "optional": true,
           "requires": {
             "wrappy": "1"
           }
           "version": "5.1.2",
           "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
           "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "safer-buffer": {
           "version": "2.1.2",
           "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
           "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
           "dev": true,
+          "optional": true,
           "requires": {
             "code-point-at": "^1.0.0",
             "is-fullwidth-code-point": "^1.0.0",
           "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
           "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
           "dev": true,
+          "optional": true,
           "requires": {
             "ansi-regex": "^2.0.0"
           }
           "version": "1.0.2",
           "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
           "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "yallist": {
           "version": "3.0.3",
           "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz",
           "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==",
-          "dev": true
+          "dev": true,
+          "optional": true
         }
       }
     },
       "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==",
       "dev": true
     },
+    "grapheme-splitter": {
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz",
+      "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==",
+      "dev": true
+    },
     "growl": {
       "version": "1.10.5",
       "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz",
         }
       }
     },
-    "hawk": {
-      "version": "6.0.2",
-      "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz",
-      "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==",
-      "dev": true,
-      "requires": {
-        "boom": "4.x.x",
-        "cryptiles": "3.x.x",
-        "hoek": "4.x.x",
-        "sntp": "2.x.x"
-      }
-    },
     "he": {
       "version": "1.1.1",
       "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz",
       "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=",
       "dev": true
     },
-    "hoek": {
-      "version": "4.2.1",
-      "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz",
-      "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==",
-      "dev": true
-    },
     "hooker": {
       "version": "0.2.3",
       "resolved": "https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz",
       }
     },
     "https-proxy-agent": {
-      "version": "2.2.1",
-      "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz",
-      "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==",
+      "version": "2.2.2",
+      "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz",
+      "integrity": "sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg==",
       "dev": true,
       "requires": {
-        "agent-base": "^4.1.0",
+        "agent-base": "^4.3.0",
         "debug": "^3.1.0"
       },
       "dependencies": {
       }
     },
     "humanize-duration": {
-      "version": "3.18.0",
-      "resolved": "https://registry.npmjs.org/humanize-duration/-/humanize-duration-3.18.0.tgz",
-      "integrity": "sha512-reYy4EJMqlhX13TDlgSqLYfVGKOoixoEzsSL6DBlp22dScWN8Q2eMgDF4L0q28mzbgO40rnBy3WyEUQEhfYALw==",
+      "version": "3.15.3",
+      "resolved": "https://registry.npmjs.org/humanize-duration/-/humanize-duration-3.15.3.tgz",
+      "integrity": "sha512-BMz6w8p3NVa6QP9wDtqUkXfwgBqDaZ5z/np0EYdoWrLqL849Onp6JWMXMhbHtuvO9jUThLN5H1ThRQ8dUWnYkA==",
       "dev": true
     },
     "iconv-lite": {
       "version": "3.13.1",
       "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
       "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
+      "dev": true,
       "requires": {
         "argparse": "^1.0.7",
         "esprima": "^4.0.0"
       "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==",
       "dev": true
     },
+    "lodash.get": {
+      "version": "4.4.2",
+      "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
+      "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=",
+      "dev": true
+    },
     "log-symbols": {
       "version": "2.2.0",
       "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz",
       "dev": true
     },
     "sauce-connect-launcher": {
-      "version": "1.2.6",
-      "resolved": "https://registry.npmjs.org/sauce-connect-launcher/-/sauce-connect-launcher-1.2.6.tgz",
-      "integrity": "sha512-yBTYfzI6AWRwoXJoIqmVgz+eCpWX6CsJ4Ap8fowjsGlN+27OKbnQxv6POd4Rzh57BH9WeA9K8orIzNxO8mMBQA==",
+      "version": "1.2.7",
+      "resolved": "https://registry.npmjs.org/sauce-connect-launcher/-/sauce-connect-launcher-1.2.7.tgz",
+      "integrity": "sha512-v07+QhFrxgz3seMFuRSonu3gW1s6DbcLQlFhjsRrmKUauzPbbudHdnn91WYgEwhoZVdPNzeZpAEJwcQyd9xnTA==",
       "dev": true,
       "requires": {
         "adm-zip": "~0.4.3",
         }
       }
     },
-    "sntp": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz",
-      "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==",
-      "dev": true,
-      "requires": {
-        "hoek": "4.x.x"
-      }
-    },
     "socket.io": {
       "version": "2.1.1",
       "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.1.1.tgz",
     "sprintf-js": {
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
-      "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
+      "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
+      "dev": true
     },
     "sshpk": {
       "version": "1.16.1",
         "is-hexadecimal": "^1.0.0"
       }
     },
-    "stringstream": {
-      "version": "0.0.6",
-      "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.6.tgz",
-      "integrity": "sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA==",
-      "dev": true
-    },
     "strip-ansi": {
       "version": "4.0.0",
       "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
       "dev": true
     },
     "wdio-junit-reporter": {
-      "version": "0.2.0",
-      "resolved": "https://registry.npmjs.org/wdio-junit-reporter/-/wdio-junit-reporter-0.2.0.tgz",
-      "integrity": "sha1-88QXRHftcXN2k9wKFBU6wEhiG8g=",
+      "version": "0.4.4",
+      "resolved": "https://registry.npmjs.org/wdio-junit-reporter/-/wdio-junit-reporter-0.4.4.tgz",
+      "integrity": "sha512-EE5b7dnQ5yOCGVM48ItdJg9KJHpqCk8w0GL2rhwP+K9FPHhIokEAR0zZq5MqW8wRPR0ibWUmQKUN7D4ED85XLA==",
       "dev": true,
       "requires": {
-        "babel-runtime": "^5.8.25",
-        "junit-report-builder": "^1.1.1",
-        "mkdirp": "^0.5.1"
-      },
-      "dependencies": {
-        "babel-runtime": {
-          "version": "5.8.38",
-          "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-5.8.38.tgz",
-          "integrity": "sha1-HAsC62MxL18If/IEUIJ7QlydTBk=",
-          "dev": true,
-          "requires": {
-            "core-js": "^1.0.0"
-          }
-        },
-        "core-js": {
-          "version": "1.2.7",
-          "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz",
-          "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=",
-          "dev": true
-        }
+        "junit-report-builder": "~1.3.0",
+        "lodash.get": "^4.4.2",
+        "mkdirp": "~0.5.1"
       }
     },
     "wdio-mediawiki": {
       }
     },
     "wdio-sauce-service": {
-      "version": "0.3.1",
-      "resolved": "https://registry.npmjs.org/wdio-sauce-service/-/wdio-sauce-service-0.3.1.tgz",
-      "integrity": "sha1-++wJG+UeaUgkGnsMdmAKfnguqM0=",
+      "version": "0.4.14",
+      "resolved": "https://registry.npmjs.org/wdio-sauce-service/-/wdio-sauce-service-0.4.14.tgz",
+      "integrity": "sha512-LlnMHVzbuaF69CzcqzJiMAkJbdOTlsX3vRqD4cf3eE3UTC6rdRN9DhFCFBeQq6KW1L2bE1LbegFteo0V4Nilkw==",
       "dev": true,
       "requires": {
-        "request": "^2.67.0",
-        "sauce-connect-launcher": "^1.1.1"
+        "request": "^2.88.0",
+        "sauce-connect-launcher": "~1.2.3"
       }
     },
     "wdio-spec-reporter": {
-      "version": "0.0.5",
-      "resolved": "https://registry.npmjs.org/wdio-spec-reporter/-/wdio-spec-reporter-0.0.5.tgz",
-      "integrity": "sha1-0PuP0UrxU/4BAFG7dAqjCrMQY/U=",
+      "version": "0.1.5",
+      "resolved": "https://registry.npmjs.org/wdio-spec-reporter/-/wdio-spec-reporter-0.1.5.tgz",
+      "integrity": "sha512-MqvgTow8hFwhFT47q67JwyJyeynKodGRQCxF7ijKPGfsaG1NLssbXYc0JhiL7SiAyxnQxII0UxzTCd3I6sEdkg==",
       "dev": true,
       "requires": {
-        "babel-runtime": "^5.8.25",
-        "humanize-duration": "^3.9.0"
+        "babel-runtime": "~6.26.0",
+        "chalk": "^2.3.0",
+        "humanize-duration": "~3.15.0"
       }
     },
     "wdio-sync": {
       }
     },
     "webdriverio": {
-      "version": "4.12.0",
-      "resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-4.12.0.tgz",
-      "integrity": "sha1-40De8nIYPIFopN0LOCMi+de+4Q0=",
+      "version": "4.14.4",
+      "resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-4.14.4.tgz",
+      "integrity": "sha512-Knp2vzuzP5c5ybgLu+zTwy/l1Gh0bRP4zAr8NWcrStbuomm9Krn9oRF0rZucT6AyORpXinETzmeowFwIoo7mNA==",
       "dev": true,
       "requires": {
         "archiver": "~2.1.0",
         "babel-runtime": "^6.26.0",
-        "css-parse": "~2.0.0",
+        "css-parse": "^2.0.0",
         "css-value": "~0.0.1",
         "deepmerge": "~2.0.1",
         "ejs": "~2.5.6",
         "gaze": "~1.1.2",
         "glob": "~7.1.1",
+        "grapheme-splitter": "^1.0.2",
         "inquirer": "~3.3.0",
         "json-stringify-safe": "~5.0.1",
         "mkdirp": "~0.5.1",
         "npm-install-package": "~2.1.0",
         "optimist": "~0.6.1",
         "q": "~1.5.0",
-        "request": "~2.83.0",
-        "rgb2hex": "~0.1.0",
+        "request": "^2.83.0",
+        "rgb2hex": "^0.1.9",
         "safe-buffer": "~5.1.1",
         "supports-color": "~5.0.0",
         "url": "~0.11.0",
         "wgxpath": "~1.0.0"
       },
       "dependencies": {
-        "ajv": {
-          "version": "5.5.2",
-          "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
-          "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=",
-          "dev": true,
-          "requires": {
-            "co": "^4.6.0",
-            "fast-deep-equal": "^1.0.0",
-            "fast-json-stable-stringify": "^2.0.0",
-            "json-schema-traverse": "^0.3.0"
-          }
-        },
-        "babel-runtime": {
-          "version": "6.26.0",
-          "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
-          "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
-          "dev": true,
-          "requires": {
-            "core-js": "^2.4.0",
-            "regenerator-runtime": "^0.11.0"
-          }
-        },
         "chardet": {
           "version": "0.4.2",
           "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz",
             "tmp": "^0.0.33"
           }
         },
-        "fast-deep-equal": {
-          "version": "1.1.0",
-          "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz",
-          "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=",
-          "dev": true
-        },
-        "har-validator": {
-          "version": "5.0.3",
-          "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz",
-          "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=",
-          "dev": true,
-          "requires": {
-            "ajv": "^5.1.0",
-            "har-schema": "^2.0.0"
-          }
-        },
         "has-flag": {
           "version": "2.0.0",
           "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
             "through": "^2.3.6"
           }
         },
-        "json-schema-traverse": {
-          "version": "0.3.1",
-          "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz",
-          "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=",
-          "dev": true
-        },
-        "oauth-sign": {
-          "version": "0.8.2",
-          "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz",
-          "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=",
-          "dev": true
-        },
-        "punycode": {
-          "version": "1.4.1",
-          "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
-          "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=",
-          "dev": true
-        },
-        "qs": {
-          "version": "6.5.2",
-          "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
-          "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==",
-          "dev": true
-        },
-        "request": {
-          "version": "2.83.0",
-          "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz",
-          "integrity": "sha512-lR3gD69osqm6EYLk9wB/G1W/laGWjzH90t1vEa2xuxHD5KUrSzp9pUSfTm+YC5Nxt2T8nMPEvKlhbQayU7bgFw==",
-          "dev": true,
-          "requires": {
-            "aws-sign2": "~0.7.0",
-            "aws4": "^1.6.0",
-            "caseless": "~0.12.0",
-            "combined-stream": "~1.0.5",
-            "extend": "~3.0.1",
-            "forever-agent": "~0.6.1",
-            "form-data": "~2.3.1",
-            "har-validator": "~5.0.3",
-            "hawk": "~6.0.2",
-            "http-signature": "~1.2.0",
-            "is-typedarray": "~1.0.0",
-            "isstream": "~0.1.2",
-            "json-stringify-safe": "~5.0.1",
-            "mime-types": "~2.1.17",
-            "oauth-sign": "~0.8.2",
-            "performance-now": "^2.1.0",
-            "qs": "~6.5.1",
-            "safe-buffer": "^5.1.1",
-            "stringstream": "~0.0.5",
-            "tough-cookie": "~2.3.3",
-            "tunnel-agent": "^0.6.0",
-            "uuid": "^3.1.0"
-          }
-        },
         "supports-color": {
           "version": "5.0.1",
           "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.0.1.tgz",
           "requires": {
             "has-flag": "^2.0.0"
           }
-        },
-        "tough-cookie": {
-          "version": "2.3.4",
-          "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz",
-          "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==",
-          "dev": true,
-          "requires": {
-            "punycode": "^1.4.1"
-          }
         }
       }
     },
index f9fe5cb..f16b605 100644 (file)
     "postcss-less": "2.0.0",
     "qunit": "2.9.1",
     "stylelint-config-wikimedia": "0.6.0",
-    "wdio-junit-reporter": "0.2.0",
+    "wdio-junit-reporter": "0.4.4",
     "wdio-mediawiki": "file:tests/selenium/wdio-mediawiki",
     "wdio-mocha-framework": "0.6.4",
-    "wdio-sauce-service": "0.3.1",
-    "wdio-spec-reporter": "0.0.5",
-    "webdriverio": "4.12.0"
+    "wdio-sauce-service": "0.4.14",
+    "wdio-spec-reporter": "0.1.5",
+    "webdriverio": "4.14.4"
   }
 }
index c24e3eb..6298086 100644 (file)
@@ -39,11 +39,6 @@ return [
                'class' => ResourceLoaderWikiModule::class,
                'styles' => [ 'MediaWiki:Filepage.css' ],
        ],
-       'user.groups' => [
-               // Merged into 'user' since MediaWiki 1.28 - kept for back-compat
-               'dependencies' => 'user',
-               'targets' => [ 'desktop', 'mobile' ],
-       ],
 
        // Scripts managed by the current user (stored in their user space)
        'user' => [ 'class' => ResourceLoaderUserModule::class ],
index 66c1fe7..36a0195 100644 (file)
@@ -2,8 +2,7 @@
        'use strict';
 
        var util,
-               config = require( './config.json' ),
-               origConfig = config;
+               config = require( './config.json' );
 
        /**
         * Encode the string like PHP's rawurlencode
         */
        util = {
 
-               /* Main body */
-
-               setOptionsForTest: function ( opts ) {
-                       if ( !window.QUnit ) {
-                               throw new Error( 'Modifying options not allowed outside unit tests' );
-                       }
-                       config = $.extend( {}, config, opts );
-               },
-
-               resetOptionsForTest: function () {
-                       if ( !window.QUnit ) {
-                               throw new Error( 'Resetting options not allowed outside unit tests' );
-                       }
-                       config = origConfig;
-               },
-
                /**
                 * Encode the string like PHP's rawurlencode
                 *
                }
        };
 
+       // Not allowed outside unit tests
+       if ( window.QUnit ) {
+               util.setOptionsForTest = function ( opts ) {
+                       var oldConfig = config;
+                       config = $.extend( {}, config, opts );
+                       return oldConfig;
+               };
+       }
+
        /**
         * Initialisation of mw.util.$content
         */
index 5e9b6ab..0f044f8 100644 (file)
@@ -1,7 +1,6 @@
 /*!
  * Augment mw.loader to facilitate module-level profiling.
  *
- * @author Timo Tijhof
  * @since 1.32
  */
 /* global mw */
index 1065c2f..3f0fc7a 100644 (file)
@@ -31,4 +31,26 @@ abstract class MediaWikiUnitTestCase extends TestCase {
        use PHPUnit4And6Compat;
        use MediaWikiCoversValidator;
 
+       private $unitGlobals = [];
+
+       protected function setUp() {
+               parent::setUp();
+               $reflection = new ReflectionClass( $this );
+               if ( strpos( $reflection->getFilename(), '/unit/' ) === false ) {
+                       $this->fail( 'This unit test needs to be in "tests/phpunit/unit" !' );
+               }
+               $this->unitGlobals = $GLOBALS;
+               unset( $GLOBALS );
+               $GLOBALS = [];
+               // Add back the minimal set of globals needed for unit tests to run for core +
+               // extensions/skins.
+               foreach ( [ 'wgAutoloadClasses', 'wgAutoloadLocalClasses', 'IP' ] as $requiredGlobal ) {
+                       $GLOBALS[$requiredGlobal] = $this->unitGlobals[ $requiredGlobal ];
+               }
+       }
+
+       protected function tearDown() {
+               $GLOBALS = $this->unitGlobals;
+               parent::tearDown();
+       }
 }
diff --git a/tests/phpunit/includes/DerivativeRequestTest.php b/tests/phpunit/includes/DerivativeRequestTest.php
deleted file mode 100644 (file)
index f33022b..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-/**
- * @covers DerivativeRequest
- */
-class DerivativeRequestTest extends PHPUnit\Framework\TestCase {
-
-       public function testSetIp() {
-               $original = new WebRequest();
-               $original->setIP( '1.2.3.4' );
-               $derivative = new DerivativeRequest( $original, [] );
-
-               $this->assertEquals( '1.2.3.4', $derivative->getIP() );
-
-               $derivative->setIP( '5.6.7.8' );
-
-               $this->assertEquals( '5.6.7.8', $derivative->getIP() );
-               $this->assertEquals( '1.2.3.4', $original->getIP() );
-       }
-
-}
diff --git a/tests/phpunit/includes/MediaWikiVersionFetcherTest.php b/tests/phpunit/includes/MediaWikiVersionFetcherTest.php
new file mode 100644 (file)
index 0000000..8f0a44d
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * Note: this is not a unit test, as it touches the file system and reads an actual file.
+ * If unit tests are added for MediaWikiVersionFetcher, this should be done in a distinct test case.
+ *
+ * @covers MediaWikiVersionFetcher
+ *
+ * @group ComposerHooks
+ *
+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
+ */
+class MediaWikiVersionFetcherTest extends \MediaWikiIntegrationTestCase {
+
+       public function testReturnsResult() {
+               global $wgVersion;
+               $versionFetcher = new MediaWikiVersionFetcher();
+               $this->assertSame( $wgVersion, $versionFetcher->fetchVersion() );
+       }
+
+}
diff --git a/tests/phpunit/includes/Revision/RevisionStoreFactoryTest.php b/tests/phpunit/includes/Revision/RevisionStoreFactoryTest.php
new file mode 100644 (file)
index 0000000..f4d324d
--- /dev/null
@@ -0,0 +1,193 @@
+<?php
+
+namespace MediaWiki\Tests\Revision;
+
+use ActorMigration;
+use CommentStore;
+use MediaWiki\Logger\Spi as LoggerSpi;
+use MediaWiki\Revision\RevisionStore;
+use MediaWiki\Revision\RevisionStoreFactory;
+use MediaWiki\Revision\SlotRoleRegistry;
+use MediaWiki\Storage\BlobStore;
+use MediaWiki\Storage\BlobStoreFactory;
+use MediaWiki\Storage\NameTableStore;
+use MediaWiki\Storage\NameTableStoreFactory;
+use MediaWiki\Storage\SqlBlobStore;
+use Psr\Log\LoggerInterface;
+use Psr\Log\NullLogger;
+use WANObjectCache;
+use Wikimedia\Rdbms\ILBFactory;
+use Wikimedia\Rdbms\ILoadBalancer;
+use Wikimedia\TestingAccessWrapper;
+
+class RevisionStoreFactoryTest extends \MediaWikiIntegrationTestCase {
+
+       /**
+        * @covers \MediaWiki\Revision\RevisionStoreFactory::__construct
+        */
+       public function testValidConstruction_doesntCauseErrors() {
+               new RevisionStoreFactory(
+                       $this->getMockLoadBalancerFactory(),
+                       $this->getMockBlobStoreFactory(),
+                       $this->getNameTableStoreFactory(),
+                       $this->getMockSlotRoleRegistry(),
+                       $this->getHashWANObjectCache(),
+                       $this->getMockCommentStore(),
+                       ActorMigration::newMigration(),
+                       MIGRATION_OLD,
+                       $this->getMockLoggerSpi(),
+                       true
+               );
+               $this->assertTrue( true );
+       }
+
+       public function provideWikiIds() {
+               yield [ true ];
+               yield [ false ];
+               yield [ 'somewiki' ];
+               yield [ 'somewiki', MIGRATION_OLD , false ];
+               yield [ 'somewiki', MIGRATION_NEW , true ];
+       }
+
+       /**
+        * @dataProvider provideWikiIds
+        * @covers \MediaWiki\Revision\RevisionStoreFactory::getRevisionStore
+        */
+       public function testGetRevisionStore(
+               $dbDomain,
+               $mcrMigrationStage = MIGRATION_OLD,
+               $contentHandlerUseDb = true
+       ) {
+               $lbFactory = $this->getMockLoadBalancerFactory();
+               $blobStoreFactory = $this->getMockBlobStoreFactory();
+               $nameTableStoreFactory = $this->getNameTableStoreFactory();
+               $slotRoleRegistry = $this->getMockSlotRoleRegistry();
+               $cache = $this->getHashWANObjectCache();
+               $commentStore = $this->getMockCommentStore();
+               $actorMigration = ActorMigration::newMigration();
+               $loggerProvider = $this->getMockLoggerSpi();
+
+               $factory = new RevisionStoreFactory(
+                       $lbFactory,
+                       $blobStoreFactory,
+                       $nameTableStoreFactory,
+                       $slotRoleRegistry,
+                       $cache,
+                       $commentStore,
+                       $actorMigration,
+                       $mcrMigrationStage,
+                       $loggerProvider,
+                       $contentHandlerUseDb
+               );
+
+               $store = $factory->getRevisionStore( $dbDomain );
+               $wrapper = TestingAccessWrapper::newFromObject( $store );
+
+               // ensure the correct object type is returned
+               $this->assertInstanceOf( RevisionStore::class, $store );
+
+               // ensure the RevisionStore is for the given wikiId
+               $this->assertSame( $dbDomain, $wrapper->dbDomain );
+
+               // ensure all other required services are correctly set
+               $this->assertSame( $cache, $wrapper->cache );
+               $this->assertSame( $commentStore, $wrapper->commentStore );
+               $this->assertSame( $mcrMigrationStage, $wrapper->mcrMigrationStage );
+               $this->assertSame( $actorMigration, $wrapper->actorMigration );
+               $this->assertSame( $contentHandlerUseDb, $store->getContentHandlerUseDB() );
+
+               $this->assertInstanceOf( ILoadBalancer::class, $wrapper->loadBalancer );
+               $this->assertInstanceOf( BlobStore::class, $wrapper->blobStore );
+               $this->assertInstanceOf( NameTableStore::class, $wrapper->contentModelStore );
+               $this->assertInstanceOf( NameTableStore::class, $wrapper->slotRoleStore );
+               $this->assertInstanceOf( LoggerInterface::class, $wrapper->logger );
+       }
+
+       /**
+        * @return \PHPUnit_Framework_MockObject_MockObject|ILoadBalancer
+        */
+       private function getMockLoadBalancer() {
+               return $this->getMockBuilder( ILoadBalancer::class )
+                       ->disableOriginalConstructor()->getMock();
+       }
+
+       /**
+        * @return \PHPUnit_Framework_MockObject_MockObject|ILBFactory
+        */
+       private function getMockLoadBalancerFactory() {
+               $mock = $this->getMockBuilder( ILBFactory::class )
+                       ->disableOriginalConstructor()->getMock();
+
+               $mock->method( 'getMainLB' )
+                       ->willReturnCallback( function () {
+                               return $this->getMockLoadBalancer();
+                       } );
+
+               return $mock;
+       }
+
+       /**
+        * @return \PHPUnit_Framework_MockObject_MockObject|SqlBlobStore
+        */
+       private function getMockSqlBlobStore() {
+               return $this->getMockBuilder( SqlBlobStore::class )
+                       ->disableOriginalConstructor()->getMock();
+       }
+
+       /**
+        * @return \PHPUnit_Framework_MockObject_MockObject|BlobStoreFactory
+        */
+       private function getMockBlobStoreFactory() {
+               $mock = $this->getMockBuilder( BlobStoreFactory::class )
+                       ->disableOriginalConstructor()->getMock();
+
+               $mock->method( 'newSqlBlobStore' )
+                       ->willReturnCallback( function () {
+                               return $this->getMockSqlBlobStore();
+                       } );
+
+               return $mock;
+       }
+
+       /**
+        * @return SlotRoleRegistry
+        */
+       private function getMockSlotRoleRegistry() {
+               return $this->createMock( SlotRoleRegistry::class );
+       }
+
+       /**
+        * @return NameTableStoreFactory
+        */
+       private function getNameTableStoreFactory() {
+               return new NameTableStoreFactory(
+                       $this->getMockLoadBalancerFactory(),
+                       $this->getHashWANObjectCache(),
+                       new NullLogger() );
+       }
+
+       /**
+        * @return \PHPUnit_Framework_MockObject_MockObject|CommentStore
+        */
+       private function getMockCommentStore() {
+               return $this->getMockBuilder( CommentStore::class )
+                       ->disableOriginalConstructor()->getMock();
+       }
+
+       private function getHashWANObjectCache() {
+               return new WANObjectCache( [ 'cache' => new \HashBagOStuff() ] );
+       }
+
+       /**
+        * @return \PHPUnit_Framework_MockObject_MockObject|LoggerSpi
+        */
+       private function getMockLoggerSpi() {
+               $mock = $this->getMock( LoggerSpi::class );
+
+               $mock->method( 'getLogger' )
+                       ->willReturn( new NullLogger() );
+
+               return $mock;
+       }
+
+}
diff --git a/tests/phpunit/includes/SanitizerValidateEmailTest.php b/tests/phpunit/includes/SanitizerValidateEmailTest.php
deleted file mode 100644 (file)
index c4e4308..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-<?php
-
-/**
- * @covers Sanitizer::validateEmail
- * @todo all test methods in this class should be refactored and...
- *    use a single test method and a single data provider...
- */
-class SanitizerValidateEmailTest extends PHPUnit\Framework\TestCase {
-
-       use MediaWikiCoversValidator;
-
-       private function checkEmail( $addr, $expected = true, $msg = '' ) {
-               if ( $msg == '' ) {
-                       $msg = "Testing $addr";
-               }
-
-               $this->assertEquals(
-                       $expected,
-                       Sanitizer::validateEmail( $addr ),
-                       $msg
-               );
-       }
-
-       private function valid( $addr, $msg = '' ) {
-               $this->checkEmail( $addr, true, $msg );
-       }
-
-       private function invalid( $addr, $msg = '' ) {
-               $this->checkEmail( $addr, false, $msg );
-       }
-
-       public function testEmailWellKnownUserAtHostDotTldAreValid() {
-               $this->valid( 'user@example.com' );
-               $this->valid( 'user@example.museum' );
-       }
-
-       public function testEmailWithUpperCaseCharactersAreValid() {
-               $this->valid( 'USER@example.com' );
-               $this->valid( 'user@EXAMPLE.COM' );
-               $this->valid( 'user@Example.com' );
-               $this->valid( 'USER@eXAMPLE.com' );
-       }
-
-       public function testEmailWithAPlusInUserName() {
-               $this->valid( 'user+sub@example.com' );
-               $this->valid( 'user+@example.com' );
-       }
-
-       public function testEmailDoesNotNeedATopLevelDomain() {
-               $this->valid( "user@localhost" );
-               $this->valid( "FooBar@localdomain" );
-               $this->valid( "nobody@mycompany" );
-       }
-
-       public function testEmailWithWhiteSpacesBeforeOrAfterAreInvalids() {
-               $this->invalid( " user@host.com" );
-               $this->invalid( "user@host.com " );
-               $this->invalid( "\tuser@host.com" );
-               $this->invalid( "user@host.com\t" );
-       }
-
-       public function testEmailWithWhiteSpacesAreInvalids() {
-               $this->invalid( "User user@host" );
-               $this->invalid( "first last@mycompany" );
-               $this->invalid( "firstlast@my company" );
-       }
-
-       /**
-        * T28948 : comma were matched by an incorrect regexp range
-        */
-       public function testEmailWithCommasAreInvalids() {
-               $this->invalid( "user,foo@example.org" );
-               $this->invalid( "userfoo@ex,ample.org" );
-       }
-
-       public function testEmailWithHyphens() {
-               $this->valid( "user-foo@example.org" );
-               $this->valid( "userfoo@ex-ample.org" );
-       }
-
-       public function testEmailDomainCanNotBeginWithDot() {
-               $this->invalid( "user@." );
-               $this->invalid( "user@.localdomain" );
-               $this->invalid( "user@localdomain." );
-               $this->valid( "user.@localdomain" );
-               $this->valid( ".@localdomain" );
-               $this->invalid( ".@a............" );
-       }
-
-       public function testEmailWithFunnyCharacters() {
-               $this->valid( "\$user!ex{this}@123.com" );
-       }
-
-       public function testEmailTopLevelDomainCanBeNumerical() {
-               $this->valid( "user@example.1234" );
-       }
-
-       public function testEmailWithoutAtSignIsInvalid() {
-               $this->invalid( 'useràexample.com' );
-       }
-
-       public function testEmailWithOneCharacterDomainIsValid() {
-               $this->valid( 'user@a' );
-       }
-}
diff --git a/tests/phpunit/includes/XmlJsTest.php b/tests/phpunit/includes/XmlJsTest.php
deleted file mode 100644 (file)
index c7975ef..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-
-/**
- * @group Xml
- */
-class XmlJsTest extends PHPUnit\Framework\TestCase {
-
-       use MediaWikiCoversValidator;
-
-       /**
-        * @covers XmlJsCode::__construct
-        * @dataProvider provideConstruction
-        */
-       public function testConstruction( $value ) {
-               $obj = new XmlJsCode( $value );
-               $this->assertEquals( $value, $obj->value );
-       }
-
-       public static function provideConstruction() {
-               return [
-                       [ null ],
-                       [ '' ],
-               ];
-       }
-
-}
diff --git a/tests/phpunit/includes/composer/ComposerVersionNormalizerTest.php b/tests/phpunit/includes/composer/ComposerVersionNormalizerTest.php
deleted file mode 100644 (file)
index c5c0dc7..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-<?php
-
-/**
- * @covers ComposerVersionNormalizer
- *
- * @group ComposerHooks
- *
- * @author Jeroen De Dauw < jeroendedauw@gmail.com >
- */
-class ComposerVersionNormalizerTest extends PHPUnit\Framework\TestCase {
-
-       use MediaWikiCoversValidator;
-       use PHPUnit4And6Compat;
-
-       /**
-        * @dataProvider nonStringProvider
-        */
-       public function testGivenNonString_normalizeThrowsInvalidArgumentException( $nonString ) {
-               $normalizer = new ComposerVersionNormalizer();
-
-               $this->setExpectedException( InvalidArgumentException::class );
-               $normalizer->normalizeSuffix( $nonString );
-       }
-
-       public function nonStringProvider() {
-               return [
-                       [ null ],
-                       [ 42 ],
-                       [ [] ],
-                       [ new stdClass() ],
-                       [ true ],
-               ];
-       }
-
-       /**
-        * @dataProvider simpleVersionProvider
-        */
-       public function testGivenSimpleVersion_normalizeSuffixReturnsAsIs( $simpleVersion ) {
-               $this->assertRemainsUnchanged( $simpleVersion );
-       }
-
-       protected function assertRemainsUnchanged( $version ) {
-               $normalizer = new ComposerVersionNormalizer();
-
-               $this->assertEquals(
-                       $version,
-                       $normalizer->normalizeSuffix( $version )
-               );
-       }
-
-       public function simpleVersionProvider() {
-               return [
-                       [ '1.22.0' ],
-                       [ '1.19.2' ],
-                       [ '1.19.2.0' ],
-                       [ '1.9' ],
-                       [ '123.321.456.654' ],
-               ];
-       }
-
-       /**
-        * @dataProvider complexVersionProvider
-        */
-       public function testGivenComplexVersionWithoutDash_normalizeSuffixAddsDash(
-               $withoutDash, $withDash
-       ) {
-               $normalizer = new ComposerVersionNormalizer();
-
-               $this->assertEquals(
-                       $withDash,
-                       $normalizer->normalizeSuffix( $withoutDash )
-               );
-       }
-
-       public function complexVersionProvider() {
-               return [
-                       [ '1.22.0alpha', '1.22.0-alpha' ],
-                       [ '1.22.0RC', '1.22.0-RC' ],
-                       [ '1.19beta', '1.19-beta' ],
-                       [ '1.9RC4', '1.9-RC4' ],
-                       [ '1.9.1.2RC4', '1.9.1.2-RC4' ],
-                       [ '1.9.1.2RC', '1.9.1.2-RC' ],
-                       [ '123.321.456.654RC9001', '123.321.456.654-RC9001' ],
-               ];
-       }
-
-       /**
-        * @dataProvider complexVersionProvider
-        */
-       public function testGivenComplexVersionWithDash_normalizeSuffixReturnsAsIs(
-               $withoutDash, $withDash
-       ) {
-               $this->assertRemainsUnchanged( $withDash );
-       }
-
-       /**
-        * @dataProvider fourLevelVersionsProvider
-        */
-       public function testGivenFourLevels_levelCountNormalizationDoesNothing( $version ) {
-               $normalizer = new ComposerVersionNormalizer();
-
-               $this->assertEquals(
-                       $version,
-                       $normalizer->normalizeLevelCount( $version )
-               );
-       }
-
-       public function fourLevelVersionsProvider() {
-               return [
-                       [ '1.22.0.0' ],
-                       [ '1.19.2.4' ],
-                       [ '1.19.2.0' ],
-                       [ '1.9.0.1' ],
-                       [ '123.321.456.654' ],
-                       [ '123.321.456.654RC4' ],
-                       [ '123.321.456.654-RC4' ],
-               ];
-       }
-
-       /**
-        * @dataProvider levelNormalizationProvider
-        */
-       public function testGivenFewerLevels_levelCountNormalizationEnsuresFourLevels(
-               $expected, $version
-       ) {
-               $normalizer = new ComposerVersionNormalizer();
-
-               $this->assertEquals(
-                       $expected,
-                       $normalizer->normalizeLevelCount( $version )
-               );
-       }
-
-       public function levelNormalizationProvider() {
-               return [
-                       [ '1.22.0.0', '1.22' ],
-                       [ '1.22.0.0', '1.22.0' ],
-                       [ '1.19.2.0', '1.19.2' ],
-                       [ '12345.0.0.0', '12345' ],
-                       [ '12345.0.0.0-RC4', '12345-RC4' ],
-                       [ '12345.0.0.0-alpha', '12345-alpha' ],
-               ];
-       }
-
-       /**
-        * @dataProvider invalidVersionProvider
-        */
-       public function testGivenInvalidVersion_normalizeSuffixReturnsAsIs( $invalidVersion ) {
-               $this->assertRemainsUnchanged( $invalidVersion );
-       }
-
-       public function invalidVersionProvider() {
-               return [
-                       [ '1.221-a' ],
-                       [ '1.221-' ],
-                       [ '1.22rc4a' ],
-                       [ 'a1.22rc' ],
-                       [ '.1.22rc' ],
-                       [ 'a' ],
-                       [ 'alpha42' ],
-               ];
-       }
-}
diff --git a/tests/phpunit/includes/config/ConfigFactoryTest.php b/tests/phpunit/includes/config/ConfigFactoryTest.php
new file mode 100644 (file)
index 0000000..f1cc857
--- /dev/null
@@ -0,0 +1,168 @@
+<?php
+
+use MediaWiki\MediaWikiServices;
+
+class ConfigFactoryTest extends \MediaWikiIntegrationTestCase {
+
+       /**
+        * @covers ConfigFactory::register
+        */
+       public function testRegister() {
+               $factory = new ConfigFactory();
+               $factory->register( 'unittest', 'GlobalVarConfig::newInstance' );
+               $this->assertInstanceOf( GlobalVarConfig::class, $factory->makeConfig( 'unittest' ) );
+       }
+
+       /**
+        * @covers ConfigFactory::register
+        */
+       public function testRegisterInvalid() {
+               $factory = new ConfigFactory();
+               $this->setExpectedException( InvalidArgumentException::class );
+               $factory->register( 'invalid', 'Invalid callback' );
+       }
+
+       /**
+        * @covers ConfigFactory::register
+        */
+       public function testRegisterInvalidInstance() {
+               $factory = new ConfigFactory();
+               $this->setExpectedException( InvalidArgumentException::class );
+               $factory->register( 'invalidInstance', new stdClass );
+       }
+
+       /**
+        * @covers ConfigFactory::register
+        */
+       public function testRegisterInstance() {
+               $config = GlobalVarConfig::newInstance();
+               $factory = new ConfigFactory();
+               $factory->register( 'unittest', $config );
+               $this->assertSame( $config, $factory->makeConfig( 'unittest' ) );
+       }
+
+       /**
+        * @covers ConfigFactory::register
+        */
+       public function testRegisterAgain() {
+               $factory = new ConfigFactory();
+               $factory->register( 'unittest', 'GlobalVarConfig::newInstance' );
+               $config1 = $factory->makeConfig( 'unittest' );
+
+               $factory->register( 'unittest', 'GlobalVarConfig::newInstance' );
+               $config2 = $factory->makeConfig( 'unittest' );
+
+               $this->assertNotSame( $config1, $config2 );
+       }
+
+       /**
+        * @covers ConfigFactory::salvage
+        */
+       public function testSalvage() {
+               $oldFactory = new ConfigFactory();
+               $oldFactory->register( 'foo', 'GlobalVarConfig::newInstance' );
+               $oldFactory->register( 'bar', 'GlobalVarConfig::newInstance' );
+               $oldFactory->register( 'quux', 'GlobalVarConfig::newInstance' );
+
+               // instantiate two of the three defined configurations
+               $foo = $oldFactory->makeConfig( 'foo' );
+               $bar = $oldFactory->makeConfig( 'bar' );
+               $quux = $oldFactory->makeConfig( 'quux' );
+
+               // define new config instance
+               $newFactory = new ConfigFactory();
+               $newFactory->register( 'foo', 'GlobalVarConfig::newInstance' );
+               $newFactory->register( 'bar', function () {
+                       return new HashConfig();
+               } );
+
+               // "foo" and "quux" are defined in the old and the new factory.
+               // The old factory has instances for "foo" and "bar", but not "quux".
+               $newFactory->salvage( $oldFactory );
+
+               $newFoo = $newFactory->makeConfig( 'foo' );
+               $this->assertSame( $foo, $newFoo, 'existing instance should be salvaged' );
+
+               $newBar = $newFactory->makeConfig( 'bar' );
+               $this->assertNotSame( $bar, $newBar, 'don\'t salvage if callbacks differ' );
+
+               // the new factory doesn't have quux defined, so the quux instance should not be salvaged
+               $this->setExpectedException( ConfigException::class );
+               $newFactory->makeConfig( 'quux' );
+       }
+
+       /**
+        * @covers ConfigFactory::getConfigNames
+        */
+       public function testGetConfigNames() {
+               $factory = new ConfigFactory();
+               $factory->register( 'foo', 'GlobalVarConfig::newInstance' );
+               $factory->register( 'bar', new HashConfig() );
+
+               $this->assertEquals( [ 'foo', 'bar' ], $factory->getConfigNames() );
+       }
+
+       /**
+        * @covers ConfigFactory::makeConfig
+        */
+       public function testMakeConfigWithCallback() {
+               $factory = new ConfigFactory();
+               $factory->register( 'unittest', 'GlobalVarConfig::newInstance' );
+
+               $conf = $factory->makeConfig( 'unittest' );
+               $this->assertInstanceOf( Config::class, $conf );
+               $this->assertSame( $conf, $factory->makeConfig( 'unittest' ) );
+       }
+
+       /**
+        * @covers ConfigFactory::makeConfig
+        */
+       public function testMakeConfigWithObject() {
+               $factory = new ConfigFactory();
+               $conf = new HashConfig();
+               $factory->register( 'test', $conf );
+               $this->assertSame( $conf, $factory->makeConfig( 'test' ) );
+       }
+
+       /**
+        * @covers ConfigFactory::makeConfig
+        */
+       public function testMakeConfigFallback() {
+               $factory = new ConfigFactory();
+               $factory->register( '*', 'GlobalVarConfig::newInstance' );
+               $conf = $factory->makeConfig( 'unittest' );
+               $this->assertInstanceOf( Config::class, $conf );
+       }
+
+       /**
+        * @covers ConfigFactory::makeConfig
+        */
+       public function testMakeConfigWithNoBuilders() {
+               $factory = new ConfigFactory();
+               $this->setExpectedException( ConfigException::class );
+               $factory->makeConfig( 'nobuilderregistered' );
+       }
+
+       /**
+        * @covers ConfigFactory::makeConfig
+        */
+       public function testMakeConfigWithInvalidCallback() {
+               $factory = new ConfigFactory();
+               $factory->register( 'unittest', function () {
+                       return true; // Not a Config object
+               } );
+               $this->setExpectedException( UnexpectedValueException::class );
+               $factory->makeConfig( 'unittest' );
+       }
+
+       /**
+        * @covers ConfigFactory::getDefaultInstance
+        */
+       public function testGetDefaultInstance() {
+               // NOTE: the global config factory returned here has been overwritten
+               // for operation in test mode. It may not reflect LocalSettings.
+               $factory = MediaWikiServices::getInstance()->getConfigFactory();
+               $this->assertInstanceOf( Config::class, $factory->makeConfig( 'main' ) );
+       }
+
+}
diff --git a/tests/phpunit/includes/config/EtcdConfigTest.php b/tests/phpunit/includes/config/EtcdConfigTest.php
deleted file mode 100644 (file)
index 3eecf82..0000000
+++ /dev/null
@@ -1,621 +0,0 @@
-<?php
-
-use Wikimedia\TestingAccessWrapper;
-
-class EtcdConfigTest extends PHPUnit\Framework\TestCase {
-
-       use MediaWikiCoversValidator;
-       use PHPUnit4And6Compat;
-
-       private function createConfigMock( array $options = [] ) {
-               return $this->getMockBuilder( EtcdConfig::class )
-                       ->setConstructorArgs( [ $options + [
-                               'host' => 'etcd-tcp.example.net',
-                               'directory' => '/',
-                               'timeout' => 0.1,
-                       ] ] )
-                       ->setMethods( [ 'fetchAllFromEtcd' ] )
-                       ->getMock();
-       }
-
-       private static function createEtcdResponse( array $response ) {
-               $baseResponse = [
-                       'config' => null,
-                       'error' => null,
-                       'retry' => false,
-                       'modifiedIndex' => 0,
-               ];
-               return array_merge( $baseResponse, $response );
-       }
-
-       private function createSimpleConfigMock( array $config, $index = 0 ) {
-               $mock = $this->createConfigMock();
-               $mock->expects( $this->once() )->method( 'fetchAllFromEtcd' )
-                       ->willReturn( self::createEtcdResponse( [
-                               'config' => $config,
-                               'modifiedIndex' => $index,
-                       ] ) );
-               return $mock;
-       }
-
-       /**
-        * @covers EtcdConfig::has
-        */
-       public function testHasKnown() {
-               $config = $this->createSimpleConfigMock( [
-                       'known' => 'value'
-               ] );
-               $this->assertSame( true, $config->has( 'known' ) );
-       }
-
-       /**
-        * @covers EtcdConfig::__construct
-        * @covers EtcdConfig::get
-        */
-       public function testGetKnown() {
-               $config = $this->createSimpleConfigMock( [
-                       'known' => 'value'
-               ] );
-               $this->assertSame( 'value', $config->get( 'known' ) );
-       }
-
-       /**
-        * @covers EtcdConfig::has
-        */
-       public function testHasUnknown() {
-               $config = $this->createSimpleConfigMock( [
-                       'known' => 'value'
-               ] );
-               $this->assertSame( false, $config->has( 'unknown' ) );
-       }
-
-       /**
-        * @covers EtcdConfig::get
-        */
-       public function testGetUnknown() {
-               $config = $this->createSimpleConfigMock( [
-                       'known' => 'value'
-               ] );
-               $this->setExpectedException( ConfigException::class );
-               $config->get( 'unknown' );
-       }
-
-       /**
-        * @covers EtcdConfig::getModifiedIndex
-        */
-       public function testGetModifiedIndex() {
-               $config = $this->createSimpleConfigMock(
-                       [ 'some' => 'value' ],
-                       123
-               );
-               $this->assertSame( 123, $config->getModifiedIndex() );
-       }
-
-       /**
-        * @covers EtcdConfig::__construct
-        */
-       public function testConstructCacheObj() {
-               $cache = $this->getMockBuilder( HashBagOStuff::class )
-                       ->setMethods( [ 'get' ] )
-                       ->getMock();
-               $cache->expects( $this->once() )->method( 'get' )
-                       ->willReturn( [
-                               'config' => [ 'known' => 'from-cache' ],
-                               'expires' => INF,
-                               'modifiedIndex' => 123
-                       ] );
-               $config = $this->createConfigMock( [ 'cache' => $cache ] );
-
-               $this->assertSame( 'from-cache', $config->get( 'known' ) );
-       }
-
-       /**
-        * @covers EtcdConfig::__construct
-        */
-       public function testConstructCacheSpec() {
-               $config = $this->createConfigMock( [ 'cache' => [
-                       'class' => HashBagOStuff::class
-               ] ] );
-               $config->expects( $this->once() )->method( 'fetchAllFromEtcd' )
-                       ->willReturn( self::createEtcdResponse(
-                               [ 'config' => [ 'known' => 'from-fetch' ], ] ) );
-
-               $this->assertSame( 'from-fetch', $config->get( 'known' ) );
-       }
-
-       /**
-        * Test matrix
-        *
-        * - [x] Cache miss
-        *       Result: Fetched value
-        *       > cache miss | gets lock | backend succeeds
-        *
-        * - [x] Cache miss with backend error
-        *       Result: ConfigException
-        *       > cache miss | gets lock | backend error (no retry)
-        *
-        * - [x] Cache hit after retry
-        *       Result: Cached value (populated by process holding lock)
-        *       > cache miss | no lock | cache retry
-        *
-        * - [x] Cache hit
-        *       Result: Cached value
-        *       > cache hit
-        *
-        * - [x] Process cache hit
-        *       Result: Cached value
-        *       > process cache hit
-        *
-        * - [x] Cache expired
-        *       Result: Fetched value
-        *       > cache expired | gets lock | backend succeeds
-        *
-        * - [x] Cache expired with backend failure
-        *       Result: Cached value (stale)
-        *       > cache expired | gets lock | backend fails (allows retry)
-        *
-        * - [x] Cache expired and no lock
-        *       Result: Cached value (stale)
-        *       > cache expired | no lock
-        *
-        * Other notable scenarios:
-        *
-        * - [ ] Cache miss with backend retry
-        *       Result: Fetched value
-        *       > cache expired | gets lock | backend failure (allows retry)
-        */
-
-       /**
-        * @covers EtcdConfig::load
-        */
-       public function testLoadCacheMiss() {
-               // Create cache mock
-               $cache = $this->getMockBuilder( HashBagOStuff::class )
-                       ->setMethods( [ 'get', 'lock' ] )
-                       ->getMock();
-               // .. misses cache
-               $cache->expects( $this->once() )->method( 'get' )
-                       ->willReturn( false );
-               // .. gets lock
-               $cache->expects( $this->once() )->method( 'lock' )
-                       ->willReturn( true );
-
-               // Create config mock
-               $mock = $this->createConfigMock( [
-                       'cache' => $cache,
-               ] );
-               $mock->expects( $this->once() )->method( 'fetchAllFromEtcd' )
-                       ->willReturn(
-                               self::createEtcdResponse( [ 'config' => [ 'known' => 'from-fetch' ] ] ) );
-
-               $this->assertSame( 'from-fetch', $mock->get( 'known' ) );
-       }
-
-       /**
-        * @covers EtcdConfig::load
-        */
-       public function testLoadCacheMissBackendError() {
-               // Create cache mock
-               $cache = $this->getMockBuilder( HashBagOStuff::class )
-                       ->setMethods( [ 'get', 'lock' ] )
-                       ->getMock();
-               // .. misses cache
-               $cache->expects( $this->once() )->method( 'get' )
-                       ->willReturn( false );
-               // .. gets lock
-               $cache->expects( $this->once() )->method( 'lock' )
-                       ->willReturn( true );
-
-               // Create config mock
-               $mock = $this->createConfigMock( [
-                       'cache' => $cache,
-               ] );
-               $mock->expects( $this->once() )->method( 'fetchAllFromEtcd' )
-                       ->willReturn( self::createEtcdResponse( [ 'error' => 'Fake error', ] ) );
-
-               $this->setExpectedException( ConfigException::class );
-               $mock->get( 'key' );
-       }
-
-       /**
-        * @covers EtcdConfig::load
-        */
-       public function testLoadCacheMissWithoutLock() {
-               // Create cache mock
-               $cache = $this->getMockBuilder( HashBagOStuff::class )
-                       ->setMethods( [ 'get', 'lock' ] )
-                       ->getMock();
-               $cache->expects( $this->exactly( 2 ) )->method( 'get' )
-                       ->will( $this->onConsecutiveCalls(
-                               // .. misses cache first time
-                               false,
-                               // .. hits cache on retry
-                               [
-                                       'config' => [ 'known' => 'from-cache' ],
-                                       'expires' => INF,
-                                       'modifiedIndex' => 123
-                               ]
-                       ) );
-               // .. misses lock
-               $cache->expects( $this->once() )->method( 'lock' )
-                       ->willReturn( false );
-
-               // Create config mock
-               $mock = $this->createConfigMock( [
-                       'cache' => $cache,
-               ] );
-               $mock->expects( $this->never() )->method( 'fetchAllFromEtcd' );
-
-               $this->assertSame( 'from-cache', $mock->get( 'known' ) );
-       }
-
-       /**
-        * @covers EtcdConfig::load
-        */
-       public function testLoadCacheHit() {
-               // Create cache mock
-               $cache = $this->getMockBuilder( HashBagOStuff::class )
-                       ->setMethods( [ 'get', 'lock' ] )
-                       ->getMock();
-               $cache->expects( $this->once() )->method( 'get' )
-                       // .. hits cache
-                       ->willReturn( [
-                               'config' => [ 'known' => 'from-cache' ],
-                               'expires' => INF,
-                               'modifiedIndex' => 0,
-                       ] );
-               $cache->expects( $this->never() )->method( 'lock' );
-
-               // Create config mock
-               $mock = $this->createConfigMock( [
-                       'cache' => $cache,
-               ] );
-               $mock->expects( $this->never() )->method( 'fetchAllFromEtcd' );
-
-               $this->assertSame( 'from-cache', $mock->get( 'known' ) );
-       }
-
-       /**
-        * @covers EtcdConfig::load
-        */
-       public function testLoadProcessCacheHit() {
-               // Create cache mock
-               $cache = $this->getMockBuilder( HashBagOStuff::class )
-                       ->setMethods( [ 'get', 'lock' ] )
-                       ->getMock();
-               $cache->expects( $this->once() )->method( 'get' )
-                       // .. hits cache
-                       ->willReturn( [
-                               'config' => [ 'known' => 'from-cache' ],
-                               'expires' => INF,
-                               'modifiedIndex' => 0,
-                       ] );
-               $cache->expects( $this->never() )->method( 'lock' );
-
-               // Create config mock
-               $mock = $this->createConfigMock( [
-                       'cache' => $cache,
-               ] );
-               $mock->expects( $this->never() )->method( 'fetchAllFromEtcd' );
-
-               $this->assertSame( 'from-cache', $mock->get( 'known' ), 'Cache hit' );
-               $this->assertSame( 'from-cache', $mock->get( 'known' ), 'Process cache hit' );
-       }
-
-       /**
-        * @covers EtcdConfig::load
-        */
-       public function testLoadCacheExpiredLockFetchSucceeded() {
-               // Create cache mock
-               $cache = $this->getMockBuilder( HashBagOStuff::class )
-                       ->setMethods( [ 'get', 'lock' ] )
-                       ->getMock();
-               $cache->expects( $this->once() )->method( 'get' )->willReturn(
-                       // .. stale cache
-                       [
-                               'config' => [ 'known' => 'from-cache-expired' ],
-                               'expires' => -INF,
-                               'modifiedIndex' => 0,
-                       ]
-               );
-               // .. gets lock
-               $cache->expects( $this->once() )->method( 'lock' )
-                       ->willReturn( true );
-
-               // Create config mock
-               $mock = $this->createConfigMock( [
-                       'cache' => $cache,
-               ] );
-               $mock->expects( $this->once() )->method( 'fetchAllFromEtcd' )
-                       ->willReturn( self::createEtcdResponse( [ 'config' => [ 'known' => 'from-fetch' ] ] ) );
-
-               $this->assertSame( 'from-fetch', $mock->get( 'known' ) );
-       }
-
-       /**
-        * @covers EtcdConfig::load
-        */
-       public function testLoadCacheExpiredLockFetchFails() {
-               // Create cache mock
-               $cache = $this->getMockBuilder( HashBagOStuff::class )
-                       ->setMethods( [ 'get', 'lock' ] )
-                       ->getMock();
-               $cache->expects( $this->once() )->method( 'get' )->willReturn(
-                       // .. stale cache
-                       [
-                               'config' => [ 'known' => 'from-cache-expired' ],
-                               'expires' => -INF,
-                               'modifiedIndex' => 0,
-                       ]
-               );
-               // .. gets lock
-               $cache->expects( $this->once() )->method( 'lock' )
-                       ->willReturn( true );
-
-               // Create config mock
-               $mock = $this->createConfigMock( [
-                       'cache' => $cache,
-               ] );
-               $mock->expects( $this->once() )->method( 'fetchAllFromEtcd' )
-                       ->willReturn( self::createEtcdResponse( [ 'error' => 'Fake failure', 'retry' => true ] ) );
-
-               $this->assertSame( 'from-cache-expired', $mock->get( 'known' ) );
-       }
-
-       /**
-        * @covers EtcdConfig::load
-        */
-       public function testLoadCacheExpiredNoLock() {
-               // Create cache mock
-               $cache = $this->getMockBuilder( HashBagOStuff::class )
-                       ->setMethods( [ 'get', 'lock' ] )
-                       ->getMock();
-               $cache->expects( $this->once() )->method( 'get' )
-                       // .. hits cache (expired value)
-                       ->willReturn( [
-                               'config' => [ 'known' => 'from-cache-expired' ],
-                               'expires' => -INF,
-                               'modifiedIndex' => 0,
-                       ] );
-               // .. misses lock
-               $cache->expects( $this->once() )->method( 'lock' )
-                       ->willReturn( false );
-
-               // Create config mock
-               $mock = $this->createConfigMock( [
-                       'cache' => $cache,
-               ] );
-               $mock->expects( $this->never() )->method( 'fetchAllFromEtcd' );
-
-               $this->assertSame( 'from-cache-expired', $mock->get( 'known' ) );
-       }
-
-       public static function provideFetchFromServer() {
-               return [
-                       '200 OK - Success' => [
-                               'http' => [
-                                       'code' => 200,
-                                       'reason' => 'OK',
-                                       'headers' => [],
-                                       'body' => json_encode( [ 'node' => [ 'nodes' => [
-                                               [
-                                                       'key' => '/example/foo',
-                                                       'value' => json_encode( [ 'val' => true ] ),
-                                                       'modifiedIndex' => 123
-                                               ],
-                                       ] ] ] ),
-                                       'error' => '',
-                               ],
-                               'expect' => self::createEtcdResponse( [
-                                       'config' => [ 'foo' => true ], // data
-                                       'modifiedIndex' => 123
-                               ] ),
-                       ],
-                       '200 OK - Empty dir' => [
-                               'http' => [
-                                       'code' => 200,
-                                       'reason' => 'OK',
-                                       'headers' => [],
-                                       'body' => json_encode( [ 'node' => [ 'nodes' => [
-                                               [
-                                                       'key' => '/example/foo',
-                                                       'value' => json_encode( [ 'val' => true ] ),
-                                                       'modifiedIndex' => 123
-                                               ],
-                                               [
-                                                       'key' => '/example/sub',
-                                                       'dir' => true,
-                                                       'modifiedIndex' => 234,
-                                                       'nodes' => [],
-                                               ],
-                                               [
-                                                       'key' => '/example/bar',
-                                                       'value' => json_encode( [ 'val' => false ] ),
-                                                       'modifiedIndex' => 125
-                                               ],
-                                       ] ] ] ),
-                                       'error' => '',
-                               ],
-                               'expect' => self::createEtcdResponse( [
-                                       'config' => [ 'foo' => true, 'bar' => false ], // data
-                                       'modifiedIndex' => 125 // largest modified index
-                               ] ),
-                       ],
-                       '200 OK - Recursive' => [
-                               'http' => [
-                                       'code' => 200,
-                                       'reason' => 'OK',
-                                       'headers' => [],
-                                       'body' => json_encode( [ 'node' => [ 'nodes' => [
-                                               [
-                                                       'key' => '/example/a',
-                                                       'dir' => true,
-                                                       'modifiedIndex' => 124,
-                                                       'nodes' => [
-                                                               [
-                                                                       'key' => 'b',
-                                                                       'value' => json_encode( [ 'val' => true ] ),
-                                                                       'modifiedIndex' => 123,
-
-                                                               ],
-                                                               [
-                                                                       'key' => 'c',
-                                                                       'value' => json_encode( [ 'val' => false ] ),
-                                                                       'modifiedIndex' => 123,
-                                                               ],
-                                                       ],
-                                               ],
-                                       ] ] ] ),
-                                       'error' => '',
-                               ],
-                               'expect' => self::createEtcdResponse( [
-                                       'config' => [ 'a/b' => true, 'a/c' => false ], // data
-                                       'modifiedIndex' => 123 // largest modified index
-                               ] ),
-                       ],
-                       '200 OK - Missing nodes at second level' => [
-                               'http' => [
-                                       'code' => 200,
-                                       'reason' => 'OK',
-                                       'headers' => [],
-                                       'body' => json_encode( [ 'node' => [ 'nodes' => [
-                                               [
-                                                       'key' => '/example/a',
-                                                       'dir' => true,
-                                                       'modifiedIndex' => 0,
-                                               ],
-                                       ] ] ] ),
-                                       'error' => '',
-                               ],
-                               'expect' => self::createEtcdResponse( [
-                                       'error' => "Unexpected JSON response in dir 'a'; missing 'nodes' list.",
-                               ] ),
-                       ],
-                       '200 OK - Directory with non-array "nodes" key' => [
-                               'http' => [
-                                       'code' => 200,
-                                       'reason' => 'OK',
-                                       'headers' => [],
-                                       'body' => json_encode( [ 'node' => [ 'nodes' => [
-                                               [
-                                                       'key' => '/example/a',
-                                                       'dir' => true,
-                                                       'nodes' => 'not an array'
-                                               ],
-                                       ] ] ] ),
-                                       'error' => '',
-                               ],
-                               'expect' => self::createEtcdResponse( [
-                                       'error' => "Unexpected JSON response in dir 'a'; 'nodes' is not an array.",
-                               ] ),
-                       ],
-                       '200 OK - Correctly encoded garbage response' => [
-                               'http' => [
-                                       'code' => 200,
-                                       'reason' => 'OK',
-                                       'headers' => [],
-                                       'body' => json_encode( [ 'foo' => 'bar' ] ),
-                                       'error' => '',
-                               ],
-                               'expect' => self::createEtcdResponse( [
-                                       'error' => "Unexpected JSON response: Missing or invalid node at top level.",
-                               ] ),
-                       ],
-                       '200 OK - Bad value' => [
-                               'http' => [
-                                       'code' => 200,
-                                       'reason' => 'OK',
-                                       'headers' => [],
-                                       'body' => json_encode( [ 'node' => [ 'nodes' => [
-                                               [
-                                                       'key' => '/example/foo',
-                                                       'value' => ';"broken{value',
-                                                       'modifiedIndex' => 123,
-                                               ]
-                                       ] ] ] ),
-                                       'error' => '',
-                               ],
-                               'expect' => self::createEtcdResponse( [
-                                       'error' => "Failed to parse value for 'foo'.",
-                               ] ),
-                       ],
-                       '200 OK - Empty node list' => [
-                               'http' => [
-                                       'code' => 200,
-                                       'reason' => 'OK',
-                                       'headers' => [],
-                                       'body' => '{"node":{"nodes":[], "modifiedIndex": 12 }}',
-                                       'error' => '',
-                               ],
-                               'expect' => self::createEtcdResponse( [
-                                       'config' => [], // data
-                               ] ),
-                       ],
-                       '200 OK - Invalid JSON' => [
-                               'http' => [
-                                       'code' => 200,
-                                       'reason' => 'OK',
-                                       'headers' => [ 'content-length' => 0 ],
-                                       'body' => '',
-                                       'error' => '(curl error: no status set)',
-                               ],
-                               'expect' => self::createEtcdResponse( [
-                                       'error' => "Error unserializing JSON response.",
-                               ] ),
-                       ],
-                       '404 Not Found' => [
-                               'http' => [
-                                       'code' => 404,
-                                       'reason' => 'Not Found',
-                                       'headers' => [ 'content-length' => 0 ],
-                                       'body' => '',
-                                       'error' => '',
-                               ],
-                               'expect' => self::createEtcdResponse( [
-                                       'error' => 'HTTP 404 (Not Found)',
-                               ] ),
-                       ],
-                       '400 Bad Request - custom error' => [
-                               'http' => [
-                                       'code' => 400,
-                                       'reason' => 'Bad Request',
-                                       'headers' => [ 'content-length' => 0 ],
-                                       'body' => '',
-                                       'error' => 'No good reason',
-                               ],
-                               'expect' => self::createEtcdResponse( [
-                                       'error' => 'No good reason',
-                                       'retry' => true, // retry
-                               ] ),
-                       ],
-               ];
-       }
-
-       /**
-        * @covers EtcdConfig::fetchAllFromEtcdServer
-        * @covers EtcdConfig::unserialize
-        * @covers EtcdConfig::parseResponse
-        * @covers EtcdConfig::parseDirectory
-        * @covers EtcdConfigParseError
-        * @dataProvider provideFetchFromServer
-        */
-       public function testFetchFromServer( array $httpResponse, array $expected ) {
-               $http = $this->getMockBuilder( MultiHttpClient::class )
-                       ->disableOriginalConstructor()
-                       ->getMock();
-               $http->expects( $this->once() )->method( 'run' )
-                       ->willReturn( array_values( $httpResponse ) );
-
-               $conf = $this->getMockBuilder( EtcdConfig::class )
-                       ->disableOriginalConstructor()
-                       ->getMock();
-               // Access for protected member and method
-               $conf = TestingAccessWrapper::newFromObject( $conf );
-               $conf->http = $http;
-
-               $this->assertSame(
-                       $expected,
-                       $conf->fetchAllFromEtcdServer( 'etcd-tcp.example.net' )
-               );
-       }
-}
diff --git a/tests/phpunit/includes/db/DatabaseOracleTest.php b/tests/phpunit/includes/db/DatabaseOracleTest.php
deleted file mode 100644 (file)
index 061e121..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<?php
-
-class DatabaseOracleTest extends PHPUnit\Framework\TestCase {
-
-       use MediaWikiCoversValidator;
-       use PHPUnit4And6Compat;
-
-       /**
-        * @return PHPUnit_Framework_MockObject_MockObject|DatabaseOracle
-        */
-       private function getMockDb() {
-               return $this->getMockBuilder( DatabaseOracle::class )
-                       ->disableOriginalConstructor()
-                       ->setMethods( null )
-                       ->getMock();
-       }
-
-       public function provideBuildSubstring() {
-               yield [ 'someField', 1, 2, 'SUBSTR(someField,1,2)' ];
-               yield [ 'someField', 1, null, 'SUBSTR(someField,1)' ];
-       }
-
-       /**
-        * @covers DatabaseOracle::buildSubstring
-        * @dataProvider provideBuildSubstring
-        */
-       public function testBuildSubstring( $input, $start, $length, $expected ) {
-               $mockDb = $this->getMockDb();
-               $output = $mockDb->buildSubstring( $input, $start, $length );
-               $this->assertSame( $expected, $output );
-       }
-
-       public function provideBuildSubstring_invalidParams() {
-               yield [ -1, 1 ];
-               yield [ 1, -1 ];
-               yield [ 1, 'foo' ];
-               yield [ 'foo', 1 ];
-               yield [ null, 1 ];
-               yield [ 0, 1 ];
-       }
-
-       /**
-        * @covers DatabaseOracle::buildSubstring
-        * @dataProvider provideBuildSubstring_invalidParams
-        */
-       public function testBuildSubstring_invalidParams( $start, $length ) {
-               $mockDb = $this->getMockDb();
-               $this->setExpectedException( InvalidArgumentException::class );
-               $mockDb->buildSubstring( 'foo', $start, $length );
-       }
-
-}
index defa0aa..0c0b82b 100644 (file)
@@ -167,7 +167,9 @@ class LoadBalancerTest extends MediaWikiTestCase {
                ] );
        }
 
-       private function newMultiServerLocalLoadBalancer( $lbExtra = [], $srvExtra = [] ) {
+       private function newMultiServerLocalLoadBalancer(
+               $lbExtra = [], $srvExtra = [], $masterOnly = false
+       ) {
                global $wgDBserver, $wgDBname, $wgDBuser, $wgDBpassword, $wgDBtype, $wgSQLiteDataDir;
 
                $servers = [
@@ -180,7 +182,7 @@ class LoadBalancerTest extends MediaWikiTestCase {
                                'password' => $wgDBpassword,
                                'type' => $wgDBtype,
                                'dbDirectory' => $wgSQLiteDataDir,
-                               'load' => 0,
+                               'load' => $masterOnly ? 100 : 0,
                        ],
                        // Main replica DBs
                        1 => $srvExtra + [
@@ -191,7 +193,7 @@ class LoadBalancerTest extends MediaWikiTestCase {
                                'password' => $wgDBpassword,
                                'type' => $wgDBtype,
                                'dbDirectory' => $wgSQLiteDataDir,
-                               'load' => 100,
+                               'load' => $masterOnly ? 0 : 100,
                        ],
                        2 => $srvExtra + [
                                'host' => $wgDBserver,
@@ -201,7 +203,7 @@ class LoadBalancerTest extends MediaWikiTestCase {
                                'password' => $wgDBpassword,
                                'type' => $wgDBtype,
                                'dbDirectory' => $wgSQLiteDataDir,
-                               'load' => 100,
+                               'load' => $masterOnly ? 0 : 100,
                        ],
                        // RC replica DBs
                        3 => $srvExtra + [
@@ -618,4 +620,11 @@ class LoadBalancerTest extends MediaWikiTestCase {
                $this->assertEquals( $vslowIndexPicked, $lbWrapper->getExistingReaderIndex( 'vslow' ) );
                $this->assertEquals( 6, $vslowIndexPicked );
        }
+
+       public function testNonZeroMasterLoad() {
+               $lb = $this->newMultiServerLocalLoadBalancer( [], [ 'flags' => DBO_DEFAULT ], true );
+               // Make sure that no infinite loop occurs (T226678)
+               $rGeneric = $lb->getConnectionRef( DB_REPLICA );
+               $this->assertEquals( $lb->getWriterIndex(), $rGeneric->getLBInfo( 'serverIndex' ) );
+       }
 }
diff --git a/tests/phpunit/includes/debug/logger/monolog/LogstashFormatterTest.php b/tests/phpunit/includes/debug/logger/monolog/LogstashFormatterTest.php
deleted file mode 100644 (file)
index a1207b2..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-
-namespace MediaWiki\Logger\Monolog;
-
-class LogstashFormatterTest extends \PHPUnit\Framework\TestCase {
-       /**
-        * @dataProvider provideV1
-        * @covers MediaWiki\Logger\Monolog\LogstashFormatter::formatV1
-        * @param array $record The input record.
-        * @param array $expected Associative array of expected keys and their values.
-        * @param array $notExpected List of keys that should not exist.
-        */
-       public function testV1( array $record, array $expected, array $notExpected ) {
-               $formatter = new LogstashFormatter( 'app', 'system', null, null, LogstashFormatter::V1 );
-               $formatted = json_decode( $formatter->format( $record ), true );
-               foreach ( $expected as $key => $value ) {
-                       $this->assertArrayHasKey( $key, $formatted );
-                       $this->assertSame( $value, $formatted[$key] );
-               }
-               foreach ( $notExpected as $key ) {
-                       $this->assertArrayNotHasKey( $key, $formatted );
-               }
-       }
-
-       public function provideV1() {
-               return [
-                       [
-                               [ 'extra' => [ 'foo' => 1 ], 'context' => [ 'bar' => 2 ] ],
-                               [ 'foo' => 1, 'bar' => 2 ],
-                               [ 'logstash_formatter_key_conflict' ],
-                       ],
-                       [
-                               [ 'extra' => [ 'url' => 1 ], 'context' => [ 'url' => 2 ] ],
-                               [ 'url' => 1, 'c_url' => 2, 'logstash_formatter_key_conflict' => [ 'url' ] ],
-                               [],
-                       ],
-                       [
-                               [ 'channel' => 'x', 'context' => [ 'channel' => 'y' ] ],
-                               [ 'channel' => 'x', 'c_channel' => 'y',
-                                       'logstash_formatter_key_conflict' => [ 'channel' ] ],
-                               [],
-                       ],
-               ];
-       }
-
-       /**
-        * @covers MediaWiki\Logger\Monolog\LogstashFormatter::formatV1
-        */
-       public function testV1WithPrefix() {
-               $formatter = new LogstashFormatter( 'app', 'system', null, 'ctx_', LogstashFormatter::V1 );
-               $record = [ 'extra' => [ 'url' => 1 ], 'context' => [ 'url' => 2 ] ];
-               $formatted = json_decode( $formatter->format( $record ), true );
-               $this->assertArrayHasKey( 'url', $formatted );
-               $this->assertSame( 1, $formatted['url'] );
-               $this->assertArrayHasKey( 'ctx_url', $formatted );
-               $this->assertSame( 2, $formatted['ctx_url'] );
-               $this->assertArrayNotHasKey( 'c_url', $formatted );
-       }
-}
diff --git a/tests/phpunit/includes/deferred/MWCallableUpdateTest.php b/tests/phpunit/includes/deferred/MWCallableUpdateTest.php
deleted file mode 100644 (file)
index 3ab9b56..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-<?php
-
-/**
- * @covers MWCallableUpdate
- */
-class MWCallableUpdateTest extends PHPUnit\Framework\TestCase {
-
-       use MediaWikiCoversValidator;
-
-       public function testDoUpdate() {
-               $ran = 0;
-               $update = new MWCallableUpdate( function () use ( &$ran ) {
-                       $ran++;
-               } );
-               $this->assertSame( 0, $ran );
-               $update->doUpdate();
-               $this->assertSame( 1, $ran );
-       }
-
-       public function testCancel() {
-               // Prepare update and DB
-               $db = new DatabaseTestHelper( __METHOD__ );
-               $db->begin( __METHOD__ );
-               $ran = 0;
-               $update = new MWCallableUpdate( function () use ( &$ran ) {
-                       $ran++;
-               }, __METHOD__, $db );
-
-               // Emulate rollback
-               $db->rollback( __METHOD__ );
-
-               $update->doUpdate();
-
-               // Ensure it was cancelled
-               $this->assertSame( 0, $ran );
-       }
-
-       public function testCancelSome() {
-               // Prepare update and DB
-               $db1 = new DatabaseTestHelper( __METHOD__ );
-               $db1->begin( __METHOD__ );
-               $db2 = new DatabaseTestHelper( __METHOD__ );
-               $db2->begin( __METHOD__ );
-               $ran = 0;
-               $update = new MWCallableUpdate( function () use ( &$ran ) {
-                       $ran++;
-               }, __METHOD__, [ $db1, $db2 ] );
-
-               // Emulate rollback
-               $db1->rollback( __METHOD__ );
-
-               $update->doUpdate();
-
-               // Prevents: "Notice: DB transaction writes or callbacks still pending"
-               $db2->rollback( __METHOD__ );
-
-               // Ensure it was cancelled
-               $this->assertSame( 0, $ran );
-       }
-
-       public function testCancelAll() {
-               // Prepare update and DB
-               $db1 = new DatabaseTestHelper( __METHOD__ );
-               $db1->begin( __METHOD__ );
-               $db2 = new DatabaseTestHelper( __METHOD__ );
-               $db2->begin( __METHOD__ );
-               $ran = 0;
-               $update = new MWCallableUpdate( function () use ( &$ran ) {
-                       $ran++;
-               }, __METHOD__, [ $db1, $db2 ] );
-
-               // Emulate rollbacks
-               $db1->rollback( __METHOD__ );
-               $db2->rollback( __METHOD__ );
-
-               $update->doUpdate();
-
-               // Ensure it was cancelled
-               $this->assertSame( 0, $ran );
-       }
-
-}
diff --git a/tests/phpunit/includes/deferred/TransactionRoundDefiningUpdateTest.php b/tests/phpunit/includes/deferred/TransactionRoundDefiningUpdateTest.php
deleted file mode 100644 (file)
index 693897e..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-
-/**
- * @covers TransactionRoundDefiningUpdate
- */
-class TransactionRoundDefiningUpdateTest extends PHPUnit\Framework\TestCase {
-
-       use MediaWikiCoversValidator;
-
-       public function testDoUpdate() {
-               $ran = 0;
-               $update = new TransactionRoundDefiningUpdate( function () use ( &$ran ) {
-                       $ran++;
-               } );
-               $this->assertSame( 0, $ran );
-               $update->doUpdate();
-               $this->assertSame( 1, $ran );
-       }
-}
diff --git a/tests/phpunit/includes/libs/mime/MSCompoundFileReaderTest.php b/tests/phpunit/includes/libs/mime/MSCompoundFileReaderTest.php
deleted file mode 100644 (file)
index 4509a61..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php
-/*
- * Copyright 2019 Wikimedia Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed
- * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
- * OF ANY KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations under the License.
- */
-
-/**
- * @group Media
- * @covers MSCompoundFileReader
- */
-class MSCompoundFileReaderTest extends PHPUnit\Framework\TestCase {
-       public static function provideValid() {
-               return [
-                       [ 'calc.xls', 'application/vnd.ms-excel' ],
-                       [ 'excel2016-compat97.xls', 'application/vnd.ms-excel' ],
-                       [ 'gnumeric.xls', 'application/vnd.ms-excel' ],
-                       [ 'impress.ppt', 'application/vnd.ms-powerpoint' ],
-                       [ 'powerpoint2016-compat97.ppt', 'application/vnd.ms-powerpoint' ],
-                       [ 'word2016-compat97.doc', 'application/msword' ],
-                       [ 'writer.doc', 'application/msword' ],
-               ];
-       }
-
-       /** @dataProvider provideValid */
-       public function testReadFile( $fileName, $expectedMime ) {
-               global $IP;
-
-               $info = MSCompoundFileReader::readFile( "$IP/tests/phpunit/data/MSCompoundFileReader/$fileName" );
-               $this->assertTrue( $info['valid'] );
-               $this->assertSame( $expectedMime, $info['mime'] );
-       }
-
-       public static function provideInvalid() {
-               return [
-                       [ 'dir-beyond-end.xls', 'ERROR_READ_PAST_END' ],
-                       [ 'fat-loop.xls', 'ERROR_INVALID_FORMAT' ],
-                       [ 'invalid-signature.xls', 'ERROR_INVALID_SIGNATURE' ],
-               ];
-       }
-
-       /** @dataProvider provideInvalid */
-       public function testReadFileInvalid( $fileName, $expectedError ) {
-               global $IP;
-
-               $info = MSCompoundFileReader::readFile( "$IP/tests/phpunit/data/MSCompoundFileReader/$fileName" );
-               $this->assertFalse( $info['valid'] );
-               $this->assertSame( constant( MSCompoundFileReader::class . '::' . $expectedError ),
-                       $info['errorCode'] );
-       }
-}
index 1947812..0f23b8c 100644 (file)
@@ -137,4 +137,30 @@ class MimeAnalyzerTest extends PHPUnit\Framework\TestCase {
                $actualType = $this->doGuessMimeType( [ $file, 'doc' ] );
                $this->assertEquals( 'application/msword', $actualType );
        }
+
+       /**
+        * @covers MimeAnalyzer::detectZipType
+        * @dataProvider provideOpendocumentsformatHeaders
+        */
+       function testDetectZipTypeRecognizesOpendocuments( $expected, $header ) {
+               $this->assertEquals(
+                       $expected,
+                       $this->mimeAnalyzer->detectZipType( $header )
+               );
+       }
+
+       /**
+        * An ODF file is a ZIP file of multiple files. The first one being
+        * 'mimetype' and is not compressed.
+        */
+       function provideOpendocumentsformatHeaders() {
+               $thirtychars = str_repeat( 0, 30 );
+               return [
+                       'Database front end document header based on ODF 1.2' => [
+                               'application/vnd.oasis.opendocument.base',
+                               $thirtychars . 'mimetypeapplication/vnd.oasis.opendocument.basePK',
+                       ],
+               ];
+       }
+
 }
index e5ca3df..58f6c05 100644 (file)
@@ -1702,7 +1702,7 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
                        $this->fail( 'Test exception not thrown' );
                } catch ( DBTransactionError $ex ) {
                        $this->assertSame(
-                               'Cannot execute query from ' . __METHOD__ . ' while transaction status is ERROR.',
+                               'Cannot execute query from ' . __METHOD__ . ' while transaction status is ERROR',
                                $ex->getMessage()
                        );
                }
@@ -1819,7 +1819,7 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
                } catch ( DBUnexpectedError $e ) {
                        $m = __METHOD__;
                        $this->assertSame(
-                               "Invalid atomic section ended (got {$m}_X but expected {$m}).",
+                               "Invalid atomic section ended (got {$m}_X but expected {$m})",
                                $e->getMessage()
                        );
                }
@@ -1934,7 +1934,7 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
                        $this->fail( 'Expected exception not thrown' );
                } catch ( DBUnexpectedError $ex ) {
                        $this->assertSame(
-                               'No atomic section is open (got ' . __METHOD__ . ').',
+                               'No atomic section is open (got ' . __METHOD__ . ')',
                                $ex->getMessage()
                        );
                }
@@ -1953,7 +1953,7 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
                } catch ( DBUnexpectedError $ex ) {
                        $this->assertSame(
                                'Invalid atomic section ended (got ' . __METHOD__ . ' but expected ' .
-                                       __METHOD__ . 'X).',
+                                       __METHOD__ . 'X)',
                                $ex->getMessage()
                        );
                }
@@ -1970,7 +1970,7 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
                        $this->fail( 'Expected exception not thrown' );
                } catch ( DBTransactionError $ex ) {
                        $this->assertSame(
-                               'Cannot execute query from ' . __METHOD__ . ' while transaction status is ERROR.',
+                               'Cannot execute query from ' . __METHOD__ . ' while transaction status is ERROR',
                                $ex->getMessage()
                        );
                }
@@ -1986,7 +1986,7 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
                        $this->fail( 'Expected exception not thrown' );
                } catch ( DBUnexpectedError $ex ) {
                        $this->assertSame(
-                               'No atomic section is open (got ' . __METHOD__ . ').',
+                               'No atomic section is open (got ' . __METHOD__ . ')',
                                $ex->getMessage()
                        );
                }
@@ -2074,7 +2074,7 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
                        $this->fail( 'Expected exception not thrown' );
                } catch ( DBTransactionError $e ) {
                        $this->assertEquals(
-                               'Cannot execute query from ' . __METHOD__ . ' while transaction status is ERROR.',
+                               'Cannot execute query from ' . __METHOD__ . ' while transaction status is ERROR',
                                $e->getMessage()
                        );
                }
@@ -2083,7 +2083,7 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
                        $this->fail( 'Expected exception not thrown' );
                } catch ( DBTransactionError $e ) {
                        $this->assertEquals(
-                               'Cannot execute query from ' . __METHOD__ . ' while transaction status is ERROR.',
+                               'Cannot execute query from ' . __METHOD__ . ' while transaction status is ERROR',
                                $e->getMessage()
                        );
                }
@@ -2187,7 +2187,7 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
                        $this->fail( 'Expected exception not thrown' );
                } catch ( DBUnexpectedError $ex ) {
                        $this->assertSame(
-                               "Wikimedia\Rdbms\Database::close: transaction is still open (from $fname).",
+                               "Wikimedia\Rdbms\Database::close: transaction is still open (from $fname)",
                                $ex->getMessage()
                        );
                }
@@ -2216,7 +2216,7 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
                } catch ( DBUnexpectedError $ex ) {
                        $this->assertSame(
                                'Wikimedia\Rdbms\Database::close: atomic sections ' .
-                               'DatabaseSQLTest::testPrematureClose2 are still open.',
+                               'DatabaseSQLTest::testPrematureClose2 are still open',
                                $ex->getMessage()
                        );
                }
@@ -2239,7 +2239,7 @@ class DatabaseSQLTest extends PHPUnit\Framework\TestCase {
                } catch ( DBUnexpectedError $ex ) {
                        $this->assertSame(
                                'Wikimedia\Rdbms\Database::close: ' .
-                               'mass commit/rollback of peer transaction required (DBO_TRX set).',
+                               'mass commit/rollback of peer transaction required (DBO_TRX set)',
                                $ex->getMessage()
                        );
                }
diff --git a/tests/phpunit/includes/media/SVGMetadataExtractorTest.php b/tests/phpunit/includes/media/SVGMetadataExtractorTest.php
new file mode 100644 (file)
index 0000000..c84efa1
--- /dev/null
@@ -0,0 +1,201 @@
+<?php
+
+/**
+ * @group Media
+ * @covers SVGMetadataExtractor
+ */
+class SVGMetadataExtractorTest extends \MediaWikiIntegrationTestCase {
+
+       /**
+        * @dataProvider provideSvgFiles
+        */
+       public function testGetMetadata( $infile, $expected ) {
+               $this->assertMetadata( $infile, $expected );
+       }
+
+       /**
+        * @dataProvider provideSvgFilesWithXMLMetadata
+        */
+       public function testGetXMLMetadata( $infile, $expected ) {
+               $r = new XMLReader();
+               $this->assertMetadata( $infile, $expected );
+       }
+
+       /**
+        * @dataProvider provideSvgUnits
+        */
+       public function testScaleSVGUnit( $inUnit, $expected ) {
+               $this->assertEquals(
+                       $expected,
+                       SVGReader::scaleSVGUnit( $inUnit ),
+                       'SVG unit conversion and scaling failure'
+               );
+       }
+
+       function assertMetadata( $infile, $expected ) {
+               try {
+                       $data = SVGMetadataExtractor::getMetadata( $infile );
+                       $this->assertEquals( $expected, $data, 'SVG metadata extraction test' );
+               } catch ( MWException $e ) {
+                       if ( $expected === false ) {
+                               $this->assertTrue( true, 'SVG metadata extracted test (expected failure)' );
+                       } else {
+                               throw $e;
+                       }
+               }
+       }
+
+       public static function provideSvgFiles() {
+               $base = __DIR__ . '/../../data/media';
+
+               return [
+                       [
+                               "$base/Wikimedia-logo.svg",
+                               [
+                                       'width' => 1024,
+                                       'height' => 1024,
+                                       'originalWidth' => '1024',
+                                       'originalHeight' => '1024',
+                                       'translations' => [],
+                               ]
+                       ],
+                       [
+                               "$base/QA_icon.svg",
+                               [
+                                       'width' => 60,
+                                       'height' => 60,
+                                       'originalWidth' => '60',
+                                       'originalHeight' => '60',
+                                       'translations' => [],
+                               ]
+                       ],
+                       [
+                               "$base/Gtk-media-play-ltr.svg",
+                               [
+                                       'width' => 60,
+                                       'height' => 60,
+                                       'originalWidth' => '60.0000000',
+                                       'originalHeight' => '60.0000000',
+                                       'translations' => [],
+                               ]
+                       ],
+                       [
+                               "$base/Toll_Texas_1.svg",
+                               // This file triggered T33719, needs entity expansion in the xmlns checks
+                               [
+                                       'width' => 385,
+                                       'height' => 385,
+                                       'originalWidth' => '385',
+                                       'originalHeight' => '385.0004883',
+                                       'translations' => [],
+                               ]
+                       ],
+                       [
+                               "$base/Tux.svg",
+                               [
+                                       'width' => 512,
+                                       'height' => 594,
+                                       'originalWidth' => '100%',
+                                       'originalHeight' => '100%',
+                                       'title' => 'Tux',
+                                       'translations' => [],
+                                       'description' => 'For more information see: http://commons.wikimedia.org/wiki/Image:Tux.svg',
+                               ]
+                       ],
+                       [
+                               "$base/Speech_bubbles.svg",
+                               [
+                                       'width' => 627,
+                                       'height' => 461,
+                                       'originalWidth' => '17.7cm',
+                                       'originalHeight' => '13cm',
+                                       'translations' => [
+                                               'de' => SVGReader::LANG_FULL_MATCH,
+                                               'fr' => SVGReader::LANG_FULL_MATCH,
+                                               'nl' => SVGReader::LANG_FULL_MATCH,
+                                               'tlh-ca' => SVGReader::LANG_FULL_MATCH,
+                                               'tlh' => SVGReader::LANG_PREFIX_MATCH
+                                       ],
+                               ]
+                       ],
+                       [
+                               "$base/Soccer_ball_animated.svg",
+                               [
+                                       'width' => 150,
+                                       'height' => 150,
+                                       'originalWidth' => '150',
+                                       'originalHeight' => '150',
+                                       'animated' => true,
+                                       'translations' => []
+                               ],
+                       ],
+                       [
+                               "$base/comma_separated_viewbox.svg",
+                               [
+                                       'width' => 512,
+                                       'height' => 594,
+                                       'originalWidth' => '100%',
+                                       'originalHeight' => '100%',
+                                       'translations' => []
+                               ],
+                       ],
+               ];
+       }
+
+       public static function provideSvgFilesWithXMLMetadata() {
+               $base = __DIR__ . '/../../data/media';
+               // phpcs:disable Generic.Files.LineLength
+               $metadata = '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+      <ns4:Work xmlns:ns4="http://creativecommons.org/ns#" rdf:about="">
+        <ns5:format xmlns:ns5="http://purl.org/dc/elements/1.1/">image/svg+xml</ns5:format>
+        <ns5:type xmlns:ns5="http://purl.org/dc/elements/1.1/" rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
+      </ns4:Work>
+    </rdf:RDF>';
+               // phpcs:enable
+
+               $metadata = str_replace( "\r", '', $metadata ); // Windows compat
+               return [
+                       [
+                               "$base/US_states_by_total_state_tax_revenue.svg",
+                               [
+                                       'height' => 593,
+                                       'metadata' => $metadata,
+                                       'width' => 959,
+                                       'originalWidth' => '958.69',
+                                       'originalHeight' => '592.78998',
+                                       'translations' => [],
+                               ]
+                       ],
+               ];
+       }
+
+       public static function provideSvgUnits() {
+               return [
+                       [ '1' , 1 ],
+                       [ '1.1' , 1.1 ],
+                       [ '0.1' , 0.1 ],
+                       [ '.1' , 0.1 ],
+                       [ '1e2' , 100 ],
+                       [ '1E2' , 100 ],
+                       [ '+1' , 1 ],
+                       [ '-1' , -1 ],
+                       [ '-1.1' , -1.1 ],
+                       [ '1e+2' , 100 ],
+                       [ '1e-2' , 0.01 ],
+                       [ '10px' , 10 ],
+                       [ '10pt' , 10 * 1.25 ],
+                       [ '10pc' , 10 * 15 ],
+                       [ '10mm' , 10 * 3.543307 ],
+                       [ '10cm' , 10 * 35.43307 ],
+                       [ '10in' , 10 * 90 ],
+                       [ '10em' , 10 * 16 ],
+                       [ '10ex' , 10 * 12 ],
+                       [ '10%' , 51.2 ],
+                       [ '10 px' , 10 ],
+                       // Invalid values
+                       [ '1e1.1', 10 ],
+                       [ '10bp', 10 ],
+                       [ 'p10', null ],
+               ];
+       }
+}
diff --git a/tests/phpunit/includes/objectcache/RedisBagOStuffTest.php b/tests/phpunit/includes/objectcache/RedisBagOStuffTest.php
deleted file mode 100644 (file)
index df5614d..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-<?php
-
-use Wikimedia\TestingAccessWrapper;
-
-/**
- * @group BagOStuff
- */
-class RedisBagOStuffTest extends PHPUnit\Framework\TestCase {
-
-       use MediaWikiCoversValidator;
-
-       /** @var RedisBagOStuff */
-       private $cache;
-
-       protected function setUp() {
-               parent::setUp();
-               $cache = $this->getMockBuilder( RedisBagOStuff::class )
-                       ->disableOriginalConstructor()
-                       ->getMock();
-               $this->cache = TestingAccessWrapper::newFromObject( $cache );
-       }
-
-       /**
-        * @covers RedisBagOStuff::unserialize
-        * @dataProvider unserializeProvider
-        */
-       public function testUnserialize( $expected, $input, $message ) {
-               $actual = $this->cache->unserialize( $input );
-               $this->assertSame( $expected, $actual, $message );
-       }
-
-       public function unserializeProvider() {
-               return [
-                       [
-                               -1,
-                               '-1',
-                               'String representation of \'-1\'',
-                       ],
-                       [
-                               0,
-                               '0',
-                               'String representation of \'0\'',
-                       ],
-                       [
-                               1,
-                               '1',
-                               'String representation of \'1\'',
-                       ],
-                       [
-                               -1.0,
-                               'd:-1;',
-                               'Serialized negative double',
-                       ],
-                       [
-                               'foo',
-                               's:3:"foo";',
-                               'Serialized string',
-                       ]
-               ];
-       }
-
-       /**
-        * @covers RedisBagOStuff::serialize
-        * @dataProvider serializeProvider
-        */
-       public function testSerialize( $expected, $input, $message ) {
-               $actual = $this->cache->serialize( $input );
-               $this->assertSame( $expected, $actual, $message );
-       }
-
-       public function serializeProvider() {
-               return [
-                       [
-                               -1,
-                               -1,
-                               '-1 as integer',
-                       ],
-                       [
-                               0,
-                               0,
-                               '0 as integer',
-                       ],
-                       [
-                               1,
-                               1,
-                               '1 as integer',
-                       ],
-                       [
-                               'd:-1;',
-                               -1.0,
-                               'Negative double',
-                       ],
-                       [
-                               's:3:"2.1";',
-                               '2.1',
-                               'Decimal string',
-                       ],
-                       [
-                               's:1:"1";',
-                               '1',
-                               'String representation of 1',
-                       ],
-                       [
-                               's:3:"foo";',
-                               'foo',
-                               'String',
-                       ],
-               ];
-       }
-}
index e665d67..99e8fb7 100644 (file)
@@ -271,4 +271,29 @@ class SanitizerTest extends MediaWikiTestCase {
                $this->setMwGlobals( 'wgFragmentMode', [ 666 => 'html5' ] );
                Sanitizer::escapeIdForLink( 'This should throw' );
        }
+
+       /**
+        * Test escapeIdReferenceList for consistency with escapeIdForAttribute
+        *
+        * @dataProvider provideEscapeIdReferenceList
+        * @covers Sanitizer::escapeIdReferenceList
+        */
+       public function testEscapeIdReferenceList( $referenceList, $id1, $id2 ) {
+               $this->assertEquals(
+                       Sanitizer::escapeIdReferenceList( $referenceList ),
+                       Sanitizer::escapeIdForAttribute( $id1 )
+                       . ' '
+                       . Sanitizer::escapeIdForAttribute( $id2 )
+               );
+       }
+
+       public static function provideEscapeIdReferenceList() {
+               /** [ <reference list>, <individual id 1>, <individual id 2> ] */
+               return [
+                       [ 'foo bar', 'foo', 'bar' ],
+                       [ '#1 #2', '#1', '#2' ],
+                       [ '+1 +2', '+1', '+2' ],
+               ];
+       }
+
 }
diff --git a/tests/phpunit/includes/registration/VersionCheckerTest.php b/tests/phpunit/includes/registration/VersionCheckerTest.php
deleted file mode 100644 (file)
index e824e3f..0000000
+++ /dev/null
@@ -1,479 +0,0 @@
-<?php
-
-/**
- * @covers VersionChecker
- */
-class VersionCheckerTest extends PHPUnit\Framework\TestCase {
-
-       use MediaWikiCoversValidator;
-       use PHPUnit4And6Compat;
-
-       /**
-        * @dataProvider provideMediaWikiCheck
-        */
-       public function testMediaWikiCheck( $coreVersion, $constraint, $expected ) {
-               $checker = new VersionChecker( $coreVersion, '7.0.0', [] );
-               $this->assertEquals( $expected, !(bool)$checker->checkArray( [
-                       'FakeExtension' => [
-                               'MediaWiki' => $constraint,
-                       ],
-               ] ) );
-       }
-
-       public static function provideMediaWikiCheck() {
-               return [
-                       // [ $wgVersion, constraint, expected ]
-                       [ '1.25alpha', '>= 1.26', false ],
-                       [ '1.25.0', '>= 1.26', false ],
-                       [ '1.26alpha', '>= 1.26', true ],
-                       [ '1.26alpha', '>= 1.26.0', true ],
-                       [ '1.26alpha', '>= 1.26.0-stable', false ],
-                       [ '1.26.0', '>= 1.26.0-stable', true ],
-                       [ '1.26.1', '>= 1.26.0-stable', true ],
-                       [ '1.27.1', '>= 1.26.0-stable', true ],
-                       [ '1.26alpha', '>= 1.26.1', false ],
-                       [ '1.26alpha', '>= 1.26alpha', true ],
-                       [ '1.26alpha', '>= 1.25', true ],
-                       [ '1.26.0-alpha.14', '>= 1.26.0-alpha.15', false ],
-                       [ '1.26.0-alpha.14', '>= 1.26.0-alpha.10', true ],
-                       [ '1.26.1', '>= 1.26.2, <=1.26.0', false ],
-                       [ '1.26.1', '^1.26.2', false ],
-                       // Accept anything for un-parsable version strings
-                       [ '1.26mwf14', '== 1.25alpha', true ],
-                       [ 'totallyinvalid', '== 1.0', true ],
-               ];
-       }
-
-       /**
-        * @dataProvider providePhpValidCheck
-        */
-       public function testPhpValidCheck( $phpVersion, $constraint, $expected ) {
-               $checker = new VersionChecker( '1.0.0', $phpVersion, [] );
-               $this->assertEquals( $expected, !(bool)$checker->checkArray( [
-                       'FakeExtension' => [
-                               'platform' => [
-                                       'php' => $constraint,
-                               ],
-                       ],
-               ] ) );
-       }
-
-       public static function providePhpValidCheck() {
-               return [
-                       // [ phpVersion, constraint, expected ]
-                       [ '7.0.23', '>= 7.0.0', true ],
-                       [ '7.0.23', '^7.1.0', false ],
-                       [ '7.0.23', '7.0.23', true ],
-               ];
-       }
-
-       /**
-        * @expectedException UnexpectedValueException
-        */
-       public function testPhpInvalidConstraint() {
-               $checker = new VersionChecker( '1.0.0', '7.0.0', [] );
-               $checker->checkArray( [
-                       'FakeExtension' => [
-                               'platform' => [
-                                       'php' => 'totallyinvalid',
-                               ],
-                       ],
-               ] );
-       }
-
-       /**
-        * @dataProvider providePhpInvalidVersion
-        * @expectedException UnexpectedValueException
-        */
-       public function testPhpInvalidVersion( $phpVersion ) {
-                $checker = new VersionChecker( '1.0.0', $phpVersion, [] );
-       }
-
-       public static function providePhpInvalidVersion() {
-               return [
-                       // [ phpVersion ]
-                       [ '7.abc' ],
-                       [ '5.a.x' ],
-               ];
-       }
-
-       /**
-        * @dataProvider provideType
-        */
-       public function testType( $given, $expected ) {
-               $checker = new VersionChecker(
-                       '1.0.0',
-                       '7.0.0',
-                       [ 'phpLoadedExtension' ],
-                       [
-                               'presentAbility' => true,
-                               'presentAbilityWithMessage' => true,
-                               'missingAbility' => false,
-                               'missingAbilityWithMessage' => false,
-                       ],
-                       [
-                               'presentAbilityWithMessage' => 'Present.',
-                               'missingAbilityWithMessage' => 'Missing.',
-                       ]
-               );
-               $checker->setLoadedExtensionsAndSkins( [
-                               'FakeDependency' => [
-                                       'version' => '1.0.0',
-                               ],
-                               'NoVersionGiven' => [],
-                       ] );
-               $this->assertEquals( $expected, $checker->checkArray( [
-                       'FakeExtension' => $given,
-               ] ) );
-       }
-
-       public static function provideType() {
-               return [
-                       // valid type
-                       [
-                               [
-                                       'extensions' => [
-                                               'FakeDependency' => '1.0.0',
-                                       ],
-                               ],
-                               [],
-                       ],
-                       [
-                               [
-                                       'MediaWiki' => '1.0.0',
-                               ],
-                               [],
-                       ],
-                       [
-                               [
-                                       'extensions' => [
-                                               'NoVersionGiven' => '*',
-                                       ],
-                               ],
-                               [],
-                       ],
-                       [
-                               [
-                                       'extensions' => [
-                                               'NoVersionGiven' => '1.0',
-                                       ],
-                               ],
-                               [
-                                       [
-                                               'incompatible' => 'FakeExtension',
-                                               'type' => 'incompatible-extensions',
-                                               'msg' => 'NoVersionGiven does not expose its version, but FakeExtension requires: 1.0.',
-                                       ],
-                               ],
-                       ],
-                       [
-                               [
-                                       'extensions' => [
-                                               'Missing' => '*',
-                                       ],
-                               ],
-                               [
-                                       [
-                                               'missing' => 'Missing',
-                                               'type' => 'missing-extensions',
-                                               'msg' => 'FakeExtension requires Missing to be installed.',
-                                       ],
-                               ],
-                       ],
-                       [
-                               [
-                                       'extensions' => [
-                                               'FakeDependency' => '2.0.0',
-                                       ],
-                               ],
-                               [
-                                       [
-                                               'incompatible' => 'FakeExtension',
-                                               'type' => 'incompatible-extensions',
-                                               // phpcs:ignore Generic.Files.LineLength.TooLong
-                                               'msg' => 'FakeExtension is not compatible with the current installed version of FakeDependency (1.0.0), it requires: 2.0.0.',
-                                       ],
-                               ],
-                       ],
-                       [
-                               [
-                                       'skins' => [
-                                               'FakeSkin' => '*',
-                                       ],
-                               ],
-                               [
-                                       [
-                                               'missing' => 'FakeSkin',
-                                               'type' => 'missing-skins',
-                                               'msg' => 'FakeExtension requires FakeSkin to be installed.',
-                                       ],
-                               ],
-                       ],
-                       [
-                               [
-                                       'platform' => [
-                                               'ext-phpLoadedExtension' => '*',
-                                       ],
-                               ],
-                               [],
-                       ],
-                       [
-                               [
-                                       'platform' => [
-                                               'ext-phpMissingExtension' => '*',
-                                       ],
-                               ],
-                               [
-                                       [
-                                               'missing' => 'phpMissingExtension',
-                                               'type' => 'missing-phpExtension',
-                                               // phpcs:ignore Generic.Files.LineLength.TooLong
-                                               'msg' => 'FakeExtension requires phpMissingExtension PHP extension to be installed.',
-                                       ],
-                               ],
-                       ],
-                       [
-                               [
-                                       'platform' => [
-                                               'ability-presentAbility' => true,
-                                       ],
-                               ],
-                               [],
-                       ],
-                       [
-                               [
-                                       'platform' => [
-                                               'ability-presentAbilityWithMessage' => true,
-                                       ],
-                               ],
-                               [],
-                       ],
-                       [
-                               [
-                                       'platform' => [
-                                               'ability-presentAbility' => false,
-                                       ],
-                               ],
-                               [],
-                       ],
-                       [
-                               [
-                                       'platform' => [
-                                               'ability-presentAbilityWithMessage' => false,
-                                       ],
-                               ],
-                               [],
-                       ],
-                       [
-                               [
-                                       'platform' => [
-                                               'ability-missingAbility' => true,
-                                       ],
-                               ],
-                               [
-                                       [
-                                               'missing' => 'missingAbility',
-                                               'type' => 'missing-ability',
-                                               'msg' => 'FakeExtension requires "missingAbility" ability',
-                                       ],
-                               ],
-                       ],
-                       [
-                               [
-                                       'platform' => [
-                                               'ability-missingAbilityWithMessage' => true,
-                                       ],
-                               ],
-                               [
-                                       [
-                                               'missing' => 'missingAbilityWithMessage',
-                                               'type' => 'missing-ability',
-                                               // phpcs:ignore Generic.Files.LineLength.TooLong
-                                               'msg' => 'FakeExtension requires "missingAbilityWithMessage" ability: Missing.',
-                                       ],
-                               ],
-                       ],
-                       [
-                               [
-                                       'platform' => [
-                                               'ability-missingAbility' => false,
-                                       ],
-                               ],
-                               [],
-                       ],
-                       [
-                               [
-                                       'platform' => [
-                                               'ability-missingAbilityWithMessage' => false,
-                                       ],
-                               ],
-                               [],
-                       ],
-               ];
-       }
-
-       /**
-        * Check, if a non-parsable version constraint does not throw an exception or
-        * returns any error message.
-        */
-       public function testInvalidConstraint() {
-               $checker = new VersionChecker( '1.0.0', '7.0.0', [] );
-               $checker->setLoadedExtensionsAndSkins( [
-                               'FakeDependency' => [
-                                       'version' => 'not really valid',
-                               ],
-                       ] );
-               $this->assertEquals( [
-                       [
-                               'type' => 'invalid-version',
-                               'msg' => "FakeDependency does not have a valid version string.",
-                       ],
-               ], $checker->checkArray( [
-                       'FakeExtension' => [
-                               'extensions' => [
-                                       'FakeDependency' => '1.24.3',
-                               ],
-                       ],
-               ] ) );
-
-               $checker = new VersionChecker( '1.0.0', '7.0.0', [] );
-               $checker->setLoadedExtensionsAndSkins( [
-                               'FakeDependency' => [
-                                       'version' => '1.24.3',
-                               ],
-                       ] );
-
-               $this->setExpectedException( UnexpectedValueException::class );
-               $checker->checkArray( [
-                       'FakeExtension' => [
-                               'FakeDependency' => 'not really valid',
-                       ],
-               ] );
-       }
-
-       public function provideInvalidDependency() {
-               return [
-                       [
-                               [
-                                       'FakeExtension' => [
-                                               'platform' => [
-                                                       'undefinedPlatformDependency' => '*',
-                                               ],
-                                       ],
-                               ],
-                               'undefinedPlatformDependency',
-                       ],
-                       [
-                               [
-                                       'FakeExtension' => [
-                                               'platform' => [
-                                                       'phpLoadedExtension' => '*',
-                                               ],
-                                       ],
-                               ],
-                               'phpLoadedExtension',
-                       ],
-                       [
-                               [
-                                       'FakeExtension' => [
-                                               'platform' => [
-                                                       'ability-invalidAbility' => true,
-                                               ],
-                                       ],
-                               ],
-                               'ability-invalidAbility',
-                       ],
-                       [
-                               [
-                                       'FakeExtension' => [
-                                               'platform' => [
-                                                       'presentAbility' => true,
-                                               ],
-                                       ],
-                               ],
-                               'presentAbility',
-                       ],
-                       [
-                               [
-                                       'FakeExtension' => [
-                                               'undefinedDependencyType' => '*',
-                                       ],
-                               ],
-                               'undefinedDependencyType',
-                       ],
-                       // T197478
-                       [
-                               [
-                                       'FakeExtension' => [
-                                               'skin' => [
-                                                       'FakeSkin' => '*',
-                                               ],
-                                       ],
-                               ],
-                               'skin',
-                       ],
-               ];
-       }
-
-       /**
-        * @dataProvider provideInvalidDependency
-        */
-       public function testInvalidDependency( $depencency, $type ) {
-               $checker = new VersionChecker(
-                       '1.0.0',
-                       '7.0.0',
-                       [ 'phpLoadedExtension' ],
-                       [
-                               'presentAbility' => true,
-                               'missingAbility' => false,
-                       ]
-               );
-               $this->setExpectedException(
-                       UnexpectedValueException::class,
-                       "Dependency type $type unknown in FakeExtension"
-               );
-               $checker->checkArray( $depencency );
-       }
-
-       public function testInvalidPhpExtensionConstraint() {
-               $checker = new VersionChecker( '1.0.0', '7.0.0', [ 'phpLoadedExtension' ] );
-               $this->setExpectedException(
-                       UnexpectedValueException::class,
-                       'Version constraints for PHP extensions are not supported in FakeExtension'
-               );
-               $checker->checkArray( [
-                       'FakeExtension' => [
-                               'platform' => [
-                                       'ext-phpLoadedExtension' => '1.0.0',
-                               ],
-                       ],
-               ] );
-       }
-
-       /**
-        * @dataProvider provideInvalidAbilityType
-        */
-       public function testInvalidAbilityType( $value ) {
-               $checker = new VersionChecker( '1.0.0', '7.0.0', [], [ 'presentAbility' => true ] );
-               $this->setExpectedException(
-                       UnexpectedValueException::class,
-                       'Only booleans are allowed to to indicate the presence of abilities in FakeExtension'
-               );
-               $checker->checkArray( [
-                       'FakeExtension' => [
-                               'platform' => [
-                                       'ability-presentAbility' => $value,
-                               ],
-                       ],
-               ] );
-       }
-
-       public function provideInvalidAbilityType() {
-               return [
-                       [ null ],
-                       [ 1 ],
-                       [ '1' ],
-               ];
-       }
-
-}
diff --git a/tests/phpunit/includes/search/SearchSuggestionSetTest.php b/tests/phpunit/includes/search/SearchSuggestionSetTest.php
deleted file mode 100644 (file)
index 02fa5e9..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-<?php
-
-/**
- * Test for filter utilities.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- */
-
-class SearchSuggestionSetTest extends \PHPUnit\Framework\TestCase {
-       /**
-        * Test that adding a new suggestion at the end
-        * will keep proper score ordering
-        * @covers SearchSuggestionSet::append
-        */
-       public function testAppend() {
-               $set = SearchSuggestionSet::emptySuggestionSet();
-               $this->assertEquals( 0, $set->getSize() );
-               $set->append( new SearchSuggestion( 3 ) );
-               $this->assertEquals( 3, $set->getWorstScore() );
-               $this->assertEquals( 3, $set->getBestScore() );
-
-               $suggestion = new SearchSuggestion( 4 );
-               $set->append( $suggestion );
-               $this->assertEquals( 2, $set->getWorstScore() );
-               $this->assertEquals( 3, $set->getBestScore() );
-               $this->assertEquals( 2, $suggestion->getScore() );
-
-               $suggestion = new SearchSuggestion( 2 );
-               $set->append( $suggestion );
-               $this->assertEquals( 1, $set->getWorstScore() );
-               $this->assertEquals( 3, $set->getBestScore() );
-               $this->assertEquals( 1, $suggestion->getScore() );
-
-               $scores = $set->map( function ( $s ) {
-                       return $s->getScore();
-               } );
-               $sorted = $scores;
-               asort( $sorted );
-               $this->assertEquals( $sorted, $scores );
-       }
-
-       /**
-        * Test that adding a new best suggestion will keep proper score
-        * ordering
-        * @covers SearchSuggestionSet::getWorstScore
-        * @covers SearchSuggestionSet::getBestScore
-        * @covers SearchSuggestionSet::prepend
-        */
-       public function testInsertBest() {
-               $set = SearchSuggestionSet::emptySuggestionSet();
-               $this->assertEquals( 0, $set->getSize() );
-               $set->prepend( new SearchSuggestion( 3 ) );
-               $this->assertEquals( 3, $set->getWorstScore() );
-               $this->assertEquals( 3, $set->getBestScore() );
-
-               $suggestion = new SearchSuggestion( 4 );
-               $set->prepend( $suggestion );
-               $this->assertEquals( 3, $set->getWorstScore() );
-               $this->assertEquals( 4, $set->getBestScore() );
-               $this->assertEquals( 4, $suggestion->getScore() );
-
-               $suggestion = new SearchSuggestion( 0 );
-               $set->prepend( $suggestion );
-               $this->assertEquals( 3, $set->getWorstScore() );
-               $this->assertEquals( 5, $set->getBestScore() );
-               $this->assertEquals( 5, $suggestion->getScore() );
-
-               $suggestion = new SearchSuggestion( 2 );
-               $set->prepend( $suggestion );
-               $this->assertEquals( 3, $set->getWorstScore() );
-               $this->assertEquals( 6, $set->getBestScore() );
-               $this->assertEquals( 6, $suggestion->getScore() );
-
-               $scores = $set->map( function ( $s ) {
-                       return $s->getScore();
-               } );
-               $sorted = $scores;
-               asort( $sorted );
-               $this->assertEquals( $sorted, $scores );
-       }
-
-       /**
-        * @covers SearchSuggestionSet::shrink
-        */
-       public function testShrink() {
-               $set = SearchSuggestionSet::emptySuggestionSet();
-               for ( $i = 0; $i < 100; $i++ ) {
-                       $set->append( new SearchSuggestion( 0 ) );
-               }
-               $set->shrink( 10 );
-               $this->assertEquals( 10, $set->getSize() );
-
-               $set->shrink( 0 );
-               $this->assertEquals( 0, $set->getSize() );
-       }
-
-       // TODO: test for fromTitles
-}
diff --git a/tests/phpunit/includes/shell/CommandFactoryTest.php b/tests/phpunit/includes/shell/CommandFactoryTest.php
deleted file mode 100644 (file)
index b031431..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-
-use MediaWiki\Shell\Command;
-use MediaWiki\Shell\CommandFactory;
-use MediaWiki\Shell\FirejailCommand;
-use Psr\Log\NullLogger;
-use Wikimedia\TestingAccessWrapper;
-
-/**
- * @group Shell
- */
-class CommandFactoryTest extends PHPUnit\Framework\TestCase {
-
-       use MediaWikiCoversValidator;
-
-       /**
-        * @covers MediaWiki\Shell\CommandFactory::create
-        */
-       public function testCreate() {
-               $logger = new NullLogger();
-               $cgroup = '/sys/fs/cgroup/memory/mygroup';
-               $limits = [
-                       'filesize' => 1000,
-                       'memory' => 1000,
-                       'time' => 30,
-                       'walltime' => 40,
-               ];
-
-               $factory = new CommandFactory( $limits, $cgroup, false );
-               $factory->setLogger( $logger );
-               $factory->logStderr();
-               $command = $factory->create();
-               $this->assertInstanceOf( Command::class, $command );
-
-               $wrapper = TestingAccessWrapper::newFromObject( $command );
-               $this->assertSame( $logger, $wrapper->logger );
-               $this->assertSame( $cgroup, $wrapper->cgroup );
-               $this->assertSame( $limits, $wrapper->limits );
-               $this->assertTrue( $wrapper->doLogStderr );
-       }
-
-       /**
-        * @covers MediaWiki\Shell\CommandFactory::create
-        */
-       public function testFirejailCreate() {
-               $factory = new CommandFactory( [], false, 'firejail' );
-               $factory->setLogger( new NullLogger() );
-               $this->assertInstanceOf( FirejailCommand::class, $factory->create() );
-       }
-}
diff --git a/tests/phpunit/includes/site/CachingSiteStoreTest.php b/tests/phpunit/includes/site/CachingSiteStoreTest.php
new file mode 100644 (file)
index 0000000..df12eba
--- /dev/null
@@ -0,0 +1,167 @@
+<?php
+
+/**
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @since 1.25
+ *
+ * @ingroup Site
+ * @ingroup Test
+ *
+ * @group Site
+ * @group Database
+ *
+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
+ */
+class CachingSiteStoreTest extends \MediaWikiIntegrationTestCase {
+
+       /**
+        * @covers CachingSiteStore::getSites
+        */
+       public function testGetSites() {
+               $testSites = TestSites::getSites();
+
+               $store = new CachingSiteStore(
+                       $this->getHashSiteStore( $testSites ),
+                       ObjectCache::getLocalClusterInstance()
+               );
+
+               $sites = $store->getSites();
+
+               $this->assertInstanceOf( SiteList::class, $sites );
+
+               /**
+                * @var Site $site
+                */
+               foreach ( $sites as $site ) {
+                       $this->assertInstanceOf( Site::class, $site );
+               }
+
+               foreach ( $testSites as $site ) {
+                       if ( $site->getGlobalId() !== null ) {
+                               $this->assertTrue( $sites->hasSite( $site->getGlobalId() ) );
+                       }
+               }
+       }
+
+       /**
+        * @covers CachingSiteStore::saveSites
+        */
+       public function testSaveSites() {
+               $store = new CachingSiteStore(
+                       new HashSiteStore(), ObjectCache::getLocalClusterInstance()
+               );
+
+               $sites = [];
+
+               $site = new Site();
+               $site->setGlobalId( 'ertrywuutr' );
+               $site->setLanguageCode( 'en' );
+               $sites[] = $site;
+
+               $site = new MediaWikiSite();
+               $site->setGlobalId( 'sdfhxujgkfpth' );
+               $site->setLanguageCode( 'nl' );
+               $sites[] = $site;
+
+               $this->assertTrue( $store->saveSites( $sites ) );
+
+               $site = $store->getSite( 'ertrywuutr' );
+               $this->assertInstanceOf( Site::class, $site );
+               $this->assertEquals( 'en', $site->getLanguageCode() );
+
+               $site = $store->getSite( 'sdfhxujgkfpth' );
+               $this->assertInstanceOf( Site::class, $site );
+               $this->assertEquals( 'nl', $site->getLanguageCode() );
+       }
+
+       /**
+        * @covers CachingSiteStore::reset
+        */
+       public function testReset() {
+               $dbSiteStore = $this->getMockBuilder( SiteStore::class )
+                       ->disableOriginalConstructor()
+                       ->getMock();
+
+               $dbSiteStore->expects( $this->any() )
+                       ->method( 'getSite' )
+                       ->will( $this->returnValue( $this->getTestSite() ) );
+
+               $dbSiteStore->expects( $this->any() )
+                       ->method( 'getSites' )
+                       ->will( $this->returnCallback( function () {
+                               $siteList = new SiteList();
+                               $siteList->setSite( $this->getTestSite() );
+
+                               return $siteList;
+                       } ) );
+
+               $store = new CachingSiteStore( $dbSiteStore, ObjectCache::getLocalClusterInstance() );
+
+               // initialize internal cache
+               $this->assertGreaterThan( 0, $store->getSites()->count(), 'count sites' );
+
+               $store->getSite( 'enwiki' )->setLanguageCode( 'en-ca' );
+
+               // sanity check: $store should have the new language code for 'enwiki'
+               $this->assertEquals( 'en-ca', $store->getSite( 'enwiki' )->getLanguageCode(), 'sanity check' );
+
+               // purge cache
+               $store->reset();
+
+               // the internal cache of $store should be updated, and now pulling
+               // the site from the 'fallback' DBSiteStore with the original language code.
+               $this->assertEquals( 'en', $store->getSite( 'enwiki' )->getLanguageCode(), 'reset' );
+       }
+
+       public function getTestSite() {
+               $enwiki = new MediaWikiSite();
+               $enwiki->setGlobalId( 'enwiki' );
+               $enwiki->setLanguageCode( 'en' );
+
+               return $enwiki;
+       }
+
+       /**
+        * @covers CachingSiteStore::clear
+        */
+       public function testClear() {
+               $store = new CachingSiteStore(
+                       new HashSiteStore(), ObjectCache::getLocalClusterInstance()
+               );
+               $this->assertTrue( $store->clear() );
+
+               $site = $store->getSite( 'enwiki' );
+               $this->assertNull( $site );
+
+               $sites = $store->getSites();
+               $this->assertEquals( 0, $sites->count() );
+       }
+
+       /**
+        * @param Site[] $sites
+        *
+        * @return SiteStore
+        */
+       private function getHashSiteStore( array $sites ) {
+               $siteStore = new HashSiteStore();
+               $siteStore->saveSites( $sites );
+
+               return $siteStore;
+       }
+
+}
diff --git a/tests/phpunit/includes/site/HashSiteStoreTest.php b/tests/phpunit/includes/site/HashSiteStoreTest.php
new file mode 100644 (file)
index 0000000..3912504
--- /dev/null
@@ -0,0 +1,105 @@
+<?php
+
+/**
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @since 1.25
+ *
+ * @ingroup Site
+ * @group Site
+ *
+ * @author Katie Filbert < aude.wiki@gmail.com >
+ */
+class HashSiteStoreTest extends \MediaWikiIntegrationTestCase {
+
+       /**
+        * @covers HashSiteStore::getSites
+        */
+       public function testGetSites() {
+               $expectedSites = [];
+
+               foreach ( TestSites::getSites() as $testSite ) {
+                       $siteId = $testSite->getGlobalId();
+                       $expectedSites[$siteId] = $testSite;
+               }
+
+               $siteStore = new HashSiteStore( $expectedSites );
+
+               $this->assertEquals( new SiteList( $expectedSites ), $siteStore->getSites() );
+       }
+
+       /**
+        * @covers HashSiteStore::saveSite
+        * @covers HashSiteStore::getSite
+        */
+       public function testSaveSite() {
+               $store = new HashSiteStore();
+
+               $site = new Site();
+               $site->setGlobalId( 'dewiki' );
+
+               $this->assertCount( 0, $store->getSites(), '0 sites in store' );
+
+               $store->saveSite( $site );
+
+               $this->assertCount( 1, $store->getSites(), 'Store has 1 sites' );
+               $this->assertEquals( $site, $store->getSite( 'dewiki' ), 'Store has dewiki' );
+       }
+
+       /**
+        * @covers HashSiteStore::saveSites
+        */
+       public function testSaveSites() {
+               $store = new HashSiteStore();
+
+               $sites = [];
+
+               $site = new Site();
+               $site->setGlobalId( 'enwiki' );
+               $site->setLanguageCode( 'en' );
+               $sites[] = $site;
+
+               $site = new MediaWikiSite();
+               $site->setGlobalId( 'eswiki' );
+               $site->setLanguageCode( 'es' );
+               $sites[] = $site;
+
+               $this->assertCount( 0, $store->getSites(), '0 sites in store' );
+
+               $store->saveSites( $sites );
+
+               $this->assertCount( 2, $store->getSites(), 'Store has 2 sites' );
+               $this->assertTrue( $store->getSites()->hasSite( 'enwiki' ), 'Store has enwiki' );
+               $this->assertTrue( $store->getSites()->hasSite( 'eswiki' ), 'Store has eswiki' );
+       }
+
+       /**
+        * @covers HashSiteStore::clear
+        */
+       public function testClear() {
+               $store = new HashSiteStore();
+
+               $site = new Site();
+               $site->setGlobalId( 'arwiki' );
+               $store->saveSite( $site );
+
+               $this->assertCount( 1, $store->getSites(), '1 site in store' );
+
+               $store->clear();
+               $this->assertCount( 0, $store->getSites(), '0 sites in store' );
+       }
+}
diff --git a/tests/phpunit/includes/site/SiteExporterTest.php b/tests/phpunit/includes/site/SiteExporterTest.php
deleted file mode 100644 (file)
index 97a43f8..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-<?php
-
-/**
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- *
- * @ingroup Site
- * @ingroup Test
- *
- * @group Site
- *
- * @covers SiteExporter
- *
- * @author Daniel Kinzler
- */
-class SiteExporterTest extends PHPUnit\Framework\TestCase {
-
-       use MediaWikiCoversValidator;
-       use PHPUnit4And6Compat;
-
-       public function testConstructor_InvalidArgument() {
-               $this->setExpectedException( InvalidArgumentException::class );
-
-               new SiteExporter( 'Foo' );
-       }
-
-       public function testExportSites() {
-               $foo = Site::newForType( Site::TYPE_UNKNOWN );
-               $foo->setGlobalId( 'Foo' );
-
-               $acme = Site::newForType( Site::TYPE_UNKNOWN );
-               $acme->setGlobalId( 'acme.com' );
-               $acme->setGroup( 'Test' );
-               $acme->addLocalId( Site::ID_INTERWIKI, 'acme' );
-               $acme->setPath( Site::PATH_LINK, 'http://acme.com/' );
-
-               $tmp = tmpfile();
-               $exporter = new SiteExporter( $tmp );
-
-               $exporter->exportSites( [ $foo, $acme ] );
-
-               fseek( $tmp, 0 );
-               $xml = fread( $tmp, 16 * 1024 );
-
-               $this->assertContains( '<sites ', $xml );
-               $this->assertContains( '<site>', $xml );
-               $this->assertContains( '<globalid>Foo</globalid>', $xml );
-               $this->assertContains( '</site>', $xml );
-               $this->assertContains( '<globalid>acme.com</globalid>', $xml );
-               $this->assertContains( '<group>Test</group>', $xml );
-               $this->assertContains( '<localid type="interwiki">acme</localid>', $xml );
-               $this->assertContains( '<path type="link">http://acme.com/</path>', $xml );
-               $this->assertContains( '</sites>', $xml );
-
-               // NOTE: HHVM (at least on wmf Jenkins) doesn't like file URLs.
-               $xsdFile = __DIR__ . '/../../../../docs/sitelist-1.0.xsd';
-               $xsdData = file_get_contents( $xsdFile );
-
-               $document = new DOMDocument();
-               $document->loadXML( $xml, LIBXML_NONET );
-               $document->schemaValidateSource( $xsdData );
-       }
-
-       private function newSiteStore( SiteList $sites ) {
-               $store = $this->getMockBuilder( SiteStore::class )->getMock();
-
-               $store->expects( $this->once() )
-                       ->method( 'saveSites' )
-                       ->will( $this->returnCallback( function ( $moreSites ) use ( $sites ) {
-                               foreach ( $moreSites as $site ) {
-                                       $sites->setSite( $site );
-                               }
-                       } ) );
-
-               $store->expects( $this->any() )
-                       ->method( 'getSites' )
-                       ->will( $this->returnValue( new SiteList() ) );
-
-               return $store;
-       }
-
-       public function provideRoundTrip() {
-               $foo = Site::newForType( Site::TYPE_UNKNOWN );
-               $foo->setGlobalId( 'Foo' );
-
-               $acme = Site::newForType( Site::TYPE_UNKNOWN );
-               $acme->setGlobalId( 'acme.com' );
-               $acme->setGroup( 'Test' );
-               $acme->addLocalId( Site::ID_INTERWIKI, 'acme' );
-               $acme->setPath( Site::PATH_LINK, 'http://acme.com/' );
-
-               $dewiki = Site::newForType( Site::TYPE_MEDIAWIKI );
-               $dewiki->setGlobalId( 'dewiki' );
-               $dewiki->setGroup( 'wikipedia' );
-               $dewiki->setForward( true );
-               $dewiki->addLocalId( Site::ID_INTERWIKI, 'wikipedia' );
-               $dewiki->addLocalId( Site::ID_EQUIVALENT, 'de' );
-               $dewiki->setPath( Site::PATH_LINK, 'http://de.wikipedia.org/w/' );
-               $dewiki->setPath( MediaWikiSite::PATH_PAGE, 'http://de.wikipedia.org/wiki/' );
-               $dewiki->setSource( 'meta.wikimedia.org' );
-
-               return [
-                       'empty' => [
-                               new SiteList()
-                       ],
-
-                       'some' => [
-                               new SiteList( [ $foo, $acme, $dewiki ] ),
-                       ],
-               ];
-       }
-
-       /**
-        * @dataProvider provideRoundTrip()
-        */
-       public function testRoundTrip( SiteList $sites ) {
-               $tmp = tmpfile();
-               $exporter = new SiteExporter( $tmp );
-
-               $exporter->exportSites( $sites );
-
-               fseek( $tmp, 0 );
-               $xml = fread( $tmp, 16 * 1024 );
-
-               $actualSites = new SiteList();
-               $store = $this->newSiteStore( $actualSites );
-
-               $importer = new SiteImporter( $store );
-               $importer->importFromXML( $xml );
-
-               $this->assertEquals( $sites, $actualSites );
-       }
-
-}
diff --git a/tests/phpunit/includes/site/SiteImporterTest.php b/tests/phpunit/includes/site/SiteImporterTest.php
deleted file mode 100644 (file)
index dbdbd6f..0000000
+++ /dev/null
@@ -1,200 +0,0 @@
-<?php
-
-/**
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- *
- * @ingroup Site
- * @ingroup Test
- *
- * @group Site
- *
- * @covers SiteImporter
- *
- * @author Daniel Kinzler
- */
-class SiteImporterTest extends PHPUnit\Framework\TestCase {
-
-       use MediaWikiCoversValidator;
-       use PHPUnit4And6Compat;
-
-       private function newSiteImporter( array $expectedSites, $errorCount ) {
-               $store = $this->getMockBuilder( SiteStore::class )->getMock();
-
-               $store->expects( $this->once() )
-                       ->method( 'saveSites' )
-                       ->will( $this->returnCallback( function ( $sites ) use ( $expectedSites ) {
-                               $this->assertSitesEqual( $expectedSites, $sites );
-                       } ) );
-
-               $store->expects( $this->any() )
-                       ->method( 'getSites' )
-                       ->will( $this->returnValue( new SiteList() ) );
-
-               $errorHandler = $this->getMockBuilder( Psr\Log\LoggerInterface::class )->getMock();
-               $errorHandler->expects( $this->exactly( $errorCount ) )
-                       ->method( 'error' );
-
-               $importer = new SiteImporter( $store );
-               $importer->setExceptionCallback( [ $errorHandler, 'error' ] );
-
-               return $importer;
-       }
-
-       public function assertSitesEqual( $expected, $actual, $message = '' ) {
-               $this->assertEquals(
-                       $this->getSerializedSiteList( $expected ),
-                       $this->getSerializedSiteList( $actual ),
-                       $message
-               );
-       }
-
-       public function provideImportFromXML() {
-               $foo = Site::newForType( Site::TYPE_UNKNOWN );
-               $foo->setGlobalId( 'Foo' );
-
-               $acme = Site::newForType( Site::TYPE_UNKNOWN );
-               $acme->setGlobalId( 'acme.com' );
-               $acme->setGroup( 'Test' );
-               $acme->addLocalId( Site::ID_INTERWIKI, 'acme' );
-               $acme->setPath( Site::PATH_LINK, 'http://acme.com/' );
-
-               $dewiki = Site::newForType( Site::TYPE_MEDIAWIKI );
-               $dewiki->setGlobalId( 'dewiki' );
-               $dewiki->setGroup( 'wikipedia' );
-               $dewiki->setForward( true );
-               $dewiki->addLocalId( Site::ID_INTERWIKI, 'wikipedia' );
-               $dewiki->addLocalId( Site::ID_EQUIVALENT, 'de' );
-               $dewiki->setPath( Site::PATH_LINK, 'http://de.wikipedia.org/w/' );
-               $dewiki->setPath( MediaWikiSite::PATH_PAGE, 'http://de.wikipedia.org/wiki/' );
-               $dewiki->setSource( 'meta.wikimedia.org' );
-
-               return [
-                       'empty' => [
-                               '<sites></sites>',
-                               [],
-                       ],
-                       'no sites' => [
-                               '<sites><Foo><globalid>Foo</globalid></Foo><Bar><quux>Bla</quux></Bar></sites>',
-                               [],
-                       ],
-                       'minimal' => [
-                               '<sites>' .
-                                       '<site><globalid>Foo</globalid></site>' .
-                               '</sites>',
-                               [ $foo ],
-                       ],
-                       'full' => [
-                               '<sites>' .
-                                       '<site><globalid>Foo</globalid></site>' .
-                                       '<site>' .
-                                               '<globalid>acme.com</globalid>' .
-                                               '<localid type="interwiki">acme</localid>' .
-                                               '<group>Test</group>' .
-                                               '<path type="link">http://acme.com/</path>' .
-                                       '</site>' .
-                                       '<site type="mediawiki">' .
-                                               '<source>meta.wikimedia.org</source>' .
-                                               '<globalid>dewiki</globalid>' .
-                                               '<localid type="interwiki">wikipedia</localid>' .
-                                               '<localid type="equivalent">de</localid>' .
-                                               '<group>wikipedia</group>' .
-                                               '<forward/>' .
-                                               '<path type="link">http://de.wikipedia.org/w/</path>' .
-                                               '<path type="page_path">http://de.wikipedia.org/wiki/</path>' .
-                                       '</site>' .
-                               '</sites>',
-                               [ $foo, $acme, $dewiki ],
-                       ],
-                       'skip' => [
-                               '<sites>' .
-                                       '<site><globalid>Foo</globalid></site>' .
-                                       '<site><barf>Foo</barf></site>' .
-                                       '<site>' .
-                                               '<globalid>acme.com</globalid>' .
-                                               '<localid type="interwiki">acme</localid>' .
-                                               '<silly>boop!</silly>' .
-                                               '<group>Test</group>' .
-                                               '<path type="link">http://acme.com/</path>' .
-                                       '</site>' .
-                               '</sites>',
-                               [ $foo, $acme ],
-                               1
-                       ],
-               ];
-       }
-
-       /**
-        * @dataProvider provideImportFromXML
-        */
-       public function testImportFromXML( $xml, array $expectedSites, $errorCount = 0 ) {
-               $importer = $this->newSiteImporter( $expectedSites, $errorCount );
-               $importer->importFromXML( $xml );
-       }
-
-       public function testImportFromXML_malformed() {
-               $this->setExpectedException( Exception::class );
-
-               $store = $this->getMockBuilder( SiteStore::class )->getMock();
-               $importer = new SiteImporter( $store );
-               $importer->importFromXML( 'THIS IS NOT XML' );
-       }
-
-       public function testImportFromFile() {
-               $foo = Site::newForType( Site::TYPE_UNKNOWN );
-               $foo->setGlobalId( 'Foo' );
-
-               $acme = Site::newForType( Site::TYPE_UNKNOWN );
-               $acme->setGlobalId( 'acme.com' );
-               $acme->setGroup( 'Test' );
-               $acme->addLocalId( Site::ID_INTERWIKI, 'acme' );
-               $acme->setPath( Site::PATH_LINK, 'http://acme.com/' );
-
-               $dewiki = Site::newForType( Site::TYPE_MEDIAWIKI );
-               $dewiki->setGlobalId( 'dewiki' );
-               $dewiki->setGroup( 'wikipedia' );
-               $dewiki->setForward( true );
-               $dewiki->addLocalId( Site::ID_INTERWIKI, 'wikipedia' );
-               $dewiki->addLocalId( Site::ID_EQUIVALENT, 'de' );
-               $dewiki->setPath( Site::PATH_LINK, 'http://de.wikipedia.org/w/' );
-               $dewiki->setPath( MediaWikiSite::PATH_PAGE, 'http://de.wikipedia.org/wiki/' );
-               $dewiki->setSource( 'meta.wikimedia.org' );
-
-               $importer = $this->newSiteImporter( [ $foo, $acme, $dewiki ], 0 );
-
-               $file = __DIR__ . '/SiteImporterTest.xml';
-               $importer->importFromFile( $file );
-       }
-
-       /**
-        * @param Site[] $sites
-        *
-        * @return array[]
-        */
-       private function getSerializedSiteList( $sites ) {
-               $serialized = [];
-
-               foreach ( $sites as $site ) {
-                       $key = $site->getGlobalId();
-                       $data = unserialize( $site->serialize() );
-
-                       $serialized[$key] = $data;
-               }
-
-               return $serialized;
-       }
-}
diff --git a/tests/phpunit/includes/site/SiteImporterTest.xml b/tests/phpunit/includes/site/SiteImporterTest.xml
deleted file mode 100644 (file)
index 720b1fa..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-<sites version="1.0" xmlns="http://www.mediawiki.org/xml/sitelist-1.0/">
-       <site><globalid>Foo</globalid></site>
-       <site>
-               <globalid>acme.com</globalid>
-               <localid type="interwiki">acme</localid>
-               <group>Test</group>
-               <path type="link">http://acme.com/</path>
-       </site>
-       <site type="mediawiki">
-               <source>meta.wikimedia.org</source>
-               <globalid>dewiki</globalid>
-               <localid type="interwiki">wikipedia</localid>
-               <localid type="equivalent">de</localid>
-               <group>wikipedia</group>
-               <forward/>
-               <path type="link">http://de.wikipedia.org/w/</path>
-               <path type="page_path">http://de.wikipedia.org/wiki/</path>
-       </site>
-</sites>
diff --git a/tests/phpunit/includes/tidy/RemexDriverTest.php b/tests/phpunit/includes/tidy/RemexDriverTest.php
deleted file mode 100644 (file)
index 5ad8416..0000000
+++ /dev/null
@@ -1,326 +0,0 @@
-<?php
-
-class RemexDriverTest extends MediaWikiTestCase {
-       private static $remexTidyTestData = [
-               [
-                       'Empty string',
-                       "",
-                       ""
-               ],
-               [
-                       'Simple p-wrap',
-                       "x",
-                       "<p>x</p>"
-               ],
-               [
-                       'No p-wrap of blank node',
-                       " ",
-                       " "
-               ],
-               [
-                       'p-wrap terminated by div',
-                       "x<div></div>",
-                       "<p>x</p><div></div>"
-               ],
-               [
-                       'p-wrap not terminated by span',
-                       "x<span></span>",
-                       "<p>x<span></span></p>"
-               ],
-               [
-                       'An element is non-blank and so gets p-wrapped',
-                       "<span></span>",
-                       "<p><span></span></p>"
-               ],
-               [
-                       'The blank flag is set after a block-level element',
-                       "<div></div> ",
-                       "<div></div> "
-               ],
-               [
-                       'Blank detection between two block-level elements',
-                       "<div></div> <div></div>",
-                       "<div></div> <div></div>"
-               ],
-               [
-                       'But p-wrapping of non-blank content works after an element',
-                       "<div></div>x",
-                       "<div></div><p>x</p>"
-               ],
-               [
-                       'p-wrapping between two block-level elements',
-                       "<div></div>x<div></div>",
-                       "<div></div><p>x</p><div></div>"
-               ],
-               [
-                       'p-wrap inside blockquote',
-                       "<blockquote>x</blockquote>",
-                       "<blockquote><p>x</p></blockquote>"
-               ],
-               [
-                       'A comment is blank for p-wrapping purposes',
-                       "<!-- x -->",
-                       "<!-- x -->"
-               ],
-               [
-                       'A comment is blank even when a p-wrap was opened by a text node',
-                       " <!-- x -->",
-                       " <!-- x -->"
-               ],
-               [
-                       'A comment does not open a p-wrap',
-                       "<!-- x -->x",
-                       "<!-- x --><p>x</p>"
-               ],
-               [
-                       'A comment does not close a p-wrap',
-                       "x<!-- x -->",
-                       "<p>x<!-- x --></p>"
-               ],
-               [
-                       'Empty li',
-                       "<ul><li></li></ul>",
-                       "<ul><li class=\"mw-empty-elt\"></li></ul>"
-               ],
-               [
-                       'li with element',
-                       "<ul><li><span></span></li></ul>",
-                       "<ul><li><span></span></li></ul>"
-               ],
-               [
-                       'li with text',
-                       "<ul><li>x</li></ul>",
-                       "<ul><li>x</li></ul>"
-               ],
-               [
-                       'Empty tr',
-                       "<table><tbody><tr></tr></tbody></table>",
-                       "<table><tbody><tr class=\"mw-empty-elt\"></tr></tbody></table>"
-               ],
-               [
-                       'Empty p',
-                       "<p>\n</p>",
-                       "<p class=\"mw-empty-elt\">\n</p>"
-               ],
-               [
-                       'No p-wrapping of an inline element which contains a block element (T150317)',
-                       "<small><div>x</div></small>",
-                       "<small><div>x</div></small>"
-               ],
-               [
-                       'p-wrapping of an inline element which contains an inline element',
-                       "<small><b>x</b></small>",
-                       "<p><small><b>x</b></small></p>"
-               ],
-               [
-                       'p-wrapping is enabled in a blockquote in an inline element',
-                       "<small><blockquote>x</blockquote></small>",
-                       "<small><blockquote><p>x</p></blockquote></small>"
-               ],
-               [
-                       'All bare text should be p-wrapped even when surrounded by block tags',
-                       "<small><blockquote>x</blockquote></small>y<div></div>z",
-                       "<small><blockquote><p>x</p></blockquote></small><p>y</p><div></div><p>z</p>"
-               ],
-               [
-                       'Split tag stack 1',
-                       "<small>x<div>y</div>z</small>",
-                       "<p><small>x</small></p><small><div>y</div></small><p><small>z</small></p>"
-               ],
-               [
-                       'Split tag stack 2',
-                       "<small><div>y</div>z</small>",
-                       "<small><div>y</div></small><p><small>z</small></p>"
-               ],
-               [
-                       'Split tag stack 3',
-                       "<small>x<div>y</div></small>",
-                       "<p><small>x</small></p><small><div>y</div></small>"
-               ],
-               [
-                       'Split tag stack 4 (modified to use splittable tag)',
-                       "a<code>b<i>c<div>d</div></i>e</code>",
-                       "<p>a<code>b<i>c</i></code></p><code><i><div>d</div></i></code><p><code>e</code></p>"
-               ],
-               [
-                       "Split tag stack regression check 1",
-                       "x<span><div>y</div></span>",
-                       "<p>x</p><span><div>y</div></span>"
-               ],
-               [
-                       "Split tag stack regression check 2 (modified to use splittable tag)",
-                       "a<code><i><div>d</div></i>e</code>",
-                       "<p>a</p><code><i><div>d</div></i></code><p><code>e</code></p>"
-               ],
-               // Simple tests from pwrap.js
-               [
-                       'Simple pwrap test 1',
-                       'a',
-                       '<p>a</p>'
-               ],
-               [
-                       '<span> is not a splittable tag, but gets p-wrapped in simple wrapping scenarios',
-                       '<span>a</span>',
-                       '<p><span>a</span></p>'
-               ],
-               [
-                       'Simple pwrap test 3',
-                       'x <div>a</div> <div>b</div> y',
-                       '<p>x </p><div>a</div> <div>b</div><p> y</p>'
-               ],
-               [
-                       'Simple pwrap test 4',
-                       'x<!--c--> <div>a</div> <div>b</div> <!--c-->y',
-                       '<p>x<!--c--> </p><div>a</div> <div>b</div> <!--c--><p>y</p>'
-               ],
-               // Complex tests from pwrap.js
-               [
-                       'Complex pwrap test 1',
-                       '<i>x<div>a</div>y</i>',
-                       '<p><i>x</i></p><i><div>a</div></i><p><i>y</i></p>'
-               ],
-               [
-                       'Complex pwrap test 2',
-                       'a<small>b</small><i>c<div>d</div>e</i>f',
-                       '<p>a<small>b</small><i>c</i></p><i><div>d</div></i><p><i>e</i>f</p>'
-               ],
-               [
-                       'Complex pwrap test 3',
-                       'a<small>b<i>c<div>d</div></i>e</small>',
-                       '<p>a<small>b<i>c</i></small></p><small><i><div>d</div></i></small><p><small>e</small></p>'
-               ],
-               [
-                       'Complex pwrap test 4',
-                       'x<small><div>y</div></small>',
-                       '<p>x</p><small><div>y</div></small>'
-               ],
-               [
-                       'Complex pwrap test 5',
-                       'a<small><i><div>d</div></i>e</small>',
-                       '<p>a</p><small><i><div>d</div></i></small><p><small>e</small></p>'
-               ],
-               // phpcs:disable Generic.Files.LineLength
-               [
-                       'Complex pwrap test 6',
-                       '<i>a<div>b</div>c<b>d<div>e</div>f</b>g</i>',
-                       // PHP 5 does not allow concatenation in initialisation of a class static variable
-                       '<p><i>a</i></p><i><div>b</div></i><p><i>c<b>d</b></i></p><i><b><div>e</div></b></i><p><i><b>f</b>g</i></p>'
-               ],
-               // phpcs:enable
-               /* FIXME the second <b> causes a stack split which clones the <i> even
-                * though no <p> is actually generated
-               [
-                       'Complex pwrap test 7',
-                       '<i><b><font><div>x</div></font></b><div>y</div><b><font><div>z</div></font></b></i>',
-                       '<i><b><font><div>x</div></font></b><div>y</div><b><font><div>z</div></font></b></i>'
-               ],
-                */
-               // New local tests
-               [
-                       'Blank text node after block end',
-                       '<small>x<div>y</div> <b>z</b></small>',
-                       '<p><small>x</small></p><small><div>y</div></small><p><small> <b>z</b></small></p>'
-               ],
-               [
-                       'Text node fostering (FIXME: wrap missing)',
-                       '<table>x</table>',
-                       'x<table></table>'
-               ],
-               [
-                       'Blockquote fostering',
-                       '<table><blockquote>x</blockquote></table>',
-                       '<blockquote><p>x</p></blockquote><table></table>'
-               ],
-               [
-                       'Block element fostering',
-                       '<table><div>x',
-                       '<div>x</div><table></table>'
-               ],
-               [
-                       'Formatting element fostering (FIXME: wrap missing)',
-                       '<table><b>x',
-                       '<b>x</b><table></table>'
-               ],
-               [
-                       'AAA clone of p-wrapped element (FIXME: empty b)',
-                       '<b>x<p>y</b>z</p>',
-                       '<p><b>x</b></p><b></b><p><b>y</b>z</p>',
-               ],
-               [
-                       'AAA with fostering (FIXME: wrap missing)',
-                       '<table><b>1<p>2</b>3</p>',
-                       '<b>1</b><p><b>2</b>3</p><table></table>'
-               ],
-               [
-                       'AAA causes reparent of p-wrapped text node (T178632)',
-                       '<i><blockquote>x</i></blockquote>',
-                       '<i></i><blockquote><p><i>x</i></p></blockquote>',
-               ],
-               [
-                       'p-wrap ended by reparenting (T200827)',
-                       '<i><blockquote><p></i>',
-                       '<i></i><blockquote><p><i></i></p><p><i></i></p></blockquote>',
-               ],
-               [
-                       'style tag isn\'t p-wrapped (T186965)',
-                       '<style>/* ... */</style>',
-                       '<style>/* ... */</style>',
-               ],
-               [
-                       'link tag isn\'t p-wrapped (T186965)',
-                       '<link rel="foo" href="bar" />',
-                       '<link rel="foo" href="bar" />',
-               ],
-               [
-                       'style tag doesn\'t split p-wrapping (T208901)',
-                       'foo <style>/* ... */</style> bar',
-                       '<p>foo <style>/* ... */</style> bar</p>',
-               ],
-               [
-                       'link tag doesn\'t split p-wrapping (T208901)',
-                       'foo <link rel="foo" href="bar" /> bar',
-                       '<p>foo <link rel="foo" href="bar" /> bar</p>',
-               ],
-       ];
-
-       public function provider() {
-               return self::$remexTidyTestData;
-       }
-
-       /**
-        * @dataProvider provider
-        * @covers MediaWiki\Tidy\RemexCompatFormatter
-        * @covers MediaWiki\Tidy\RemexCompatMunger
-        * @covers MediaWiki\Tidy\RemexDriver
-        * @covers MediaWiki\Tidy\RemexMungerData
-        */
-       public function testTidy( $desc, $input, $expected ) {
-               $r = new MediaWiki\Tidy\RemexDriver( [] );
-               $result = $r->tidy( $input );
-               $this->assertEquals( $expected, $result, $desc );
-       }
-
-       public function html5libProvider() {
-               $files = json_decode( file_get_contents( __DIR__ . '/html5lib-tests.json' ), true );
-               $tests = [];
-               foreach ( $files as $file => $fileTests ) {
-                       foreach ( $fileTests as $i => $test ) {
-                               $tests[] = [ "$file:$i", $test['data'] ];
-                       }
-               }
-               return $tests;
-       }
-
-       /**
-        * This is a quick and dirty test to make sure none of the html5lib tests
-        * generate exceptions. We don't really know what the expected output is.
-        *
-        * @dataProvider html5libProvider
-        * @coversNothing
-        */
-       public function testHtml5Lib( $desc, $input ) {
-               $r = new MediaWiki\Tidy\RemexDriver( [] );
-               $result = $r->tidy( $input );
-               $this->assertTrue( true, $desc );
-       }
-}
diff --git a/tests/phpunit/includes/tidy/html5lib-tests.json b/tests/phpunit/includes/tidy/html5lib-tests.json
deleted file mode 100644 (file)
index 2b1c3e8..0000000
+++ /dev/null
@@ -1,80692 +0,0 @@
-{
-  "adoption01.dat": [
-    {
-      "data": "<a><p></a></p>",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag",
-        "(1,10): adoption-agency-1.3"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a"
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "a"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a></a><p><a></a></p></body></html>",
-        "noQuirksBodyHtml": "<a></a><p><a></a></p>"
-      }
-    },
-    {
-      "data": "<a>1<p>2</a>3</p>",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag",
-        "(1,12): adoption-agency-1.3"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "text": "1"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "a",
-                        "children": [
-                          {
-                            "text": "2"
-                          }
-                        ]
-                      },
-                      {
-                        "text": "3"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a>1</a><p><a>2</a>3</p></body></html>",
-        "noQuirksBodyHtml": "<a>1</a><p><a>2</a>3</p>"
-      }
-    },
-    {
-      "data": "<a>1<button>2</a>3</button>",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag",
-        "(1,17): adoption-agency-1.3"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "button": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "text": "1"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "button",
-                    "children": [
-                      {
-                        "tag": "a",
-                        "children": [
-                          {
-                            "text": "2"
-                          }
-                        ]
-                      },
-                      {
-                        "text": "3"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a>1</a><button><a>2</a>3</button></body></html>",
-        "noQuirksBodyHtml": "<a>1</a><button><a>2</a>3</button>"
-      }
-    },
-    {
-      "data": "<a>1<b>2</a>3</b>",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag",
-        "(1,12): adoption-agency-1.3"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "b": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "text": "1"
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": "2"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "text": "3"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a>1<b>2</b></a><b>3</b></body></html>",
-        "noQuirksBodyHtml": "<a>1<b>2</b></a><b>3</b>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "text": "1"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "a",
-                        "children": [
-                          {
-                            "text": "2"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "div",
-                        "children": [
-                          {
-                            "tag": "a",
-                            "children": [
-                              {
-                                "text": "3"
-                              }
-                            ]
-                          },
-                          {
-                            "text": "4"
-                          }
-                        ]
-                      },
-                      {
-                        "text": "5"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a>1</a><div><a>2</a><div><a>3</a>4</div>5</div></body></html>",
-        "noQuirksBodyHtml": "<a>1</a><div><a>2</a><div><a>3</a>4</div>5</div>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "p": true,
-            "table": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "text": "1"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "a",
-                        "children": [
-                          {
-                            "text": "2"
-                          }
-                        ]
-                      },
-                      {
-                        "text": "3"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a>1</a><p><a>2</a>3</p><table></table></body></html>",
-        "noQuirksBodyHtml": "<a>1</a><p><a>2</a>3</p><table></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "a": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "tag": "a"
-                          },
-                          {
-                            "tag": "p",
-                            "children": [
-                              {
-                                "tag": "a"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b><b><a></a><p><a></a></p></b></b></body></html>",
-        "noQuirksBodyHtml": "<b><b><a></a><p><a></a></p></b></b>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "a": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "a",
-                        "children": [
-                          {
-                            "tag": "b"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "tag": "p",
-                            "children": [
-                              {
-                                "tag": "a"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b><a><b></b></a><b><p><a></a></p></b></b></body></html>",
-        "noQuirksBodyHtml": "<b><a><b></b></a><b><p><a></a></p></b></b>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "b": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "tag": "b"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "tag": "p",
-                            "children": [
-                              {
-                                "tag": "a"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a><b><b></b></b></a><b><b><p><a></a></p></b></b></body></html>",
-        "noQuirksBodyHtml": "<a><b><b></b></b></a><b><b><p><a></a></p></b></b>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "s": true,
-            "b": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "1"
-                      },
-                      {
-                        "tag": "s",
-                        "attrs": [
-                          {
-                            "name": "id",
-                            "value": "A"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "text": "2"
-                          },
-                          {
-                            "tag": "b",
-                            "attrs": [
-                              {
-                                "name": "id",
-                                "value": "B"
-                              }
-                            ],
-                            "children": [
-                              {
-                                "text": "3"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "s",
-                    "attrs": [
-                      {
-                        "name": "id",
-                        "value": "A"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "tag": "b",
-                        "attrs": [
-                          {
-                            "name": "id",
-                            "value": "B"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "text": "4"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "b",
-                    "attrs": [
-                      {
-                        "name": "id",
-                        "value": "B"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "5"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><p>1<s id=\"A\">2<b id=\"B\">3</b></s></p><s id=\"A\"><b id=\"B\">4</b></s><b id=\"B\">5</b></body></html>",
-        "noQuirksBodyHtml": "<p>1<s id=\"A\">2<b id=\"B\">3</b></s></p><s id=\"A\"><b id=\"B\">4</b></s><b id=\"B\">5</b>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "text": "1"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "text": "3"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "text": "2"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a>1</a><a>3</a><table><tbody><tr><td>2</td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<a>1</a><a>3</a><table><tbody><tr><td>2</td></tr></tbody></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "AC"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "text": "B"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>AC<table><tbody><tr><td>B</td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "AC<table><tbody><tr><td>B</td></tr></tbody></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "svg svg": true,
-            "svg tr": true,
-            "svg input": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "tag": "svg",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "ns": "http://www.w3.org/2000/svg",
-                            "children": [
-                              {
-                                "tag": "input",
-                                "ns": "http://www.w3.org/2000/svg"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a><svg><tr><input></input></tr></svg></a></body></html>",
-        "noQuirksBodyHtml": "<a><svg><tr><input></input></tr></svg></a>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "a": true,
-            "b": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "a",
-                        "children": [
-                          {
-                            "tag": "b"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "tag": "div",
-                            "children": [
-                              {
-                                "tag": "a"
-                              },
-                              {
-                                "tag": "div",
-                                "children": [
-                                  {
-                                    "tag": "a"
-                                  },
-                                  {
-                                    "tag": "div",
-                                    "children": [
-                                      {
-                                        "tag": "a"
-                                      },
-                                      {
-                                        "tag": "div",
-                                        "children": [
-                                          {
-                                            "tag": "a"
-                                          },
-                                          {
-                                            "tag": "div",
-                                            "children": [
-                                              {
-                                                "tag": "a"
-                                              },
-                                              {
-                                                "tag": "div",
-                                                "children": [
-                                                  {
-                                                    "tag": "a"
-                                                  },
-                                                  {
-                                                    "tag": "div",
-                                                    "children": [
-                                                      {
-                                                        "tag": "a"
-                                                      },
-                                                      {
-                                                        "tag": "div",
-                                                        "children": [
-                                                          {
-                                                            "tag": "a",
-                                                            "children": [
-                                                              {
-                                                                "tag": "div",
-                                                                "children": [
-                                                                  {
-                                                                    "tag": "div"
-                                                                  }
-                                                                ]
-                                                              }
-                                                            ]
-                                                          }
-                                                        ]
-                                                      }
-                                                    ]
-                                                  }
-                                                ]
-                                              }
-                                            ]
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div><a><b></b></a><b><div><a></a><div><a></a><div><a></a><div><a></a><div><a></a><div><a></a><div><a></a><div><a><div><div></div></div></a></div></div></div></div></div></div></div></div></b></div></body></html>",
-        "noQuirksBodyHtml": "<div><a><b></b></a><b><div><a></a><div><a></a><div><a></a><div><a></a><div><a></a><div><a></a><div><a></a><div><a><div><div></div></div></a></div></div></div></div></div></div></div></div></b></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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "a": true,
-            "b": true,
-            "u": true,
-            "i": true,
-            "code": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "a",
-                        "children": [
-                          {
-                            "tag": "b",
-                            "children": [
-                              {
-                                "tag": "u",
-                                "children": [
-                                  {
-                                    "tag": "i",
-                                    "children": [
-                                      {
-                                        "tag": "code"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "u",
-                        "children": [
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "tag": "code",
-                                "children": [
-                                  {
-                                    "tag": "div",
-                                    "children": [
-                                      {
-                                        "tag": "a"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div><a><b><u><i><code></code></i></u></b></a><u><i><code><div><a></a></div></code></i></u></div></body></html>",
-        "noQuirksBodyHtml": "<div><a><b><u><i><code></code></i></u></b></a><u><i><code><div><a></a></div></code></i></u></div>"
-      }
-    },
-    {
-      "data": "<b><b><b><b>x</b></b></b></b>y",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "tag": "b",
-                            "children": [
-                              {
-                                "tag": "b",
-                                "children": [
-                                  {
-                                    "text": "x"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "text": "y"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b><b><b><b>x</b></b></b></b>y</body></html>",
-        "noQuirksBodyHtml": "<b><b><b><b>x</b></b></b></b>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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "b": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "tag": "b",
-                            "children": [
-                              {
-                                "tag": "b",
-                                "children": [
-                                  {
-                                    "tag": "b"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "tag": "b",
-                            "children": [
-                              {
-                                "tag": "b",
-                                "children": [
-                                  {
-                                    "text": "x"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><p><b><b><b><b></b></b></b></b></p><p><b><b><b>x</b></b></b></p></body></html>",
-        "noQuirksBodyHtml": "<p><b><b><b><b></b></b></b></b></p><p><b><b><b>x</b></b></b></p>"
-      }
-    },
-    {
-      "data": "<b><em><foo><foob><fooc><aside></b></em>",
-      "errors": [
-        "(1,35): adoption-agency-1.3",
-        "(1,40): adoption-agency-1.3",
-        "(1,40): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "div"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "b": true,
-            "em": true,
-            "foo": true,
-            "foob": true,
-            "fooc": true,
-            "aside": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "b",
-            "children": [
-              {
-                "tag": "em",
-                "children": [
-                  {
-                    "tag": "foo",
-                    "children": [
-                      {
-                        "tag": "foob",
-                        "children": [
-                          {
-                            "tag": "fooc"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          },
-          {
-            "tag": "aside",
-            "children": [
-              {
-                "tag": "b"
-              }
-            ]
-          }
-        ],
-        "html": "<b><em><foo><foob><fooc></fooc></foob></foo></em></b><aside><b></b></aside>",
-        "noQuirksBodyHtml": "<b><em><foo><foob><fooc></fooc></foob></foo></em></b><aside><b></b></aside>"
-      }
-    }
-  ],
-  "adoption02.dat": [
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "i": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "text": "1"
-                      },
-                      {
-                        "tag": "i",
-                        "children": [
-                          {
-                            "text": "2"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "i",
-                    "children": [
-                      {
-                        "tag": "p",
-                        "children": [
-                          {
-                            "tag": "b",
-                            "children": [
-                              {
-                                "text": "3"
-                              }
-                            ]
-                          },
-                          {
-                            "text": "4"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b>1<i>2</i></b><i><p><b>3</b>4</p></i></body></html>",
-        "noQuirksBodyHtml": "<b>1<i>2</i></b><i><p><b>3</b>4</p></i>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "div": true,
-            "style": true,
-            "address": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a"
-                  },
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "a",
-                        "children": [
-                          {
-                            "tag": "style"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "address",
-                        "children": [
-                          {
-                            "tag": "a"
-                          },
-                          {
-                            "tag": "a"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a></a><div><a><style></style></a><address><a></a><a></a></address></div></body></html>",
-        "noQuirksBodyHtml": "<a></a><div><a><style></style></a><address><a></a><a></a></address></div>"
-      }
-    }
-  ],
-  "comments01.dat": [
-    {
-      "data": "FOO<!-- BAR -->BAZ",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "comment": " BAR "
-                  },
-                  {
-                    "text": "BAZ"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<!-- BAR -->BAZ</body></html>",
-        "noQuirksBodyHtml": "FOO<!-- BAR -->BAZ"
-      }
-    },
-    {
-      "data": "FOO<!-- BAR --!>BAZ",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,15): unexpected-bang-after-double-dash-in-comment"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "comment": " BAR "
-                  },
-                  {
-                    "text": "BAZ"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<!-- BAR -->BAZ</body></html>",
-        "noQuirksBodyHtml": "FOO<!-- BAR -->BAZ"
-      }
-    },
-    {
-      "data": "FOO<!-- BAR --   >BAZ",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,15): unexpected-char-in-comment",
-        "(1,21): eof-in-comment"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "comment": " BAR --   >BAZ"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<!-- BAR --   >BAZ--></body></html>",
-        "noQuirksBodyHtml": "FOO<!-- BAR --   >BAZ-->"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "comment": " BAR -- <QUX> -- MUX "
-                  },
-                  {
-                    "text": "BAZ"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<!-- BAR -- <QUX> -- MUX -->BAZ</body></html>",
-        "noQuirksBodyHtml": "FOO<!-- BAR -- <QUX> -- MUX -->BAZ"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "comment": " BAR -- <QUX> -- MUX "
-                  },
-                  {
-                    "text": "BAZ"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<!-- BAR -- <QUX> -- MUX -->BAZ</body></html>",
-        "noQuirksBodyHtml": "FOO<!-- BAR -- <QUX> -- MUX -->BAZ"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "comment": " BAR -- <QUX> -- MUX -- >BAZ"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<!-- BAR -- <QUX> -- MUX -- >BAZ--></body></html>",
-        "noQuirksBodyHtml": "FOO<!-- BAR -- <QUX> -- MUX -- >BAZ-->"
-      }
-    },
-    {
-      "data": "FOO<!---->BAZ",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "comment": ""
-                  },
-                  {
-                    "text": "BAZ"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<!---->BAZ</body></html>",
-        "noQuirksBodyHtml": "FOO<!---->BAZ"
-      }
-    },
-    {
-      "data": "FOO<!--->BAZ",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,9): incorrect-comment"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "comment": ""
-                  },
-                  {
-                    "text": "BAZ"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<!---->BAZ</body></html>",
-        "noQuirksBodyHtml": "FOO<!---->BAZ"
-      }
-    },
-    {
-      "data": "FOO<!-->BAZ",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,8): incorrect-comment"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "comment": ""
-                  },
-                  {
-                    "text": "BAZ"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<!---->BAZ</body></html>",
-        "noQuirksBodyHtml": "FOO<!---->BAZ"
-      }
-    },
-    {
-      "data": "<?xml version=\"1.0\">Hi",
-      "errors": [
-        "(1,1): expected-tag-name-but-got-question-mark",
-        "(1,22): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "comment": "?xml version=\"1.0\""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hi"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!--?xml version=\"1.0\"--><html><head></head><body>Hi</body></html>",
-        "noQuirksBodyHtml": "<!--?xml version=\"1.0\"-->Hi"
-      }
-    },
-    {
-      "data": "<?xml version=\"1.0\">",
-      "errors": [
-        "(1,1): expected-tag-name-but-got-question-mark",
-        "(1,20): expected-doctype-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "comment": "?xml version=\"1.0\""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!--?xml version=\"1.0\"--><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!--?xml version=\"1.0\"-->"
-      }
-    },
-    {
-      "data": "<?xml version",
-      "errors": [
-        "(1,1): expected-tag-name-but-got-question-mark",
-        "(1,13): expected-doctype-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "comment": "?xml version"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!--?xml version--><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!--?xml version-->"
-      }
-    },
-    {
-      "data": "FOO<!----->BAZ",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,10): unexpected-dash-after-double-dash-in-comment"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "comment": "-"
-                  },
-                  {
-                    "text": "BAZ"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<!----->BAZ</body></html>",
-        "noQuirksBodyHtml": "FOO<!----->BAZ"
-      }
-    },
-    {
-      "data": "<html><!-- comment --><title>Comment before head</title>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "title": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "comment": " comment "
-              },
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "Comment before head"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><!-- comment --><head><title>Comment before head</title></head><body></body></html>",
-        "noQuirksBodyHtml": "<!-- comment --><title>Comment before head</title>"
-      }
-    }
-  ],
-  "doctype01.dat": [
-    {
-      "data": "<!DOCTYPE html>Hello",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!dOctYpE HtMl>Hello",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPEhtml>Hello",
-      "errors": [
-        "(1,9): need-space-after-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE>Hello",
-      "errors": [
-        "(1,9): need-space-after-doctype",
-        "(1,10): expected-doctype-name-but-got-right-bracket",
-        "(1,10): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": ""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE ><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE >Hello",
-      "errors": [
-        "(1,11): expected-doctype-name-but-got-right-bracket",
-        "(1,11): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": ""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE ><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE potato>Hello",
-      "errors": [
-        "(1,17): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "potato"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE potato >Hello",
-      "errors": [
-        "(1,18): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "potato"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE potato taco>Hello",
-      "errors": [
-        "(1,17): expected-space-or-right-bracket-in-doctype",
-        "(1,22): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "potato"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE potato taco \"ddd>Hello",
-      "errors": [
-        "(1,17): expected-space-or-right-bracket-in-doctype",
-        "(1,27): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "potato"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE potato sYstEM>Hello",
-      "errors": [
-        "(1,24): unexpected-char-in-doctype",
-        "(1,24): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "potato"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE potato sYstEM    >Hello",
-      "errors": [
-        "(1,28): unexpected-char-in-doctype",
-        "(1,28): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "potato"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE   potato       sYstEM  ggg>Hello",
-      "errors": [
-        "(1,34): unexpected-char-in-doctype",
-        "(1,37): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "potato"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE potato SYSTEM taco  >Hello",
-      "errors": [
-        "(1,25): unexpected-char-in-doctype",
-        "(1,31): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "potato"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE potato SYSTEM 'taco\"'>Hello",
-      "errors": [
-        "(1,32): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "potato \"\" \"taco\"\""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE potato SYSTEM \"taco\">Hello",
-      "errors": [
-        "(1,31): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "potato \"\" \"taco\""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE potato SYSTEM \"tai'co\">Hello",
-      "errors": [
-        "(1,33): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "potato \"\" \"tai'co\""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE potato SYSTEMtaco \"ddd\">Hello",
-      "errors": [
-        "(1,24): unexpected-char-in-doctype",
-        "(1,34): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "potato"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE potato grass SYSTEM taco>Hello",
-      "errors": [
-        "(1,17): expected-space-or-right-bracket-in-doctype",
-        "(1,35): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "potato"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE potato pUbLIc>Hello",
-      "errors": [
-        "(1,24): unexpected-end-of-doctype",
-        "(1,24): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "potato"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE potato pUbLIc >Hello",
-      "errors": [
-        "(1,25): unexpected-end-of-doctype",
-        "(1,25): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "potato"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE potato pUbLIcgoof>Hello",
-      "errors": [
-        "(1,24): unexpected-char-in-doctype",
-        "(1,28): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "potato"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE potato PUBLIC goof>Hello",
-      "errors": [
-        "(1,25): unexpected-char-in-doctype",
-        "(1,29): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "potato"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE potato PUBLIC \"go'of\">Hello",
-      "errors": [
-        "(1,32): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "potato \"go'of\" \"\""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE potato PUBLIC 'go'of'>Hello",
-      "errors": [
-        "(1,29): unexpected-char-in-doctype",
-        "(1,32): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "potato \"go\" \"\""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE potato PUBLIC 'go:hh   of' >Hello",
-      "errors": [
-        "(1,38): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "potato \"go:hh   of\" \"\""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE potato PUBLIC \"W3C-//dfdf\" SYSTEM ggg>Hello",
-      "errors": [
-        "(1,38): unexpected-char-in-doctype",
-        "(1,48): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "potato \"W3C-//dfdf\" \"\""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\n   \"http://www.w3.org/TR/html4/strict.dtd\">Hello",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE ...>Hello",
-      "errors": [
-        "(1,14): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "..."
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Hello"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE ...><html><head></head><body>Hello</body></html>",
-        "noQuirksBodyHtml": "Hello"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">",
-      "errors": [
-        "(2,58): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\"\n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">",
-      "errors": [
-        "(2,54): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<!DOCTYPE root-element [SYSTEM OR PUBLIC FPI] \"uri\" [ \n<!-- internal declarations -->\n]>",
-      "errors": [
-        "(1,23): expected-space-or-right-bracket-in-doctype",
-        "(2,30): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "doctype": "root-element"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "]>",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE root-element><html><head></head><body>]&gt;</body></html>",
-        "noQuirksBodyHtml": "\n]&gt;"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html PUBLIC\n  \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\n    \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">",
-      "errors": [
-        "(3,53): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<!DOCTYPE HTML SYSTEM \"http://www.w3.org/DTD/HTML4-strict.dtd\"><body><b>Mine!</b></body>",
-      "errors": [
-        "(1,63): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html \"\" \"http://www.w3.org/DTD/HTML4-strict.dtd\""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "text": "Mine!"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><b>Mine!</b></body></html>",
-        "noQuirksBodyHtml": "<b>Mine!</b>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    }
-  ],
-  "domjs-unsafe.dat": [
-    {
-      "data": "<svg><![CDATA[foo\nbar]]>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(2,6): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "foo\nbar"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>foo\nbar</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>foo\nbar</svg>"
-      }
-    },
-    {
-      "data": "<svg><![CDATA[foo\rbar]]>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(2,6): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "foo\nbar"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>foo\nbar</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>foo\nbar</svg>"
-      }
-    },
-    {
-      "data": "<svg><![CDATA[foo\r\nbar]]>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(2,6): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "foo\nbar"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>foo\nbar</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>foo\nbar</svg>"
-      }
-    },
-    {
-      "data": "<script>a='\u0000'</script>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,12): invalid-codepoint"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "a='�'",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script>a='�'</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script>a='�'</script>"
-      }
-    },
-    {
-      "data": "<script type=\"data\"><!--\u0000</script>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag",
-        "(1,25): invalid-codepoint"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "data"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "<!--�",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script type=\"data\"><!--�</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"data\"><!--�</script>"
-      }
-    },
-    {
-      "data": "<script type=\"data\"><!--foo\u0000</script>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag",
-        "(1,28): invalid-codepoint"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "data"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "<!--foo�",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script type=\"data\"><!--foo�</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"data\"><!--foo�</script>"
-      }
-    },
-    {
-      "data": "<script type=\"data\"><!-- foo-\u0000</script>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag",
-        "(1,30): invalid-codepoint"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "data"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "<!-- foo-�",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script type=\"data\"><!-- foo-�</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"data\"><!-- foo-�</script>"
-      }
-    },
-    {
-      "data": "<script type=\"data\"><!-- foo--\u0000</script>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag",
-        "(1,31): invalid-codepoint"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "data"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "<!-- foo--�",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script type=\"data\"><!-- foo--�</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"data\"><!-- foo--�</script>"
-      }
-    },
-    {
-      "data": "<script type=\"data\"><!-- foo-",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag",
-        "(1,29): expected-script-data-but-got-eof",
-        "(1,29): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "data"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "<!-- foo-",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script type=\"data\"><!-- foo-</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"data\"><!-- foo-</script>"
-      }
-    },
-    {
-      "data": "<script type=\"data\"><!-- foo-<</script>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "data"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "<!-- foo-<",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script type=\"data\"><!-- foo-<</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"data\"><!-- foo-<</script>"
-      }
-    },
-    {
-      "data": "<script type=\"data\"><!-- foo-<S",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag",
-        "(1,31): expected-script-data-but-got-eof",
-        "(1,31): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "data"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "<!-- foo-<S",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script type=\"data\"><!-- foo-<S</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"data\"><!-- foo-<S</script>"
-      }
-    },
-    {
-      "data": "<script type=\"data\"><!-- foo-</SCRIPT>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "data"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "<!-- foo-",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script type=\"data\"><!-- foo-</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"data\"><!-- foo-</script>"
-      }
-    },
-    {
-      "data": "<script type=\"data\"><!--<p></script>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "data"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "<!--<p>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script type=\"data\"><!--<p></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"data\"><!--<p></script>"
-      }
-    },
-    {
-      "data": "<script type=\"data\"><!--<script></script></script>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "data"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "<!--<script></script>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script type=\"data\"><!--<script></script></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"data\"><!--<script></script></script>"
-      }
-    },
-    {
-      "data": "<script type=\"data\"><!--<script>\u0000</script></script>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag",
-        "(1,33): invalid-codepoint"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "data"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "<!--<script>�</script>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script type=\"data\"><!--<script>�</script></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"data\"><!--<script>�</script></script>"
-      }
-    },
-    {
-      "data": "<script type=\"data\"><!--<script>-\u0000</script></script>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag",
-        "(1,34): invalid-codepoint"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "data"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "<!--<script>-�</script>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script type=\"data\"><!--<script>-�</script></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"data\"><!--<script>-�</script></script>"
-      }
-    },
-    {
-      "data": "<script type=\"data\"><!--<script>--\u0000</script></script>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag",
-        "(1,35): invalid-codepoint"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "data"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "<!--<script>--�</script>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script type=\"data\"><!--<script>--�</script></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"data\"><!--<script>--�</script></script>"
-      }
-    },
-    {
-      "data": "<script type=\"data\"><!--<script>---</script></script>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "data"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "<!--<script>---</script>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script type=\"data\"><!--<script>---</script></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"data\"><!--<script>---</script></script>"
-      }
-    },
-    {
-      "data": "<script type=\"data\"><!--<script></scrip></SCRIPT></script>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "data"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "<!--<script></scrip></SCRIPT>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script type=\"data\"><!--<script></scrip></SCRIPT></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"data\"><!--<script></scrip></SCRIPT></script>"
-      }
-    },
-    {
-      "data": "<script type=\"data\"><!--<script></scrip </SCRIPT></script>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "data"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "<!--<script></scrip </SCRIPT>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script type=\"data\"><!--<script></scrip </SCRIPT></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"data\"><!--<script></scrip </SCRIPT></script>"
-      }
-    },
-    {
-      "data": "<script type=\"data\"><!--<script></scrip/</SCRIPT></script>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "data"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "<!--<script></scrip/</SCRIPT>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script type=\"data\"><!--<script></scrip/</SCRIPT></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"data\"><!--<script></scrip/</SCRIPT></script>"
-      }
-    },
-    {
-      "data": "<script type=\"data\"></scrip/></script>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "data"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "</scrip/>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script type=\"data\"></scrip/></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"data\"></scrip/></script>"
-      }
-    },
-    {
-      "data": "<script type=\"data\"></scrip ></script>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "data"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "</scrip >",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script type=\"data\"></scrip ></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"data\"></scrip ></script>"
-      }
-    },
-    {
-      "data": "<script type=\"data\"><!--</scrip></script>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "data"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "<!--</scrip>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script type=\"data\"><!--</scrip></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"data\"><!--</scrip></script>"
-      }
-    },
-    {
-      "data": "<script type=\"data\"><!--</scrip </script>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "data"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "<!--</scrip ",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script type=\"data\"><!--</scrip </script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"data\"><!--</scrip </script>"
-      }
-    },
-    {
-      "data": "<script type=\"data\"><!--</scrip/</script>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "data"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "<!--</scrip/",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script type=\"data\"><!--</scrip/</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"data\"><!--</scrip/</script>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><!DOCTYPE html>",
-      "errors": [
-        "(1,30): unexpected-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<html><!DOCTYPE html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,21): unexpected-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<html><head><!DOCTYPE html></head>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,27): unexpected-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<html><head></head><!DOCTYPE html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,34): unexpected-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<body></body><!DOCTYPE html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,28): unexpected-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<table><!DOCTYPE html></table>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,22): unexpected-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table></table></body></html>",
-        "noQuirksBodyHtml": "<table></table>"
-      }
-    },
-    {
-      "data": "<select><!DOCTYPE html></select>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,23): unexpected-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><select></select></body></html>",
-        "noQuirksBodyHtml": "<select></select>"
-      }
-    },
-    {
-      "data": "<table><colgroup><!DOCTYPE html></colgroup></table>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,32): unexpected-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "colgroup": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "colgroup"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><colgroup></colgroup></table></body></html>",
-        "noQuirksBodyHtml": "<table><colgroup></colgroup></table>"
-      }
-    },
-    {
-      "data": "<table><colgroup><!--test--></colgroup></table>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "colgroup": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "colgroup",
-                        "children": [
-                          {
-                            "comment": "test"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><colgroup><!--test--></colgroup></table></body></html>",
-        "noQuirksBodyHtml": "<table><colgroup><!--test--></colgroup></table>"
-      }
-    },
-    {
-      "data": "<table><colgroup><html></colgroup></table>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,23): non-html-root"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "colgroup": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "colgroup"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><colgroup></colgroup></table></body></html>",
-        "noQuirksBodyHtml": "<table><colgroup></colgroup></table>"
-      }
-    },
-    {
-      "data": "<table><colgroup> foo</colgroup></table>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,32): foster-parenting-character-in-table",
-        "(1,32): foster-parenting-character-in-table",
-        "(1,32): foster-parenting-character-in-table",
-        "(1,32): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "colgroup": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "foo"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "colgroup",
-                        "children": [
-                          {
-                            "text": " "
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>foo<table><colgroup> </colgroup></table></body></html>",
-        "noQuirksBodyHtml": "foo<table><colgroup> </colgroup></table>"
-      }
-    },
-    {
-      "data": "<select><!--test--></select>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "comment": "test"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><select><!--test--></select></body></html>",
-        "noQuirksBodyHtml": "<select><!--test--></select>"
-      }
-    },
-    {
-      "data": "<select><html></select>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,14): non-html-root"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><select></select></body></html>",
-        "noQuirksBodyHtml": "<select></select>"
-      }
-    },
-    {
-      "data": "<frameset><html></frameset>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag",
-        "(1,16): non-html-root"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<frameset></frameset><html>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag",
-        "(1,27): non-html-root"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<frameset></frameset><!DOCTYPE html>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag",
-        "(1,36): unexpected-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<html><body></body></html><!DOCTYPE html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,41): unexpected-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<svg><!DOCTYPE html></svg>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,20): unexpected-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg></svg></body></html>",
-        "noQuirksBodyHtml": "<svg></svg>"
-      }
-    },
-    {
-      "data": "<svg><font></font></svg>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg font": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "font",
-                        "ns": "http://www.w3.org/2000/svg"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg><font></font></svg></body></html>",
-        "noQuirksBodyHtml": "<svg><font></font></svg>"
-      }
-    },
-    {
-      "data": "<svg><font id=foo></font></svg>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg font": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "font",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "attrs": [
-                          {
-                            "name": "id",
-                            "value": "foo"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg><font id=\"foo\"></font></svg></body></html>",
-        "noQuirksBodyHtml": "<svg><font id=\"foo\"></font></svg>"
-      }
-    },
-    {
-      "data": "<svg><font size=4></font></svg>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,18): unexpected-html-element-in-foreign-content",
-        "(1,31): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "font": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg"
-                  },
-                  {
-                    "tag": "font",
-                    "attrs": [
-                      {
-                        "name": "size",
-                        "value": "4"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg></svg><font size=\"4\"></font></body></html>",
-        "noQuirksBodyHtml": "<svg><font size=\"4\"></font></svg>"
-      }
-    },
-    {
-      "data": "<svg><font color=red></font></svg>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,21): unexpected-html-element-in-foreign-content",
-        "(1,34): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "font": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg"
-                  },
-                  {
-                    "tag": "font",
-                    "attrs": [
-                      {
-                        "name": "color",
-                        "value": "red"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg></svg><font color=\"red\"></font></body></html>",
-        "noQuirksBodyHtml": "<svg><font color=\"red\"></font></svg>"
-      }
-    },
-    {
-      "data": "<svg><font font=sans></font></svg>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg font": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "font",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "attrs": [
-                          {
-                            "name": "font",
-                            "value": "sans"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg><font font=\"sans\"></font></svg></body></html>",
-        "noQuirksBodyHtml": "<svg><font font=\"sans\"></font></svg>"
-      }
-    }
-  ],
-  "entities01.dat": [
-    {
-      "data": "FOO&gt;BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO>BAR",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO&gt;BAR</body></html>",
-        "noQuirksBodyHtml": "FOO&gt;BAR"
-      }
-    },
-    {
-      "data": "FOO&gtBAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,6): named-entity-without-semicolon"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO>BAR",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO&gt;BAR</body></html>",
-        "noQuirksBodyHtml": "FOO&gt;BAR"
-      }
-    },
-    {
-      "data": "FOO&gt BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,6): named-entity-without-semicolon"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO> BAR",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO&gt; BAR</body></html>",
-        "noQuirksBodyHtml": "FOO&gt; BAR"
-      }
-    },
-    {
-      "data": "FOO&gt;;;BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO>;;BAR",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO&gt;;;BAR</body></html>",
-        "noQuirksBodyHtml": "FOO&gt;;;BAR"
-      }
-    },
-    {
-      "data": "I'm &notit; I tell you",
-      "errors": [
-        "(1,4): expected-doctype-but-got-chars",
-        "(1,9): named-entity-without-semicolon"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "I'm ¬it; I tell you"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>I'm ¬it; I tell you</body></html>",
-        "noQuirksBodyHtml": "I'm ¬it; I tell you"
-      }
-    },
-    {
-      "data": "I'm &notin; I tell you",
-      "errors": [
-        "(1,4): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "I'm ∉ I tell you"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>I'm ∉ I tell you</body></html>",
-        "noQuirksBodyHtml": "I'm ∉ I tell you"
-      }
-    },
-    {
-      "data": "FOO& BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO& BAR",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO&amp; BAR</body></html>",
-        "noQuirksBodyHtml": "FOO&amp; BAR"
-      }
-    },
-    {
-      "data": "FOO&<BAR>",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,9): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "bar": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO&",
-                    "escaped": true
-                  },
-                  {
-                    "tag": "bar"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO&amp;<bar></bar></body></html>",
-        "noQuirksBodyHtml": "FOO&amp;<bar></bar>"
-      }
-    },
-    {
-      "data": "FOO&&&&gt;BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO&&&>BAR",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO&amp;&amp;&amp;&gt;BAR</body></html>",
-        "noQuirksBodyHtml": "FOO&amp;&amp;&amp;&gt;BAR"
-      }
-    },
-    {
-      "data": "FOO&#41;BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO)BAR"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO)BAR</body></html>",
-        "noQuirksBodyHtml": "FOO)BAR"
-      }
-    },
-    {
-      "data": "FOO&#x41;BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOOABAR"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOOABAR</body></html>",
-        "noQuirksBodyHtml": "FOOABAR"
-      }
-    },
-    {
-      "data": "FOO&#X41;BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOOABAR"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOOABAR</body></html>",
-        "noQuirksBodyHtml": "FOOABAR"
-      }
-    },
-    {
-      "data": "FOO&#BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,5): expected-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO&#BAR",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO&amp;#BAR</body></html>",
-        "noQuirksBodyHtml": "FOO&amp;#BAR"
-      }
-    },
-    {
-      "data": "FOO&#ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,5): expected-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO&#ZOO",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO&amp;#ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO&amp;#ZOO"
-      }
-    },
-    {
-      "data": "FOO&#xBAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,7): expected-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOOºR"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOOºR</body></html>",
-        "noQuirksBodyHtml": "FOOºR"
-      }
-    },
-    {
-      "data": "FOO&#xZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,6): expected-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO&#xZOO",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO&amp;#xZOO</body></html>",
-        "noQuirksBodyHtml": "FOO&amp;#xZOO"
-      }
-    },
-    {
-      "data": "FOO&#XZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,6): expected-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO&#XZOO",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO&amp;#XZOO</body></html>",
-        "noQuirksBodyHtml": "FOO&amp;#XZOO"
-      }
-    },
-    {
-      "data": "FOO&#41BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,7): numeric-entity-without-semicolon"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO)BAR"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO)BAR</body></html>",
-        "noQuirksBodyHtml": "FOO)BAR"
-      }
-    },
-    {
-      "data": "FOO&#x41BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,10): numeric-entity-without-semicolon"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO䆺R"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO䆺R</body></html>",
-        "noQuirksBodyHtml": "FOO䆺R"
-      }
-    },
-    {
-      "data": "FOO&#x41ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,8): numeric-entity-without-semicolon"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOOAZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOOAZOO</body></html>",
-        "noQuirksBodyHtml": "FOOAZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0000;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO�ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO�ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO�ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0078;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOOxZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOOxZOO</body></html>",
-        "noQuirksBodyHtml": "FOOxZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0079;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOOyZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOOyZOO</body></html>",
-        "noQuirksBodyHtml": "FOOyZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0080;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO€ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO€ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO€ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0081;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO\81ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO\81ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO\81ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0082;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO‚ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO‚ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO‚ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0083;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOOƒZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOOƒZOO</body></html>",
-        "noQuirksBodyHtml": "FOOƒZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0084;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO„ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO„ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO„ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0085;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO…ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO…ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO…ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0086;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO†ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO†ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO†ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0087;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO‡ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO‡ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO‡ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0088;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOOˆZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOOˆZOO</body></html>",
-        "noQuirksBodyHtml": "FOOˆZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0089;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO‰ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO‰ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO‰ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x008A;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOOŠZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOOŠZOO</body></html>",
-        "noQuirksBodyHtml": "FOOŠZOO"
-      }
-    },
-    {
-      "data": "FOO&#x008B;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO‹ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO‹ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO‹ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x008C;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOOŒZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOOŒZOO</body></html>",
-        "noQuirksBodyHtml": "FOOŒZOO"
-      }
-    },
-    {
-      "data": "FOO&#x008D;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO\8dZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO\8dZOO</body></html>",
-        "noQuirksBodyHtml": "FOO\8dZOO"
-      }
-    },
-    {
-      "data": "FOO&#x008E;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOOŽZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOOŽZOO</body></html>",
-        "noQuirksBodyHtml": "FOOŽZOO"
-      }
-    },
-    {
-      "data": "FOO&#x008F;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO\8fZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO\8fZOO</body></html>",
-        "noQuirksBodyHtml": "FOO\8fZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0090;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO\90ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO\90ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO\90ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0091;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO‘ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO‘ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO‘ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0092;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO’ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO’ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO’ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0093;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO“ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO“ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO“ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0094;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO”ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO”ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO”ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0095;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO•ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO•ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO•ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0096;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO–ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO–ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO–ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0097;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO—ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO—ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO—ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0098;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO˜ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO˜ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO˜ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x0099;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO™ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO™ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO™ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x009A;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOOšZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOOšZOO</body></html>",
-        "noQuirksBodyHtml": "FOOšZOO"
-      }
-    },
-    {
-      "data": "FOO&#x009B;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO›ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO›ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO›ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x009C;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOOœZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOOœZOO</body></html>",
-        "noQuirksBodyHtml": "FOOœZOO"
-      }
-    },
-    {
-      "data": "FOO&#x009D;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO\9dZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO\9dZOO</body></html>",
-        "noQuirksBodyHtml": "FOO\9dZOO"
-      }
-    },
-    {
-      "data": "FOO&#x009E;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOOžZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOOžZOO</body></html>",
-        "noQuirksBodyHtml": "FOOžZOO"
-      }
-    },
-    {
-      "data": "FOO&#x009F;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOOŸZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOOŸZOO</body></html>",
-        "noQuirksBodyHtml": "FOOŸZOO"
-      }
-    },
-    {
-      "data": "FOO&#x00A0;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO ZOO",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO&nbsp;ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO&nbsp;ZOO"
-      }
-    },
-    {
-      "data": "FOO&#xD7FF;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO퟿ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO퟿ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO퟿ZOO"
-      }
-    },
-    {
-      "data": "FOO&#xD800;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO�ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO�ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO�ZOO"
-      }
-    },
-    {
-      "data": "FOO&#xD801;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO�ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO�ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO�ZOO"
-      }
-    },
-    {
-      "data": "FOO&#xDFFE;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO�ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO�ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO�ZOO"
-      }
-    },
-    {
-      "data": "FOO&#xDFFF;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO�ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO�ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO�ZOO"
-      }
-    },
-    {
-      "data": "FOO&#xE000;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOOZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOOZOO</body></html>",
-        "noQuirksBodyHtml": "FOOZOO"
-      }
-    },
-    {
-      "data": "FOO&#x10FFFE;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,13): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO􏿾ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO􏿾ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO􏿾ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x1087D4;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO􈟔ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO􈟔ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO􈟔ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x10FFFF;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,13): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO􏿿ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO􏿿ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO􏿿ZOO"
-      }
-    },
-    {
-      "data": "FOO&#x110000;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,13): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO�ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO�ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO�ZOO"
-      }
-    },
-    {
-      "data": "FOO&#xFFFFFF;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,13): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO�ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO�ZOO</body></html>",
-        "noQuirksBodyHtml": "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO�"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO�</body></html>",
-        "noQuirksBodyHtml": "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO�"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO�</body></html>",
-        "noQuirksBodyHtml": "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO�"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO�</body></html>",
-        "noQuirksBodyHtml": "FOO�"
-      }
-    },
-    {
-      "data": "FOO&#11111111111ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,16): numeric-entity-without-semicolon",
-        "(1,16): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO�ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO�ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO�ZOO"
-      }
-    },
-    {
-      "data": "FOO&#1111111111ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,15): numeric-entity-without-semicolon",
-        "(1,15): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO�ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO�ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO�ZOO"
-      }
-    },
-    {
-      "data": "FOO&#111111111111ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,17): numeric-entity-without-semicolon",
-        "(1,17): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO�ZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO�ZOO</body></html>",
-        "noQuirksBodyHtml": "FOO�ZOO"
-      }
-    }
-  ],
-  "entities02.dat": [
-    {
-      "data": "<div bar=\"ZZ&gt;YY\"></div>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "bar",
-                        "value": "ZZ>YY"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div bar=\"ZZ>YY\"></div></body></html>",
-        "noQuirksBodyHtml": "<div bar=\"ZZ>YY\"></div>"
-      }
-    },
-    {
-      "data": "<div bar=\"ZZ&\"></div>",
-      "errors": [
-        "(1,15): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "bar",
-                        "value": "ZZ&",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div bar=\"ZZ&amp;\"></div></body></html>",
-        "noQuirksBodyHtml": "<div bar=\"ZZ&amp;\"></div>"
-      }
-    },
-    {
-      "data": "<div bar='ZZ&'></div>",
-      "errors": [
-        "(1,15): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "bar",
-                        "value": "ZZ&",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div bar=\"ZZ&amp;\"></div></body></html>",
-        "noQuirksBodyHtml": "<div bar=\"ZZ&amp;\"></div>"
-      }
-    },
-    {
-      "data": "<div bar=ZZ&></div>",
-      "errors": [
-        "(1,13): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "bar",
-                        "value": "ZZ&",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div bar=\"ZZ&amp;\"></div></body></html>",
-        "noQuirksBodyHtml": "<div bar=\"ZZ&amp;\"></div>"
-      }
-    },
-    {
-      "data": "<div bar=\"ZZ&gt=YY\"></div>",
-      "errors": [
-        "(1,15): named-entity-without-semicolon",
-        "(1,20): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "bar",
-                        "value": "ZZ&gt=YY",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div bar=\"ZZ&amp;gt=YY\"></div></body></html>",
-        "noQuirksBodyHtml": "<div bar=\"ZZ&amp;gt=YY\"></div>"
-      }
-    },
-    {
-      "data": "<div bar=\"ZZ&gt0YY\"></div>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "bar",
-                        "value": "ZZ&gt0YY",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div bar=\"ZZ&amp;gt0YY\"></div></body></html>",
-        "noQuirksBodyHtml": "<div bar=\"ZZ&amp;gt0YY\"></div>"
-      }
-    },
-    {
-      "data": "<div bar=\"ZZ&gt9YY\"></div>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "bar",
-                        "value": "ZZ&gt9YY",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div bar=\"ZZ&amp;gt9YY\"></div></body></html>",
-        "noQuirksBodyHtml": "<div bar=\"ZZ&amp;gt9YY\"></div>"
-      }
-    },
-    {
-      "data": "<div bar=\"ZZ&gtaYY\"></div>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "bar",
-                        "value": "ZZ&gtaYY",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div bar=\"ZZ&amp;gtaYY\"></div></body></html>",
-        "noQuirksBodyHtml": "<div bar=\"ZZ&amp;gtaYY\"></div>"
-      }
-    },
-    {
-      "data": "<div bar=\"ZZ&gtZYY\"></div>",
-      "errors": [
-        "(1,20): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "bar",
-                        "value": "ZZ&gtZYY",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div bar=\"ZZ&amp;gtZYY\"></div></body></html>",
-        "noQuirksBodyHtml": "<div bar=\"ZZ&amp;gtZYY\"></div>"
-      }
-    },
-    {
-      "data": "<div bar=\"ZZ&gt YY\"></div>",
-      "errors": [
-        "(1,15): named-entity-without-semicolon",
-        "(1,20): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "bar",
-                        "value": "ZZ> YY"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div bar=\"ZZ> YY\"></div></body></html>",
-        "noQuirksBodyHtml": "<div bar=\"ZZ> YY\"></div>"
-      }
-    },
-    {
-      "data": "<div bar=\"ZZ&gt\"></div>",
-      "errors": [
-        "(1,15): named-entity-without-semicolon",
-        "(1,17): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "bar",
-                        "value": "ZZ>"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div bar=\"ZZ>\"></div></body></html>",
-        "noQuirksBodyHtml": "<div bar=\"ZZ>\"></div>"
-      }
-    },
-    {
-      "data": "<div bar='ZZ&gt'></div>",
-      "errors": [
-        "(1,15): named-entity-without-semicolon",
-        "(1,17): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "bar",
-                        "value": "ZZ>"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div bar=\"ZZ>\"></div></body></html>",
-        "noQuirksBodyHtml": "<div bar=\"ZZ>\"></div>"
-      }
-    },
-    {
-      "data": "<div bar=ZZ&gt></div>",
-      "errors": [
-        "(1,14): named-entity-without-semicolon",
-        "(1,15): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "bar",
-                        "value": "ZZ>"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div bar=\"ZZ>\"></div></body></html>",
-        "noQuirksBodyHtml": "<div bar=\"ZZ>\"></div>"
-      }
-    },
-    {
-      "data": "<div bar=\"ZZ&pound_id=23\"></div>",
-      "errors": [
-        "(1,18): named-entity-without-semicolon",
-        "(1,26): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "bar",
-                        "value": "ZZ£_id=23"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div bar=\"ZZ£_id=23\"></div></body></html>",
-        "noQuirksBodyHtml": "<div bar=\"ZZ£_id=23\"></div>"
-      }
-    },
-    {
-      "data": "<div bar=\"ZZ&prod_id=23\"></div>",
-      "errors": [
-        "(1,25): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "bar",
-                        "value": "ZZ&prod_id=23",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div bar=\"ZZ&amp;prod_id=23\"></div></body></html>",
-        "noQuirksBodyHtml": "<div bar=\"ZZ&amp;prod_id=23\"></div>"
-      }
-    },
-    {
-      "data": "<div bar=\"ZZ&pound;_id=23\"></div>",
-      "errors": [
-        "(1,27): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "bar",
-                        "value": "ZZ£_id=23"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div bar=\"ZZ£_id=23\"></div></body></html>",
-        "noQuirksBodyHtml": "<div bar=\"ZZ£_id=23\"></div>"
-      }
-    },
-    {
-      "data": "<div bar=\"ZZ&prod;_id=23\"></div>",
-      "errors": [
-        "(1,26): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "bar",
-                        "value": "ZZ∏_id=23"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div bar=\"ZZ∏_id=23\"></div></body></html>",
-        "noQuirksBodyHtml": "<div bar=\"ZZ∏_id=23\"></div>"
-      }
-    },
-    {
-      "data": "<div bar=\"ZZ&pound=23\"></div>",
-      "errors": [
-        "(1,18): named-entity-without-semicolon",
-        "(1,23): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "bar",
-                        "value": "ZZ&pound=23",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div bar=\"ZZ&amp;pound=23\"></div></body></html>",
-        "noQuirksBodyHtml": "<div bar=\"ZZ&amp;pound=23\"></div>"
-      }
-    },
-    {
-      "data": "<div bar=\"ZZ&prod=23\"></div>",
-      "errors": [
-        "(1,22): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "bar",
-                        "value": "ZZ&prod=23",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div bar=\"ZZ&amp;prod=23\"></div></body></html>",
-        "noQuirksBodyHtml": "<div bar=\"ZZ&amp;prod=23\"></div>"
-      }
-    },
-    {
-      "data": "<div>ZZ&pound_id=23</div>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,13): named-entity-without-semicolon"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": "ZZ£_id=23"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div>ZZ£_id=23</div></body></html>",
-        "noQuirksBodyHtml": "<div>ZZ£_id=23</div>"
-      }
-    },
-    {
-      "data": "<div>ZZ&prod_id=23</div>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": "ZZ&prod_id=23",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div>ZZ&amp;prod_id=23</div></body></html>",
-        "noQuirksBodyHtml": "<div>ZZ&amp;prod_id=23</div>"
-      }
-    },
-    {
-      "data": "<div>ZZ&pound;_id=23</div>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": "ZZ£_id=23"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div>ZZ£_id=23</div></body></html>",
-        "noQuirksBodyHtml": "<div>ZZ£_id=23</div>"
-      }
-    },
-    {
-      "data": "<div>ZZ&prod;_id=23</div>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": "ZZ∏_id=23"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div>ZZ∏_id=23</div></body></html>",
-        "noQuirksBodyHtml": "<div>ZZ∏_id=23</div>"
-      }
-    },
-    {
-      "data": "<div>ZZ&pound=23</div>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,13): named-entity-without-semicolon"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": "ZZ£=23"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div>ZZ£=23</div></body></html>",
-        "noQuirksBodyHtml": "<div>ZZ£=23</div>"
-      }
-    },
-    {
-      "data": "<div>ZZ&prod=23</div>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": "ZZ&prod=23",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div>ZZ&amp;prod=23</div></body></html>",
-        "noQuirksBodyHtml": "<div>ZZ&amp;prod=23</div>"
-      }
-    },
-    {
-      "data": "<div>ZZ&AElig=</div>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": "ZZÆ="
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div>ZZÆ=</div></body></html>",
-        "noQuirksBodyHtml": "<div>ZZÆ=</div>"
-      }
-    }
-  ],
-  "foreign-fragment.dat": [
-    {
-      "data": "<nobr>X",
-      "errors": [
-        "6: HTML start tag “nobr” in a foreign namespace context.",
-        "7: End of file seen and there were open elements.",
-        "6: Unclosed element “nobr”."
-      ],
-      "fragment": {
-        "name": "path",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "svg nobr": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "nobr",
-            "ns": "http://www.w3.org/2000/svg",
-            "children": [
-              {
-                "text": "X"
-              }
-            ]
-          }
-        ],
-        "html": "<nobr>X</nobr>",
-        "noQuirksBodyHtml": "<nobr>X</nobr>"
-      }
-    },
-    {
-      "data": "<font color></font>X",
-      "errors": [
-        "12: HTML start tag “font” in a foreign namespace context."
-      ],
-      "fragment": {
-        "name": "path",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "svg font": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "font",
-            "ns": "http://www.w3.org/2000/svg",
-            "attrs": [
-              {
-                "name": "color",
-                "value": ""
-              }
-            ]
-          },
-          {
-            "text": "X"
-          }
-        ],
-        "html": "<font color=\"\"></font>X",
-        "noQuirksBodyHtml": "<font color=\"\"></font>X"
-      }
-    },
-    {
-      "data": "<font></font>X",
-      "errors": [],
-      "fragment": {
-        "name": "path",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "svg font": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "font",
-            "ns": "http://www.w3.org/2000/svg"
-          },
-          {
-            "text": "X"
-          }
-        ],
-        "html": "<font></font>X",
-        "noQuirksBodyHtml": "<font></font>X"
-      }
-    },
-    {
-      "data": "<g></path>X",
-      "errors": [
-        "10: End tag “path” did not match the name of the current open element (“g”).",
-        "11: End of file seen and there were open elements.",
-        "3: Unclosed element “g”."
-      ],
-      "fragment": {
-        "name": "path",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "svg g": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "g",
-            "ns": "http://www.w3.org/2000/svg",
-            "children": [
-              {
-                "text": "X"
-              }
-            ]
-          }
-        ],
-        "html": "<g>X</g>",
-        "noQuirksBodyHtml": "<g>X</g>"
-      }
-    },
-    {
-      "data": "</path>X",
-      "errors": [
-        "5: Stray end tag “path”."
-      ],
-      "fragment": {
-        "name": "path",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {}
-        },
-        "tree": [
-          {
-            "text": "X"
-          }
-        ],
-        "html": "X",
-        "noQuirksBodyHtml": "X"
-      }
-    },
-    {
-      "data": "</foreignObject>X",
-      "errors": [
-        "5: Stray end tag “foreignobject”."
-      ],
-      "fragment": {
-        "name": "foreignObject",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {}
-        },
-        "tree": [
-          {
-            "text": "X"
-          }
-        ],
-        "html": "X",
-        "noQuirksBodyHtml": "X"
-      }
-    },
-    {
-      "data": "</desc>X",
-      "errors": [
-        "5: Stray end tag “desc”."
-      ],
-      "fragment": {
-        "name": "desc",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {}
-        },
-        "tree": [
-          {
-            "text": "X"
-          }
-        ],
-        "html": "X",
-        "noQuirksBodyHtml": "X"
-      }
-    },
-    {
-      "data": "</title>X",
-      "errors": [
-        "5: Stray end tag “title”."
-      ],
-      "fragment": {
-        "name": "title",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {}
-        },
-        "tree": [
-          {
-            "text": "X"
-          }
-        ],
-        "html": "X",
-        "noQuirksBodyHtml": "X"
-      }
-    },
-    {
-      "data": "</svg>X",
-      "errors": [
-        "5: Stray end tag “svg”."
-      ],
-      "fragment": {
-        "name": "svg",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {}
-        },
-        "tree": [
-          {
-            "text": "X"
-          }
-        ],
-        "html": "X",
-        "noQuirksBodyHtml": "X"
-      }
-    },
-    {
-      "data": "</mfenced>X",
-      "errors": [
-        "5: Stray end tag “mfenced”."
-      ],
-      "fragment": {
-        "name": "mfenced",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {}
-        },
-        "tree": [
-          {
-            "text": "X"
-          }
-        ],
-        "html": "X",
-        "noQuirksBodyHtml": "X"
-      }
-    },
-    {
-      "data": "</malignmark>X",
-      "errors": [
-        "5: Stray end tag “malignmark”."
-      ],
-      "fragment": {
-        "name": "malignmark",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {}
-        },
-        "tree": [
-          {
-            "text": "X"
-          }
-        ],
-        "html": "X",
-        "noQuirksBodyHtml": "X"
-      }
-    },
-    {
-      "data": "</math>X",
-      "errors": [
-        "5: Stray end tag “math”."
-      ],
-      "fragment": {
-        "name": "math",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {}
-        },
-        "tree": [
-          {
-            "text": "X"
-          }
-        ],
-        "html": "X",
-        "noQuirksBodyHtml": "X"
-      }
-    },
-    {
-      "data": "</annotation-xml>X",
-      "errors": [
-        "5: Stray end tag “annotation-xml”."
-      ],
-      "fragment": {
-        "name": "annotation-xml",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {}
-        },
-        "tree": [
-          {
-            "text": "X"
-          }
-        ],
-        "html": "X",
-        "noQuirksBodyHtml": "X"
-      }
-    },
-    {
-      "data": "</mtext>X",
-      "errors": [
-        "5: Stray end tag “mtext”."
-      ],
-      "fragment": {
-        "name": "mtext",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {}
-        },
-        "tree": [
-          {
-            "text": "X"
-          }
-        ],
-        "html": "X",
-        "noQuirksBodyHtml": "X"
-      }
-    },
-    {
-      "data": "</mi>X",
-      "errors": [
-        "5: Stray end tag “mi”."
-      ],
-      "fragment": {
-        "name": "mi",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {}
-        },
-        "tree": [
-          {
-            "text": "X"
-          }
-        ],
-        "html": "X",
-        "noQuirksBodyHtml": "X"
-      }
-    },
-    {
-      "data": "</mo>X",
-      "errors": [
-        "5: Stray end tag “mo”."
-      ],
-      "fragment": {
-        "name": "mo",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {}
-        },
-        "tree": [
-          {
-            "text": "X"
-          }
-        ],
-        "html": "X",
-        "noQuirksBodyHtml": "X"
-      }
-    },
-    {
-      "data": "</mn>X",
-      "errors": [
-        "5: Stray end tag “mn”."
-      ],
-      "fragment": {
-        "name": "mn",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {}
-        },
-        "tree": [
-          {
-            "text": "X"
-          }
-        ],
-        "html": "X",
-        "noQuirksBodyHtml": "X"
-      }
-    },
-    {
-      "data": "</ms>X",
-      "errors": [
-        "5: Stray end tag “ms”."
-      ],
-      "fragment": {
-        "name": "ms",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {}
-        },
-        "tree": [
-          {
-            "text": "X"
-          }
-        ],
-        "html": "X",
-        "noQuirksBodyHtml": "X"
-      }
-    },
-    {
-      "data": "<b></b><mglyph/><i></i><malignmark/><u></u><ms/>X",
-      "errors": [
-        "51: Self-closing syntax (“/>”) used on a non-void HTML element. Ignoring the slash and treating as a start tag.",
-        "52: End of file seen and there were open elements.",
-        "51: Unclosed element “ms”."
-      ],
-      "fragment": {
-        "name": "ms",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "b": true,
-            "math mglyph": true,
-            "i": true,
-            "math malignmark": true,
-            "u": true,
-            "ms": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "b"
-          },
-          {
-            "tag": "mglyph",
-            "ns": "http://www.w3.org/1998/Math/MathML"
-          },
-          {
-            "tag": "i"
-          },
-          {
-            "tag": "malignmark",
-            "ns": "http://www.w3.org/1998/Math/MathML"
-          },
-          {
-            "tag": "u"
-          },
-          {
-            "tag": "ms",
-            "children": [
-              {
-                "text": "X"
-              }
-            ]
-          }
-        ],
-        "html": "<b></b><mglyph></mglyph><i></i><malignmark></malignmark><u></u><ms>X</ms>",
-        "noQuirksBodyHtml": "<b></b><mglyph><i></i><malignmark><u></u><ms>X</ms></malignmark></mglyph>"
-      }
-    },
-    {
-      "data": "<malignmark></malignmark>",
-      "errors": [],
-      "fragment": {
-        "name": "ms",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "math malignmark": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "malignmark",
-            "ns": "http://www.w3.org/1998/Math/MathML"
-          }
-        ],
-        "html": "<malignmark></malignmark>",
-        "noQuirksBodyHtml": "<malignmark></malignmark>"
-      }
-    },
-    {
-      "data": "<div></div>",
-      "errors": [],
-      "fragment": {
-        "name": "ms",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "div"
-          }
-        ],
-        "html": "<div></div>",
-        "noQuirksBodyHtml": "<div></div>"
-      }
-    },
-    {
-      "data": "<figure></figure>",
-      "errors": [],
-      "fragment": {
-        "name": "ms",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "figure": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "figure"
-          }
-        ],
-        "html": "<figure></figure>",
-        "noQuirksBodyHtml": "<figure></figure>"
-      }
-    },
-    {
-      "data": "<b></b><mglyph/><i></i><malignmark/><u></u><mn/>X",
-      "errors": [
-        "51: Self-closing syntax (“/>”) used on a non-void HTML element. Ignoring the slash and treating as a start tag.",
-        "52: End of file seen and there were open elements.",
-        "51: Unclosed element “mn”."
-      ],
-      "fragment": {
-        "name": "mn",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "b": true,
-            "math mglyph": true,
-            "i": true,
-            "math malignmark": true,
-            "u": true,
-            "mn": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "b"
-          },
-          {
-            "tag": "mglyph",
-            "ns": "http://www.w3.org/1998/Math/MathML"
-          },
-          {
-            "tag": "i"
-          },
-          {
-            "tag": "malignmark",
-            "ns": "http://www.w3.org/1998/Math/MathML"
-          },
-          {
-            "tag": "u"
-          },
-          {
-            "tag": "mn",
-            "children": [
-              {
-                "text": "X"
-              }
-            ]
-          }
-        ],
-        "html": "<b></b><mglyph></mglyph><i></i><malignmark></malignmark><u></u><mn>X</mn>",
-        "noQuirksBodyHtml": "<b></b><mglyph><i></i><malignmark><u></u><mn>X</mn></malignmark></mglyph>"
-      }
-    },
-    {
-      "data": "<malignmark></malignmark>",
-      "errors": [],
-      "fragment": {
-        "name": "mn",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "math malignmark": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "malignmark",
-            "ns": "http://www.w3.org/1998/Math/MathML"
-          }
-        ],
-        "html": "<malignmark></malignmark>",
-        "noQuirksBodyHtml": "<malignmark></malignmark>"
-      }
-    },
-    {
-      "data": "<div></div>",
-      "errors": [],
-      "fragment": {
-        "name": "mn",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "div"
-          }
-        ],
-        "html": "<div></div>",
-        "noQuirksBodyHtml": "<div></div>"
-      }
-    },
-    {
-      "data": "<figure></figure>",
-      "errors": [],
-      "fragment": {
-        "name": "mn",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "figure": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "figure"
-          }
-        ],
-        "html": "<figure></figure>",
-        "noQuirksBodyHtml": "<figure></figure>"
-      }
-    },
-    {
-      "data": "<b></b><mglyph/><i></i><malignmark/><u></u><mo/>X",
-      "errors": [
-        "51: Self-closing syntax (“/>”) used on a non-void HTML element. Ignoring the slash and treating as a start tag.",
-        "52: End of file seen and there were open elements.",
-        "51: Unclosed element “mo”."
-      ],
-      "fragment": {
-        "name": "mo",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "b": true,
-            "math mglyph": true,
-            "i": true,
-            "math malignmark": true,
-            "u": true,
-            "mo": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "b"
-          },
-          {
-            "tag": "mglyph",
-            "ns": "http://www.w3.org/1998/Math/MathML"
-          },
-          {
-            "tag": "i"
-          },
-          {
-            "tag": "malignmark",
-            "ns": "http://www.w3.org/1998/Math/MathML"
-          },
-          {
-            "tag": "u"
-          },
-          {
-            "tag": "mo",
-            "children": [
-              {
-                "text": "X"
-              }
-            ]
-          }
-        ],
-        "html": "<b></b><mglyph></mglyph><i></i><malignmark></malignmark><u></u><mo>X</mo>",
-        "noQuirksBodyHtml": "<b></b><mglyph><i></i><malignmark><u></u><mo>X</mo></malignmark></mglyph>"
-      }
-    },
-    {
-      "data": "<malignmark></malignmark>",
-      "errors": [],
-      "fragment": {
-        "name": "mo",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "math malignmark": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "malignmark",
-            "ns": "http://www.w3.org/1998/Math/MathML"
-          }
-        ],
-        "html": "<malignmark></malignmark>",
-        "noQuirksBodyHtml": "<malignmark></malignmark>"
-      }
-    },
-    {
-      "data": "<div></div>",
-      "errors": [],
-      "fragment": {
-        "name": "mo",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "div"
-          }
-        ],
-        "html": "<div></div>",
-        "noQuirksBodyHtml": "<div></div>"
-      }
-    },
-    {
-      "data": "<figure></figure>",
-      "errors": [],
-      "fragment": {
-        "name": "mo",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "figure": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "figure"
-          }
-        ],
-        "html": "<figure></figure>",
-        "noQuirksBodyHtml": "<figure></figure>"
-      }
-    },
-    {
-      "data": "<b></b><mglyph/><i></i><malignmark/><u></u><mi/>X",
-      "errors": [
-        "51: Self-closing syntax (“/>”) used on a non-void HTML element. Ignoring the slash and treating as a start tag.",
-        "52: End of file seen and there were open elements.",
-        "51: Unclosed element “mi”."
-      ],
-      "fragment": {
-        "name": "mi",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "b": true,
-            "math mglyph": true,
-            "i": true,
-            "math malignmark": true,
-            "u": true,
-            "mi": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "b"
-          },
-          {
-            "tag": "mglyph",
-            "ns": "http://www.w3.org/1998/Math/MathML"
-          },
-          {
-            "tag": "i"
-          },
-          {
-            "tag": "malignmark",
-            "ns": "http://www.w3.org/1998/Math/MathML"
-          },
-          {
-            "tag": "u"
-          },
-          {
-            "tag": "mi",
-            "children": [
-              {
-                "text": "X"
-              }
-            ]
-          }
-        ],
-        "html": "<b></b><mglyph></mglyph><i></i><malignmark></malignmark><u></u><mi>X</mi>",
-        "noQuirksBodyHtml": "<b></b><mglyph><i></i><malignmark><u></u><mi>X</mi></malignmark></mglyph>"
-      }
-    },
-    {
-      "data": "<malignmark></malignmark>",
-      "errors": [],
-      "fragment": {
-        "name": "mi",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "math malignmark": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "malignmark",
-            "ns": "http://www.w3.org/1998/Math/MathML"
-          }
-        ],
-        "html": "<malignmark></malignmark>",
-        "noQuirksBodyHtml": "<malignmark></malignmark>"
-      }
-    },
-    {
-      "data": "<div></div>",
-      "errors": [],
-      "fragment": {
-        "name": "mi",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "div"
-          }
-        ],
-        "html": "<div></div>",
-        "noQuirksBodyHtml": "<div></div>"
-      }
-    },
-    {
-      "data": "<figure></figure>",
-      "errors": [],
-      "fragment": {
-        "name": "mi",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "figure": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "figure"
-          }
-        ],
-        "html": "<figure></figure>",
-        "noQuirksBodyHtml": "<figure></figure>"
-      }
-    },
-    {
-      "data": "<b></b><mglyph/><i></i><malignmark/><u></u><mtext/>X",
-      "errors": [
-        "51: Self-closing syntax (“/>”) used on a non-void HTML element. Ignoring the slash and treating as a start tag.",
-        "52: End of file seen and there were open elements.",
-        "51: Unclosed element “mtext”."
-      ],
-      "fragment": {
-        "name": "mtext",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "b": true,
-            "math mglyph": true,
-            "i": true,
-            "math malignmark": true,
-            "u": true,
-            "mtext": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "b"
-          },
-          {
-            "tag": "mglyph",
-            "ns": "http://www.w3.org/1998/Math/MathML"
-          },
-          {
-            "tag": "i"
-          },
-          {
-            "tag": "malignmark",
-            "ns": "http://www.w3.org/1998/Math/MathML"
-          },
-          {
-            "tag": "u"
-          },
-          {
-            "tag": "mtext",
-            "children": [
-              {
-                "text": "X"
-              }
-            ]
-          }
-        ],
-        "html": "<b></b><mglyph></mglyph><i></i><malignmark></malignmark><u></u><mtext>X</mtext>",
-        "noQuirksBodyHtml": "<b></b><mglyph><i></i><malignmark><u></u><mtext>X</mtext></malignmark></mglyph>"
-      }
-    },
-    {
-      "data": "<malignmark></malignmark>",
-      "errors": [],
-      "fragment": {
-        "name": "mtext",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "math malignmark": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "malignmark",
-            "ns": "http://www.w3.org/1998/Math/MathML"
-          }
-        ],
-        "html": "<malignmark></malignmark>",
-        "noQuirksBodyHtml": "<malignmark></malignmark>"
-      }
-    },
-    {
-      "data": "<div></div>",
-      "errors": [],
-      "fragment": {
-        "name": "mtext",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "div"
-          }
-        ],
-        "html": "<div></div>",
-        "noQuirksBodyHtml": "<div></div>"
-      }
-    },
-    {
-      "data": "<figure></figure>",
-      "errors": [],
-      "fragment": {
-        "name": "mtext",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "figure": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "figure"
-          }
-        ],
-        "html": "<figure></figure>",
-        "noQuirksBodyHtml": "<figure></figure>"
-      }
-    },
-    {
-      "data": "<div></div>",
-      "errors": [
-        "5: HTML start tag “div” in a foreign namespace context."
-      ],
-      "fragment": {
-        "name": "annotation-xml",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "math div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "div",
-            "ns": "http://www.w3.org/1998/Math/MathML"
-          }
-        ],
-        "html": "<div></div>",
-        "noQuirksBodyHtml": "<div></div>"
-      }
-    },
-    {
-      "data": "<figure></figure>",
-      "errors": [],
-      "fragment": {
-        "name": "annotation-xml",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "math figure": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "figure",
-            "ns": "http://www.w3.org/1998/Math/MathML"
-          }
-        ],
-        "html": "<figure></figure>",
-        "noQuirksBodyHtml": "<figure></figure>"
-      }
-    },
-    {
-      "data": "<div></div>",
-      "errors": [
-        "5: HTML start tag “div” in a foreign namespace context."
-      ],
-      "fragment": {
-        "name": "math",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "math div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "div",
-            "ns": "http://www.w3.org/1998/Math/MathML"
-          }
-        ],
-        "html": "<div></div>",
-        "noQuirksBodyHtml": "<div></div>"
-      }
-    },
-    {
-      "data": "<figure></figure>",
-      "errors": [],
-      "fragment": {
-        "name": "math",
-        "ns": "http://www.w3.org/1998/Math/MathML"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "math figure": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "figure",
-            "ns": "http://www.w3.org/1998/Math/MathML"
-          }
-        ],
-        "html": "<figure></figure>",
-        "noQuirksBodyHtml": "<figure></figure>"
-      }
-    },
-    {
-      "data": "<div></div>",
-      "errors": [],
-      "fragment": {
-        "name": "foreignObject",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "div"
-          }
-        ],
-        "html": "<div></div>",
-        "noQuirksBodyHtml": "<div></div>"
-      }
-    },
-    {
-      "data": "<figure></figure>",
-      "errors": [],
-      "fragment": {
-        "name": "foreignObject",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "figure": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "figure"
-          }
-        ],
-        "html": "<figure></figure>",
-        "noQuirksBodyHtml": "<figure></figure>"
-      }
-    },
-    {
-      "data": "<div></div>",
-      "errors": [],
-      "fragment": {
-        "name": "title",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "div"
-          }
-        ],
-        "html": "<div></div>",
-        "noQuirksBodyHtml": "<div></div>"
-      }
-    },
-    {
-      "data": "<figure></figure>",
-      "errors": [],
-      "fragment": {
-        "name": "title",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "figure": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "figure"
-          }
-        ],
-        "html": "<figure></figure>",
-        "noQuirksBodyHtml": "<figure></figure>"
-      }
-    },
-    {
-      "data": "<figure></figure>",
-      "errors": [],
-      "fragment": {
-        "name": "desc",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "figure": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "figure"
-          }
-        ],
-        "html": "<figure></figure>",
-        "noQuirksBodyHtml": "<figure></figure>"
-      }
-    },
-    {
-      "data": "<div><h1>X</h1></div>",
-      "errors": [
-        "5: HTML start tag “div” in a foreign namespace context.",
-        "9: HTML start tag “h1” in a foreign namespace context."
-      ],
-      "fragment": {
-        "name": "svg",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "svg div": true,
-            "svg h1": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "div",
-            "ns": "http://www.w3.org/2000/svg",
-            "children": [
-              {
-                "tag": "h1",
-                "ns": "http://www.w3.org/2000/svg",
-                "children": [
-                  {
-                    "text": "X"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<div><h1>X</h1></div>",
-        "noQuirksBodyHtml": "<div><h1>X</h1></div>"
-      }
-    },
-    {
-      "data": "<div></div>",
-      "errors": [
-        "5: HTML start tag “div” in a foreign namespace context."
-      ],
-      "fragment": {
-        "name": "svg",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "svg div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "div",
-            "ns": "http://www.w3.org/2000/svg"
-          }
-        ],
-        "html": "<div></div>",
-        "noQuirksBodyHtml": "<div></div>"
-      }
-    },
-    {
-      "data": "<div></div>",
-      "errors": [],
-      "fragment": {
-        "name": "desc",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "div"
-          }
-        ],
-        "html": "<div></div>",
-        "noQuirksBodyHtml": "<div></div>"
-      }
-    },
-    {
-      "data": "<figure></figure>",
-      "errors": [],
-      "fragment": {
-        "name": "desc",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "figure": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "figure"
-          }
-        ],
-        "html": "<figure></figure>",
-        "noQuirksBodyHtml": "<figure></figure>"
-      }
-    },
-    {
-      "data": "<plaintext><foo>",
-      "errors": [
-        "(1,16): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "desc",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "plaintext": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "plaintext",
-            "children": [
-              {
-                "text": "<foo>",
-                "no_escape": true
-              }
-            ]
-          }
-        ],
-        "html": "<plaintext><foo></plaintext>",
-        "noQuirksBodyHtml": "<plaintext><foo></plaintext>"
-      }
-    },
-    {
-      "data": "<frameset>X",
-      "errors": [
-        "6: Stray start tag “frameset”."
-      ],
-      "fragment": {
-        "name": "desc",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {}
-        },
-        "tree": [
-          {
-            "text": "X"
-          }
-        ],
-        "html": "X",
-        "noQuirksBodyHtml": "X"
-      }
-    },
-    {
-      "data": "<head>X",
-      "errors": [
-        "6: Stray start tag “head”."
-      ],
-      "fragment": {
-        "name": "desc",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {}
-        },
-        "tree": [
-          {
-            "text": "X"
-          }
-        ],
-        "html": "X",
-        "noQuirksBodyHtml": "X"
-      }
-    },
-    {
-      "data": "<body>X",
-      "errors": [
-        "6: Stray start tag “body”."
-      ],
-      "fragment": {
-        "name": "desc",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {}
-        },
-        "tree": [
-          {
-            "text": "X"
-          }
-        ],
-        "html": "X",
-        "noQuirksBodyHtml": "X"
-      }
-    },
-    {
-      "data": "<html>X",
-      "errors": [
-        "6: Stray start tag “html”."
-      ],
-      "fragment": {
-        "name": "desc",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {}
-        },
-        "tree": [
-          {
-            "text": "X"
-          }
-        ],
-        "html": "X",
-        "noQuirksBodyHtml": "X"
-      }
-    },
-    {
-      "data": "<html class=\"foo\">X",
-      "errors": [
-        "6: Stray start tag “html”."
-      ],
-      "fragment": {
-        "name": "desc",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {}
-        },
-        "tree": [
-          {
-            "text": "X"
-          }
-        ],
-        "html": "X",
-        "noQuirksBodyHtml": "X"
-      }
-    },
-    {
-      "data": "<body class=\"foo\">X",
-      "errors": [
-        "6: Stray start tag “body”."
-      ],
-      "fragment": {
-        "name": "desc",
-        "ns": "http://www.w3.org/2000/svg"
-      },
-      "document": {
-        "props": {
-          "tags": {}
-        },
-        "tree": [
-          {
-            "text": "X"
-          }
-        ],
-        "html": "X",
-        "noQuirksBodyHtml": "X"
-      }
-    }
-  ],
-  "html5test-com.dat": [
-    {
-      "data": "<div<div>",
-      "errors": [
-        "(1,9): expected-doctype-but-got-start-tag",
-        "(1,9): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div<div": true
-          },
-          "tagWithLt": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div<div"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div<div></div<div></body></html>",
-        "noQuirksBodyHtml": "<div<div></div<div>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          },
-          "attrWithFunnyChar": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "foo<bar",
-                        "value": ""
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div foo<bar=\"\"></div></body></html>",
-        "noQuirksBodyHtml": "<div foo<bar=\"\"></div>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "foo",
-                        "value": "`bar`"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div foo=\"`bar`\"></div></body></html>",
-        "noQuirksBodyHtml": "<div foo=\"`bar`\"></div>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          },
-          "attrWithFunnyChar": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "\\\"foo",
-                        "value": ""
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div \\\"foo=\"\"></div></body></html>",
-        "noQuirksBodyHtml": "<div \\\"foo=\"\"></div>"
-      }
-    },
-    {
-      "data": "<a href='\\nbar'></a>",
-      "errors": [
-        "(1,16): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "attrs": [
-                      {
-                        "name": "href",
-                        "value": "\\nbar"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a href=\"\\nbar\"></a></body></html>",
-        "noQuirksBodyHtml": "<a href=\"\\nbar\"></a>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "&lang;&rang;",
-      "errors": [
-        "(1,6): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "⟨⟩"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>⟨⟩</body></html>",
-        "noQuirksBodyHtml": "⟨⟩"
-      }
-    },
-    {
-      "data": "&apos;",
-      "errors": [
-        "(1,6): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "'"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>'</body></html>",
-        "noQuirksBodyHtml": "'"
-      }
-    },
-    {
-      "data": "&ImaginaryI;",
-      "errors": [
-        "(1,12): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "ⅈ"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>ⅈ</body></html>",
-        "noQuirksBodyHtml": "ⅈ"
-      }
-    },
-    {
-      "data": "&Kopf;",
-      "errors": [
-        "(1,6): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "𝕂"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>𝕂</body></html>",
-        "noQuirksBodyHtml": "𝕂"
-      }
-    },
-    {
-      "data": "&notinva;",
-      "errors": [
-        "(1,9): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "∉"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>∉</body></html>",
-        "noQuirksBodyHtml": "∉"
-      }
-    },
-    {
-      "data": "<?import namespace=\"foo\" implementation=\"#bar\">",
-      "errors": [
-        "(1,1): expected-tag-name-but-got-question-mark",
-        "(1,47): expected-doctype-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "comment": "?import namespace=\"foo\" implementation=\"#bar\""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!--?import namespace=\"foo\" implementation=\"#bar\"--><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!--?import namespace=\"foo\" implementation=\"#bar\"-->"
-      }
-    },
-    {
-      "data": "<!--foo--bar-->",
-      "errors": [
-        "(1,10): unexpected-char-in-comment",
-        "(1,15): expected-doctype-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "comment": "foo--bar"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!--foo--bar--><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!--foo--bar-->"
-      }
-    },
-    {
-      "data": "<![CDATA[x]]>",
-      "errors": [
-        "(1,2): expected-dashes-or-doctype",
-        "(1,13): expected-doctype-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "comment": "[CDATA[x]]"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!--[CDATA[x]]--><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!--[CDATA[x]]-->"
-      }
-    },
-    {
-      "data": "<textarea><!--</textarea>--></textarea>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag",
-        "(1,39): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "textarea": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "textarea",
-                    "children": [
-                      {
-                        "text": "<!--",
-                        "escaped": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><textarea>&lt;!--</textarea>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<textarea>&lt;!--</textarea>--&gt;"
-      }
-    },
-    {
-      "data": "<textarea><!--</textarea>-->",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "textarea": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "textarea",
-                    "children": [
-                      {
-                        "text": "<!--",
-                        "escaped": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><textarea>&lt;!--</textarea>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<textarea>&lt;!--</textarea>--&gt;"
-      }
-    },
-    {
-      "data": "<style><!--</style>--></style>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,30): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": "<!--",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><style><!--</style></head><body>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<style><!--</style>--&gt;"
-      }
-    },
-    {
-      "data": "<style><!--</style>-->",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": "<!--",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><style><!--</style></head><body>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<style><!--</style>--&gt;"
-      }
-    },
-    {
-      "data": "<ul><li>A </li> <li>B</li></ul>",
-      "errors": [
-        "(1,4): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ul": true,
-            "li": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ul",
-                    "children": [
-                      {
-                        "tag": "li",
-                        "children": [
-                          {
-                            "text": "A "
-                          }
-                        ]
-                      },
-                      {
-                        "text": " "
-                      },
-                      {
-                        "tag": "li",
-                        "children": [
-                          {
-                            "text": "B"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ul><li>A </li> <li>B</li></ul></body></html>",
-        "noQuirksBodyHtml": "<ul><li>A </li> <li>B</li></ul>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "input": true,
-            "div": true,
-            "table": true,
-            "form": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "input"
-                  },
-                  {
-                    "tag": "div"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "form"
-                      },
-                      {
-                        "tag": "input",
-                        "attrs": [
-                          {
-                            "name": "type",
-                            "value": "hidden"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><input><div></div><table><form></form><input type=\"hidden\"></table></body></html>",
-        "noQuirksBodyHtml": "<input><div></div><table><form></form><input type=\"hidden\"></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "i": true,
-            "b": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "i",
-                    "children": [
-                      {
-                        "text": "A"
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": "B"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "b"
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "tag": "i"
-                          },
-                          {
-                            "text": "C"
-                          }
-                        ]
-                      },
-                      {
-                        "text": "D"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><i>A<b>B</b></i><b></b><p><b><i></i>C</b>D</p></body></html>",
-        "noQuirksBodyHtml": "<i>A<b>B</b></i><b></b><p><b><i></i>C</b>D</p>"
-      }
-    },
-    {
-      "data": "<div></div>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div></div></body></html>",
-        "noQuirksBodyHtml": "<div></div>"
-      }
-    },
-    {
-      "data": "<svg></svg>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg></svg></body></html>",
-        "noQuirksBodyHtml": "<svg></svg>"
-      }
-    },
-    {
-      "data": "<math></math>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math></math></body></html>",
-        "noQuirksBodyHtml": "<math></math>"
-      }
-    }
-  ],
-  "inbody01.dat": [
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "button": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "button",
-                    "children": [
-                      {
-                        "text": "1"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><button>1</button></body></html>",
-        "noQuirksBodyHtml": "<button>1</button>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "foo": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "foo",
-                    "children": [
-                      {
-                        "text": "1"
-                      },
-                      {
-                        "tag": "p",
-                        "children": [
-                          {
-                            "text": "2"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><foo>1<p>2</p></foo></body></html>",
-        "noQuirksBodyHtml": "<foo>1<p>2</p></foo>"
-      }
-    },
-    {
-      "data": "<dd>1</foo>",
-      "errors": [
-        "(1,4): expected-doctype-but-got-start-tag",
-        "(1,11): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "dd": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "dd",
-                    "children": [
-                      {
-                        "text": "1"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><dd>1</dd></body></html>",
-        "noQuirksBodyHtml": "<dd>1</dd>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "foo": true,
-            "dd": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "foo",
-                    "children": [
-                      {
-                        "text": "1"
-                      },
-                      {
-                        "tag": "dd",
-                        "children": [
-                          {
-                            "text": "2"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><foo>1<dd>2</dd></foo></body></html>",
-        "noQuirksBodyHtml": "<foo>1<dd>2</dd></foo>"
-      }
-    }
-  ],
-  "isindex.dat": [
-    {
-      "data": "<isindex>",
-      "errors": [
-        "(1,9): expected-doctype-but-got-start-tag",
-        "(1,9): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "isindex": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "isindex"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><isindex></isindex></body></html>",
-        "noQuirksBodyHtml": "<isindex></isindex>"
-      }
-    },
-    {
-      "data": "<isindex name=\"A\" action=\"B\" prompt=\"C\" foo=\"D\">",
-      "errors": [
-        "(1,48): expected-doctype-but-got-start-tag",
-        "(1,48): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "isindex": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "isindex",
-                    "attrs": [
-                      {
-                        "name": "action",
-                        "value": "B"
-                      },
-                      {
-                        "name": "foo",
-                        "value": "D"
-                      },
-                      {
-                        "name": "name",
-                        "value": "A"
-                      },
-                      {
-                        "name": "prompt",
-                        "value": "C"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><isindex name=\"A\" action=\"B\" prompt=\"C\" foo=\"D\"></isindex></body></html>",
-        "noQuirksBodyHtml": "<isindex name=\"A\" action=\"B\" prompt=\"C\" foo=\"D\"></isindex>"
-      }
-    },
-    {
-      "data": "<form><isindex>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,15): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "form": true,
-            "isindex": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "form",
-                    "children": [
-                      {
-                        "tag": "isindex"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><form><isindex></isindex></form></body></html>",
-        "noQuirksBodyHtml": "<form><isindex></isindex></form>"
-      }
-    },
-    {
-      "data": "<!doctype html><isindex>x</isindex>x",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "isindex": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "isindex",
-                    "children": [
-                      {
-                        "text": "x"
-                      }
-                    ]
-                  },
-                  {
-                    "text": "x"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><isindex>x</isindex>x</body></html>",
-        "noQuirksBodyHtml": "<isindex>x</isindex>x"
-      }
-    }
-  ],
-  "main-element.dat": [
-    {
-      "data": "<!doctype html><p>foo<main>bar<p>baz",
-      "errors": [
-        "(1,36): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "main": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "foo"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "main",
-                    "children": [
-                      {
-                        "text": "bar"
-                      },
-                      {
-                        "tag": "p",
-                        "children": [
-                          {
-                            "text": "baz"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p>foo</p><main>bar<p>baz</p></main></body></html>",
-        "noQuirksBodyHtml": "<p>foo</p><main>bar<p>baz</p></main>"
-      }
-    },
-    {
-      "data": "<!doctype html><main><p>foo</main>bar",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "main": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "main",
-                    "children": [
-                      {
-                        "tag": "p",
-                        "children": [
-                          {
-                            "text": "foo"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "text": "bar"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><main><p>foo</p></main>bar</body></html>",
-        "noQuirksBodyHtml": "<main><p>foo</p></main>bar"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html>xxx<svg><x><g><a><main><b>",
-      "errors": [
-        " * (1,42) unexpected HTML-like start tag token in foreign content",
-        " * (1,42) unexpected end of file"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg x": true,
-            "svg g": true,
-            "svg a": true,
-            "svg main": true,
-            "b": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "xxx"
-                  },
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "x",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "tag": "g",
-                            "ns": "http://www.w3.org/2000/svg",
-                            "children": [
-                              {
-                                "tag": "a",
-                                "ns": "http://www.w3.org/2000/svg",
-                                "children": [
-                                  {
-                                    "tag": "main",
-                                    "ns": "http://www.w3.org/2000/svg"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "b"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>xxx<svg><x><g><a><main></main></a></g></x></svg><b></b></body></html>",
-        "noQuirksBodyHtml": "xxx<svg><x><g><a><main><b></b></main></a></g></x></svg>"
-      }
-    }
-  ],
-  "math.dat": [
-    {
-      "data": "<math><tr><td><mo><tr>",
-      "errors": [],
-      "fragment": {
-        "name": "td"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "math math": true,
-            "math tr": true,
-            "math td": true,
-            "math mo": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "math",
-            "ns": "http://www.w3.org/1998/Math/MathML",
-            "children": [
-              {
-                "tag": "tr",
-                "ns": "http://www.w3.org/1998/Math/MathML",
-                "children": [
-                  {
-                    "tag": "td",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mo",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<math><tr><td><mo></mo></td></tr></math>",
-        "noQuirksBodyHtml": "<math><tr><td><mo></mo></td></tr></math>"
-      }
-    },
-    {
-      "data": "<math><tr><td><mo><tr>",
-      "errors": [],
-      "fragment": {
-        "name": "tr"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "math math": true,
-            "math tr": true,
-            "math td": true,
-            "math mo": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "math",
-            "ns": "http://www.w3.org/1998/Math/MathML",
-            "children": [
-              {
-                "tag": "tr",
-                "ns": "http://www.w3.org/1998/Math/MathML",
-                "children": [
-                  {
-                    "tag": "td",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mo",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<math><tr><td><mo></mo></td></tr></math>",
-        "noQuirksBodyHtml": "<math><tr><td><mo></mo></td></tr></math>"
-      }
-    },
-    {
-      "data": "<math><thead><mo><tbody>",
-      "errors": [],
-      "fragment": {
-        "name": "thead"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "math math": true,
-            "math thead": true,
-            "math mo": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "math",
-            "ns": "http://www.w3.org/1998/Math/MathML",
-            "children": [
-              {
-                "tag": "thead",
-                "ns": "http://www.w3.org/1998/Math/MathML",
-                "children": [
-                  {
-                    "tag": "mo",
-                    "ns": "http://www.w3.org/1998/Math/MathML"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<math><thead><mo></mo></thead></math>",
-        "noQuirksBodyHtml": "<math><thead><mo></mo></thead></math>"
-      }
-    },
-    {
-      "data": "<math><tfoot><mo><tbody>",
-      "errors": [],
-      "fragment": {
-        "name": "tfoot"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "math math": true,
-            "math tfoot": true,
-            "math mo": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "math",
-            "ns": "http://www.w3.org/1998/Math/MathML",
-            "children": [
-              {
-                "tag": "tfoot",
-                "ns": "http://www.w3.org/1998/Math/MathML",
-                "children": [
-                  {
-                    "tag": "mo",
-                    "ns": "http://www.w3.org/1998/Math/MathML"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<math><tfoot><mo></mo></tfoot></math>",
-        "noQuirksBodyHtml": "<math><tfoot><mo></mo></tfoot></math>"
-      }
-    },
-    {
-      "data": "<math><tbody><mo><tfoot>",
-      "errors": [],
-      "fragment": {
-        "name": "tbody"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "math math": true,
-            "math tbody": true,
-            "math mo": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "math",
-            "ns": "http://www.w3.org/1998/Math/MathML",
-            "children": [
-              {
-                "tag": "tbody",
-                "ns": "http://www.w3.org/1998/Math/MathML",
-                "children": [
-                  {
-                    "tag": "mo",
-                    "ns": "http://www.w3.org/1998/Math/MathML"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<math><tbody><mo></mo></tbody></math>",
-        "noQuirksBodyHtml": "<math><tbody><mo></mo></tbody></math>"
-      }
-    },
-    {
-      "data": "<math><tbody><mo></table>",
-      "errors": [],
-      "fragment": {
-        "name": "tbody"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "math math": true,
-            "math tbody": true,
-            "math mo": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "math",
-            "ns": "http://www.w3.org/1998/Math/MathML",
-            "children": [
-              {
-                "tag": "tbody",
-                "ns": "http://www.w3.org/1998/Math/MathML",
-                "children": [
-                  {
-                    "tag": "mo",
-                    "ns": "http://www.w3.org/1998/Math/MathML"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<math><tbody><mo></mo></tbody></math>",
-        "noQuirksBodyHtml": "<math><tbody><mo></mo></tbody></math>"
-      }
-    },
-    {
-      "data": "<math><thead><mo></table>",
-      "errors": [],
-      "fragment": {
-        "name": "tbody"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "math math": true,
-            "math thead": true,
-            "math mo": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "math",
-            "ns": "http://www.w3.org/1998/Math/MathML",
-            "children": [
-              {
-                "tag": "thead",
-                "ns": "http://www.w3.org/1998/Math/MathML",
-                "children": [
-                  {
-                    "tag": "mo",
-                    "ns": "http://www.w3.org/1998/Math/MathML"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<math><thead><mo></mo></thead></math>",
-        "noQuirksBodyHtml": "<math><thead><mo></mo></thead></math>"
-      }
-    },
-    {
-      "data": "<math><tfoot><mo></table>",
-      "errors": [],
-      "fragment": {
-        "name": "tbody"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "math math": true,
-            "math tfoot": true,
-            "math mo": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "math",
-            "ns": "http://www.w3.org/1998/Math/MathML",
-            "children": [
-              {
-                "tag": "tfoot",
-                "ns": "http://www.w3.org/1998/Math/MathML",
-                "children": [
-                  {
-                    "tag": "mo",
-                    "ns": "http://www.w3.org/1998/Math/MathML"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<math><tfoot><mo></mo></tfoot></math>",
-        "noQuirksBodyHtml": "<math><tfoot><mo></mo></tfoot></math>"
-      }
-    }
-  ],
-  "menuitem-element.dat": [
-    {
-      "data": "<menuitem>",
-      "errors": [
-        "10: Start tag seen without seeing a doctype first. Expected “<!DOCTYPE html>”."
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "menuitem": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "menuitem"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><menuitem></menuitem></body></html>",
-        "noQuirksBodyHtml": "<menuitem></menuitem>"
-      }
-    },
-    {
-      "data": "</menuitem>",
-      "errors": [
-        "11: End tag seen without seeing a doctype first. Expected “<!DOCTYPE html>”.",
-        "11: Stray end tag “menuitem”."
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><menuitem>A",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "menuitem": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "menuitem",
-                    "children": [
-                      {
-                        "text": "A"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><menuitem>A</menuitem></body></html>",
-        "noQuirksBodyHtml": "<menuitem>A</menuitem>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><menuitem>A<menuitem>B",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "menuitem": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "menuitem",
-                    "children": [
-                      {
-                        "text": "A"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "menuitem",
-                    "children": [
-                      {
-                        "text": "B"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><menuitem>A</menuitem><menuitem>B</menuitem></body></html>",
-        "noQuirksBodyHtml": "<menuitem>A</menuitem><menuitem>B</menuitem>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><menuitem>A<menu>B</menu>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "menuitem": true,
-            "menu": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "menuitem",
-                    "children": [
-                      {
-                        "text": "A"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "menu",
-                    "children": [
-                      {
-                        "text": "B"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><menuitem>A</menuitem><menu>B</menu></body></html>",
-        "noQuirksBodyHtml": "<menuitem>A</menuitem><menu>B</menu>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><menuitem>A<hr>B",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "menuitem": true,
-            "hr": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "menuitem",
-                    "children": [
-                      {
-                        "text": "A"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "hr"
-                  },
-                  {
-                    "text": "B"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><menuitem>A</menuitem><hr>B</body></html>",
-        "noQuirksBodyHtml": "<menuitem>A</menuitem><hr>B"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><li><menuitem><li>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "li": true,
-            "menuitem": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "li",
-                    "children": [
-                      {
-                        "tag": "menuitem"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "li"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><li><menuitem></menuitem></li><li></li></body></html>",
-        "noQuirksBodyHtml": "<li><menuitem></menuitem></li><li></li>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><menuitem><p></menuitem>x",
-      "errors": [
-        "39: Stray end tag “menuitem”."
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "menuitem": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "menuitem",
-                    "children": [
-                      {
-                        "tag": "p",
-                        "children": [
-                          {
-                            "text": "x"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><menuitem><p>x</p></menuitem></body></html>",
-        "noQuirksBodyHtml": "<menuitem><p>x</p></menuitem>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><p><b></p><menuitem>",
-      "errors": [
-        "25: End tag “p” seen, but there were open elements.",
-        "21: Unclosed element “b”.",
-        "35: End of file seen and there were open elements."
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "b": true,
-            "menuitem": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "b"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "menuitem"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><b></b></p><b><menuitem></menuitem></b></body></html>",
-        "noQuirksBodyHtml": "<p><b></b></p><b><menuitem></menuitem></b>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><menuitem><asdf></menuitem>x",
-      "errors": [
-        "40: End tag “menuitem” seen, but there were open elements.",
-        "31: Unclosed element “asdf”."
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "menuitem": true,
-            "asdf": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "menuitem",
-                    "children": [
-                      {
-                        "tag": "asdf"
-                      }
-                    ]
-                  },
-                  {
-                    "text": "x"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><menuitem><asdf></asdf></menuitem>x</body></html>",
-        "noQuirksBodyHtml": "<menuitem><asdf></asdf></menuitem>x"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html></menuitem>",
-      "errors": [
-        "26: Stray end tag “menuitem”."
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><html></menuitem>",
-      "errors": [
-        "26: Stray end tag “menuitem”."
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><head></menuitem>",
-      "errors": [
-        "26: Stray end tag “menuitem”."
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><select><menuitem></select>",
-      "errors": [
-        "33: Stray start tag “menuitem”."
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select></select></body></html>",
-        "noQuirksBodyHtml": "<select></select>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><option><menuitem>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "option": true,
-            "menuitem": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "option",
-                    "children": [
-                      {
-                        "tag": "menuitem"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><option><menuitem></menuitem></option></body></html>",
-        "noQuirksBodyHtml": "<option><menuitem></menuitem></option>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><menuitem><option>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "menuitem": true,
-            "option": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "menuitem",
-                    "children": [
-                      {
-                        "tag": "option"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><menuitem><option></option></menuitem></body></html>",
-        "noQuirksBodyHtml": "<menuitem><option></option></menuitem>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><menuitem></body>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "menuitem": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "menuitem"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><menuitem></menuitem></body></html>",
-        "noQuirksBodyHtml": "<menuitem></menuitem>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><menuitem></html>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "menuitem": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "menuitem"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><menuitem></menuitem></body></html>",
-        "noQuirksBodyHtml": "<menuitem></menuitem>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><menuitem><p>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "menuitem": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "menuitem",
-                    "children": [
-                      {
-                        "tag": "p"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><menuitem><p></p></menuitem></body></html>",
-        "noQuirksBodyHtml": "<menuitem><p></p></menuitem>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><menuitem><li>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "menuitem": true,
-            "li": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "menuitem",
-                    "children": [
-                      {
-                        "tag": "li"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><menuitem><li></li></menuitem></body></html>",
-        "noQuirksBodyHtml": "<menuitem><li></li></menuitem>"
-      }
-    }
-  ],
-  "namespace-sensitivity.dat": [
-    {
-      "data": "<body><table><tr><td><svg><td><foreignObject><span></td>Foo",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "svg svg": true,
-            "svg td": true,
-            "svg foreignObject": true,
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Foo"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "svg",
-                                    "ns": "http://www.w3.org/2000/svg",
-                                    "children": [
-                                      {
-                                        "tag": "td",
-                                        "ns": "http://www.w3.org/2000/svg",
-                                        "children": [
-                                          {
-                                            "tag": "foreignObject",
-                                            "ns": "http://www.w3.org/2000/svg",
-                                            "children": [
-                                              {
-                                                "tag": "span"
-                                              }
-                                            ]
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>Foo<table><tbody><tr><td><svg><td><foreignObject><span></span></foreignObject></td></svg></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "Foo<table><tbody><tr><td><svg><td><foreignObject><span></span></foreignObject></td></svg></td></tr></tbody></table>"
-      }
-    }
-  ],
-  "noscript01.dat": [
-    {
-      "data": "<head><noscript><!doctype html><!--foo--></noscript>",
-      "errors": [
-        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.",
-        "Line: 1 Col: 31 Unexpected DOCTYPE. Ignored."
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "comment": "foo"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript><!--foo--></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript><!--foo--></noscript>"
-      }
-    },
-    {
-      "data": "<head><noscript><html class=\"foo\"><!--foo--></noscript>",
-      "errors": [
-        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.",
-        "Line: 1 Col: 34 html needs to be the first start tag."
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "attrs": [
-              {
-                "name": "class",
-                "value": "foo"
-              }
-            ],
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "comment": "foo"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html class=\"foo\"><head><noscript><!--foo--></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript><!--foo--></noscript>"
-      }
-    },
-    {
-      "data": "<head><noscript></noscript>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-tag"
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript"
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript></noscript>"
-      }
-    },
-    {
-      "data": "<head><noscript>   </noscript>",
-      "errors": [
-        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE."
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "text": "   ",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript>   </noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript>   </noscript>"
-      }
-    },
-    {
-      "data": "<head><noscript><!--foo--></noscript>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-tag"
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "comment": "foo"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript><!--foo--></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript><!--foo--></noscript>"
-      }
-    },
-    {
-      "data": "<head><noscript><basefont><!--foo--></noscript>",
-      "errors": [
-        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE."
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "basefont": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "tag": "basefont"
-                      },
-                      {
-                        "comment": "foo"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript><basefont><!--foo--></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript><basefont><!--foo--></noscript>"
-      }
-    },
-    {
-      "data": "<head><noscript><bgsound><!--foo--></noscript>",
-      "errors": [
-        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE."
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "bgsound": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "tag": "bgsound"
-                      },
-                      {
-                        "comment": "foo"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript><bgsound><!--foo--></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript><bgsound><!--foo--></noscript>"
-      }
-    },
-    {
-      "data": "<head><noscript><link><!--foo--></noscript>",
-      "errors": [
-        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE."
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "link": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "tag": "link"
-                      },
-                      {
-                        "comment": "foo"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript><link><!--foo--></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript><link><!--foo--></noscript>"
-      }
-    },
-    {
-      "data": "<head><noscript><meta><!--foo--></noscript>",
-      "errors": [
-        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE."
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "meta": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "tag": "meta"
-                      },
-                      {
-                        "comment": "foo"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript><meta><!--foo--></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript><meta><!--foo--></noscript>"
-      }
-    },
-    {
-      "data": "<head><noscript><noframes>XXX</noscript></noframes></noscript>",
-      "errors": [
-        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE."
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "noframes": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "tag": "noframes",
-                        "children": [
-                          {
-                            "text": "XXX</noscript>",
-                            "no_escape": true
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript><noframes>XXX</noscript></noframes></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript><noframes>XXX</noscript></noframes></noscript>"
-      }
-    },
-    {
-      "data": "<head><noscript><style>XXX</style></noscript>",
-      "errors": [
-        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE."
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "style": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "tag": "style",
-                        "children": [
-                          {
-                            "text": "XXX",
-                            "no_escape": true
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript><style>XXX</style></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript><style>XXX</style></noscript>"
-      }
-    },
-    {
-      "data": "<head><noscript></br><!--foo--></noscript>",
-      "errors": [
-        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.",
-        "Line: 1 Col: 21 Element br not allowed in a inhead-noscript context",
-        "Line: 1 Col: 21 Unexpected end tag (br). Treated as br element.",
-        "Line: 1 Col: 42 Unexpected end tag (noscript). Ignored."
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true,
-            "br": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript"
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "br"
-                  },
-                  {
-                    "comment": "foo"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript></noscript></head><body><br><!--foo--></body></html>",
-        "noQuirksBodyHtml": "<noscript><br><!--foo--></noscript>"
-      }
-    },
-    {
-      "data": "<head><noscript><head class=\"foo\"><!--foo--></noscript>",
-      "errors": [
-        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.",
-        "Line: 1 Col: 34 Unexpected start tag (head)."
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "comment": "foo"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript><!--foo--></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript><!--foo--></noscript>"
-      }
-    },
-    {
-      "data": "<head><noscript><noscript class=\"foo\"><!--foo--></noscript>",
-      "errors": [
-        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.",
-        "Line: 1 Col: 34 Unexpected start tag (noscript)."
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "comment": "foo"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript><!--foo--></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript><noscript class=\"foo\"><!--foo--></noscript></noscript>"
-      }
-    },
-    {
-      "data": "<head><noscript></p><!--foo--></noscript>",
-      "errors": [
-        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.",
-        "Line: 1 Col: 20 Unexpected end tag (p). Ignored."
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "comment": "foo"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript><!--foo--></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript><p></p><!--foo--></noscript>"
-      }
-    },
-    {
-      "data": "<head><noscript><p><!--foo--></noscript>",
-      "errors": [
-        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.",
-        "Line: 1 Col: 19 Element p not allowed in a inhead-noscript context",
-        "Line: 1 Col: 40 Unexpected end tag (noscript). Ignored."
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true,
-            "p": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript"
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "comment": "foo"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript></noscript></head><body><p><!--foo--></p></body></html>",
-        "noQuirksBodyHtml": "<noscript><p><!--foo--></p></noscript>"
-      }
-    },
-    {
-      "data": "<head><noscript>XXX<!--foo--></noscript></head>",
-      "errors": [
-        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.",
-        "Line: 1 Col: 19 Unexpected non-space character. Expected inhead-noscript content",
-        "Line: 1 Col: 30 Unexpected end tag (noscript). Ignored.",
-        "Line: 1 Col: 37 Unexpected end tag (head). Ignored."
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript"
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "XXX"
-                  },
-                  {
-                    "comment": "foo"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript></noscript></head><body>XXX<!--foo--></body></html>",
-        "noQuirksBodyHtml": "<noscript>XXX<!--foo--></noscript>"
-      }
-    },
-    {
-      "data": "<head><noscript>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-tag",
-        "(1,6): eof-in-head-noscript"
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript"
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript></noscript>"
-      }
-    }
-  ],
-  "pending-spec-changes-plain-text-unsafe.dat": [
-    {
-      "data": "<body><table>\u0000filler\u0000text\u0000",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,14): invalid-codepoint",
-        "(1,14): invalid-codepoint-in-table-text",
-        "(1,21): invalid-codepoint",
-        "(1,21): invalid-codepoint-in-table-text",
-        "(1,26): invalid-codepoint",
-        "(1,26): invalid-codepoint-in-table-text",
-        "(1,26): foster-parenting-character-in-table",
-        "(1,26): foster-parenting-character-in-table",
-        "(1,26): foster-parenting-character-in-table",
-        "(1,26): foster-parenting-character-in-table",
-        "(1,26): foster-parenting-character-in-table",
-        "(1,26): foster-parenting-character-in-table",
-        "(1,26): foster-parenting-character-in-table",
-        "(1,26): foster-parenting-character-in-table",
-        "(1,26): foster-parenting-character-in-table",
-        "(1,26): foster-parenting-character-in-table",
-        "(1,26): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "fillertext"
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>fillertext<table></table></body></html>",
-        "noQuirksBodyHtml": "fillertext<table></table>"
-      }
-    }
-  ],
-  "pending-spec-changes.dat": [
-    {
-      "data": "<input type=\"hidden\"><frameset>",
-      "errors": [
-        "(1,21): expected-doctype-but-got-start-tag",
-        "(1,31): unexpected-start-tag",
-        "(1,31): eof-in-frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "<input type=\"hidden\">"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><table><caption><svg>foo</table>bar",
-      "errors": [
-        "(1,47): unexpected-end-tag",
-        "(1,47): end-table-tag-in-caption"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "caption": true,
-            "svg svg": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "caption",
-                        "children": [
-                          {
-                            "tag": "svg",
-                            "ns": "http://www.w3.org/2000/svg",
-                            "children": [
-                              {
-                                "text": "foo"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "text": "bar"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><caption><svg>foo</svg></caption></table>bar</body></html>",
-        "noQuirksBodyHtml": "<table><caption><svg>foo</svg></caption></table>bar"
-      }
-    },
-    {
-      "data": "<table><tr><td><svg><desc><td></desc><circle>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "svg svg": true,
-            "svg desc": true,
-            "circle": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "svg",
-                                    "ns": "http://www.w3.org/2000/svg",
-                                    "children": [
-                                      {
-                                        "tag": "desc",
-                                        "ns": "http://www.w3.org/2000/svg"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              },
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "circle"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><tr><td><svg><desc></desc></svg></td><td><circle></circle></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><svg><desc></desc></svg></td><td><circle></circle></td></tr></tbody></table>"
-      }
-    }
-  ],
-  "plain-text-unsafe.dat": [
-    {
-      "data": "FOO&#x000D;ZOO",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,11): illegal-codepoint-for-numeric-entity"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO\rZOO"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO\rZOO</body></html>",
-        "noQuirksBodyHtml": "FOO\rZOO"
-      }
-    },
-    {
-      "data": "<html>\u0000<frameset></frameset>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,7): invalid-codepoint",
-        "(1,7): invalid-codepoint-in-body",
-        "(1,17): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<html> \u0000 <frameset></frameset>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,8): invalid-codepoint",
-        "(1,8): invalid-codepoint-in-body",
-        "(1,19): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "  "
-      }
-    },
-    {
-      "data": "<html>a\u0000a<frameset></frameset>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,8): invalid-codepoint",
-        "(1,8): invalid-codepoint-in-body",
-        "(1,19): unexpected-start-tag",
-        "(1,30): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "aa"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>aa</body></html>",
-        "noQuirksBodyHtml": "aa"
-      }
-    },
-    {
-      "data": "<html>\u0000\u0000<frameset></frameset>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,7): invalid-codepoint",
-        "(1,7): invalid-codepoint-in-body",
-        "(1,8): invalid-codepoint",
-        "(1,8): invalid-codepoint-in-body",
-        "(1,18): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<html>\u0000\n <frameset></frameset>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,7): invalid-codepoint",
-        "(1,7): invalid-codepoint-in-body",
-        "(2,11): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "\n "
-      }
-    },
-    {
-      "data": "<html><select>\u0000",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,15): invalid-codepoint",
-        "(1,15): invalid-codepoint-in-select",
-        "(1,15): eof-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><select></select></body></html>",
-        "noQuirksBodyHtml": "<select></select>"
-      }
-    },
-    {
-      "data": "\u0000",
-      "errors": [
-        "(1,1): invalid-codepoint",
-        "(1,1): expected-doctype-but-got-chars",
-        "(1,1): invalid-codepoint-in-body"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<body>\u0000",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,7): invalid-codepoint",
-        "(1,7): invalid-codepoint-in-body"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<plaintext>\u0000filler\u0000text\u0000",
-      "errors": [
-        "(1,11): expected-doctype-but-got-start-tag",
-        "(1,12): invalid-codepoint",
-        "(1,19): invalid-codepoint",
-        "(1,24): invalid-codepoint",
-        "(1,24): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "plaintext": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "plaintext",
-                    "children": [
-                      {
-                        "text": "�filler�text�",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><plaintext>�filler�text�</plaintext></body></html>",
-        "noQuirksBodyHtml": "<plaintext>�filler�text�</plaintext>"
-      }
-    },
-    {
-      "data": "<svg><![CDATA[\u0000filler\u0000text\u0000]]>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,30): invalid-codepoint",
-        "(1,30): invalid-codepoint",
-        "(1,30): invalid-codepoint",
-        "(1,30): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "�filler�text�"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>�filler�text�</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>�filler�text�</svg>"
-      }
-    },
-    {
-      "data": "<body><!\u0000>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,8): expected-dashes-or-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "comment": "�"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><!--�--></body></html>",
-        "noQuirksBodyHtml": "<!--�-->"
-      }
-    },
-    {
-      "data": "<body><!\u0000filler\u0000text>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,8): expected-dashes-or-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "comment": "�filler�text"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><!--�filler�text--></body></html>",
-        "noQuirksBodyHtml": "<!--�filler�text-->"
-      }
-    },
-    {
-      "data": "<body><svg><foreignObject>\u0000filler\u0000text",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,27): invalid-codepoint",
-        "(1,27): invalid-codepoint-in-body",
-        "(1,34): invalid-codepoint",
-        "(1,34): invalid-codepoint-in-body",
-        "(1,38): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg foreignObject": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "foreignObject",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "text": "fillertext"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg><foreignObject>fillertext</foreignObject></svg></body></html>",
-        "noQuirksBodyHtml": "<svg><foreignObject>fillertext</foreignObject></svg>"
-      }
-    },
-    {
-      "data": "<svg>\u0000filler\u0000text",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,6): invalid-codepoint",
-        "(1,6): invalid-codepoint-in-foreign-content",
-        "(1,13): invalid-codepoint",
-        "(1,13): invalid-codepoint-in-foreign-content",
-        "(1,17): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "�filler�text"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>�filler�text</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>�filler�text</svg>"
-      }
-    },
-    {
-      "data": "<svg>\u0000<frameset>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,6): invalid-codepoint",
-        "(1,6): invalid-codepoint-in-foreign-content",
-        "(1,16): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "�"
-                      },
-                      {
-                        "tag": "frameset",
-                        "ns": "http://www.w3.org/2000/svg"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>�<frameset></frameset></svg></body></html>",
-        "noQuirksBodyHtml": "<svg>�<frameset></frameset></svg>"
-      }
-    },
-    {
-      "data": "<svg>\u0000 <frameset>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,6): invalid-codepoint",
-        "(1,6): invalid-codepoint-in-foreign-content",
-        "(1,17): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "� "
-                      },
-                      {
-                        "tag": "frameset",
-                        "ns": "http://www.w3.org/2000/svg"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>� <frameset></frameset></svg></body></html>",
-        "noQuirksBodyHtml": "<svg>� <frameset></frameset></svg>"
-      }
-    },
-    {
-      "data": "<svg>\u0000a<frameset>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,6): invalid-codepoint",
-        "(1,6): invalid-codepoint-in-foreign-content",
-        "(1,17): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "�a"
-                      },
-                      {
-                        "tag": "frameset",
-                        "ns": "http://www.w3.org/2000/svg"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>�a<frameset></frameset></svg></body></html>",
-        "noQuirksBodyHtml": "<svg>�a<frameset></frameset></svg>"
-      }
-    },
-    {
-      "data": "<svg>\u0000</svg><frameset>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,6): invalid-codepoint",
-        "(1,6): invalid-codepoint-in-foreign-content",
-        "(1,22): unexpected-start-tag",
-        "(1,22): eof-in-frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "<svg>�</svg>"
-      }
-    },
-    {
-      "data": "<svg>\u0000 </svg><frameset>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,6): invalid-codepoint",
-        "(1,6): invalid-codepoint-in-foreign-content",
-        "(1,23): unexpected-start-tag",
-        "(1,23): eof-in-frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "<svg>� </svg>"
-      }
-    },
-    {
-      "data": "<svg>\u0000a</svg><frameset>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,6): invalid-codepoint",
-        "(1,6): invalid-codepoint-in-foreign-content",
-        "(1,23): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "�a"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>�a</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>�a</svg>"
-      }
-    },
-    {
-      "data": "<svg><path></path></svg><frameset>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,34): unexpected-start-tag",
-        "(1,34): eof-in-frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "<svg><path></path></svg>"
-      }
-    },
-    {
-      "data": "<svg><p><frameset>",
-      "errors": [
-        "(1, 5) expected-doctype-but-got-start-tag",
-        "(1, 8) unexpected-html-element-in-foreign-content",
-        "(1, 18) unexpected-start-tag",
-        "(1, 18) eof-in-frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "<svg><p><frameset></frameset></p></svg>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><pre>\r\n\r\nA</pre>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "pre": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "pre",
-                    "children": [
-                      {
-                        "text": "\nA"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><pre>\nA</pre></body></html>",
-        "noQuirksBodyHtml": "<pre>\nA</pre>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><pre>\r\rA</pre>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "pre": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "pre",
-                    "children": [
-                      {
-                        "text": "\nA"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><pre>\nA</pre></body></html>",
-        "noQuirksBodyHtml": "<pre>\nA</pre>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><pre>\rA</pre>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "pre": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "pre",
-                    "children": [
-                      {
-                        "text": "A"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><pre>A</pre></body></html>",
-        "noQuirksBodyHtml": "<pre>A</pre>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><table><tr><td><math><mtext>\u0000a",
-      "errors": [
-        "(1,44): invalid-codepoint",
-        "(1,44): invalid-codepoint-in-body",
-        "(1,45): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "math math": true,
-            "math mtext": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "math",
-                                    "ns": "http://www.w3.org/1998/Math/MathML",
-                                    "children": [
-                                      {
-                                        "tag": "mtext",
-                                        "ns": "http://www.w3.org/1998/Math/MathML",
-                                        "children": [
-                                          {
-                                            "text": "a"
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><math><mtext>a</mtext></math></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><math><mtext>a</mtext></math></td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><table><tr><td><svg><foreignObject>\u0000a",
-      "errors": [
-        "(1,51): invalid-codepoint",
-        "(1,51): invalid-codepoint-in-body",
-        "(1,52): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "svg svg": true,
-            "svg foreignObject": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "svg",
-                                    "ns": "http://www.w3.org/2000/svg",
-                                    "children": [
-                                      {
-                                        "tag": "foreignObject",
-                                        "ns": "http://www.w3.org/2000/svg",
-                                        "children": [
-                                          {
-                                            "text": "a"
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><svg><foreignObject>a</foreignObject></svg></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><svg><foreignObject>a</foreignObject></svg></td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><math><mi>a\u0000b",
-      "errors": [
-        "(1,27): invalid-codepoint",
-        "(1,27): invalid-codepoint-in-body",
-        "(1,28): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mi": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "text": "ab"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math><mi>ab</mi></math></body></html>",
-        "noQuirksBodyHtml": "<math><mi>ab</mi></math>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><math><mo>a\u0000b",
-      "errors": [
-        "(1,27): invalid-codepoint",
-        "(1,27): invalid-codepoint-in-body",
-        "(1,28): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mo": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mo",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "text": "ab"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math><mo>ab</mo></math></body></html>",
-        "noQuirksBodyHtml": "<math><mo>ab</mo></math>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><math><mn>a\u0000b",
-      "errors": [
-        "(1,27): invalid-codepoint",
-        "(1,27): invalid-codepoint-in-body",
-        "(1,28): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mn": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mn",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "text": "ab"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math><mn>ab</mn></math></body></html>",
-        "noQuirksBodyHtml": "<math><mn>ab</mn></math>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><math><ms>a\u0000b",
-      "errors": [
-        "(1,27): invalid-codepoint",
-        "(1,27): invalid-codepoint-in-body",
-        "(1,28): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math ms": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "ms",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "text": "ab"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math><ms>ab</ms></math></body></html>",
-        "noQuirksBodyHtml": "<math><ms>ab</ms></math>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><math><mtext>a\u0000b",
-      "errors": [
-        "(1,30): invalid-codepoint",
-        "(1,30): invalid-codepoint-in-body",
-        "(1,31): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mtext": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mtext",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "text": "ab"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math><mtext>ab</mtext></math></body></html>",
-        "noQuirksBodyHtml": "<math><mtext>ab</mtext></math>"
-      }
-    }
-  ],
-  "ruby.dat": [
-    {
-      "data": "<html><ruby>a<rb>b<rb></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rb": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rb",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "rb"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rb>b</rb><rb></rb></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rb>b</rb><rb></rb></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rb>b<rt></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rb": true,
-            "rt": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rb",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "rt"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rb>b</rb><rt></rt></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rb>b</rb><rt></rt></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rb>b<rtc></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rb": true,
-            "rtc": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rb",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "rtc"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rb>b</rb><rtc></rtc></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rb>b</rb><rtc></rtc></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rb>b<rp></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rb": true,
-            "rp": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rb",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "rp"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rb>b</rb><rp></rp></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rb>b</rb><rp></rp></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rb>b<span></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,31): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rb": true,
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rb",
-                        "children": [
-                          {
-                            "text": "b"
-                          },
-                          {
-                            "tag": "span"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rb>b<span></span></rb></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rb>b<span></span></rb></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rt>b<rb></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rt": true,
-            "rb": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rt",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "rb"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rt>b</rt><rb></rb></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rt>b</rt><rb></rb></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rt>b<rt></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rt": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rt",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "rt"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rt>b</rt><rt></rt></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rt>b</rt><rt></rt></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rt>b<rtc></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rt": true,
-            "rtc": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rt",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "rtc"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rt>b</rt><rtc></rtc></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rt>b</rt><rtc></rtc></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rt>b<rp></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rt": true,
-            "rp": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rt",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "rp"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rt>b</rt><rp></rp></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rt>b</rt><rp></rp></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rt>b<span></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,31): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rt": true,
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rt",
-                        "children": [
-                          {
-                            "text": "b"
-                          },
-                          {
-                            "tag": "span"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rt>b<span></span></rt></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rt>b<span></span></rt></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rtc>b<rb></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rtc": true,
-            "rb": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rtc",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "rb"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rtc>b</rtc><rb></rb></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rtc>b</rtc><rb></rb></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rtc>b<rt>c<rt>d</ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rtc": true,
-            "rt": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rtc",
-                        "children": [
-                          {
-                            "text": "b"
-                          },
-                          {
-                            "tag": "rt",
-                            "children": [
-                              {
-                                "text": "c"
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "rt",
-                            "children": [
-                              {
-                                "text": "d"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rtc>b<rt>c</rt><rt>d</rt></rtc></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rtc>b<rt>c</rt><rt>d</rt></rtc></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rtc>b<rtc></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rtc": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rtc",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "rtc"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rtc>b</rtc><rtc></rtc></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rtc>b</rtc><rtc></rtc></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rtc>b<rp></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rtc": true,
-            "rp": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rtc",
-                        "children": [
-                          {
-                            "text": "b"
-                          },
-                          {
-                            "tag": "rp"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rtc>b<rp></rp></rtc></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rtc>b<rp></rp></rtc></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rtc>b<span></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rtc": true,
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rtc",
-                        "children": [
-                          {
-                            "text": "b"
-                          },
-                          {
-                            "tag": "span"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rtc>b<span></span></rtc></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rtc>b<span></span></rtc></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rp>b<rb></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rp": true,
-            "rb": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rp",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "rb"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rp>b</rp><rb></rb></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rp>b</rp><rb></rb></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rp>b<rt></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rp": true,
-            "rt": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rp",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "rt"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rp>b</rp><rt></rt></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rp>b</rp><rt></rt></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rp>b<rtc></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rp": true,
-            "rtc": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rp",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "rtc"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rp>b</rp><rtc></rtc></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rp>b</rp><rtc></rtc></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rp>b<rp></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rp": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rp",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "rp"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rp>b</rp><rp></rp></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rp>b</rp><rp></rp></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rp>b<span></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,31): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rp": true,
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rp",
-                        "children": [
-                          {
-                            "text": "b"
-                          },
-                          {
-                            "tag": "span"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rp>b<span></span></rp></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rp>b<span></span></rp></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby><rtc><ruby>a<rb>b<rt></ruby></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rtc": true,
-            "rb": true,
-            "rt": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "tag": "rtc",
-                        "children": [
-                          {
-                            "tag": "ruby",
-                            "children": [
-                              {
-                                "text": "a"
-                              },
-                              {
-                                "tag": "rb",
-                                "children": [
-                                  {
-                                    "text": "b"
-                                  }
-                                ]
-                              },
-                              {
-                                "tag": "rt"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby><rtc><ruby>a<rb>b</rb><rt></rt></ruby></rtc></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby><rtc><ruby>a<rb>b</rb><rt></rt></ruby></rtc></ruby>"
-      }
-    }
-  ],
-  "scriptdata01.dat": [
-    {
-      "data": "FOO<script>'Hello'</script>BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "'Hello'",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "BAR"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script>'Hello'</script>BAR</body></html>",
-        "noQuirksBodyHtml": "FOO<script>'Hello'</script>BAR"
-      }
-    },
-    {
-      "data": "FOO<script></script>BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script"
-                  },
-                  {
-                    "text": "BAR"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script></script>BAR</body></html>",
-        "noQuirksBodyHtml": "FOO<script></script>BAR"
-      }
-    },
-    {
-      "data": "FOO<script></script >BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script"
-                  },
-                  {
-                    "text": "BAR"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script></script>BAR</body></html>",
-        "noQuirksBodyHtml": "FOO<script></script>BAR"
-      }
-    },
-    {
-      "data": "FOO<script></script/>BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,21): self-closing-flag-on-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script"
-                  },
-                  {
-                    "text": "BAR"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script></script>BAR</body></html>",
-        "noQuirksBodyHtml": "FOO<script></script>BAR"
-      }
-    },
-    {
-      "data": "FOO<script></script/ >BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,20): unexpected-character-after-solidus-in-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script"
-                  },
-                  {
-                    "text": "BAR"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script></script>BAR</body></html>",
-        "noQuirksBodyHtml": "FOO<script></script>BAR"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "text/plain"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "</scriptx>BAR",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script type=\"text/plain\"></scriptx>BAR</script></body></html>",
-        "noQuirksBodyHtml": "FOO<script type=\"text/plain\"></scriptx>BAR</script>"
-      }
-    },
-    {
-      "data": "FOO<script></script foo=\">\" dd>BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars",
-        "(1,31): attributes-in-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script"
-                  },
-                  {
-                    "text": "BAR"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script></script>BAR</body></html>",
-        "noQuirksBodyHtml": "FOO<script></script>BAR"
-      }
-    },
-    {
-      "data": "FOO<script>'<'</script>BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "'<'",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "BAR"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script>'<'</script>BAR</body></html>",
-        "noQuirksBodyHtml": "FOO<script>'<'</script>BAR"
-      }
-    },
-    {
-      "data": "FOO<script>'<!'</script>BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "'<!'",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "BAR"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script>'<!'</script>BAR</body></html>",
-        "noQuirksBodyHtml": "FOO<script>'<!'</script>BAR"
-      }
-    },
-    {
-      "data": "FOO<script>'<!-'</script>BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "'<!-'",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "BAR"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script>'<!-'</script>BAR</body></html>",
-        "noQuirksBodyHtml": "FOO<script>'<!-'</script>BAR"
-      }
-    },
-    {
-      "data": "FOO<script>'<!--'</script>BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "'<!--'",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "BAR"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script>'<!--'</script>BAR</body></html>",
-        "noQuirksBodyHtml": "FOO<script>'<!--'</script>BAR"
-      }
-    },
-    {
-      "data": "FOO<script>'<!---'</script>BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "'<!---'",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "BAR"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script>'<!---'</script>BAR</body></html>",
-        "noQuirksBodyHtml": "FOO<script>'<!---'</script>BAR"
-      }
-    },
-    {
-      "data": "FOO<script>'<!-->'</script>BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "'<!-->'",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "BAR"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script>'<!-->'</script>BAR</body></html>",
-        "noQuirksBodyHtml": "FOO<script>'<!-->'</script>BAR"
-      }
-    },
-    {
-      "data": "FOO<script>'<!-->'</script>BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "'<!-->'",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "BAR"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script>'<!-->'</script>BAR</body></html>",
-        "noQuirksBodyHtml": "FOO<script>'<!-->'</script>BAR"
-      }
-    },
-    {
-      "data": "FOO<script>'<!-- potato'</script>BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "'<!-- potato'",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "BAR"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script>'<!-- potato'</script>BAR</body></html>",
-        "noQuirksBodyHtml": "FOO<script>'<!-- potato'</script>BAR"
-      }
-    },
-    {
-      "data": "FOO<script>'<!-- <sCrIpt'</script>BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "'<!-- <sCrIpt'",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "BAR"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script>'<!-- <sCrIpt'</script>BAR</body></html>",
-        "noQuirksBodyHtml": "FOO<script>'<!-- <sCrIpt'</script>BAR"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "text/plain"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "'<!-- <sCrIpt>'</script>BAR",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script type=\"text/plain\">'<!-- <sCrIpt>'</script>BAR</script></body></html>",
-        "noQuirksBodyHtml": "FOO<script type=\"text/plain\">'<!-- <sCrIpt>'</script>BAR</script>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "text/plain"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "'<!-- <sCrIpt> -'</script>BAR",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script type=\"text/plain\">'<!-- <sCrIpt> -'</script>BAR</script></body></html>",
-        "noQuirksBodyHtml": "FOO<script type=\"text/plain\">'<!-- <sCrIpt> -'</script>BAR</script>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "text/plain"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "'<!-- <sCrIpt> --'</script>BAR",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script type=\"text/plain\">'<!-- <sCrIpt> --'</script>BAR</script></body></html>",
-        "noQuirksBodyHtml": "FOO<script type=\"text/plain\">'<!-- <sCrIpt> --'</script>BAR</script>"
-      }
-    },
-    {
-      "data": "FOO<script>'<!-- <sCrIpt> -->'</script>BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "'<!-- <sCrIpt> -->'",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "BAR"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script>'<!-- <sCrIpt> -->'</script>BAR</body></html>",
-        "noQuirksBodyHtml": "FOO<script>'<!-- <sCrIpt> -->'</script>BAR"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "text/plain"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "'<!-- <sCrIpt> --!>'</script>BAR",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script type=\"text/plain\">'<!-- <sCrIpt> --!>'</script>BAR</script></body></html>",
-        "noQuirksBodyHtml": "FOO<script type=\"text/plain\">'<!-- <sCrIpt> --!>'</script>BAR</script>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "text/plain"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "'<!-- <sCrIpt> -- >'</script>BAR",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script type=\"text/plain\">'<!-- <sCrIpt> -- >'</script>BAR</script></body></html>",
-        "noQuirksBodyHtml": "FOO<script type=\"text/plain\">'<!-- <sCrIpt> -- >'</script>BAR</script>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "text/plain"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "'<!-- <sCrIpt '</script>BAR",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script type=\"text/plain\">'<!-- <sCrIpt '</script>BAR</script></body></html>",
-        "noQuirksBodyHtml": "FOO<script type=\"text/plain\">'<!-- <sCrIpt '</script>BAR</script>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "text/plain"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "'<!-- <sCrIpt/'</script>BAR",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script type=\"text/plain\">'<!-- <sCrIpt/'</script>BAR</script></body></html>",
-        "noQuirksBodyHtml": "FOO<script type=\"text/plain\">'<!-- <sCrIpt/'</script>BAR</script>"
-      }
-    },
-    {
-      "data": "FOO<script type=\"text/plain\">'<!-- <sCrIpt\\'</script>BAR",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "text/plain"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "'<!-- <sCrIpt\\'",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "BAR"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script type=\"text/plain\">'<!-- <sCrIpt\\'</script>BAR</body></html>",
-        "noQuirksBodyHtml": "FOO<script type=\"text/plain\">'<!-- <sCrIpt\\'</script>BAR"
-      }
-    },
-    {
-      "data": "FOO<script type=\"text/plain\">'<!-- <sCrIpt/'</script>BAR</script>QUX",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "text/plain"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "'<!-- <sCrIpt/'</script>BAR",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "QUX"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script type=\"text/plain\">'<!-- <sCrIpt/'</script>BAR</script>QUX</body></html>",
-        "noQuirksBodyHtml": "FOO<script type=\"text/plain\">'<!-- <sCrIpt/'</script>BAR</script>QUX"
-      }
-    },
-    {
-      "data": "FOO<script><!--<script>-></script>--></script>QUX",
-      "errors": [
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "FOO"
-                  },
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script>-></script>-->",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "QUX"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>FOO<script><!--<script>-></script>--></script>QUX</body></html>",
-        "noQuirksBodyHtml": "FOO<script><!--<script>-></script>--></script>QUX"
-      }
-    }
-  ],
-  "tables01.dat": [
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "th": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "th"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><tr><th></th></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><th></th></tr></tbody></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><tr><td></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td></td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<table><col foo='bar'>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,22): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "colgroup": true,
-            "col": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "colgroup",
-                        "children": [
-                          {
-                            "tag": "col",
-                            "attrs": [
-                              {
-                                "name": "foo",
-                                "value": "bar"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><colgroup><col foo=\"bar\"></colgroup></table></body></html>",
-        "noQuirksBodyHtml": "<table><colgroup><col foo=\"bar\"></colgroup></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "colgroup": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "foo"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "colgroup"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>foo<table><colgroup></colgroup></table></body></html>",
-        "noQuirksBodyHtml": "foo<table><colgroup></colgroup></table>"
-      }
-    },
-    {
-      "data": "<table></table><p>foo",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table"
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "foo"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table></table><p>foo</p></body></html>",
-        "noQuirksBodyHtml": "<table></table><p>foo</p>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><tr><td></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td></td></tr></tbody></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "option": true,
-            "table": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "option",
-                        "children": [
-                          {
-                            "text": "3"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><select><option>3</option></select><table></table></body></html>",
-        "noQuirksBodyHtml": "<select><option>3</option></select><table></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "table": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select"
-                  },
-                  {
-                    "tag": "table"
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><select></select><table></table><table></table></body></html>",
-        "noQuirksBodyHtml": "<select></select><table></table><table></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "table": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select"
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><select></select><table></table></body></html>",
-        "noQuirksBodyHtml": "<select></select><table></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "option": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "option",
-                        "children": [
-                          {
-                            "text": "A"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "text": "B"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><select><option>A</option></select><table><tbody><tr><td>B</td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<select><option>A</option></select><table><tbody><tr><td>B</td></tr></tbody></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "text": "foo"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><tr><td>foo</td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td>foo</td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<table><td>A</table>B",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,11): unexpected-cell-in-table-body"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "text": "A"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "text": "B"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><tr><td>A</td></tr></tbody></table>B</body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td>A</td></tr></tbody></table>B"
-      }
-    },
-    {
-      "data": "<table><tr><caption>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,20): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "caption": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "caption"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><tr></tr></tbody><caption></caption></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr></tr></tbody><caption></caption></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "text": "foo"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><tr><td>foo</td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td>foo</td></tr></tbody></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td"
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><tr><td></td></tr><tr></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td></td></tr><tr></tr></tbody></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "button": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "button"
-                                  }
-                                ]
-                              },
-                              {
-                                "tag": "td"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><tr><td><button></button></td><td></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><button></button></td><td></td></tr></tbody></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "svg svg": true,
-            "svg desc": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "svg",
-                                    "ns": "http://www.w3.org/2000/svg",
-                                    "children": [
-                                      {
-                                        "tag": "desc",
-                                        "ns": "http://www.w3.org/2000/svg"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              },
-                              {
-                                "tag": "td"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><tr><td><svg><desc></desc></svg></td><td></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><svg><desc></desc></svg></td><td></td></tr></tbody></table>"
-      }
-    }
-  ],
-  "template.dat": [
-    {
-      "data": "<body><template>Hello</template>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "text": "Hello"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template>Hello</template></body></html>",
-        "noQuirksBodyHtml": "<template>Hello</template>"
-      }
-    },
-    {
-      "data": "<template>Hello</template>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "text": "Hello"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template>Hello</template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template>Hello</template>"
-      }
-    },
-    {
-      "data": "<template></template><div></div>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "body": true,
-            "div": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template></template></head><body><div></div></body></html>",
-        "noQuirksBodyHtml": "<template></template><div></div>"
-      }
-    },
-    {
-      "data": "<html><template>Hello</template>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "text": "Hello"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template>Hello</template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template>Hello</template>"
-      }
-    },
-    {
-      "data": "<head><template><div></div></template></head>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "div": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "div"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><div></div></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><div></div></template>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "template": true,
-            "span": true,
-            "b": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "template",
-                        "children": [
-                          {
-                            "content": true,
-                            "children": [
-                              {
-                                "tag": "div",
-                                "children": [
-                                  {
-                                    "tag": "span"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "b"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div><template><div><span></span></div></template><b></b></div></body></html>",
-        "noQuirksBodyHtml": "<div><template><div><span></span></div></template><b></b></div>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "template": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "template",
-                        "children": [
-                          {
-                            "content": true,
-                            "children": [
-                              {
-                                "text": "Hello"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div><template>Hello</template></div></body></html>",
-        "noQuirksBodyHtml": "<div><template>Hello</template></div>"
-      }
-    },
-    {
-      "data": "<div></template></div>",
-      "errors": [
-        " * (1,6) missing DOCTYPE",
-        " * (1,17) unexpected template end tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div></div></body></html>",
-        "noQuirksBodyHtml": "<div></div>"
-      }
-    },
-    {
-      "data": "<table><template></template></table>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "template": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "template",
-                        "children": [
-                          {
-                            "content": true
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><template></template></table></body></html>",
-        "noQuirksBodyHtml": "<table><template></template></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "template": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "template",
-                        "children": [
-                          {
-                            "content": true
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><template></template></table></body></html>",
-        "noQuirksBodyHtml": "<table><template></template></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "template": true,
-            "table": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "template",
-                        "children": [
-                          {
-                            "content": true
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div><template></template></div><table></table></body></html>",
-        "noQuirksBodyHtml": "<div><template></template></div><table></table>"
-      }
-    },
-    {
-      "data": "<table><template></template><div></div>",
-      "errors": [
-        "no doctype",
-        "bad div in table",
-        "bad /div in table",
-        "eof in table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "table": true,
-            "template": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "template",
-                        "children": [
-                          {
-                            "content": true
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div></div><table><template></template></table></body></html>",
-        "noQuirksBodyHtml": "<div></div><table><template></template></table>"
-      }
-    },
-    {
-      "data": "<table>   <template></template></table>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "template": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "text": "   "
-                      },
-                      {
-                        "tag": "template",
-                        "children": [
-                          {
-                            "content": true
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table>   <template></template></table></body></html>",
-        "noQuirksBodyHtml": "<table>   <template></template></table>"
-      }
-    },
-    {
-      "data": "<table><tbody><template></template></tbody>",
-      "errors": [
-        "no doctype",
-        "eof in table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "template": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><template></template></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><template></template></tbody></table>"
-      }
-    },
-    {
-      "data": "<table><tbody><template></tbody></template>",
-      "errors": [
-        "no doctype",
-        "bad /tbody",
-        "eof in table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "template": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><template></template></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><template></template></tbody></table>"
-      }
-    },
-    {
-      "data": "<table><tbody><template></template></tbody></table>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "template": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><template></template></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><template></template></tbody></table>"
-      }
-    },
-    {
-      "data": "<table><thead><template></template></thead>",
-      "errors": [
-        "no doctype",
-        "eof in table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "thead": true,
-            "template": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "thead",
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><thead><template></template></thead></table></body></html>",
-        "noQuirksBodyHtml": "<table><thead><template></template></thead></table>"
-      }
-    },
-    {
-      "data": "<table><tfoot><template></template></tfoot>",
-      "errors": [
-        "no doctype",
-        "eof in table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tfoot": true,
-            "template": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tfoot",
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tfoot><template></template></tfoot></table></body></html>",
-        "noQuirksBodyHtml": "<table><tfoot><template></template></tfoot></table>"
-      }
-    },
-    {
-      "data": "<select><template></template></select>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "template": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "template",
-                        "children": [
-                          {
-                            "content": true
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><select><template></template></select></body></html>",
-        "noQuirksBodyHtml": "<select><template></template></select>"
-      }
-    },
-    {
-      "data": "<select><template><option></option></template></select>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "template": true,
-            "option": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "template",
-                        "children": [
-                          {
-                            "content": true,
-                            "children": [
-                              {
-                                "tag": "option"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><select><template><option></option></template></select></body></html>",
-        "noQuirksBodyHtml": "<select><template><option></option></template></select>"
-      }
-    },
-    {
-      "data": "<template><option></option></select><option></option></template>",
-      "errors": [
-        "no doctype",
-        "bad /select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "option": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "option"
-                          },
-                          {
-                            "tag": "option"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><option></option><option></option></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><option></option><option></option></template>"
-      }
-    },
-    {
-      "data": "<select><template></template><option></select>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "template": true,
-            "option": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "template",
-                        "children": [
-                          {
-                            "content": true
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "option"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><select><template></template><option></option></select></body></html>",
-        "noQuirksBodyHtml": "<select><template></template><option></option></select>"
-      }
-    },
-    {
-      "data": "<select><option><template></template></select>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "option": true,
-            "template": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "option",
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><select><option><template></template></option></select></body></html>",
-        "noQuirksBodyHtml": "<select><option><template></template></option></select>"
-      }
-    },
-    {
-      "data": "<select><template>",
-      "errors": [
-        "no doctype",
-        "eof in template",
-        "eof in select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "template": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "template",
-                        "children": [
-                          {
-                            "content": true
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><select><template></template></select></body></html>",
-        "noQuirksBodyHtml": "<select><template></template></select>"
-      }
-    },
-    {
-      "data": "<select><option></option><template>",
-      "errors": [
-        "no doctype",
-        "eof in template",
-        "eof in select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "option": true,
-            "template": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "option"
-                      },
-                      {
-                        "tag": "template",
-                        "children": [
-                          {
-                            "content": true
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><select><option></option><template></template></select></body></html>",
-        "noQuirksBodyHtml": "<select><option></option><template></template></select>"
-      }
-    },
-    {
-      "data": "<select><option></option><template><option>",
-      "errors": [
-        "no doctype",
-        "eof in template",
-        "eof in select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "option": true,
-            "template": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "option"
-                      },
-                      {
-                        "tag": "template",
-                        "children": [
-                          {
-                            "content": true,
-                            "children": [
-                              {
-                                "tag": "option"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><select><option></option><template><option></option></template></select></body></html>",
-        "noQuirksBodyHtml": "<select><option></option><template><option></option></template></select>"
-      }
-    },
-    {
-      "data": "<table><thead><template><td></template></table>",
-      "errors": [
-        " * (1,8) missing DOCTYPE"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "thead": true,
-            "template": true,
-            "td": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "thead",
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true,
-                                "children": [
-                                  {
-                                    "tag": "td"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><thead><template><td></td></template></thead></table></body></html>",
-        "noQuirksBodyHtml": "<table><thead><template><td></td></template></thead></table>"
-      }
-    },
-    {
-      "data": "<table><template><thead></template></table>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "template": true,
-            "thead": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "template",
-                        "children": [
-                          {
-                            "content": true,
-                            "children": [
-                              {
-                                "tag": "thead"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><template><thead></thead></template></table></body></html>",
-        "noQuirksBodyHtml": "<table><template><thead></thead></template></table>"
-      }
-    },
-    {
-      "data": "<body><table><template><td></tr><div></template></table>",
-      "errors": [
-        "no doctype",
-        "bad </tr>",
-        "missing </div>"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "template": true,
-            "td": true,
-            "div": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "template",
-                        "children": [
-                          {
-                            "content": true,
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "div"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><template><td><div></div></td></template></table></body></html>",
-        "noQuirksBodyHtml": "<table><template><td><div></div></td></template></table>"
-      }
-    },
-    {
-      "data": "<table><template><thead></template></thead></table>",
-      "errors": [
-        "no doctype",
-        "bad /thead after /template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "template": true,
-            "thead": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "template",
-                        "children": [
-                          {
-                            "content": true,
-                            "children": [
-                              {
-                                "tag": "thead"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><template><thead></thead></template></table></body></html>",
-        "noQuirksBodyHtml": "<table><template><thead></thead></template></table>"
-      }
-    },
-    {
-      "data": "<table><thead><template><tr></template></table>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "thead": true,
-            "template": true,
-            "tr": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "thead",
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true,
-                                "children": [
-                                  {
-                                    "tag": "tr"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><thead><template><tr></tr></template></thead></table></body></html>",
-        "noQuirksBodyHtml": "<table><thead><template><tr></tr></template></thead></table>"
-      }
-    },
-    {
-      "data": "<table><template><tr></template></table>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "template": true,
-            "tr": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "template",
-                        "children": [
-                          {
-                            "content": true,
-                            "children": [
-                              {
-                                "tag": "tr"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><template><tr></tr></template></table></body></html>",
-        "noQuirksBodyHtml": "<table><template><tr></tr></template></table>"
-      }
-    },
-    {
-      "data": "<table><tr><template><td>",
-      "errors": [
-        "no doctype",
-        "eof in template",
-        "eof in table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "template": true,
-            "td": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "template",
-                                "children": [
-                                  {
-                                    "content": true,
-                                    "children": [
-                                      {
-                                        "tag": "td"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><tr><template><td></td></template></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><template><td></td></template></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<table><template><tr><template><td></template></tr></template></table>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "template": true,
-            "tr": true,
-            "td": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "template",
-                        "children": [
-                          {
-                            "content": true,
-                            "children": [
-                              {
-                                "tag": "tr",
-                                "children": [
-                                  {
-                                    "tag": "template",
-                                    "children": [
-                                      {
-                                        "content": true,
-                                        "children": [
-                                          {
-                                            "tag": "td"
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><template><tr><template><td></td></template></tr></template></table></body></html>",
-        "noQuirksBodyHtml": "<table><template><tr><template><td></td></template></tr></template></table>"
-      }
-    },
-    {
-      "data": "<table><template><tr><template><td></td></template></tr></template></table>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "template": true,
-            "tr": true,
-            "td": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "template",
-                        "children": [
-                          {
-                            "content": true,
-                            "children": [
-                              {
-                                "tag": "tr",
-                                "children": [
-                                  {
-                                    "tag": "template",
-                                    "children": [
-                                      {
-                                        "content": true,
-                                        "children": [
-                                          {
-                                            "tag": "td"
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><template><tr><template><td></td></template></tr></template></table></body></html>",
-        "noQuirksBodyHtml": "<table><template><tr><template><td></td></template></tr></template></table>"
-      }
-    },
-    {
-      "data": "<table><template><td></template>",
-      "errors": [
-        "no doctype",
-        "eof in table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "template": true,
-            "td": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "template",
-                        "children": [
-                          {
-                            "content": true,
-                            "children": [
-                              {
-                                "tag": "td"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><template><td></td></template></table></body></html>",
-        "noQuirksBodyHtml": "<table><template><td></td></template></table>"
-      }
-    },
-    {
-      "data": "<body><template><td></td></template>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "td": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "td"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><td></td></template></body></html>",
-        "noQuirksBodyHtml": "<template><td></td></template>"
-      }
-    },
-    {
-      "data": "<body><template><template><tr></tr></template><td></td></template>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "tr": true,
-            "td": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true,
-                                "children": [
-                                  {
-                                    "tag": "tr"
-                                  }
-                                ]
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "td"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><template><tr></tr></template><td></td></template></body></html>",
-        "noQuirksBodyHtml": "<template><template><tr></tr></template><td></td></template>"
-      }
-    },
-    {
-      "data": "<table><colgroup><template><col>",
-      "errors": [
-        "no doctype",
-        "eof in template",
-        "eof in table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "colgroup": true,
-            "template": true,
-            "col": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "colgroup",
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true,
-                                "children": [
-                                  {
-                                    "tag": "col"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><colgroup><template><col></template></colgroup></table></body></html>",
-        "noQuirksBodyHtml": "<table><colgroup><template><col></template></colgroup></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true,
-            "frame": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset",
-                "children": [
-                  {
-                    "tag": "frame"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset><frame></frameset></html>",
-        "noQuirksBodyHtml": "<template></template>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template></template>"
-      }
-    },
-    {
-      "data": "<template><div><frameset><span></span></div><span></span></template>",
-      "errors": [
-        "no doctype",
-        "bad frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "div": true,
-            "span": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "div",
-                            "children": [
-                              {
-                                "tag": "span"
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "span"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><div><span></span></div><span></span></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><div><span></span></div><span></span></template>"
-      }
-    },
-    {
-      "data": "<body><template><div><frameset><span></span></div><span></span></template></body>",
-      "errors": [
-        "no doctype",
-        "bad frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "div": true,
-            "span": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "div",
-                            "children": [
-                              {
-                                "tag": "span"
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "span"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><div><span></span></div><span></span></template></body></html>",
-        "noQuirksBodyHtml": "<template><div><span></span></div><span></span></template>"
-      }
-    },
-    {
-      "data": "<body><template><script>var i = 1;</script><td></td></template>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "script": true,
-            "td": true
-          },
-          "template": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "script",
-                            "children": [
-                              {
-                                "text": "var i = 1;",
-                                "no_escape": true
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "td"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><script>var i = 1;</script><td></td></template></body></html>",
-        "noQuirksBodyHtml": "<template><script>var i = 1;</script><td></td></template>"
-      }
-    },
-    {
-      "data": "<body><template><tr><div></div></tr></template>",
-      "errors": [
-        "no doctype",
-        "foster-parented div",
-        "foster-parented /div"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "tr": true,
-            "div": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "tr"
-                          },
-                          {
-                            "tag": "div"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><tr></tr><div></div></template></body></html>",
-        "noQuirksBodyHtml": "<template><tr></tr><div></div></template>"
-      }
-    },
-    {
-      "data": "<body><template><tr></tr><td></td></template>",
-      "errors": [
-        "no doctype",
-        "unexpected <td>"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "tr": true,
-            "td": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "tr"
-                          },
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><tr></tr><tr><td></td></tr></template></body></html>",
-        "noQuirksBodyHtml": "<template><tr></tr><tr><td></td></tr></template>"
-      }
-    },
-    {
-      "data": "<body><template><td></td></tr><td></td></template>",
-      "errors": [
-        "no doctype",
-        "bad </tr>"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "td": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "td"
-                          },
-                          {
-                            "tag": "td"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><td></td><td></td></template></body></html>",
-        "noQuirksBodyHtml": "<template><td></td><td></td></template>"
-      }
-    },
-    {
-      "data": "<body><template><td></td><tbody><td></td></template>",
-      "errors": [
-        "no doctype",
-        "bad <tbody>"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "td": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "td"
-                          },
-                          {
-                            "tag": "td"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><td></td><td></td></template></body></html>",
-        "noQuirksBodyHtml": "<template><td></td><td></td></template>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "td": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "td"
-                          },
-                          {
-                            "tag": "td"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><td></td><td></td></template></body></html>",
-        "noQuirksBodyHtml": "<template><td></td><td></td></template>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "td": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "td"
-                          },
-                          {
-                            "tag": "td"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><td></td><td></td></template></body></html>",
-        "noQuirksBodyHtml": "<template><td></td><td></td></template>"
-      }
-    },
-    {
-      "data": "<body><template><td></td></table><td></td></template>",
-      "errors": [
-        "no doctype",
-        "bad </table>"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "td": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "td"
-                          },
-                          {
-                            "tag": "td"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><td></td><td></td></template></body></html>",
-        "noQuirksBodyHtml": "<template><td></td><td></td></template>"
-      }
-    },
-    {
-      "data": "<body><template><tr></tr><tbody><tr></tr></template>",
-      "errors": [
-        "no doctype",
-        "bad <tbody>"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "tr": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "tr"
-                          },
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><tr></tr><tr></tr></template></body></html>",
-        "noQuirksBodyHtml": "<template><tr></tr><tr></tr></template>"
-      }
-    },
-    {
-      "data": "<body><template><tr></tr><caption><tr></tr></template>",
-      "errors": [
-        "no doctype",
-        "bad <caption>"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "tr": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "tr"
-                          },
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><tr></tr><tr></tr></template></body></html>",
-        "noQuirksBodyHtml": "<template><tr></tr><tr></tr></template>"
-      }
-    },
-    {
-      "data": "<body><template><tr></tr></table><tr></tr></template>",
-      "errors": [
-        "no doctype",
-        "bad </table>"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "tr": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "tr"
-                          },
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><tr></tr><tr></tr></template></body></html>",
-        "noQuirksBodyHtml": "<template><tr></tr><tr></tr></template>"
-      }
-    },
-    {
-      "data": "<body><template><thead></thead><caption></caption><tbody></tbody></template>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "thead": true,
-            "caption": true,
-            "tbody": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "thead"
-                          },
-                          {
-                            "tag": "caption"
-                          },
-                          {
-                            "tag": "tbody"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><thead></thead><caption></caption><tbody></tbody></template></body></html>",
-        "noQuirksBodyHtml": "<template><thead></thead><caption></caption><tbody></tbody></template>"
-      }
-    },
-    {
-      "data": "<body><template><thead></thead></table><tbody></tbody></template></body>",
-      "errors": [
-        "no doctype",
-        "bad </table>"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "thead": true,
-            "tbody": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "thead"
-                          },
-                          {
-                            "tag": "tbody"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><thead></thead><tbody></tbody></template></body></html>",
-        "noQuirksBodyHtml": "<template><thead></thead><tbody></tbody></template>"
-      }
-    },
-    {
-      "data": "<body><template><div><tr></tr></div></template>",
-      "errors": [
-        "no doctype",
-        "bad tr",
-        "bad /tr"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "div": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "div"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><div></div></template></body></html>",
-        "noQuirksBodyHtml": "<template><div></div></template>"
-      }
-    },
-    {
-      "data": "<body><template><em>Hello</em></template>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "em": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "em",
-                            "children": [
-                              {
-                                "text": "Hello"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><em>Hello</em></template></body></html>",
-        "noQuirksBodyHtml": "<template><em>Hello</em></template>"
-      }
-    },
-    {
-      "data": "<body><template><!--comment--></template>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true
-          },
-          "template": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "comment": "comment"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><!--comment--></template></body></html>",
-        "noQuirksBodyHtml": "<template><!--comment--></template>"
-      }
-    },
-    {
-      "data": "<body><template><style></style><td></td></template>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "style": true,
-            "td": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "style"
-                          },
-                          {
-                            "tag": "td"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><style></style><td></td></template></body></html>",
-        "noQuirksBodyHtml": "<template><style></style><td></td></template>"
-      }
-    },
-    {
-      "data": "<body><template><meta><td></td></template>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "meta": true,
-            "td": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "meta"
-                          },
-                          {
-                            "tag": "td"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><meta><td></td></template></body></html>",
-        "noQuirksBodyHtml": "<template><meta><td></td></template>"
-      }
-    },
-    {
-      "data": "<body><template><link><td></td></template>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "link": true,
-            "td": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "link"
-                          },
-                          {
-                            "tag": "td"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><link><td></td></template></body></html>",
-        "noQuirksBodyHtml": "<template><link><td></td></template>"
-      }
-    },
-    {
-      "data": "<body><template><template><tr></tr></template><td></td></template>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "tr": true,
-            "td": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true,
-                                "children": [
-                                  {
-                                    "tag": "tr"
-                                  }
-                                ]
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "td"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><template><tr></tr></template><td></td></template></body></html>",
-        "noQuirksBodyHtml": "<template><template><tr></tr></template><td></td></template>"
-      }
-    },
-    {
-      "data": "<body><table><colgroup><template><col></col></template></colgroup></table></body>",
-      "errors": [
-        "no doctype",
-        "bad /col"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "colgroup": true,
-            "template": true,
-            "col": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "colgroup",
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true,
-                                "children": [
-                                  {
-                                    "tag": "col"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><colgroup><template><col></template></colgroup></table></body></html>",
-        "noQuirksBodyHtml": "<table><colgroup><template><col></template></colgroup></table>"
-      }
-    },
-    {
-      "data": "<body a=b><template><div></div><body c=d><div></div></body></template></body>",
-      "errors": [
-        "no doctype",
-        "bad <body>",
-        "bad </body>"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "div": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "attrs": [
-                  {
-                    "name": "a",
-                    "value": "b"
-                  }
-                ],
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "div"
-                          },
-                          {
-                            "tag": "div"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body a=\"b\"><template><div></div><div></div></template></body></html>",
-        "noQuirksBodyHtml": "<template><div></div><div></div></template>"
-      }
-    },
-    {
-      "data": "<html a=b><template><div><html b=c><span></template>",
-      "errors": [
-        "no doctype",
-        "bad <html>",
-        "missing end tags in template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "div": true,
-            "span": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "attrs": [
-              {
-                "name": "a",
-                "value": "b"
-              }
-            ],
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "div",
-                            "children": [
-                              {
-                                "tag": "span"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html a=\"b\"><head><template><div><span></span></div></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><div><span></span></div></template>"
-      }
-    },
-    {
-      "data": "<html a=b><template><col></col><html b=c><col></col></template>",
-      "errors": [
-        "no doctype",
-        "bad /col",
-        "bad html",
-        "bad /col"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "col": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "attrs": [
-              {
-                "name": "a",
-                "value": "b"
-              }
-            ],
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "col"
-                          },
-                          {
-                            "tag": "col"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html a=\"b\"><head><template><col><col></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><col><col></template>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "attrs": [
-              {
-                "name": "a",
-                "value": "b"
-              }
-            ],
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html a=\"b\"><head><template></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template></template>"
-      }
-    },
-    {
-      "data": "<body><template><tr></tr><template></template><td></td></template>",
-      "errors": [
-        "no doctype",
-        "unexpected <td>"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "tr": true,
-            "td": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "tr"
-                          },
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><tr></tr><template></template><tr><td></td></tr></template></body></html>",
-        "noQuirksBodyHtml": "<template><tr></tr><template></template><tr><td></td></tr></template>"
-      }
-    },
-    {
-      "data": "<body><template><thead></thead><template><tr></tr></template><tr></tr><tfoot></tfoot></template>",
-      "errors": [
-        "no doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "thead": true,
-            "tr": true,
-            "tbody": true,
-            "tfoot": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "thead"
-                          },
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true,
-                                "children": [
-                                  {
-                                    "tag": "tr"
-                                  }
-                                ]
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "tbody",
-                            "children": [
-                              {
-                                "tag": "tr"
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "tfoot"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><thead></thead><template><tr></tr></template><tbody><tr></tr></tbody><tfoot></tfoot></template></body></html>",
-        "noQuirksBodyHtml": "<template><thead></thead><template><tr></tr></template><tbody><tr></tr></tbody><tfoot></tfoot></template>"
-      }
-    },
-    {
-      "data": "<body><template><template><b><template></template></template>text</template>",
-      "errors": [
-        "no doctype",
-        "missing </b>"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "b": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true,
-                                "children": [
-                                  {
-                                    "tag": "b",
-                                    "children": [
-                                      {
-                                        "tag": "template",
-                                        "children": [
-                                          {
-                                            "content": true
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          },
-                          {
-                            "text": "text"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><template><b><template></template></b></template>text</template></body></html>",
-        "noQuirksBodyHtml": "<template><template><b><template></template></b></template>text</template>"
-      }
-    },
-    {
-      "data": "<body><template><col><colgroup>",
-      "errors": [
-        "no doctype",
-        "bad colgroup",
-        "eof in template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "col": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "col"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><col></template></body></html>",
-        "noQuirksBodyHtml": "<template><col></template>"
-      }
-    },
-    {
-      "data": "<body><template><col></colgroup>",
-      "errors": [
-        "no doctype",
-        "bogus /colgroup",
-        "eof in template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "col": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "col"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><col></template></body></html>",
-        "noQuirksBodyHtml": "<template><col></template>"
-      }
-    },
-    {
-      "data": "<body><template><col><colgroup></template></body>",
-      "errors": [
-        "no doctype",
-        "bad colgroup"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "col": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "col"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><col></template></body></html>",
-        "noQuirksBodyHtml": "<template><col></template>"
-      }
-    },
-    {
-      "data": "<body><template><col><div>",
-      "errors": [
-        " * (1,7) missing DOCTYPE",
-        " * (1,27) unexpected token",
-        " * (1,27) unexpected end of file in template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "col": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "col"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><col></template></body></html>",
-        "noQuirksBodyHtml": "<template><col></template>"
-      }
-    },
-    {
-      "data": "<body><template><col></div>",
-      "errors": [
-        "no doctype",
-        "bad /div",
-        "eof in template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "col": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "col"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><col></template></body></html>",
-        "noQuirksBodyHtml": "<template><col></template>"
-      }
-    },
-    {
-      "data": "<body><template><col>Hello",
-      "errors": [
-        "no doctype",
-        "unexpected text",
-        "eof in template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "col": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "col"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><col></template></body></html>",
-        "noQuirksBodyHtml": "<template><col></template>"
-      }
-    },
-    {
-      "data": "<body><template><i><menu>Foo</i>",
-      "errors": [
-        "no doctype",
-        "mising /menu",
-        "eof in template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "i": true,
-            "menu": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "i"
-                          },
-                          {
-                            "tag": "menu",
-                            "children": [
-                              {
-                                "tag": "i",
-                                "children": [
-                                  {
-                                    "text": "Foo"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><i></i><menu><i>Foo</i></menu></template></body></html>",
-        "noQuirksBodyHtml": "<template><i></i><menu><i>Foo</i></menu></template>"
-      }
-    },
-    {
-      "data": "<body><template></div><div>Foo</div><template></template><tr></tr>",
-      "errors": [
-        "no doctype",
-        "bogus /div",
-        "bogus tr",
-        "bogus /tr",
-        "eof in template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true,
-            "div": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "div",
-                            "children": [
-                              {
-                                "text": "Foo"
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template><div>Foo</div><template></template></template></body></html>",
-        "noQuirksBodyHtml": "<template><div>Foo</div><template></template></template>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "template": true,
-            "tr": true,
-            "td": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "template",
-                        "children": [
-                          {
-                            "content": true,
-                            "children": [
-                              {
-                                "tag": "tr",
-                                "children": [
-                                  {
-                                    "tag": "td",
-                                    "children": [
-                                      {
-                                        "text": "Foo"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div><template><tr><td>Foo</td></tr></template></div></body></html>",
-        "noQuirksBodyHtml": "<div><template><tr><td>Foo</td></tr></template></div>"
-      }
-    },
-    {
-      "data": "<template></figcaption><sub><table></table>",
-      "errors": [
-        "no doctype",
-        "bad /figcaption",
-        "eof in template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "sub": true,
-            "table": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "sub",
-                            "children": [
-                              {
-                                "tag": "table"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><sub><table></table></sub></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><sub><table></table></sub></template>"
-      }
-    },
-    {
-      "data": "<template><template>",
-      "errors": [
-        "no doctype",
-        "eof in template",
-        "eof in template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><template></template></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><template></template></template>"
-      }
-    },
-    {
-      "data": "<template><div>",
-      "errors": [
-        "no doctype",
-        "eof in template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "div": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "div"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><div></div></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><div></div></template>"
-      }
-    },
-    {
-      "data": "<template><template><div>",
-      "errors": [
-        "no doctype",
-        "eof in template",
-        "eof in template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "div": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true,
-                                "children": [
-                                  {
-                                    "tag": "div"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><template><div></div></template></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><template><div></div></template></template>"
-      }
-    },
-    {
-      "data": "<template><template><table>",
-      "errors": [
-        "no doctype",
-        "eof in template",
-        "eof in template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "table": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true,
-                                "children": [
-                                  {
-                                    "tag": "table"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><template><table></table></template></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><template><table></table></template></template>"
-      }
-    },
-    {
-      "data": "<template><template><tbody>",
-      "errors": [
-        "no doctype",
-        "eof in template",
-        "eof in template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "tbody": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true,
-                                "children": [
-                                  {
-                                    "tag": "tbody"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><template><tbody></tbody></template></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><template><tbody></tbody></template></template>"
-      }
-    },
-    {
-      "data": "<template><template><tr>",
-      "errors": [
-        "no doctype",
-        "eof in template",
-        "eof in template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "tr": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true,
-                                "children": [
-                                  {
-                                    "tag": "tr"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><template><tr></tr></template></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><template><tr></tr></template></template>"
-      }
-    },
-    {
-      "data": "<template><template><td>",
-      "errors": [
-        "no doctype",
-        "eof in template",
-        "eof in template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "td": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true,
-                                "children": [
-                                  {
-                                    "tag": "td"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><template><td></td></template></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><template><td></td></template></template>"
-      }
-    },
-    {
-      "data": "<template><template><caption>",
-      "errors": [
-        "no doctype",
-        "eof in template",
-        "eof in template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "caption": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true,
-                                "children": [
-                                  {
-                                    "tag": "caption"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><template><caption></caption></template></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><template><caption></caption></template></template>"
-      }
-    },
-    {
-      "data": "<template><template><colgroup>",
-      "errors": [
-        "no doctype",
-        "eof in template",
-        "eof in template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "colgroup": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true,
-                                "children": [
-                                  {
-                                    "tag": "colgroup"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><template><colgroup></colgroup></template></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><template><colgroup></colgroup></template></template>"
-      }
-    },
-    {
-      "data": "<template><template><col>",
-      "errors": [
-        "no doctype",
-        "eof in template",
-        "eof in template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "col": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true,
-                                "children": [
-                                  {
-                                    "tag": "col"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><template><col></template></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><template><col></template></template>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "tbody": true,
-            "select": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true,
-                                "children": [
-                                  {
-                                    "tag": "tbody"
-                                  },
-                                  {
-                                    "tag": "select"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><template><tbody></tbody><select></select></template></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><template><tbody></tbody><select></select></template></template>"
-      }
-    },
-    {
-      "data": "<template><template><table>Foo",
-      "errors": [
-        "no doctype",
-        "foster-parenting text F",
-        "foster-parenting text o",
-        "foster-parenting text o",
-        "eof",
-        "eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "table": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true,
-                                "children": [
-                                  {
-                                    "text": "Foo"
-                                  },
-                                  {
-                                    "tag": "table"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><template>Foo<table></table></template></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><template>Foo<table></table></template></template>"
-      }
-    },
-    {
-      "data": "<template><template><frame>",
-      "errors": [
-        "no doctype",
-        "bad tag",
-        "eof",
-        "eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><template></template></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><template></template></template>"
-      }
-    },
-    {
-      "data": "<template><template><script>var i",
-      "errors": [
-        "no doctype",
-        "eof in script",
-        "eof in template",
-        "eof in template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "script": true,
-            "body": true
-          },
-          "template": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true,
-                                "children": [
-                                  {
-                                    "tag": "script",
-                                    "children": [
-                                      {
-                                        "text": "var i",
-                                        "no_escape": true
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><template><script>var i</script></template></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><template><script>var i</script></template></template>"
-      }
-    },
-    {
-      "data": "<template><template><style>var i",
-      "errors": [
-        "no doctype",
-        "eof in style",
-        "eof in template",
-        "eof in template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "style": true,
-            "body": true
-          },
-          "template": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true,
-                                "children": [
-                                  {
-                                    "tag": "style",
-                                    "children": [
-                                      {
-                                        "text": "var i",
-                                        "no_escape": true
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><template><style>var i</style></template></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><template><style>var i</style></template></template>"
-      }
-    },
-    {
-      "data": "<template><table></template><body><span>Foo",
-      "errors": [
-        "no doctype",
-        "missing /table",
-        "bad eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "table": true,
-            "body": true,
-            "span": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "table"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "span",
-                    "children": [
-                      {
-                        "text": "Foo"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><table></table></template></head><body><span>Foo</span></body></html>",
-        "noQuirksBodyHtml": "<template><table></table></template><span>Foo</span>"
-      }
-    },
-    {
-      "data": "<template><td></template><body><span>Foo",
-      "errors": [
-        "no doctype",
-        "bad eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "td": true,
-            "body": true,
-            "span": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "td"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "span",
-                    "children": [
-                      {
-                        "text": "Foo"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><td></td></template></head><body><span>Foo</span></body></html>",
-        "noQuirksBodyHtml": "<template><td></td></template><span>Foo</span>"
-      }
-    },
-    {
-      "data": "<template><object></template><body><span>Foo",
-      "errors": [
-        "no doctype",
-        "missing /object",
-        "bad eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "object": true,
-            "body": true,
-            "span": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "object"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "span",
-                    "children": [
-                      {
-                        "text": "Foo"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><object></object></template></head><body><span>Foo</span></body></html>",
-        "noQuirksBodyHtml": "<template><object></object></template><span>Foo</span>"
-      }
-    },
-    {
-      "data": "<template><svg><template>",
-      "errors": [
-        "no doctype",
-        "eof in template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "svg svg": true,
-            "svg template": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "svg",
-                            "ns": "http://www.w3.org/2000/svg",
-                            "children": [
-                              {
-                                "tag": "template",
-                                "ns": "http://www.w3.org/2000/svg"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><svg><template></template></svg></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><svg><template></template></svg></template>"
-      }
-    },
-    {
-      "data": "<template><svg><foo><template><foreignObject><div></template><div>",
-      "errors": [
-        "no doctype",
-        "ugly template closure",
-        "bad eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "svg svg": true,
-            "svg foo": true,
-            "svg template": true,
-            "svg foreignObject": true,
-            "div": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "svg",
-                            "ns": "http://www.w3.org/2000/svg",
-                            "children": [
-                              {
-                                "tag": "foo",
-                                "ns": "http://www.w3.org/2000/svg",
-                                "children": [
-                                  {
-                                    "tag": "template",
-                                    "ns": "http://www.w3.org/2000/svg",
-                                    "children": [
-                                      {
-                                        "tag": "foreignObject",
-                                        "ns": "http://www.w3.org/2000/svg",
-                                        "children": [
-                                          {
-                                            "tag": "div"
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><svg><foo><template><foreignObject><div></div></foreignObject></template></foo></svg></template></head><body><div></div></body></html>",
-        "noQuirksBodyHtml": "<template><svg><foo><template><foreignObject><div></div></foreignObject></template></foo></svg></template><div></div>"
-      }
-    },
-    {
-      "data": "<dummy><template><span></dummy>",
-      "errors": [
-        "no doctype",
-        "bad end tag </dummy>",
-        "eof in template",
-        "eof in dummy"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "dummy": true,
-            "template": true,
-            "span": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "dummy",
-                    "children": [
-                      {
-                        "tag": "template",
-                        "children": [
-                          {
-                            "content": true,
-                            "children": [
-                              {
-                                "tag": "span"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><dummy><template><span></span></template></dummy></body></html>",
-        "noQuirksBodyHtml": "<dummy><template><span></span></template></dummy>"
-      }
-    },
-    {
-      "data": "<body><table><tr><td><select><template>Foo</template><caption>A</table>",
-      "errors": [
-        "no doctype",
-        "(1,62): unexpected-caption-in-select-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "select": true,
-            "template": true,
-            "caption": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "select",
-                                    "children": [
-                                      {
-                                        "tag": "template",
-                                        "children": [
-                                          {
-                                            "content": true,
-                                            "children": [
-                                              {
-                                                "text": "Foo"
-                                              }
-                                            ]
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "caption",
-                        "children": [
-                          {
-                            "text": "A"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><tr><td><select><template>Foo</template></select></td></tr></tbody><caption>A</caption></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><select><template>Foo</template></select></td></tr></tbody><caption>A</caption></table>"
-      }
-    },
-    {
-      "data": "<body></body><template>",
-      "errors": [
-        "no doctype",
-        "(1,23): template-after-body",
-        "(1,24): eof-in-template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "template": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><template></template></body></html>",
-        "noQuirksBodyHtml": "<template></template>"
-      }
-    },
-    {
-      "data": "<head></head><template>",
-      "errors": [
-        "no doctype",
-        "(1,23): template-after-head",
-        "(1,24): eof-in-template"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template></template>"
-      }
-    },
-    {
-      "data": "<head></head><template>Foo</template>",
-      "errors": [
-        "no doctype",
-        "(1,23): template-after-head"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "text": "Foo"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template>Foo</template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template>Foo</template>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE HTML><dummy><table><template><table><template><table><script>",
-      "errors": [
-        "eof script",
-        "eof template",
-        "eof template",
-        "eof table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "dummy": true,
-            "table": true,
-            "template": true,
-            "script": true
-          },
-          "doctype": true,
-          "template": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "dummy",
-                    "children": [
-                      {
-                        "tag": "table",
-                        "children": [
-                          {
-                            "tag": "template",
-                            "children": [
-                              {
-                                "content": true,
-                                "children": [
-                                  {
-                                    "tag": "table",
-                                    "children": [
-                                      {
-                                        "tag": "template",
-                                        "children": [
-                                          {
-                                            "content": true,
-                                            "children": [
-                                              {
-                                                "tag": "table",
-                                                "children": [
-                                                  {
-                                                    "tag": "script"
-                                                  }
-                                                ]
-                                              }
-                                            ]
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><dummy><table><template><table><template><table><script></script></table></template></table></template></table></dummy></body></html>",
-        "noQuirksBodyHtml": "<dummy><table><template><table><template><table><script></script></table></template></table></template></table></dummy>"
-      }
-    },
-    {
-      "data": "<template><a><table><a>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "template": true,
-            "a": true,
-            "table": true,
-            "body": true
-          },
-          "template": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "template",
-                    "children": [
-                      {
-                        "content": true,
-                        "children": [
-                          {
-                            "tag": "a",
-                            "children": [
-                              {
-                                "tag": "a"
-                              },
-                              {
-                                "tag": "table"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><template><a><a></a><table></table></a></template></head><body></body></html>",
-        "noQuirksBodyHtml": "<template><a><a></a><table></table></a></template>"
-      }
-    }
-  ],
-  "tests1.dat": [
-    {
-      "data": "Test",
-      "errors": [
-        "(1,0): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Test"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>Test</body></html>",
-        "noQuirksBodyHtml": "Test"
-      }
-    },
-    {
-      "data": "<p>One<p>Two",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "One"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "Two"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><p>One</p><p>Two</p></body></html>",
-        "noQuirksBodyHtml": "<p>One</p><p>Two</p>"
-      }
-    },
-    {
-      "data": "Line1<br>Line2<br>Line3<br>Line4",
-      "errors": [
-        "(1,0): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "br": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Line1"
-                  },
-                  {
-                    "tag": "br"
-                  },
-                  {
-                    "text": "Line2"
-                  },
-                  {
-                    "tag": "br"
-                  },
-                  {
-                    "text": "Line3"
-                  },
-                  {
-                    "tag": "br"
-                  },
-                  {
-                    "text": "Line4"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>Line1<br>Line2<br>Line3<br>Line4</body></html>",
-        "noQuirksBodyHtml": "Line1<br>Line2<br>Line3<br>Line4"
-      }
-    },
-    {
-      "data": "<html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<head>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<body>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<html><head>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<html><head></head>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<html><head></head><body>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<html><head></head><body></body>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<html><head><body></body></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<html><head></body></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<html><head><body></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<html><body></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<body></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<head></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "</head>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "</body>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-end-tag element."
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "</html>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-end-tag element."
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<b><table><td><i></table>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "i": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "table",
-                        "children": [
-                          {
-                            "tag": "tbody",
-                            "children": [
-                              {
-                                "tag": "tr",
-                                "children": [
-                                  {
-                                    "tag": "td",
-                                    "children": [
-                                      {
-                                        "tag": "i"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b><table><tbody><tr><td><i></i></td></tr></tbody></table></b></body></html>",
-        "noQuirksBodyHtml": "<b><table><tbody><tr><td><i></i></td></tr></tbody></table></b>"
-      }
-    },
-    {
-      "data": "<b><table><td></b><i></table>X",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "i": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "table",
-                        "children": [
-                          {
-                            "tag": "tbody",
-                            "children": [
-                              {
-                                "tag": "tr",
-                                "children": [
-                                  {
-                                    "tag": "td",
-                                    "children": [
-                                      {
-                                        "tag": "i"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "text": "X"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b><table><tbody><tr><td><i></i></td></tr></tbody></table>X</b></body></html>",
-        "noQuirksBodyHtml": "<b><table><tbody><tr><td><i></i></td></tr></tbody></table>X</b>"
-      }
-    },
-    {
-      "data": "<h1>Hello<h2>World",
-      "errors": [
-        "(1,4): expected-doctype-but-got-start-tag",
-        "(1,13): unexpected-start-tag",
-        "(1,18): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "h1": true,
-            "h2": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "h1",
-                    "children": [
-                      {
-                        "text": "Hello"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "h2",
-                    "children": [
-                      {
-                        "text": "World"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><h1>Hello</h1><h2>World</h2></body></html>",
-        "noQuirksBodyHtml": "<h1>Hello</h1><h2>World</h2>"
-      }
-    },
-    {
-      "data": "<a><p>X<a>Y</a>Z</p></a>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a"
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "a",
-                        "children": [
-                          {
-                            "text": "X"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "a",
-                        "children": [
-                          {
-                            "text": "Y"
-                          }
-                        ]
-                      },
-                      {
-                        "text": "Z"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a></a><p><a>X</a><a>Y</a>Z</p></body></html>",
-        "noQuirksBodyHtml": "<a></a><p><a>X</a><a>Y</a>Z</p>"
-      }
-    },
-    {
-      "data": "<b><button>foo</b>bar",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag",
-        "(1,18): adoption-agency-1.3",
-        "(1,21): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "button": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b"
-                  },
-                  {
-                    "tag": "button",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": "foo"
-                          }
-                        ]
-                      },
-                      {
-                        "text": "bar"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b></b><button><b>foo</b>bar</button></body></html>",
-        "noQuirksBodyHtml": "<b></b><button><b>foo</b>bar</button>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><span><button>foo</span>bar",
-      "errors": [
-        "(1,39): unexpected-end-tag",
-        "(1,42): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "span": true,
-            "button": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "span",
-                    "children": [
-                      {
-                        "tag": "button",
-                        "children": [
-                          {
-                            "text": "foobar"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><span><button>foobar</button></span></body></html>",
-        "noQuirksBodyHtml": "<span><button>foobar</button></span>"
-      }
-    },
-    {
-      "data": "<p><b><div><marquee></p></b></div>X",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "b": true,
-            "div": true,
-            "marquee": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "b"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "tag": "marquee",
-                            "children": [
-                              {
-                                "tag": "p"
-                              },
-                              {
-                                "text": "X"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><p><b></b></p><div><b><marquee><p></p>X</marquee></b></div></body></html>",
-        "noQuirksBodyHtml": "<p><b></b></p><div><b><marquee><p></p>X</marquee></b></div>"
-      }
-    },
-    {
-      "data": "<script><div></script></div><title><p></title><p><p>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,28): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "title": true,
-            "body": true,
-            "p": true
-          },
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<div>",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "<p>",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p"
-                  },
-                  {
-                    "tag": "p"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><div></script><title>&lt;p&gt;</title></head><body><p></p><p></p></body></html>",
-        "noQuirksBodyHtml": "<script><div></script><title>&lt;p&gt;</title><p></p><p></p>"
-      }
-    },
-    {
-      "data": "<!--><div>--<!-->",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "comment": ""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": "--"
-                      },
-                      {
-                        "comment": ""
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!----><html><head></head><body><div>--<!----></div></body></html>",
-        "noQuirksBodyHtml": "<!----><div>--<!----></div>"
-      }
-    },
-    {
-      "data": "<p><hr></p>",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag",
-        "(1,11): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "hr": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p"
-                  },
-                  {
-                    "tag": "hr"
-                  },
-                  {
-                    "tag": "p"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><p></p><hr><p></p></body></html>",
-        "noQuirksBodyHtml": "<p></p><hr><p></p>"
-      }
-    },
-    {
-      "data": "<select><b><option><select><option></b></select>X",
-      "errors": [
-        "(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"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "option": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "option"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "option",
-                    "children": [
-                      {
-                        "text": "X"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><select><option></option></select><option>X</option></body></html>",
-        "noQuirksBodyHtml": "<select><option></option></select><option>X</option>"
-      }
-    },
-    {
-      "data": "<a><table><td><a><table></table><a></tr><a></table><b>X</b>C<a>Y",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "b": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "tag": "a"
-                      },
-                      {
-                        "tag": "table",
-                        "children": [
-                          {
-                            "tag": "tbody",
-                            "children": [
-                              {
-                                "tag": "tr",
-                                "children": [
-                                  {
-                                    "tag": "td",
-                                    "children": [
-                                      {
-                                        "tag": "a",
-                                        "children": [
-                                          {
-                                            "tag": "table"
-                                          }
-                                        ]
-                                      },
-                                      {
-                                        "tag": "a"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": "X"
-                          }
-                        ]
-                      },
-                      {
-                        "text": "C"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "text": "Y"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a><a></a><table><tbody><tr><td><a><table></table></a><a></a></td></tr></tbody></table></a><a><b>X</b>C</a><a>Y</a></body></html>",
-        "noQuirksBodyHtml": "<a><a></a><table><tbody><tr><td><a><table></table></a><a></a></td></tr></tbody></table></a><a><b>X</b>C</a><a>Y</a>"
-      }
-    },
-    {
-      "data": "<a X>0<b>1<a Y>2",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "b": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "attrs": [
-                      {
-                        "name": "x",
-                        "value": ""
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "0"
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": "1"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "a",
-                        "attrs": [
-                          {
-                            "name": "y",
-                            "value": ""
-                          }
-                        ],
-                        "children": [
-                          {
-                            "text": "2"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a x=\"\">0<b>1</b></a><b><a y=\"\">2</a></b></body></html>",
-        "noQuirksBodyHtml": "<a x=\"\">0<b>1</b></a><b><a y=\"\">2</a></b>"
-      }
-    },
-    {
-      "data": "<!-----><font><div>hello<table>excite!<b>me!<th><i>please!</tr><!--X-->",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "font": true,
-            "div": true,
-            "b": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "th": true,
-            "i": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "comment": "-"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "font",
-                    "children": [
-                      {
-                        "tag": "div",
-                        "children": [
-                          {
-                            "text": "helloexcite!"
-                          },
-                          {
-                            "tag": "b",
-                            "children": [
-                              {
-                                "text": "me!"
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "table",
-                            "children": [
-                              {
-                                "tag": "tbody",
-                                "children": [
-                                  {
-                                    "tag": "tr",
-                                    "children": [
-                                      {
-                                        "tag": "th",
-                                        "children": [
-                                          {
-                                            "tag": "i",
-                                            "children": [
-                                              {
-                                                "text": "please!"
-                                              }
-                                            ]
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  },
-                                  {
-                                    "comment": "X"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!-----><html><head></head><body><font><div>helloexcite!<b>me!</b><table><tbody><tr><th><i>please!</i></th></tr><!--X--></tbody></table></div></font></body></html>",
-        "noQuirksBodyHtml": "<!-----><font><div>helloexcite!<b>me!</b><table><tbody><tr><th><i>please!</i></th></tr><!--X--></tbody></table></div></font>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><li>hello<li>world<ul>how<li>do</ul>you</body><!--do-->",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "li": true,
-            "ul": true
-          },
-          "doctype": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "li",
-                    "children": [
-                      {
-                        "text": "hello"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "li",
-                    "children": [
-                      {
-                        "text": "world"
-                      },
-                      {
-                        "tag": "ul",
-                        "children": [
-                          {
-                            "text": "how"
-                          },
-                          {
-                            "tag": "li",
-                            "children": [
-                              {
-                                "text": "do"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "text": "you"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "comment": "do"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><li>hello</li><li>world<ul>how<li>do</li></ul>you</li></body><!--do--></html>",
-        "noQuirksBodyHtml": "<li>hello</li><li>world<ul>how<li>do</li></ul>you<!--do--></li>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html>A<option>B<optgroup>C<select>D</option>E",
-      "errors": [
-        "(1,54): unexpected-end-tag-in-select",
-        "(1,55): eof-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "option": true,
-            "optgroup": true,
-            "select": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "A"
-                  },
-                  {
-                    "tag": "option",
-                    "children": [
-                      {
-                        "text": "B"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "optgroup",
-                    "children": [
-                      {
-                        "text": "C"
-                      },
-                      {
-                        "tag": "select",
-                        "children": [
-                          {
-                            "text": "DE"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>A<option>B</option><optgroup>C<select>DE</select></optgroup></body></html>",
-        "noQuirksBodyHtml": "A<option>B</option><optgroup>C<select>DE</select></optgroup>"
-      }
-    },
-    {
-      "data": "<",
-      "errors": [
-        "(1,1): expected-tag-name",
-        "(1,1): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "<",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>&lt;</body></html>",
-        "noQuirksBodyHtml": "&lt;"
-      }
-    },
-    {
-      "data": "<#",
-      "errors": [
-        "(1,1): expected-tag-name",
-        "(1,1): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "<#",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>&lt;#</body></html>",
-        "noQuirksBodyHtml": "&lt;#"
-      }
-    },
-    {
-      "data": "</",
-      "errors": [
-        "(1,2): expected-closing-tag-but-got-eof",
-        "(1,2): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "</",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>&lt;/</body></html>",
-        "noQuirksBodyHtml": "&lt;/"
-      }
-    },
-    {
-      "data": "</#",
-      "errors": [
-        "(1,2): expected-closing-tag-but-got-char",
-        "(1,3): expected-doctype-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "comment": "#"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!--#--><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!--#-->"
-      }
-    },
-    {
-      "data": "<?",
-      "errors": [
-        "(1,1): expected-tag-name-but-got-question-mark",
-        "(1,2): expected-doctype-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "comment": "?"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!--?--><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!--?-->"
-      }
-    },
-    {
-      "data": "<?#",
-      "errors": [
-        "(1,1): expected-tag-name-but-got-question-mark",
-        "(1,3): expected-doctype-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "comment": "?#"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!--?#--><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!--?#-->"
-      }
-    },
-    {
-      "data": "<!",
-      "errors": [
-        "(1,2): expected-dashes-or-doctype",
-        "(1,2): expected-doctype-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "comment": ""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!----><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!---->"
-      }
-    },
-    {
-      "data": "<!#",
-      "errors": [
-        "(1,2): expected-dashes-or-doctype",
-        "(1,3): expected-doctype-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "comment": "#"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!--#--><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!--#-->"
-      }
-    },
-    {
-      "data": "<?COMMENT?>",
-      "errors": [
-        "(1,1): expected-tag-name-but-got-question-mark",
-        "(1,11): expected-doctype-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "comment": "?COMMENT?"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!--?COMMENT?--><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!--?COMMENT?-->"
-      }
-    },
-    {
-      "data": "<!COMMENT>",
-      "errors": [
-        "(1,2): expected-dashes-or-doctype",
-        "(1,10): expected-doctype-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "comment": "COMMENT"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!--COMMENT--><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!--COMMENT-->"
-      }
-    },
-    {
-      "data": "</ COMMENT >",
-      "errors": [
-        "(1,2): expected-closing-tag-but-got-char",
-        "(1,12): expected-doctype-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "comment": " COMMENT "
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!-- COMMENT --><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!-- COMMENT -->"
-      }
-    },
-    {
-      "data": "<?COM--MENT?>",
-      "errors": [
-        "(1,1): expected-tag-name-but-got-question-mark",
-        "(1,13): expected-doctype-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "comment": "?COM--MENT?"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!--?COM--MENT?--><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!--?COM--MENT?-->"
-      }
-    },
-    {
-      "data": "<!COM--MENT>",
-      "errors": [
-        "(1,2): expected-dashes-or-doctype",
-        "(1,12): expected-doctype-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "comment": "COM--MENT"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!--COM--MENT--><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!--COM--MENT-->"
-      }
-    },
-    {
-      "data": "</ COM--MENT >",
-      "errors": [
-        "(1,2): expected-closing-tag-but-got-char",
-        "(1,14): expected-doctype-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "comment": " COM--MENT "
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!-- COM--MENT --><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!-- COM--MENT -->"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><style> EOF",
-      "errors": [
-        "(1,26): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": " EOF",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><style> EOF</style></head><body></body></html>",
-        "noQuirksBodyHtml": "<style> EOF</style>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><script> <!-- </script> --> </script> EOF",
-      "errors": [
-        "(1,52): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": " <!-- ",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": " "
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "-->  EOF",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script> <!-- </script> </head><body>--&gt;  EOF</body></html>",
-        "noQuirksBodyHtml": "<script> <!-- </script> --&gt;  EOF"
-      }
-    },
-    {
-      "data": "<b><p></b>TEST",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag",
-        "(1,10): adoption-agency-1.3"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b"
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "b"
-                      },
-                      {
-                        "text": "TEST"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b></b><p><b></b>TEST</p></body></html>",
-        "noQuirksBodyHtml": "<b></b><p><b></b>TEST</p>"
-      }
-    },
-    {
-      "data": "<p id=a><b><p id=b></b>TEST",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,19): unexpected-end-tag",
-        "(1,23): adoption-agency-1.2"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "b": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "attrs": [
-                      {
-                        "name": "id",
-                        "value": "a"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "tag": "b"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "attrs": [
-                      {
-                        "name": "id",
-                        "value": "b"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "TEST"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><p id=\"a\"><b></b></p><p id=\"b\">TEST</p></body></html>",
-        "noQuirksBodyHtml": "<p id=\"a\"><b></b></p><p id=\"b\">TEST</p>"
-      }
-    },
-    {
-      "data": "<b id=a><p><b id=b></p></b>TEST",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "attrs": [
-                      {
-                        "name": "id",
-                        "value": "a"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "tag": "p",
-                        "children": [
-                          {
-                            "tag": "b",
-                            "attrs": [
-                              {
-                                "name": "id",
-                                "value": "b"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "text": "TEST"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b id=\"a\"><p><b id=\"b\"></b></p>TEST</b></body></html>",
-        "noQuirksBodyHtml": "<b id=\"a\"><p><b id=\"b\"></b></p>TEST</b>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><title>U-test</title><body><div><p>Test<u></p></div></body>",
-      "errors": [
-        "(1,61): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "title": true,
-            "body": true,
-            "div": true,
-            "p": true,
-            "u": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "U-test"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "p",
-                        "children": [
-                          {
-                            "text": "Test"
-                          },
-                          {
-                            "tag": "u"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><title>U-test</title></head><body><div><p>Test<u></u></p></div></body></html>",
-        "noQuirksBodyHtml": "<title>U-test</title><div><p>Test<u></u></p></div>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><font><table></font></table></font>",
-      "errors": [
-        "(1,35): unexpected-end-tag-implies-table-voodoo",
-        "(1,35): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "font": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "font",
-                    "children": [
-                      {
-                        "tag": "table"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><font><table></table></font></body></html>",
-        "noQuirksBodyHtml": "<font><table></table></font>"
-      }
-    },
-    {
-      "data": "<font><p>hello<b>cruel</font>world",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "font": true,
-            "p": true,
-            "b": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "font"
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "font",
-                        "children": [
-                          {
-                            "text": "hello"
-                          },
-                          {
-                            "tag": "b",
-                            "children": [
-                              {
-                                "text": "cruel"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": "world"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><font></font><p><font>hello<b>cruel</b></font><b>world</b></p></body></html>",
-        "noQuirksBodyHtml": "<font></font><p><font>hello<b>cruel</b></font><b>world</b></p>"
-      }
-    },
-    {
-      "data": "<b>Test</i>Test",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag",
-        "(1,11): unexpected-end-tag",
-        "(1,15): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "text": "TestTest"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b>TestTest</b></body></html>",
-        "noQuirksBodyHtml": "<b>TestTest</b>"
-      }
-    },
-    {
-      "data": "<b>A<cite>B<div>C",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag",
-        "(1,17): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "cite": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "text": "A"
-                      },
-                      {
-                        "tag": "cite",
-                        "children": [
-                          {
-                            "text": "B"
-                          },
-                          {
-                            "tag": "div",
-                            "children": [
-                              {
-                                "text": "C"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b>A<cite>B<div>C</div></cite></b></body></html>",
-        "noQuirksBodyHtml": "<b>A<cite>B<div>C</div></cite></b>"
-      }
-    },
-    {
-      "data": "<b>A<cite>B<div>C</cite>D",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag",
-        "(1,24): unexpected-end-tag",
-        "(1,25): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "cite": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "text": "A"
-                      },
-                      {
-                        "tag": "cite",
-                        "children": [
-                          {
-                            "text": "B"
-                          },
-                          {
-                            "tag": "div",
-                            "children": [
-                              {
-                                "text": "CD"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b>A<cite>B<div>CD</div></cite></b></body></html>",
-        "noQuirksBodyHtml": "<b>A<cite>B<div>CD</div></cite></b>"
-      }
-    },
-    {
-      "data": "<b>A<cite>B<div>C</b>D",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag",
-        "(1,21): adoption-agency-1.3",
-        "(1,22): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "cite": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "text": "A"
-                      },
-                      {
-                        "tag": "cite",
-                        "children": [
-                          {
-                            "text": "B"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": "C"
-                          }
-                        ]
-                      },
-                      {
-                        "text": "D"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b>A<cite>B</cite></b><div><b>C</b>D</div></body></html>",
-        "noQuirksBodyHtml": "<b>A<cite>B</cite></b><div><b>C</b>D</div>"
-      }
-    },
-    {
-      "data": "",
-      "errors": [
-        "(1,0): expected-doctype-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<DIV>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,5): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div></div></body></html>",
-        "noQuirksBodyHtml": "<div></div>"
-      }
-    },
-    {
-      "data": "<DIV> abc",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,9): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": " abc"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div> abc</div></body></html>",
-        "noQuirksBodyHtml": "<div> abc</div>"
-      }
-    },
-    {
-      "data": "<DIV> abc <B>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,13): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "b": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": " abc "
-                      },
-                      {
-                        "tag": "b"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div> abc <b></b></div></body></html>",
-        "noQuirksBodyHtml": "<div> abc <b></b></div>"
-      }
-    },
-    {
-      "data": "<DIV> abc <B> def",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,17): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "b": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": " abc "
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": " def"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div> abc <b> def</b></div></body></html>",
-        "noQuirksBodyHtml": "<div> abc <b> def</b></div>"
-      }
-    },
-    {
-      "data": "<DIV> abc <B> def <I>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,21): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "b": true,
-            "i": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": " abc "
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": " def "
-                          },
-                          {
-                            "tag": "i"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div> abc <b> def <i></i></b></div></body></html>",
-        "noQuirksBodyHtml": "<div> abc <b> def <i></i></b></div>"
-      }
-    },
-    {
-      "data": "<DIV> abc <B> def <I> ghi",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,25): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "b": true,
-            "i": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": " abc "
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": " def "
-                          },
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "text": " ghi"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div> abc <b> def <i> ghi</i></b></div></body></html>",
-        "noQuirksBodyHtml": "<div> abc <b> def <i> ghi</i></b></div>"
-      }
-    },
-    {
-      "data": "<DIV> abc <B> def <I> ghi <P>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,29): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "b": true,
-            "i": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": " abc "
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": " def "
-                          },
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "text": " ghi "
-                              },
-                              {
-                                "tag": "p"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div> abc <b> def <i> ghi <p></p></i></b></div></body></html>",
-        "noQuirksBodyHtml": "<div> abc <b> def <i> ghi <p></p></i></b></div>"
-      }
-    },
-    {
-      "data": "<DIV> abc <B> def <I> ghi <P> jkl",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,33): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "b": true,
-            "i": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": " abc "
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": " def "
-                          },
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "text": " ghi "
-                              },
-                              {
-                                "tag": "p",
-                                "children": [
-                                  {
-                                    "text": " jkl"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div> abc <b> def <i> ghi <p> jkl</p></i></b></div></body></html>",
-        "noQuirksBodyHtml": "<div> abc <b> def <i> ghi <p> jkl</p></i></b></div>"
-      }
-    },
-    {
-      "data": "<DIV> abc <B> def <I> ghi <P> jkl </B>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,38): adoption-agency-1.3",
-        "(1,38): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "b": true,
-            "i": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": " abc "
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": " def "
-                          },
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "text": " ghi "
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "i",
-                        "children": [
-                          {
-                            "tag": "p",
-                            "children": [
-                              {
-                                "tag": "b",
-                                "children": [
-                                  {
-                                    "text": " jkl "
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div> abc <b> def <i> ghi </i></b><i><p><b> jkl </b></p></i></div></body></html>",
-        "noQuirksBodyHtml": "<div> abc <b> def <i> ghi </i></b><i><p><b> jkl </b></p></i></div>"
-      }
-    },
-    {
-      "data": "<DIV> abc <B> def <I> ghi <P> jkl </B> mno",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,38): adoption-agency-1.3",
-        "(1,42): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "b": true,
-            "i": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": " abc "
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": " def "
-                          },
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "text": " ghi "
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "i",
-                        "children": [
-                          {
-                            "tag": "p",
-                            "children": [
-                              {
-                                "tag": "b",
-                                "children": [
-                                  {
-                                    "text": " jkl "
-                                  }
-                                ]
-                              },
-                              {
-                                "text": " mno"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div> abc <b> def <i> ghi </i></b><i><p><b> jkl </b> mno</p></i></div></body></html>",
-        "noQuirksBodyHtml": "<div> abc <b> def <i> ghi </i></b><i><p><b> jkl </b> mno</p></i></div>"
-      }
-    },
-    {
-      "data": "<DIV> abc <B> def <I> ghi <P> jkl </B> mno </I>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "b": true,
-            "i": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": " abc "
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": " def "
-                          },
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "text": " ghi "
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "i"
-                      },
-                      {
-                        "tag": "p",
-                        "children": [
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "tag": "b",
-                                "children": [
-                                  {
-                                    "text": " jkl "
-                                  }
-                                ]
-                              },
-                              {
-                                "text": " mno "
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div> abc <b> def <i> ghi </i></b><i></i><p><i><b> jkl </b> mno </i></p></div></body></html>",
-        "noQuirksBodyHtml": "<div> abc <b> def <i> ghi </i></b><i></i><p><i><b> jkl </b> mno </i></p></div>"
-      }
-    },
-    {
-      "data": "<DIV> abc <B> def <I> ghi <P> jkl </B> mno </I> pqr",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "b": true,
-            "i": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": " abc "
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": " def "
-                          },
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "text": " ghi "
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "i"
-                      },
-                      {
-                        "tag": "p",
-                        "children": [
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "tag": "b",
-                                "children": [
-                                  {
-                                    "text": " jkl "
-                                  }
-                                ]
-                              },
-                              {
-                                "text": " mno "
-                              }
-                            ]
-                          },
-                          {
-                            "text": " pqr"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div> abc <b> def <i> ghi </i></b><i></i><p><i><b> jkl </b> mno </i> pqr</p></div></body></html>",
-        "noQuirksBodyHtml": "<div> abc <b> def <i> ghi </i></b><i></i><p><i><b> jkl </b> mno </i> pqr</p></div>"
-      }
-    },
-    {
-      "data": "<DIV> abc <B> def <I> ghi <P> jkl </B> mno </I> pqr </P>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "b": true,
-            "i": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": " abc "
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": " def "
-                          },
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "text": " ghi "
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "i"
-                      },
-                      {
-                        "tag": "p",
-                        "children": [
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "tag": "b",
-                                "children": [
-                                  {
-                                    "text": " jkl "
-                                  }
-                                ]
-                              },
-                              {
-                                "text": " mno "
-                              }
-                            ]
-                          },
-                          {
-                            "text": " pqr "
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div> abc <b> def <i> ghi </i></b><i></i><p><i><b> jkl </b> mno </i> pqr </p></div></body></html>",
-        "noQuirksBodyHtml": "<div> abc <b> def <i> ghi </i></b><i></i><p><i><b> jkl </b> mno </i> pqr </p></div>"
-      }
-    },
-    {
-      "data": "<DIV> abc <B> def <I> ghi <P> jkl </B> mno </I> pqr </P> stu",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "b": true,
-            "i": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": " abc "
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": " def "
-                          },
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "text": " ghi "
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "i"
-                      },
-                      {
-                        "tag": "p",
-                        "children": [
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "tag": "b",
-                                "children": [
-                                  {
-                                    "text": " jkl "
-                                  }
-                                ]
-                              },
-                              {
-                                "text": " mno "
-                              }
-                            ]
-                          },
-                          {
-                            "text": " pqr "
-                          }
-                        ]
-                      },
-                      {
-                        "text": " stu"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div> abc <b> def <i> ghi </i></b><i></i><p><i><b> jkl </b> mno </i> pqr </p> stu</div></body></html>",
-        "noQuirksBodyHtml": "<div> abc <b> def <i> ghi </i></b><i></i><p><i><b> jkl </b> mno </i> pqr </p> stu</div>"
-      }
-    },
-    {
-      "data": "<test attribute---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->",
-      "errors": [
-        "(1,1040): expected-doctype-but-got-start-tag",
-        "(1,1040): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "test": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "test",
-                    "attrs": [
-                      {
-                        "name": "attribute----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------",
-                        "value": ""
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><test attribute----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------=\"\"></test></body></html>",
-        "noQuirksBodyHtml": "<test attribute----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------=\"\"></test>"
-      }
-    },
-    {
-      "data": "<a href=\"blah\">aba<table><a href=\"foo\">br<tr><td></td></tr>x</table>aoe",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "attrs": [
-                      {
-                        "name": "href",
-                        "value": "blah"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "aba"
-                      },
-                      {
-                        "tag": "a",
-                        "attrs": [
-                          {
-                            "name": "href",
-                            "value": "foo"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "text": "br"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "a",
-                        "attrs": [
-                          {
-                            "name": "href",
-                            "value": "foo"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "text": "x"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "table",
-                        "children": [
-                          {
-                            "tag": "tbody",
-                            "children": [
-                              {
-                                "tag": "tr",
-                                "children": [
-                                  {
-                                    "tag": "td"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "a",
-                    "attrs": [
-                      {
-                        "name": "href",
-                        "value": "foo"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "aoe"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a href=\"blah\">aba<a href=\"foo\">br</a><a href=\"foo\">x</a><table><tbody><tr><td></td></tr></tbody></table></a><a href=\"foo\">aoe</a></body></html>",
-        "noQuirksBodyHtml": "<a href=\"blah\">aba<a href=\"foo\">br</a><a href=\"foo\">x</a><table><tbody><tr><td></td></tr></tbody></table></a><a href=\"foo\">aoe</a>"
-      }
-    },
-    {
-      "data": "<a href=\"blah\">aba<table><tr><td><a href=\"foo\">br</td></tr>x</table>aoe",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "attrs": [
-                      {
-                        "name": "href",
-                        "value": "blah"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "abax"
-                      },
-                      {
-                        "tag": "table",
-                        "children": [
-                          {
-                            "tag": "tbody",
-                            "children": [
-                              {
-                                "tag": "tr",
-                                "children": [
-                                  {
-                                    "tag": "td",
-                                    "children": [
-                                      {
-                                        "tag": "a",
-                                        "attrs": [
-                                          {
-                                            "name": "href",
-                                            "value": "foo"
-                                          }
-                                        ],
-                                        "children": [
-                                          {
-                                            "text": "br"
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "text": "aoe"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a href=\"blah\">abax<table><tbody><tr><td><a href=\"foo\">br</a></td></tr></tbody></table>aoe</a></body></html>",
-        "noQuirksBodyHtml": "<a href=\"blah\">abax<table><tbody><tr><td><a href=\"foo\">br</a></td></tr></tbody></table>aoe</a>"
-      }
-    },
-    {
-      "data": "<table><a href=\"blah\">aba<tr><td><a href=\"foo\">br</td></tr>x</table>aoe",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "attrs": [
-                      {
-                        "name": "href",
-                        "value": "blah"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "aba"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "a",
-                    "attrs": [
-                      {
-                        "name": "href",
-                        "value": "blah"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "x"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "a",
-                                    "attrs": [
-                                      {
-                                        "name": "href",
-                                        "value": "foo"
-                                      }
-                                    ],
-                                    "children": [
-                                      {
-                                        "text": "br"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "a",
-                    "attrs": [
-                      {
-                        "name": "href",
-                        "value": "blah"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "aoe"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a href=\"blah\">aba</a><a href=\"blah\">x</a><table><tbody><tr><td><a href=\"foo\">br</a></td></tr></tbody></table><a href=\"blah\">aoe</a></body></html>",
-        "noQuirksBodyHtml": "<a href=\"blah\">aba</a><a href=\"blah\">x</a><table><tbody><tr><td><a href=\"foo\">br</a></td></tr></tbody></table><a href=\"blah\">aoe</a>"
-      }
-    },
-    {
-      "data": "<a href=a>aa<marquee>aa<a href=b>bb</marquee>aa",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag",
-        "(1,45): end-tag-too-early",
-        "(1,47): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "marquee": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "attrs": [
-                      {
-                        "name": "href",
-                        "value": "a"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "aa"
-                      },
-                      {
-                        "tag": "marquee",
-                        "children": [
-                          {
-                            "text": "aa"
-                          },
-                          {
-                            "tag": "a",
-                            "attrs": [
-                              {
-                                "name": "href",
-                                "value": "b"
-                              }
-                            ],
-                            "children": [
-                              {
-                                "text": "bb"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "text": "aa"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a href=\"a\">aa<marquee>aa<a href=\"b\">bb</a></marquee>aa</a></body></html>",
-        "noQuirksBodyHtml": "<a href=\"a\">aa<marquee>aa<a href=\"b\">bb</a></marquee>aa</a>"
-      }
-    },
-    {
-      "data": "<wbr><strike><code></strike><code><strike></code>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "wbr": true,
-            "strike": true,
-            "code": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "wbr"
-                  },
-                  {
-                    "tag": "strike",
-                    "children": [
-                      {
-                        "tag": "code"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "code",
-                    "children": [
-                      {
-                        "tag": "code",
-                        "children": [
-                          {
-                            "tag": "strike"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><wbr><strike><code></code></strike><code><code><strike></strike></code></code></body></html>",
-        "noQuirksBodyHtml": "<wbr><strike><code></code></strike><code><code><strike></strike></code></code>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><spacer>foo",
-      "errors": [
-        "(1,26): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "spacer": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "spacer",
-                    "children": [
-                      {
-                        "text": "foo"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><spacer>foo</spacer></body></html>",
-        "noQuirksBodyHtml": "<spacer>foo</spacer>"
-      }
-    },
-    {
-      "data": "<title><meta></title><link><title><meta></title>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "title": true,
-            "link": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "<meta>",
-                        "escaped": true
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "link"
-                  },
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "<meta>",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><title>&lt;meta&gt;</title><link><title>&lt;meta&gt;</title></head><body></body></html>",
-        "noQuirksBodyHtml": "<title>&lt;meta&gt;</title><link><title>&lt;meta&gt;</title>"
-      }
-    },
-    {
-      "data": "<style><!--</style><meta><script>--><link></script>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "meta": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": "<!--",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "meta"
-                  },
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "--><link>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><style><!--</style><meta><script>--><link></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<style><!--</style><meta><script>--><link></script>"
-      }
-    },
-    {
-      "data": "<head><meta></head><link>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,25): unexpected-start-tag-out-of-my-head"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "meta": true,
-            "link": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "meta"
-                  },
-                  {
-                    "tag": "link"
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><meta><link></head><body></body></html>",
-        "noQuirksBodyHtml": "<meta><link>"
-      }
-    },
-    {
-      "data": "<table><tr><tr><td><td><span><th><span>X</table>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,33): unexpected-cell-end-tag",
-        "(1,48): unexpected-cell-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "span": true,
-            "th": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          },
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td"
-                              },
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "span"
-                                  }
-                                ]
-                              },
-                              {
-                                "tag": "th",
-                                "children": [
-                                  {
-                                    "tag": "span",
-                                    "children": [
-                                      {
-                                        "text": "X"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><tr></tr><tr><td></td><td><span></span></td><th><span>X</span></th></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr></tr><tr><td></td><td><span></span></td><th><span>X</span></th></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<body><body><base><link><meta><title><p></title><body><p></body>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,12): unexpected-start-tag",
-        "(1,54): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "base": true,
-            "link": true,
-            "meta": true,
-            "title": true,
-            "p": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "base"
-                  },
-                  {
-                    "tag": "link"
-                  },
-                  {
-                    "tag": "meta"
-                  },
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "<p>",
-                        "escaped": true
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><base><link><meta><title>&lt;p&gt;</title><p></p></body></html>",
-        "noQuirksBodyHtml": "<base><link><meta><title>&lt;p&gt;</title><p></p>"
-      }
-    },
-    {
-      "data": "<textarea><p></textarea>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "textarea": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "textarea",
-                    "children": [
-                      {
-                        "text": "<p>",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><textarea>&lt;p&gt;</textarea></body></html>",
-        "noQuirksBodyHtml": "<textarea>&lt;p&gt;</textarea>"
-      }
-    },
-    {
-      "data": "<p><image></p>",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag",
-        "(1,10): unexpected-start-tag-treated-as"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "img": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "img"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><p><img></p></body></html>",
-        "noQuirksBodyHtml": "<p><img></p>"
-      }
-    },
-    {
-      "data": "<a><table><a></table><p><a><div><a>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "table": true,
-            "p": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "tag": "a"
-                      },
-                      {
-                        "tag": "table"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "a"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "a"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a><a></a><table></table></a><p><a></a></p><div><a></a></div></body></html>",
-        "noQuirksBodyHtml": "<a><a></a><table></table></a><p><a></a></p><div><a></a></div>"
-      }
-    },
-    {
-      "data": "<head></p><meta><p>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,10): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "meta": true,
-            "body": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "meta"
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><meta></head><body><p></p></body></html>",
-        "noQuirksBodyHtml": "<p></p><meta><p></p>"
-      }
-    },
-    {
-      "data": "<head></html><meta><p>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,19): expected-eof-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "meta": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "meta"
-                  },
-                  {
-                    "tag": "p"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><meta><p></p></body></html>",
-        "noQuirksBodyHtml": "<meta><p></p>"
-      }
-    },
-    {
-      "data": "<b><table><td><i></table>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "i": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "table",
-                        "children": [
-                          {
-                            "tag": "tbody",
-                            "children": [
-                              {
-                                "tag": "tr",
-                                "children": [
-                                  {
-                                    "tag": "td",
-                                    "children": [
-                                      {
-                                        "tag": "i"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b><table><tbody><tr><td><i></i></td></tr></tbody></table></b></body></html>",
-        "noQuirksBodyHtml": "<b><table><tbody><tr><td><i></i></td></tr></tbody></table></b>"
-      }
-    },
-    {
-      "data": "<b><table><td></b><i></table>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "i": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "table",
-                        "children": [
-                          {
-                            "tag": "tbody",
-                            "children": [
-                              {
-                                "tag": "tr",
-                                "children": [
-                                  {
-                                    "tag": "td",
-                                    "children": [
-                                      {
-                                        "tag": "i"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b><table><tbody><tr><td><i></i></td></tr></tbody></table></b></body></html>",
-        "noQuirksBodyHtml": "<b><table><tbody><tr><td><i></i></td></tr></tbody></table></b>"
-      }
-    },
-    {
-      "data": "<h1><h2>",
-      "errors": [
-        "(1,4): expected-doctype-but-got-start-tag",
-        "(1,8): unexpected-start-tag",
-        "(1,8): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "h1": true,
-            "h2": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "h1"
-                  },
-                  {
-                    "tag": "h2"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><h1></h1><h2></h2></body></html>",
-        "noQuirksBodyHtml": "<h1></h1><h2></h2>"
-      }
-    },
-    {
-      "data": "<a><p><a></a></p></a>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a"
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "a"
-                      },
-                      {
-                        "tag": "a"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a></a><p><a></a><a></a></p></body></html>",
-        "noQuirksBodyHtml": "<a></a><p><a></a><a></a></p>"
-      }
-    },
-    {
-      "data": "<b><button></b></button></b>",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag",
-        "(1,15): adoption-agency-1.3",
-        "(1,28): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "button": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b"
-                  },
-                  {
-                    "tag": "button",
-                    "children": [
-                      {
-                        "tag": "b"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b></b><button><b></b></button></body></html>",
-        "noQuirksBodyHtml": "<b></b><button><b></b></button>"
-      }
-    },
-    {
-      "data": "<p><b><div><marquee></p></b></div>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "b": true,
-            "div": true,
-            "marquee": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "b"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "tag": "marquee",
-                            "children": [
-                              {
-                                "tag": "p"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><p><b></b></p><div><b><marquee><p></p></marquee></b></div></body></html>",
-        "noQuirksBodyHtml": "<p><b></b></p><div><b><marquee><p></p></marquee></b></div>"
-      }
-    },
-    {
-      "data": "<script></script></div><title></title><p><p>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,23): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "title": true,
-            "body": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script"
-                  },
-                  {
-                    "tag": "title"
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p"
-                  },
-                  {
-                    "tag": "p"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script></script><title></title></head><body><p></p><p></p></body></html>",
-        "noQuirksBodyHtml": "<script></script><title></title><p></p><p></p>"
-      }
-    },
-    {
-      "data": "<p><hr></p>",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag",
-        "(1,11): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "hr": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p"
-                  },
-                  {
-                    "tag": "hr"
-                  },
-                  {
-                    "tag": "p"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><p></p><hr><p></p></body></html>",
-        "noQuirksBodyHtml": "<p></p><hr><p></p>"
-      }
-    },
-    {
-      "data": "<select><b><option><select><option></b></select>",
-      "errors": [
-        "(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"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "option": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "option"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "option"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><select><option></option></select><option></option></body></html>",
-        "noQuirksBodyHtml": "<select><option></option></select><option></option>"
-      }
-    },
-    {
-      "data": "<html><head><title></title><body></body></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "title": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "title"
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><title></title></head><body></body></html>",
-        "noQuirksBodyHtml": "<title></title>"
-      }
-    },
-    {
-      "data": "<a><table><td><a><table></table><a></tr><a></table><a>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "tag": "a"
-                      },
-                      {
-                        "tag": "table",
-                        "children": [
-                          {
-                            "tag": "tbody",
-                            "children": [
-                              {
-                                "tag": "tr",
-                                "children": [
-                                  {
-                                    "tag": "td",
-                                    "children": [
-                                      {
-                                        "tag": "a",
-                                        "children": [
-                                          {
-                                            "tag": "table"
-                                          }
-                                        ]
-                                      },
-                                      {
-                                        "tag": "a"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "a"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a><a></a><table><tbody><tr><td><a><table></table></a><a></a></td></tr></tbody></table></a><a></a></body></html>",
-        "noQuirksBodyHtml": "<a><a></a><table><tbody><tr><td><a><table></table></a><a></a></td></tr></tbody></table></a><a></a>"
-      }
-    },
-    {
-      "data": "<ul><li></li><div><li></div><li><li><div><li><address><li><b><em></b><li></ul>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ul": true,
-            "li": true,
-            "div": true,
-            "address": true,
-            "b": true,
-            "em": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ul",
-                    "children": [
-                      {
-                        "tag": "li"
-                      },
-                      {
-                        "tag": "div",
-                        "children": [
-                          {
-                            "tag": "li"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "li"
-                      },
-                      {
-                        "tag": "li",
-                        "children": [
-                          {
-                            "tag": "div"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "li",
-                        "children": [
-                          {
-                            "tag": "address"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "li",
-                        "children": [
-                          {
-                            "tag": "b",
-                            "children": [
-                              {
-                                "tag": "em"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "li"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ul><li></li><div><li></li></div><li></li><li><div></div></li><li><address></address></li><li><b><em></em></b></li><li></li></ul></body></html>",
-        "noQuirksBodyHtml": "<ul><li></li><div><li></li></div><li></li><li><div></div></li><li><address></address></li><li><b><em></em></b></li><li></li></ul>"
-      }
-    },
-    {
-      "data": "<ul><li><ul></li><li>a</li></ul></li></ul>",
-      "errors": [
-        "(1,4): expected-doctype-but-got-start-tag",
-        "(1,17): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ul": true,
-            "li": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ul",
-                    "children": [
-                      {
-                        "tag": "li",
-                        "children": [
-                          {
-                            "tag": "ul",
-                            "children": [
-                              {
-                                "tag": "li",
-                                "children": [
-                                  {
-                                    "text": "a"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ul><li><ul><li>a</li></ul></li></ul></body></html>",
-        "noQuirksBodyHtml": "<ul><li><ul><li>a</li></ul></li></ul>"
-      }
-    },
-    {
-      "data": "<frameset><frame><frameset><frame></frameset><noframes></noframes></frameset>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true,
-            "frame": true,
-            "noframes": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset",
-                "children": [
-                  {
-                    "tag": "frame"
-                  },
-                  {
-                    "tag": "frameset",
-                    "children": [
-                      {
-                        "tag": "frame"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "noframes"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset><frame><frameset><frame></frameset><noframes></noframes></frameset></html>",
-        "noQuirksBodyHtml": "<noframes></noframes>"
-      }
-    },
-    {
-      "data": "<h1><table><td><h3></table><h3></h1>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "h1": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "h3": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "h1",
-                    "children": [
-                      {
-                        "tag": "table",
-                        "children": [
-                          {
-                            "tag": "tbody",
-                            "children": [
-                              {
-                                "tag": "tr",
-                                "children": [
-                                  {
-                                    "tag": "td",
-                                    "children": [
-                                      {
-                                        "tag": "h3"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "h3"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><h1><table><tbody><tr><td><h3></h3></td></tr></tbody></table></h1><h3></h3></body></html>",
-        "noQuirksBodyHtml": "<h1><table><tbody><tr><td><h3></h3></td></tr></tbody></table></h1><h3></h3>"
-      }
-    },
-    {
-      "data": "<table><colgroup><col><colgroup><col><col><col><colgroup><col><col><thead><tr><td></table>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "colgroup": true,
-            "col": true,
-            "thead": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "colgroup",
-                        "children": [
-                          {
-                            "tag": "col"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "colgroup",
-                        "children": [
-                          {
-                            "tag": "col"
-                          },
-                          {
-                            "tag": "col"
-                          },
-                          {
-                            "tag": "col"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "colgroup",
-                        "children": [
-                          {
-                            "tag": "col"
-                          },
-                          {
-                            "tag": "col"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "thead",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><colgroup><col></colgroup><colgroup><col><col><col></colgroup><colgroup><col><col></colgroup><thead><tr><td></td></tr></thead></table></body></html>",
-        "noQuirksBodyHtml": "<table><colgroup><col></colgroup><colgroup><col><col><col></colgroup><colgroup><col><col></colgroup><thead><tr><td></td></tr></thead></table>"
-      }
-    },
-    {
-      "data": "<table><col><tbody><col><tr><col><td><col></table><col>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,37): unexpected-cell-in-table-body",
-        "(1,55): unexpected-start-tag-ignored"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "colgroup": true,
-            "col": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "colgroup",
-                        "children": [
-                          {
-                            "tag": "col"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "tbody"
-                      },
-                      {
-                        "tag": "colgroup",
-                        "children": [
-                          {
-                            "tag": "col"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "colgroup",
-                        "children": [
-                          {
-                            "tag": "col"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "colgroup",
-                        "children": [
-                          {
-                            "tag": "col"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><colgroup><col></colgroup><tbody></tbody><colgroup><col></colgroup><tbody><tr></tr></tbody><colgroup><col></colgroup><tbody><tr><td></td></tr></tbody><colgroup><col></colgroup></table></body></html>",
-        "noQuirksBodyHtml": "<table><colgroup><col></colgroup><tbody></tbody><colgroup><col></colgroup><tbody><tr></tr></tbody><colgroup><col></colgroup><tbody><tr><td></td></tr></tbody><colgroup><col></colgroup></table>"
-      }
-    },
-    {
-      "data": "<table><colgroup><tbody><colgroup><tr><colgroup><td><colgroup></table><colgroup>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,52): unexpected-cell-in-table-body",
-        "(1,80): unexpected-start-tag-ignored"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "colgroup": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "colgroup"
-                      },
-                      {
-                        "tag": "tbody"
-                      },
-                      {
-                        "tag": "colgroup"
-                      },
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "colgroup"
-                      },
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "colgroup"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><colgroup></colgroup><tbody></tbody><colgroup></colgroup><tbody><tr></tr></tbody><colgroup></colgroup><tbody><tr><td></td></tr></tbody><colgroup></colgroup></table></body></html>",
-        "noQuirksBodyHtml": "<table><colgroup></colgroup><tbody></tbody><colgroup></colgroup><tbody><tr></tr></tbody><colgroup></colgroup><tbody><tr><td></td></tr></tbody><colgroup></colgroup></table>"
-      }
-    },
-    {
-      "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": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "br": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "br"
-                  },
-                  {
-                    "tag": "p"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><br><p></p></body></html>",
-        "noQuirksBodyHtml": "<br><p></p>"
-      }
-    },
-    {
-      "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": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "br": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "br"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><br><table><tbody><tr></tr></tbody></table><p></p></body></html>",
-        "noQuirksBodyHtml": "<br><table><tbody><tr></tr></tbody></table><p></p>"
-      }
-    },
-    {
-      "data": "<frameset>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag",
-        "(1,10): eof-in-frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": ""
-      }
-    }
-  ],
-  "tests10.dat": [
-    {
-      "data": "<!DOCTYPE html><svg></svg>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg></svg></body></html>",
-        "noQuirksBodyHtml": "<svg></svg>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><svg></svg><![CDATA[a]]>",
-      "errors": [
-        "(1,28) expected-dashes-or-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "doctype": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg"
-                  },
-                  {
-                    "comment": "[CDATA[a]]"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg></svg><!--[CDATA[a]]--></body></html>",
-        "noQuirksBodyHtml": "<svg></svg><!--[CDATA[a]]-->"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><svg></svg>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg></svg></body></html>",
-        "noQuirksBodyHtml": "<svg></svg>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><select><svg></svg></select>",
-      "errors": [
-        "(1,34) unexpected-start-tag-in-select",
-        "(1,40) unexpected-end-tag-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select></select></body></html>",
-        "noQuirksBodyHtml": "<select></select>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><select><option><svg></svg></option></select>",
-      "errors": [
-        "(1,42) unexpected-start-tag-in-select",
-        "(1,48) unexpected-end-tag-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "option": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "option"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select><option></option></select></body></html>",
-        "noQuirksBodyHtml": "<select><option></option></select>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><svg></svg></table>",
-      "errors": [
-        "(1,33) foster-parenting-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg"
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg></svg><table></table></body></html>",
-        "noQuirksBodyHtml": "<svg></svg><table></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><svg><g>foo</g></svg></table>",
-      "errors": [
-        "(1,33) foster-parenting-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg g": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "g",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "text": "foo"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg><g>foo</g></svg><table></table></body></html>",
-        "noQuirksBodyHtml": "<svg><g>foo</g></svg><table></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><svg><g>foo</g><g>bar</g></svg></table>",
-      "errors": [
-        "(1,33) foster-parenting-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg g": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "g",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "text": "foo"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "g",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "text": "bar"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg><g>foo</g><g>bar</g></svg><table></table></body></html>",
-        "noQuirksBodyHtml": "<svg><g>foo</g><g>bar</g></svg><table></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><tbody><svg><g>foo</g><g>bar</g></svg></tbody></table>",
-      "errors": [
-        "(1,40) foster-parenting-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg g": true,
-            "table": true,
-            "tbody": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "g",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "text": "foo"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "g",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "text": "bar"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg><g>foo</g><g>bar</g></svg><table><tbody></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<svg><g>foo</g><g>bar</g></svg><table><tbody></tbody></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><tbody><tr><svg><g>foo</g><g>bar</g></svg></tr></tbody></table>",
-      "errors": [
-        "(1,44) foster-parenting-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg g": true,
-            "table": true,
-            "tbody": true,
-            "tr": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "g",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "text": "foo"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "g",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "text": "bar"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg><g>foo</g><g>bar</g></svg><table><tbody><tr></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<svg><g>foo</g><g>bar</g></svg><table><tbody><tr></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><tbody><tr><td><svg><g>foo</g><g>bar</g></svg></td></tr></tbody></table>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "svg svg": true,
-            "svg g": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "svg",
-                                    "ns": "http://www.w3.org/2000/svg",
-                                    "children": [
-                                      {
-                                        "tag": "g",
-                                        "ns": "http://www.w3.org/2000/svg",
-                                        "children": [
-                                          {
-                                            "text": "foo"
-                                          }
-                                        ]
-                                      },
-                                      {
-                                        "tag": "g",
-                                        "ns": "http://www.w3.org/2000/svg",
-                                        "children": [
-                                          {
-                                            "text": "bar"
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><svg><g>foo</g><g>bar</g></svg></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><svg><g>foo</g><g>bar</g></svg></td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><tbody><tr><td><svg><g>foo</g><g>bar</g></svg><p>baz</td></tr></tbody></table>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "svg svg": true,
-            "svg g": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "svg",
-                                    "ns": "http://www.w3.org/2000/svg",
-                                    "children": [
-                                      {
-                                        "tag": "g",
-                                        "ns": "http://www.w3.org/2000/svg",
-                                        "children": [
-                                          {
-                                            "text": "foo"
-                                          }
-                                        ]
-                                      },
-                                      {
-                                        "tag": "g",
-                                        "ns": "http://www.w3.org/2000/svg",
-                                        "children": [
-                                          {
-                                            "text": "bar"
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  },
-                                  {
-                                    "tag": "p",
-                                    "children": [
-                                      {
-                                        "text": "baz"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><svg><g>foo</g><g>bar</g></svg><p>baz</p></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><svg><g>foo</g><g>bar</g></svg><p>baz</p></td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><caption><svg><g>foo</g><g>bar</g></svg><p>baz</caption></table>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "caption": true,
-            "svg svg": true,
-            "svg g": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "caption",
-                        "children": [
-                          {
-                            "tag": "svg",
-                            "ns": "http://www.w3.org/2000/svg",
-                            "children": [
-                              {
-                                "tag": "g",
-                                "ns": "http://www.w3.org/2000/svg",
-                                "children": [
-                                  {
-                                    "text": "foo"
-                                  }
-                                ]
-                              },
-                              {
-                                "tag": "g",
-                                "ns": "http://www.w3.org/2000/svg",
-                                "children": [
-                                  {
-                                    "text": "bar"
-                                  }
-                                ]
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "p",
-                            "children": [
-                              {
-                                "text": "baz"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><caption><svg><g>foo</g><g>bar</g></svg><p>baz</p></caption></table></body></html>",
-        "noQuirksBodyHtml": "<table><caption><svg><g>foo</g><g>bar</g></svg><p>baz</p></caption></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><caption><svg><g>foo</g><g>bar</g><p>baz</table><p>quux",
-      "errors": [
-        "(1,65) unexpected-html-element-in-foreign-content"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "caption": true,
-            "svg svg": true,
-            "svg g": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "caption",
-                        "children": [
-                          {
-                            "tag": "svg",
-                            "ns": "http://www.w3.org/2000/svg",
-                            "children": [
-                              {
-                                "tag": "g",
-                                "ns": "http://www.w3.org/2000/svg",
-                                "children": [
-                                  {
-                                    "text": "foo"
-                                  }
-                                ]
-                              },
-                              {
-                                "tag": "g",
-                                "ns": "http://www.w3.org/2000/svg",
-                                "children": [
-                                  {
-                                    "text": "bar"
-                                  }
-                                ]
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "p",
-                            "children": [
-                              {
-                                "text": "baz"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "quux"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><caption><svg><g>foo</g><g>bar</g></svg><p>baz</p></caption></table><p>quux</p></body></html>",
-        "noQuirksBodyHtml": "<table><caption><svg><g>foo</g><g>bar</g><p>baz</p></svg></caption></table><p>quux</p>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><caption><svg><g>foo</g><g>bar</g>baz</table><p>quux",
-      "errors": [
-        "(1,73) unexpected-end-tag",
-        "(1,73) expected-one-end-tag-but-got-another"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "caption": true,
-            "svg svg": true,
-            "svg g": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "caption",
-                        "children": [
-                          {
-                            "tag": "svg",
-                            "ns": "http://www.w3.org/2000/svg",
-                            "children": [
-                              {
-                                "tag": "g",
-                                "ns": "http://www.w3.org/2000/svg",
-                                "children": [
-                                  {
-                                    "text": "foo"
-                                  }
-                                ]
-                              },
-                              {
-                                "tag": "g",
-                                "ns": "http://www.w3.org/2000/svg",
-                                "children": [
-                                  {
-                                    "text": "bar"
-                                  }
-                                ]
-                              },
-                              {
-                                "text": "baz"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "quux"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><caption><svg><g>foo</g><g>bar</g>baz</svg></caption></table><p>quux</p></body></html>",
-        "noQuirksBodyHtml": "<table><caption><svg><g>foo</g><g>bar</g>baz</svg></caption></table><p>quux</p>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><colgroup><svg><g>foo</g><g>bar</g><p>baz</table><p>quux",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg g": true,
-            "p": true,
-            "table": true,
-            "colgroup": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "g",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "text": "foo"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "g",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "text": "bar"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "baz"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "colgroup"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "quux"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg><g>foo</g><g>bar</g></svg><p>baz</p><table><colgroup></colgroup></table><p>quux</p></body></html>",
-        "noQuirksBodyHtml": "<svg><g>foo</g><g>bar</g><p>baz</p></svg><table><colgroup></colgroup></table><p>quux</p>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><tr><td><select><svg><g>foo</g><g>bar</g><p>baz</table><p>quux",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "select": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "select",
-                                    "children": [
-                                      {
-                                        "text": "foobarbaz"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "quux"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><select>foobarbaz</select></td></tr></tbody></table><p>quux</p></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><select>foobarbaz</select></td></tr></tbody></table><p>quux</p>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><select><svg><g>foo</g><g>bar</g><p>baz</table><p>quux",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "table": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "text": "foobarbaz"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table"
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "quux"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select>foobarbaz</select><table></table><p>quux</p></body></html>",
-        "noQuirksBodyHtml": "<select>foobarbaz</select><table></table><p>quux</p>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body></body></html><svg><g>foo</g><g>bar</g><p>baz",
-      "errors": [
-        "(1,40) expected-eof-but-got-start-tag",
-        "(1,63) unexpected-html-element-in-foreign-content"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg g": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "g",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "text": "foo"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "g",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "text": "bar"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "baz"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg><g>foo</g><g>bar</g></svg><p>baz</p></body></html>",
-        "noQuirksBodyHtml": "<svg><g>foo</g><g>bar</g><p>baz</p></svg>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body></body><svg><g>foo</g><g>bar</g><p>baz",
-      "errors": [
-        "(1,33) unexpected-start-tag-after-body",
-        "(1,56) unexpected-html-element-in-foreign-content"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg g": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "g",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "text": "foo"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "g",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "text": "bar"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "baz"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg><g>foo</g><g>bar</g></svg><p>baz</p></body></html>",
-        "noQuirksBodyHtml": "<svg><g>foo</g><g>bar</g><p>baz</p></svg>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><frameset><svg><g></g><g></g><p><span>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "<svg><g></g><g></g><p><span></span></p></svg>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><frameset></frameset><svg><g></g><g></g><p><span>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "<svg><g></g><g></g><p><span></span></p></svg>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body xlink:href=foo><svg xlink:href=foo></svg>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "attrs": [
-                  {
-                    "name": "xlink:href",
-                    "value": "foo"
-                  }
-                ],
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "attrs": [
-                      {
-                        "name": "href",
-                        "ns": "http://www.w3.org/1999/xlink",
-                        "value": "foo"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body xlink:href=\"foo\"><svg xlink:href=\"foo\"></svg></body></html>",
-        "noQuirksBodyHtml": "<svg xlink:href=\"foo\"></svg>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body xlink:href=foo xml:lang=en><svg><g xml:lang=en xlink:href=foo></g></svg>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg g": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "attrs": [
-                  {
-                    "name": "xlink:href",
-                    "value": "foo"
-                  },
-                  {
-                    "name": "xml:lang",
-                    "value": "en"
-                  }
-                ],
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "g",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "attrs": [
-                          {
-                            "name": "href",
-                            "ns": "http://www.w3.org/1999/xlink",
-                            "value": "foo"
-                          },
-                          {
-                            "name": "lang",
-                            "ns": "http://www.w3.org/XML/1998/namespace",
-                            "value": "en"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body xlink:href=\"foo\" xml:lang=\"en\"><svg><g xml:lang=\"en\" xlink:href=\"foo\"></g></svg></body></html>",
-        "noQuirksBodyHtml": "<svg><g xml:lang=\"en\" xlink:href=\"foo\"></g></svg>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body xlink:href=foo xml:lang=en><svg><g xml:lang=en xlink:href=foo /></svg>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg g": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "attrs": [
-                  {
-                    "name": "xlink:href",
-                    "value": "foo"
-                  },
-                  {
-                    "name": "xml:lang",
-                    "value": "en"
-                  }
-                ],
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "g",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "attrs": [
-                          {
-                            "name": "href",
-                            "ns": "http://www.w3.org/1999/xlink",
-                            "value": "foo"
-                          },
-                          {
-                            "name": "lang",
-                            "ns": "http://www.w3.org/XML/1998/namespace",
-                            "value": "en"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body xlink:href=\"foo\" xml:lang=\"en\"><svg><g xml:lang=\"en\" xlink:href=\"foo\"></g></svg></body></html>",
-        "noQuirksBodyHtml": "<svg><g xml:lang=\"en\" xlink:href=\"foo\"></g></svg>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body xlink:href=foo xml:lang=en><svg><g xml:lang=en xlink:href=foo />bar</svg>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg g": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "attrs": [
-                  {
-                    "name": "xlink:href",
-                    "value": "foo"
-                  },
-                  {
-                    "name": "xml:lang",
-                    "value": "en"
-                  }
-                ],
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "g",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "attrs": [
-                          {
-                            "name": "href",
-                            "ns": "http://www.w3.org/1999/xlink",
-                            "value": "foo"
-                          },
-                          {
-                            "name": "lang",
-                            "ns": "http://www.w3.org/XML/1998/namespace",
-                            "value": "en"
-                          }
-                        ]
-                      },
-                      {
-                        "text": "bar"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body xlink:href=\"foo\" xml:lang=\"en\"><svg><g xml:lang=\"en\" xlink:href=\"foo\"></g>bar</svg></body></html>",
-        "noQuirksBodyHtml": "<svg><g xml:lang=\"en\" xlink:href=\"foo\"></g>bar</svg>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg></svg></body></html>",
-        "noQuirksBodyHtml": "<svg></svg>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "svg svg": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "svg",
-                        "ns": "http://www.w3.org/2000/svg"
-                      }
-                    ]
-                  },
-                  {
-                    "text": "a"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div><svg></svg></div>a</body></html>",
-        "noQuirksBodyHtml": "<div><svg></svg></div>a"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "svg svg": true,
-            "svg path": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "svg",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "tag": "path",
-                            "ns": "http://www.w3.org/2000/svg"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "text": "a"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div><svg><path></path></svg></div>a</body></html>",
-        "noQuirksBodyHtml": "<div><svg><path></path></svg></div>a"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "svg svg": true,
-            "svg path": true,
-            "path": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "svg",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "tag": "path",
-                            "ns": "http://www.w3.org/2000/svg"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "path"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div><svg><path></path></svg><path></path></div></body></html>",
-        "noQuirksBodyHtml": "<div><svg><path></path></svg><path></path></div>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "svg svg": true,
-            "svg path": true,
-            "svg foreignObject": true,
-            "math math": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "svg",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "tag": "path",
-                            "ns": "http://www.w3.org/2000/svg",
-                            "children": [
-                              {
-                                "tag": "foreignObject",
-                                "ns": "http://www.w3.org/2000/svg",
-                                "children": [
-                                  {
-                                    "tag": "math",
-                                    "ns": "http://www.w3.org/1998/Math/MathML",
-                                    "children": [
-                                      {
-                                        "text": "a"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div><svg><path><foreignObject><math>a</math></foreignObject></path></svg></div></body></html>",
-        "noQuirksBodyHtml": "<div><svg><path><foreignObject><math>a</math></foreignObject></path></svg></div>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "svg svg": true,
-            "svg path": true,
-            "svg foreignObject": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "svg",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "tag": "path",
-                            "ns": "http://www.w3.org/2000/svg",
-                            "children": [
-                              {
-                                "tag": "foreignObject",
-                                "ns": "http://www.w3.org/2000/svg",
-                                "children": [
-                                  {
-                                    "tag": "p",
-                                    "children": [
-                                      {
-                                        "text": "a"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div><svg><path><foreignObject><p>a</p></foreignObject></path></svg></div></body></html>",
-        "noQuirksBodyHtml": "<div><svg><path><foreignObject><p>a</p></foreignObject></path></svg></div>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><svg><desc><div><svg><ul>a",
-      "errors": [
-        "(1,40) unexpected-html-element-in-foreign-content",
-        "(1,41) expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg desc": true,
-            "div": true,
-            "ul": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "desc",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "tag": "div",
-                            "children": [
-                              {
-                                "tag": "svg",
-                                "ns": "http://www.w3.org/2000/svg"
-                              },
-                              {
-                                "tag": "ul",
-                                "children": [
-                                  {
-                                    "text": "a"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg><desc><div><svg></svg><ul>a</ul></div></desc></svg></body></html>",
-        "noQuirksBodyHtml": "<svg><desc><div><svg><ul>a</ul></svg></div></desc></svg>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><svg><desc><svg><ul>a",
-      "errors": [
-        "(1,35) unexpected-html-element-in-foreign-content",
-        "(1,36) expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg desc": true,
-            "ul": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "desc",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "tag": "svg",
-                            "ns": "http://www.w3.org/2000/svg"
-                          },
-                          {
-                            "tag": "ul",
-                            "children": [
-                              {
-                                "text": "a"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg><desc><svg></svg><ul>a</ul></desc></svg></body></html>",
-        "noQuirksBodyHtml": "<svg><desc><svg><ul>a</ul></svg></desc></svg>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><p><svg><desc><p>",
-      "errors": [
-        "(1,32) expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "svg svg": true,
-            "svg desc": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "svg",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "tag": "desc",
-                            "ns": "http://www.w3.org/2000/svg",
-                            "children": [
-                              {
-                                "tag": "p"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><svg><desc><p></p></desc></svg></p></body></html>",
-        "noQuirksBodyHtml": "<p><svg><desc><p></p></desc></svg></p>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><p><svg><title><p>",
-      "errors": [
-        "(1,33) expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "svg svg": true,
-            "svg title": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "svg",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "tag": "title",
-                            "ns": "http://www.w3.org/2000/svg",
-                            "children": [
-                              {
-                                "tag": "p"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><svg><title><p></p></title></svg></p></body></html>",
-        "noQuirksBodyHtml": "<p><svg><title><p></p></title></svg></p>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "svg svg": true,
-            "svg path": true,
-            "svg foreignObject": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "svg",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "tag": "path",
-                            "ns": "http://www.w3.org/2000/svg",
-                            "children": [
-                              {
-                                "tag": "foreignObject",
-                                "ns": "http://www.w3.org/2000/svg",
-                                "children": [
-                                  {
-                                    "tag": "p"
-                                  },
-                                  {
-                                    "tag": "p"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div><svg><path><foreignObject><p></p><p></p></foreignObject></path></svg></div></body></html>",
-        "noQuirksBodyHtml": "<div><svg><path><foreignObject><p></p><p></p></foreignObject></path></svg></div>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mi": true,
-            "div": true,
-            "object": true,
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "div",
-                            "children": [
-                              {
-                                "tag": "object",
-                                "children": [
-                                  {
-                                    "tag": "div",
-                                    "children": [
-                                      {
-                                        "tag": "span"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><mi><div><object><div><span></span></div></object></div></mi><mi></mi></math></body></html>",
-        "noQuirksBodyHtml": "<math><mi><div><object><div><span></span></div></object></div></mi><mi></mi></math>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mi": true,
-            "svg svg": true,
-            "svg foreignObject": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "svg",
-                            "ns": "http://www.w3.org/2000/svg",
-                            "children": [
-                              {
-                                "tag": "foreignObject",
-                                "ns": "http://www.w3.org/2000/svg",
-                                "children": [
-                                  {
-                                    "tag": "div",
-                                    "children": [
-                                      {
-                                        "tag": "div"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><mi><svg><foreignObject><div><div></div></div></foreignObject></svg></mi><mi></mi></math></body></html>",
-        "noQuirksBodyHtml": "<math><mi><svg><foreignObject><div><div></div></div></foreignObject></svg></mi><mi></mi></math>"
-      }
-    },
-    {
-      "data": "<svg><script></script><path>",
-      "errors": [
-        "(1,5) expected-doctype-but-got-start-tag",
-        "(1,28) expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg script": true,
-            "svg path": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "script",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "path",
-                        "ns": "http://www.w3.org/2000/svg"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg><script></script><path></path></svg></body></html>",
-        "noQuirksBodyHtml": "<svg><script></script><path></path></svg>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "table": true,
-            "tbody": true,
-            "tr": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg></svg><table><tbody><tr></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<svg></svg><table><tbody><tr></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<math><mi><mglyph>",
-      "errors": [
-        "(1,6) expected-doctype-but-got-start-tag",
-        "(1,18) expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mi": true,
-            "math mglyph": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "mglyph",
-                            "ns": "http://www.w3.org/1998/Math/MathML"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><mi><mglyph></mglyph></mi></math></body></html>",
-        "noQuirksBodyHtml": "<math><mi><mglyph></mglyph></mi></math>"
-      }
-    },
-    {
-      "data": "<math><mi><malignmark>",
-      "errors": [
-        "(1,6) expected-doctype-but-got-start-tag",
-        "(1,22) expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mi": true,
-            "math malignmark": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "malignmark",
-                            "ns": "http://www.w3.org/1998/Math/MathML"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><mi><malignmark></malignmark></mi></math></body></html>",
-        "noQuirksBodyHtml": "<math><mi><malignmark></malignmark></mi></math>"
-      }
-    },
-    {
-      "data": "<math><mo><mglyph>",
-      "errors": [
-        "(1,6) expected-doctype-but-got-start-tag",
-        "(1,18) expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mo": true,
-            "math mglyph": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mo",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "mglyph",
-                            "ns": "http://www.w3.org/1998/Math/MathML"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><mo><mglyph></mglyph></mo></math></body></html>",
-        "noQuirksBodyHtml": "<math><mo><mglyph></mglyph></mo></math>"
-      }
-    },
-    {
-      "data": "<math><mo><malignmark>",
-      "errors": [
-        "(1,6) expected-doctype-but-got-start-tag",
-        "(1,22) expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mo": true,
-            "math malignmark": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mo",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "malignmark",
-                            "ns": "http://www.w3.org/1998/Math/MathML"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><mo><malignmark></malignmark></mo></math></body></html>",
-        "noQuirksBodyHtml": "<math><mo><malignmark></malignmark></mo></math>"
-      }
-    },
-    {
-      "data": "<math><mn><mglyph>",
-      "errors": [
-        "(1,6) expected-doctype-but-got-start-tag",
-        "(1,18) expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mn": true,
-            "math mglyph": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mn",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "mglyph",
-                            "ns": "http://www.w3.org/1998/Math/MathML"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><mn><mglyph></mglyph></mn></math></body></html>",
-        "noQuirksBodyHtml": "<math><mn><mglyph></mglyph></mn></math>"
-      }
-    },
-    {
-      "data": "<math><mn><malignmark>",
-      "errors": [
-        "(1,6) expected-doctype-but-got-start-tag",
-        "(1,22) expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mn": true,
-            "math malignmark": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mn",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "malignmark",
-                            "ns": "http://www.w3.org/1998/Math/MathML"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><mn><malignmark></malignmark></mn></math></body></html>",
-        "noQuirksBodyHtml": "<math><mn><malignmark></malignmark></mn></math>"
-      }
-    },
-    {
-      "data": "<math><ms><mglyph>",
-      "errors": [
-        "(1,6) expected-doctype-but-got-start-tag",
-        "(1,18) expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math ms": true,
-            "math mglyph": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "ms",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "mglyph",
-                            "ns": "http://www.w3.org/1998/Math/MathML"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><ms><mglyph></mglyph></ms></math></body></html>",
-        "noQuirksBodyHtml": "<math><ms><mglyph></mglyph></ms></math>"
-      }
-    },
-    {
-      "data": "<math><ms><malignmark>",
-      "errors": [
-        "(1,6) expected-doctype-but-got-start-tag",
-        "(1,22) expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math ms": true,
-            "math malignmark": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "ms",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "malignmark",
-                            "ns": "http://www.w3.org/1998/Math/MathML"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><ms><malignmark></malignmark></ms></math></body></html>",
-        "noQuirksBodyHtml": "<math><ms><malignmark></malignmark></ms></math>"
-      }
-    },
-    {
-      "data": "<math><mtext><mglyph>",
-      "errors": [
-        "(1,6) expected-doctype-but-got-start-tag",
-        "(1,21) expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mtext": true,
-            "math mglyph": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mtext",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "mglyph",
-                            "ns": "http://www.w3.org/1998/Math/MathML"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><mtext><mglyph></mglyph></mtext></math></body></html>",
-        "noQuirksBodyHtml": "<math><mtext><mglyph></mglyph></mtext></math>"
-      }
-    },
-    {
-      "data": "<math><mtext><malignmark>",
-      "errors": [
-        "(1,6) expected-doctype-but-got-start-tag",
-        "(1,25) expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mtext": true,
-            "math malignmark": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mtext",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "malignmark",
-                            "ns": "http://www.w3.org/1998/Math/MathML"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><mtext><malignmark></malignmark></mtext></math></body></html>",
-        "noQuirksBodyHtml": "<math><mtext><malignmark></malignmark></mtext></math>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math annotation-xml": true,
-            "svg svg": true,
-            "math mi": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "annotation-xml",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "svg",
-                            "ns": "http://www.w3.org/2000/svg"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><annotation-xml><svg></svg></annotation-xml><mi></mi></math></body></html>",
-        "noQuirksBodyHtml": "<math><annotation-xml><svg></svg></annotation-xml><mi></mi></math>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math annotation-xml": true,
-            "svg svg": true,
-            "svg foreignObject": true,
-            "div": true,
-            "math mi": true,
-            "span": true,
-            "svg path": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "annotation-xml",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "svg",
-                            "ns": "http://www.w3.org/2000/svg",
-                            "children": [
-                              {
-                                "tag": "foreignObject",
-                                "ns": "http://www.w3.org/2000/svg",
-                                "children": [
-                                  {
-                                    "tag": "div",
-                                    "children": [
-                                      {
-                                        "tag": "math",
-                                        "ns": "http://www.w3.org/1998/Math/MathML",
-                                        "children": [
-                                          {
-                                            "tag": "mi",
-                                            "ns": "http://www.w3.org/1998/Math/MathML"
-                                          }
-                                        ]
-                                      },
-                                      {
-                                        "tag": "span"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              },
-                              {
-                                "tag": "path",
-                                "ns": "http://www.w3.org/2000/svg"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><annotation-xml><svg><foreignObject><div><math><mi></mi></math><span></span></div></foreignObject><path></path></svg></annotation-xml><mi></mi></math></body></html>",
-        "noQuirksBodyHtml": "<math><annotation-xml><svg><foreignObject><div><math><mi></mi></math><span></span></div></foreignObject><path></path></svg></annotation-xml><mi></mi></math>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math annotation-xml": true,
-            "svg svg": true,
-            "svg foreignObject": true,
-            "math mi": true,
-            "math mo": true,
-            "span": true,
-            "svg path": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "annotation-xml",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "svg",
-                            "ns": "http://www.w3.org/2000/svg",
-                            "children": [
-                              {
-                                "tag": "foreignObject",
-                                "ns": "http://www.w3.org/2000/svg",
-                                "children": [
-                                  {
-                                    "tag": "math",
-                                    "ns": "http://www.w3.org/1998/Math/MathML",
-                                    "children": [
-                                      {
-                                        "tag": "mi",
-                                        "ns": "http://www.w3.org/1998/Math/MathML",
-                                        "children": [
-                                          {
-                                            "tag": "svg",
-                                            "ns": "http://www.w3.org/2000/svg"
-                                          }
-                                        ]
-                                      },
-                                      {
-                                        "tag": "mo",
-                                        "ns": "http://www.w3.org/1998/Math/MathML"
-                                      }
-                                    ]
-                                  },
-                                  {
-                                    "tag": "span"
-                                  }
-                                ]
-                              },
-                              {
-                                "tag": "path",
-                                "ns": "http://www.w3.org/2000/svg"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><annotation-xml><svg><foreignObject><math><mi><svg></svg></mi><mo></mo></math><span></span></foreignObject><path></path></svg></annotation-xml><mi></mi></math></body></html>",
-        "noQuirksBodyHtml": "<math><annotation-xml><svg><foreignObject><math><mi><svg></svg></mi><mo></mo></math><span></span></foreignObject><path></path></svg></annotation-xml><mi></mi></math>"
-      }
-    }
-  ],
-  "tests11.dat": [
-    {
-      "data": "<!DOCTYPE html><body><svg attributeName='' attributeType='' baseFrequency='' baseProfile='' calcMode='' clipPathUnits='' diffuseConstant='' edgeMode='' filterUnits='' glyphRef='' gradientTransform='' gradientUnits='' kernelMatrix='' kernelUnitLength='' keyPoints='' keySplines='' keyTimes='' lengthAdjust='' limitingConeAngle='' markerHeight='' markerUnits='' markerWidth='' maskContentUnits='' maskUnits='' numOctaves='' pathLength='' patternContentUnits='' patternTransform='' patternUnits='' pointsAtX='' pointsAtY='' pointsAtZ='' preserveAlpha='' preserveAspectRatio='' primitiveUnits='' refX='' refY='' repeatCount='' repeatDur='' requiredExtensions='' requiredFeatures='' specularConstant='' specularExponent='' spreadMethod='' startOffset='' stdDeviation='' stitchTiles='' surfaceScale='' systemLanguage='' tableValues='' targetX='' targetY='' textLength='' viewBox='' viewTarget='' xChannelSelector='' yChannelSelector='' zoomAndPan=''></svg>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "attrs": [
-                      {
-                        "name": "attributeName",
-                        "value": ""
-                      },
-                      {
-                        "name": "attributeType",
-                        "value": ""
-                      },
-                      {
-                        "name": "baseFrequency",
-                        "value": ""
-                      },
-                      {
-                        "name": "baseProfile",
-                        "value": ""
-                      },
-                      {
-                        "name": "calcMode",
-                        "value": ""
-                      },
-                      {
-                        "name": "clipPathUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "diffuseConstant",
-                        "value": ""
-                      },
-                      {
-                        "name": "edgeMode",
-                        "value": ""
-                      },
-                      {
-                        "name": "filterUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "glyphRef",
-                        "value": ""
-                      },
-                      {
-                        "name": "gradientTransform",
-                        "value": ""
-                      },
-                      {
-                        "name": "gradientUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "kernelMatrix",
-                        "value": ""
-                      },
-                      {
-                        "name": "kernelUnitLength",
-                        "value": ""
-                      },
-                      {
-                        "name": "keyPoints",
-                        "value": ""
-                      },
-                      {
-                        "name": "keySplines",
-                        "value": ""
-                      },
-                      {
-                        "name": "keyTimes",
-                        "value": ""
-                      },
-                      {
-                        "name": "lengthAdjust",
-                        "value": ""
-                      },
-                      {
-                        "name": "limitingConeAngle",
-                        "value": ""
-                      },
-                      {
-                        "name": "markerHeight",
-                        "value": ""
-                      },
-                      {
-                        "name": "markerUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "markerWidth",
-                        "value": ""
-                      },
-                      {
-                        "name": "maskContentUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "maskUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "numOctaves",
-                        "value": ""
-                      },
-                      {
-                        "name": "pathLength",
-                        "value": ""
-                      },
-                      {
-                        "name": "patternContentUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "patternTransform",
-                        "value": ""
-                      },
-                      {
-                        "name": "patternUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "pointsAtX",
-                        "value": ""
-                      },
-                      {
-                        "name": "pointsAtY",
-                        "value": ""
-                      },
-                      {
-                        "name": "pointsAtZ",
-                        "value": ""
-                      },
-                      {
-                        "name": "preserveAlpha",
-                        "value": ""
-                      },
-                      {
-                        "name": "preserveAspectRatio",
-                        "value": ""
-                      },
-                      {
-                        "name": "primitiveUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "refX",
-                        "value": ""
-                      },
-                      {
-                        "name": "refY",
-                        "value": ""
-                      },
-                      {
-                        "name": "repeatCount",
-                        "value": ""
-                      },
-                      {
-                        "name": "repeatDur",
-                        "value": ""
-                      },
-                      {
-                        "name": "requiredExtensions",
-                        "value": ""
-                      },
-                      {
-                        "name": "requiredFeatures",
-                        "value": ""
-                      },
-                      {
-                        "name": "specularConstant",
-                        "value": ""
-                      },
-                      {
-                        "name": "specularExponent",
-                        "value": ""
-                      },
-                      {
-                        "name": "spreadMethod",
-                        "value": ""
-                      },
-                      {
-                        "name": "startOffset",
-                        "value": ""
-                      },
-                      {
-                        "name": "stdDeviation",
-                        "value": ""
-                      },
-                      {
-                        "name": "stitchTiles",
-                        "value": ""
-                      },
-                      {
-                        "name": "surfaceScale",
-                        "value": ""
-                      },
-                      {
-                        "name": "systemLanguage",
-                        "value": ""
-                      },
-                      {
-                        "name": "tableValues",
-                        "value": ""
-                      },
-                      {
-                        "name": "targetX",
-                        "value": ""
-                      },
-                      {
-                        "name": "targetY",
-                        "value": ""
-                      },
-                      {
-                        "name": "textLength",
-                        "value": ""
-                      },
-                      {
-                        "name": "viewBox",
-                        "value": ""
-                      },
-                      {
-                        "name": "viewTarget",
-                        "value": ""
-                      },
-                      {
-                        "name": "xChannelSelector",
-                        "value": ""
-                      },
-                      {
-                        "name": "yChannelSelector",
-                        "value": ""
-                      },
-                      {
-                        "name": "zoomAndPan",
-                        "value": ""
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg attributeName=\"\" attributeType=\"\" baseFrequency=\"\" baseProfile=\"\" calcMode=\"\" clipPathUnits=\"\" diffuseConstant=\"\" edgeMode=\"\" filterUnits=\"\" glyphRef=\"\" gradientTransform=\"\" gradientUnits=\"\" kernelMatrix=\"\" kernelUnitLength=\"\" keyPoints=\"\" keySplines=\"\" keyTimes=\"\" lengthAdjust=\"\" limitingConeAngle=\"\" markerHeight=\"\" markerUnits=\"\" markerWidth=\"\" maskContentUnits=\"\" maskUnits=\"\" numOctaves=\"\" pathLength=\"\" patternContentUnits=\"\" patternTransform=\"\" patternUnits=\"\" pointsAtX=\"\" pointsAtY=\"\" pointsAtZ=\"\" preserveAlpha=\"\" preserveAspectRatio=\"\" primitiveUnits=\"\" refX=\"\" refY=\"\" repeatCount=\"\" repeatDur=\"\" requiredExtensions=\"\" requiredFeatures=\"\" specularConstant=\"\" specularExponent=\"\" spreadMethod=\"\" startOffset=\"\" stdDeviation=\"\" stitchTiles=\"\" surfaceScale=\"\" systemLanguage=\"\" tableValues=\"\" targetX=\"\" targetY=\"\" textLength=\"\" viewBox=\"\" viewTarget=\"\" xChannelSelector=\"\" yChannelSelector=\"\" zoomAndPan=\"\"></svg></body></html>",
-        "noQuirksBodyHtml": "<svg attributeName=\"\" attributeType=\"\" baseFrequency=\"\" baseProfile=\"\" calcMode=\"\" clipPathUnits=\"\" diffuseConstant=\"\" edgeMode=\"\" filterUnits=\"\" glyphRef=\"\" gradientTransform=\"\" gradientUnits=\"\" kernelMatrix=\"\" kernelUnitLength=\"\" keyPoints=\"\" keySplines=\"\" keyTimes=\"\" lengthAdjust=\"\" limitingConeAngle=\"\" markerHeight=\"\" markerUnits=\"\" markerWidth=\"\" maskContentUnits=\"\" maskUnits=\"\" numOctaves=\"\" pathLength=\"\" patternContentUnits=\"\" patternTransform=\"\" patternUnits=\"\" pointsAtX=\"\" pointsAtY=\"\" pointsAtZ=\"\" preserveAlpha=\"\" preserveAspectRatio=\"\" primitiveUnits=\"\" refX=\"\" refY=\"\" repeatCount=\"\" repeatDur=\"\" requiredExtensions=\"\" requiredFeatures=\"\" specularConstant=\"\" specularExponent=\"\" spreadMethod=\"\" startOffset=\"\" stdDeviation=\"\" stitchTiles=\"\" surfaceScale=\"\" systemLanguage=\"\" tableValues=\"\" targetX=\"\" targetY=\"\" textLength=\"\" viewBox=\"\" viewTarget=\"\" xChannelSelector=\"\" yChannelSelector=\"\" zoomAndPan=\"\"></svg>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><BODY><SVG ATTRIBUTENAME='' ATTRIBUTETYPE='' BASEFREQUENCY='' BASEPROFILE='' CALCMODE='' CLIPPATHUNITS='' DIFFUSECONSTANT='' EDGEMODE='' FILTERUNITS='' GLYPHREF='' GRADIENTTRANSFORM='' GRADIENTUNITS='' KERNELMATRIX='' KERNELUNITLENGTH='' KEYPOINTS='' KEYSPLINES='' KEYTIMES='' LENGTHADJUST='' LIMITINGCONEANGLE='' MARKERHEIGHT='' MARKERUNITS='' MARKERWIDTH='' MASKCONTENTUNITS='' MASKUNITS='' NUMOCTAVES='' PATHLENGTH='' PATTERNCONTENTUNITS='' PATTERNTRANSFORM='' PATTERNUNITS='' POINTSATX='' POINTSATY='' POINTSATZ='' PRESERVEALPHA='' PRESERVEASPECTRATIO='' PRIMITIVEUNITS='' REFX='' REFY='' REPEATCOUNT='' REPEATDUR='' REQUIREDEXTENSIONS='' REQUIREDFEATURES='' SPECULARCONSTANT='' SPECULAREXPONENT='' SPREADMETHOD='' STARTOFFSET='' STDDEVIATION='' STITCHTILES='' SURFACESCALE='' SYSTEMLANGUAGE='' TABLEVALUES='' TARGETX='' TARGETY='' TEXTLENGTH='' VIEWBOX='' VIEWTARGET='' XCHANNELSELECTOR='' YCHANNELSELECTOR='' ZOOMANDPAN=''></SVG>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "attrs": [
-                      {
-                        "name": "attributeName",
-                        "value": ""
-                      },
-                      {
-                        "name": "attributeType",
-                        "value": ""
-                      },
-                      {
-                        "name": "baseFrequency",
-                        "value": ""
-                      },
-                      {
-                        "name": "baseProfile",
-                        "value": ""
-                      },
-                      {
-                        "name": "calcMode",
-                        "value": ""
-                      },
-                      {
-                        "name": "clipPathUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "diffuseConstant",
-                        "value": ""
-                      },
-                      {
-                        "name": "edgeMode",
-                        "value": ""
-                      },
-                      {
-                        "name": "filterUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "glyphRef",
-                        "value": ""
-                      },
-                      {
-                        "name": "gradientTransform",
-                        "value": ""
-                      },
-                      {
-                        "name": "gradientUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "kernelMatrix",
-                        "value": ""
-                      },
-                      {
-                        "name": "kernelUnitLength",
-                        "value": ""
-                      },
-                      {
-                        "name": "keyPoints",
-                        "value": ""
-                      },
-                      {
-                        "name": "keySplines",
-                        "value": ""
-                      },
-                      {
-                        "name": "keyTimes",
-                        "value": ""
-                      },
-                      {
-                        "name": "lengthAdjust",
-                        "value": ""
-                      },
-                      {
-                        "name": "limitingConeAngle",
-                        "value": ""
-                      },
-                      {
-                        "name": "markerHeight",
-                        "value": ""
-                      },
-                      {
-                        "name": "markerUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "markerWidth",
-                        "value": ""
-                      },
-                      {
-                        "name": "maskContentUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "maskUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "numOctaves",
-                        "value": ""
-                      },
-                      {
-                        "name": "pathLength",
-                        "value": ""
-                      },
-                      {
-                        "name": "patternContentUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "patternTransform",
-                        "value": ""
-                      },
-                      {
-                        "name": "patternUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "pointsAtX",
-                        "value": ""
-                      },
-                      {
-                        "name": "pointsAtY",
-                        "value": ""
-                      },
-                      {
-                        "name": "pointsAtZ",
-                        "value": ""
-                      },
-                      {
-                        "name": "preserveAlpha",
-                        "value": ""
-                      },
-                      {
-                        "name": "preserveAspectRatio",
-                        "value": ""
-                      },
-                      {
-                        "name": "primitiveUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "refX",
-                        "value": ""
-                      },
-                      {
-                        "name": "refY",
-                        "value": ""
-                      },
-                      {
-                        "name": "repeatCount",
-                        "value": ""
-                      },
-                      {
-                        "name": "repeatDur",
-                        "value": ""
-                      },
-                      {
-                        "name": "requiredExtensions",
-                        "value": ""
-                      },
-                      {
-                        "name": "requiredFeatures",
-                        "value": ""
-                      },
-                      {
-                        "name": "specularConstant",
-                        "value": ""
-                      },
-                      {
-                        "name": "specularExponent",
-                        "value": ""
-                      },
-                      {
-                        "name": "spreadMethod",
-                        "value": ""
-                      },
-                      {
-                        "name": "startOffset",
-                        "value": ""
-                      },
-                      {
-                        "name": "stdDeviation",
-                        "value": ""
-                      },
-                      {
-                        "name": "stitchTiles",
-                        "value": ""
-                      },
-                      {
-                        "name": "surfaceScale",
-                        "value": ""
-                      },
-                      {
-                        "name": "systemLanguage",
-                        "value": ""
-                      },
-                      {
-                        "name": "tableValues",
-                        "value": ""
-                      },
-                      {
-                        "name": "targetX",
-                        "value": ""
-                      },
-                      {
-                        "name": "targetY",
-                        "value": ""
-                      },
-                      {
-                        "name": "textLength",
-                        "value": ""
-                      },
-                      {
-                        "name": "viewBox",
-                        "value": ""
-                      },
-                      {
-                        "name": "viewTarget",
-                        "value": ""
-                      },
-                      {
-                        "name": "xChannelSelector",
-                        "value": ""
-                      },
-                      {
-                        "name": "yChannelSelector",
-                        "value": ""
-                      },
-                      {
-                        "name": "zoomAndPan",
-                        "value": ""
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg attributeName=\"\" attributeType=\"\" baseFrequency=\"\" baseProfile=\"\" calcMode=\"\" clipPathUnits=\"\" diffuseConstant=\"\" edgeMode=\"\" filterUnits=\"\" glyphRef=\"\" gradientTransform=\"\" gradientUnits=\"\" kernelMatrix=\"\" kernelUnitLength=\"\" keyPoints=\"\" keySplines=\"\" keyTimes=\"\" lengthAdjust=\"\" limitingConeAngle=\"\" markerHeight=\"\" markerUnits=\"\" markerWidth=\"\" maskContentUnits=\"\" maskUnits=\"\" numOctaves=\"\" pathLength=\"\" patternContentUnits=\"\" patternTransform=\"\" patternUnits=\"\" pointsAtX=\"\" pointsAtY=\"\" pointsAtZ=\"\" preserveAlpha=\"\" preserveAspectRatio=\"\" primitiveUnits=\"\" refX=\"\" refY=\"\" repeatCount=\"\" repeatDur=\"\" requiredExtensions=\"\" requiredFeatures=\"\" specularConstant=\"\" specularExponent=\"\" spreadMethod=\"\" startOffset=\"\" stdDeviation=\"\" stitchTiles=\"\" surfaceScale=\"\" systemLanguage=\"\" tableValues=\"\" targetX=\"\" targetY=\"\" textLength=\"\" viewBox=\"\" viewTarget=\"\" xChannelSelector=\"\" yChannelSelector=\"\" zoomAndPan=\"\"></svg></body></html>",
-        "noQuirksBodyHtml": "<svg attributeName=\"\" attributeType=\"\" baseFrequency=\"\" baseProfile=\"\" calcMode=\"\" clipPathUnits=\"\" diffuseConstant=\"\" edgeMode=\"\" filterUnits=\"\" glyphRef=\"\" gradientTransform=\"\" gradientUnits=\"\" kernelMatrix=\"\" kernelUnitLength=\"\" keyPoints=\"\" keySplines=\"\" keyTimes=\"\" lengthAdjust=\"\" limitingConeAngle=\"\" markerHeight=\"\" markerUnits=\"\" markerWidth=\"\" maskContentUnits=\"\" maskUnits=\"\" numOctaves=\"\" pathLength=\"\" patternContentUnits=\"\" patternTransform=\"\" patternUnits=\"\" pointsAtX=\"\" pointsAtY=\"\" pointsAtZ=\"\" preserveAlpha=\"\" preserveAspectRatio=\"\" primitiveUnits=\"\" refX=\"\" refY=\"\" repeatCount=\"\" repeatDur=\"\" requiredExtensions=\"\" requiredFeatures=\"\" specularConstant=\"\" specularExponent=\"\" spreadMethod=\"\" startOffset=\"\" stdDeviation=\"\" stitchTiles=\"\" surfaceScale=\"\" systemLanguage=\"\" tableValues=\"\" targetX=\"\" targetY=\"\" textLength=\"\" viewBox=\"\" viewTarget=\"\" xChannelSelector=\"\" yChannelSelector=\"\" zoomAndPan=\"\"></svg>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><svg attributename='' attributetype='' basefrequency='' baseprofile='' calcmode='' clippathunits='' diffuseconstant='' edgemode='' filterunits='' filterres='' glyphref='' gradienttransform='' gradientunits='' kernelmatrix='' kernelunitlength='' keypoints='' keysplines='' keytimes='' lengthadjust='' limitingconeangle='' markerheight='' markerunits='' markerwidth='' maskcontentunits='' maskunits='' numoctaves='' pathlength='' patterncontentunits='' patterntransform='' patternunits='' pointsatx='' pointsaty='' pointsatz='' preservealpha='' preserveaspectratio='' primitiveunits='' refx='' refy='' repeatcount='' repeatdur='' requiredextensions='' requiredfeatures='' specularconstant='' specularexponent='' spreadmethod='' startoffset='' stddeviation='' stitchtiles='' surfacescale='' systemlanguage='' tablevalues='' targetx='' targety='' textlength='' viewbox='' viewtarget='' xchannelselector='' ychannelselector='' zoomandpan=''></svg>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "attrs": [
-                      {
-                        "name": "attributeName",
-                        "value": ""
-                      },
-                      {
-                        "name": "attributeType",
-                        "value": ""
-                      },
-                      {
-                        "name": "baseFrequency",
-                        "value": ""
-                      },
-                      {
-                        "name": "baseProfile",
-                        "value": ""
-                      },
-                      {
-                        "name": "calcMode",
-                        "value": ""
-                      },
-                      {
-                        "name": "clipPathUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "diffuseConstant",
-                        "value": ""
-                      },
-                      {
-                        "name": "edgeMode",
-                        "value": ""
-                      },
-                      {
-                        "name": "filterUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "filterres",
-                        "value": ""
-                      },
-                      {
-                        "name": "glyphRef",
-                        "value": ""
-                      },
-                      {
-                        "name": "gradientTransform",
-                        "value": ""
-                      },
-                      {
-                        "name": "gradientUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "kernelMatrix",
-                        "value": ""
-                      },
-                      {
-                        "name": "kernelUnitLength",
-                        "value": ""
-                      },
-                      {
-                        "name": "keyPoints",
-                        "value": ""
-                      },
-                      {
-                        "name": "keySplines",
-                        "value": ""
-                      },
-                      {
-                        "name": "keyTimes",
-                        "value": ""
-                      },
-                      {
-                        "name": "lengthAdjust",
-                        "value": ""
-                      },
-                      {
-                        "name": "limitingConeAngle",
-                        "value": ""
-                      },
-                      {
-                        "name": "markerHeight",
-                        "value": ""
-                      },
-                      {
-                        "name": "markerUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "markerWidth",
-                        "value": ""
-                      },
-                      {
-                        "name": "maskContentUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "maskUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "numOctaves",
-                        "value": ""
-                      },
-                      {
-                        "name": "pathLength",
-                        "value": ""
-                      },
-                      {
-                        "name": "patternContentUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "patternTransform",
-                        "value": ""
-                      },
-                      {
-                        "name": "patternUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "pointsAtX",
-                        "value": ""
-                      },
-                      {
-                        "name": "pointsAtY",
-                        "value": ""
-                      },
-                      {
-                        "name": "pointsAtZ",
-                        "value": ""
-                      },
-                      {
-                        "name": "preserveAlpha",
-                        "value": ""
-                      },
-                      {
-                        "name": "preserveAspectRatio",
-                        "value": ""
-                      },
-                      {
-                        "name": "primitiveUnits",
-                        "value": ""
-                      },
-                      {
-                        "name": "refX",
-                        "value": ""
-                      },
-                      {
-                        "name": "refY",
-                        "value": ""
-                      },
-                      {
-                        "name": "repeatCount",
-                        "value": ""
-                      },
-                      {
-                        "name": "repeatDur",
-                        "value": ""
-                      },
-                      {
-                        "name": "requiredExtensions",
-                        "value": ""
-                      },
-                      {
-                        "name": "requiredFeatures",
-                        "value": ""
-                      },
-                      {
-                        "name": "specularConstant",
-                        "value": ""
-                      },
-                      {
-                        "name": "specularExponent",
-                        "value": ""
-                      },
-                      {
-                        "name": "spreadMethod",
-                        "value": ""
-                      },
-                      {
-                        "name": "startOffset",
-                        "value": ""
-                      },
-                      {
-                        "name": "stdDeviation",
-                        "value": ""
-                      },
-                      {
-                        "name": "stitchTiles",
-                        "value": ""
-                      },
-                      {
-                        "name": "surfaceScale",
-                        "value": ""
-                      },
-                      {
-                        "name": "systemLanguage",
-                        "value": ""
-                      },
-                      {
-                        "name": "tableValues",
-                        "value": ""
-                      },
-                      {
-                        "name": "targetX",
-                        "value": ""
-                      },
-                      {
-                        "name": "targetY",
-                        "value": ""
-                      },
-                      {
-                        "name": "textLength",
-                        "value": ""
-                      },
-                      {
-                        "name": "viewBox",
-                        "value": ""
-                      },
-                      {
-                        "name": "viewTarget",
-                        "value": ""
-                      },
-                      {
-                        "name": "xChannelSelector",
-                        "value": ""
-                      },
-                      {
-                        "name": "yChannelSelector",
-                        "value": ""
-                      },
-                      {
-                        "name": "zoomAndPan",
-                        "value": ""
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg attributeName=\"\" attributeType=\"\" baseFrequency=\"\" baseProfile=\"\" calcMode=\"\" clipPathUnits=\"\" diffuseConstant=\"\" edgeMode=\"\" filterUnits=\"\" filterres=\"\" glyphRef=\"\" gradientTransform=\"\" gradientUnits=\"\" kernelMatrix=\"\" kernelUnitLength=\"\" keyPoints=\"\" keySplines=\"\" keyTimes=\"\" lengthAdjust=\"\" limitingConeAngle=\"\" markerHeight=\"\" markerUnits=\"\" markerWidth=\"\" maskContentUnits=\"\" maskUnits=\"\" numOctaves=\"\" pathLength=\"\" patternContentUnits=\"\" patternTransform=\"\" patternUnits=\"\" pointsAtX=\"\" pointsAtY=\"\" pointsAtZ=\"\" preserveAlpha=\"\" preserveAspectRatio=\"\" primitiveUnits=\"\" refX=\"\" refY=\"\" repeatCount=\"\" repeatDur=\"\" requiredExtensions=\"\" requiredFeatures=\"\" specularConstant=\"\" specularExponent=\"\" spreadMethod=\"\" startOffset=\"\" stdDeviation=\"\" stitchTiles=\"\" surfaceScale=\"\" systemLanguage=\"\" tableValues=\"\" targetX=\"\" targetY=\"\" textLength=\"\" viewBox=\"\" viewTarget=\"\" xChannelSelector=\"\" yChannelSelector=\"\" zoomAndPan=\"\"></svg></body></html>",
-        "noQuirksBodyHtml": "<svg attributeName=\"\" attributeType=\"\" baseFrequency=\"\" baseProfile=\"\" calcMode=\"\" clipPathUnits=\"\" diffuseConstant=\"\" edgeMode=\"\" filterUnits=\"\" filterres=\"\" glyphRef=\"\" gradientTransform=\"\" gradientUnits=\"\" kernelMatrix=\"\" kernelUnitLength=\"\" keyPoints=\"\" keySplines=\"\" keyTimes=\"\" lengthAdjust=\"\" limitingConeAngle=\"\" markerHeight=\"\" markerUnits=\"\" markerWidth=\"\" maskContentUnits=\"\" maskUnits=\"\" numOctaves=\"\" pathLength=\"\" patternContentUnits=\"\" patternTransform=\"\" patternUnits=\"\" pointsAtX=\"\" pointsAtY=\"\" pointsAtZ=\"\" preserveAlpha=\"\" preserveAspectRatio=\"\" primitiveUnits=\"\" refX=\"\" refY=\"\" repeatCount=\"\" repeatDur=\"\" requiredExtensions=\"\" requiredFeatures=\"\" specularConstant=\"\" specularExponent=\"\" spreadMethod=\"\" startOffset=\"\" stdDeviation=\"\" stitchTiles=\"\" surfaceScale=\"\" systemLanguage=\"\" tableValues=\"\" targetX=\"\" targetY=\"\" textLength=\"\" viewBox=\"\" viewTarget=\"\" xChannelSelector=\"\" yChannelSelector=\"\" zoomAndPan=\"\"></svg>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><math attributeName='' attributeType='' baseFrequency='' baseProfile='' calcMode='' clipPathUnits='' diffuseConstant='' edgeMode='' filterUnits='' glyphRef='' gradientTransform='' gradientUnits='' kernelMatrix='' kernelUnitLength='' keyPoints='' keySplines='' keyTimes='' lengthAdjust='' limitingConeAngle='' markerHeight='' markerUnits='' markerWidth='' maskContentUnits='' maskUnits='' numOctaves='' pathLength='' patternContentUnits='' patternTransform='' patternUnits='' pointsAtX='' pointsAtY='' pointsAtZ='' preserveAlpha='' preserveAspectRatio='' primitiveUnits='' refX='' refY='' repeatCount='' repeatDur='' requiredExtensions='' requiredFeatures='' specularConstant='' specularExponent='' spreadMethod='' startOffset='' stdDeviation='' stitchTiles='' surfaceScale='' systemLanguage='' tableValues='' targetX='' targetY='' textLength='' viewBox='' viewTarget='' xChannelSelector='' yChannelSelector='' zoomAndPan=''></math>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "attrs": [
-                      {
-                        "name": "attributename",
-                        "value": ""
-                      },
-                      {
-                        "name": "attributetype",
-                        "value": ""
-                      },
-                      {
-                        "name": "basefrequency",
-                        "value": ""
-                      },
-                      {
-                        "name": "baseprofile",
-                        "value": ""
-                      },
-                      {
-                        "name": "calcmode",
-                        "value": ""
-                      },
-                      {
-                        "name": "clippathunits",
-                        "value": ""
-                      },
-                      {
-                        "name": "diffuseconstant",
-                        "value": ""
-                      },
-                      {
-                        "name": "edgemode",
-                        "value": ""
-                      },
-                      {
-                        "name": "filterunits",
-                        "value": ""
-                      },
-                      {
-                        "name": "glyphref",
-                        "value": ""
-                      },
-                      {
-                        "name": "gradienttransform",
-                        "value": ""
-                      },
-                      {
-                        "name": "gradientunits",
-                        "value": ""
-                      },
-                      {
-                        "name": "kernelmatrix",
-                        "value": ""
-                      },
-                      {
-                        "name": "kernelunitlength",
-                        "value": ""
-                      },
-                      {
-                        "name": "keypoints",
-                        "value": ""
-                      },
-                      {
-                        "name": "keysplines",
-                        "value": ""
-                      },
-                      {
-                        "name": "keytimes",
-                        "value": ""
-                      },
-                      {
-                        "name": "lengthadjust",
-                        "value": ""
-                      },
-                      {
-                        "name": "limitingconeangle",
-                        "value": ""
-                      },
-                      {
-                        "name": "markerheight",
-                        "value": ""
-                      },
-                      {
-                        "name": "markerunits",
-                        "value": ""
-                      },
-                      {
-                        "name": "markerwidth",
-                        "value": ""
-                      },
-                      {
-                        "name": "maskcontentunits",
-                        "value": ""
-                      },
-                      {
-                        "name": "maskunits",
-                        "value": ""
-                      },
-                      {
-                        "name": "numoctaves",
-                        "value": ""
-                      },
-                      {
-                        "name": "pathlength",
-                        "value": ""
-                      },
-                      {
-                        "name": "patterncontentunits",
-                        "value": ""
-                      },
-                      {
-                        "name": "patterntransform",
-                        "value": ""
-                      },
-                      {
-                        "name": "patternunits",
-                        "value": ""
-                      },
-                      {
-                        "name": "pointsatx",
-                        "value": ""
-                      },
-                      {
-                        "name": "pointsaty",
-                        "value": ""
-                      },
-                      {
-                        "name": "pointsatz",
-                        "value": ""
-                      },
-                      {
-                        "name": "preservealpha",
-                        "value": ""
-                      },
-                      {
-                        "name": "preserveaspectratio",
-                        "value": ""
-                      },
-                      {
-                        "name": "primitiveunits",
-                        "value": ""
-                      },
-                      {
-                        "name": "refx",
-                        "value": ""
-                      },
-                      {
-                        "name": "refy",
-                        "value": ""
-                      },
-                      {
-                        "name": "repeatcount",
-                        "value": ""
-                      },
-                      {
-                        "name": "repeatdur",
-                        "value": ""
-                      },
-                      {
-                        "name": "requiredextensions",
-                        "value": ""
-                      },
-                      {
-                        "name": "requiredfeatures",
-                        "value": ""
-                      },
-                      {
-                        "name": "specularconstant",
-                        "value": ""
-                      },
-                      {
-                        "name": "specularexponent",
-                        "value": ""
-                      },
-                      {
-                        "name": "spreadmethod",
-                        "value": ""
-                      },
-                      {
-                        "name": "startoffset",
-                        "value": ""
-                      },
-                      {
-                        "name": "stddeviation",
-                        "value": ""
-                      },
-                      {
-                        "name": "stitchtiles",
-                        "value": ""
-                      },
-                      {
-                        "name": "surfacescale",
-                        "value": ""
-                      },
-                      {
-                        "name": "systemlanguage",
-                        "value": ""
-                      },
-                      {
-                        "name": "tablevalues",
-                        "value": ""
-                      },
-                      {
-                        "name": "targetx",
-                        "value": ""
-                      },
-                      {
-                        "name": "targety",
-                        "value": ""
-                      },
-                      {
-                        "name": "textlength",
-                        "value": ""
-                      },
-                      {
-                        "name": "viewbox",
-                        "value": ""
-                      },
-                      {
-                        "name": "viewtarget",
-                        "value": ""
-                      },
-                      {
-                        "name": "xchannelselector",
-                        "value": ""
-                      },
-                      {
-                        "name": "ychannelselector",
-                        "value": ""
-                      },
-                      {
-                        "name": "zoomandpan",
-                        "value": ""
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math attributename=\"\" attributetype=\"\" basefrequency=\"\" baseprofile=\"\" calcmode=\"\" clippathunits=\"\" diffuseconstant=\"\" edgemode=\"\" filterunits=\"\" glyphref=\"\" gradienttransform=\"\" gradientunits=\"\" kernelmatrix=\"\" kernelunitlength=\"\" keypoints=\"\" keysplines=\"\" keytimes=\"\" lengthadjust=\"\" limitingconeangle=\"\" markerheight=\"\" markerunits=\"\" markerwidth=\"\" maskcontentunits=\"\" maskunits=\"\" numoctaves=\"\" pathlength=\"\" patterncontentunits=\"\" patterntransform=\"\" patternunits=\"\" pointsatx=\"\" pointsaty=\"\" pointsatz=\"\" preservealpha=\"\" preserveaspectratio=\"\" primitiveunits=\"\" refx=\"\" refy=\"\" repeatcount=\"\" repeatdur=\"\" requiredextensions=\"\" requiredfeatures=\"\" specularconstant=\"\" specularexponent=\"\" spreadmethod=\"\" startoffset=\"\" stddeviation=\"\" stitchtiles=\"\" surfacescale=\"\" systemlanguage=\"\" tablevalues=\"\" targetx=\"\" targety=\"\" textlength=\"\" viewbox=\"\" viewtarget=\"\" xchannelselector=\"\" ychannelselector=\"\" zoomandpan=\"\"></math></body></html>",
-        "noQuirksBodyHtml": "<math attributename=\"\" attributetype=\"\" basefrequency=\"\" baseprofile=\"\" calcmode=\"\" clippathunits=\"\" diffuseconstant=\"\" edgemode=\"\" filterunits=\"\" glyphref=\"\" gradienttransform=\"\" gradientunits=\"\" kernelmatrix=\"\" kernelunitlength=\"\" keypoints=\"\" keysplines=\"\" keytimes=\"\" lengthadjust=\"\" limitingconeangle=\"\" markerheight=\"\" markerunits=\"\" markerwidth=\"\" maskcontentunits=\"\" maskunits=\"\" numoctaves=\"\" pathlength=\"\" patterncontentunits=\"\" patterntransform=\"\" patternunits=\"\" pointsatx=\"\" pointsaty=\"\" pointsatz=\"\" preservealpha=\"\" preserveaspectratio=\"\" primitiveunits=\"\" refx=\"\" refy=\"\" repeatcount=\"\" repeatdur=\"\" requiredextensions=\"\" requiredfeatures=\"\" specularconstant=\"\" specularexponent=\"\" spreadmethod=\"\" startoffset=\"\" stddeviation=\"\" stitchtiles=\"\" surfacescale=\"\" systemlanguage=\"\" tablevalues=\"\" targetx=\"\" targety=\"\" textlength=\"\" viewbox=\"\" viewtarget=\"\" xchannelselector=\"\" ychannelselector=\"\" zoomandpan=\"\"></math>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><svg contentScriptType='' contentStyleType='' externalResourcesRequired='' filterRes=''></svg>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "attrs": [
-                      {
-                        "name": "contentscripttype",
-                        "value": ""
-                      },
-                      {
-                        "name": "contentstyletype",
-                        "value": ""
-                      },
-                      {
-                        "name": "externalresourcesrequired",
-                        "value": ""
-                      },
-                      {
-                        "name": "filterres",
-                        "value": ""
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg contentscripttype=\"\" contentstyletype=\"\" externalresourcesrequired=\"\" filterres=\"\"></svg></body></html>",
-        "noQuirksBodyHtml": "<svg contentScriptType=\"\" contentStyleType=\"\" externalResourcesRequired=\"\" filterres=\"\"></svg>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><svg CONTENTSCRIPTTYPE='' CONTENTSTYLETYPE='' EXTERNALRESOURCESREQUIRED='' FILTERRES=''></svg>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "attrs": [
-                      {
-                        "name": "contentscripttype",
-                        "value": ""
-                      },
-                      {
-                        "name": "contentstyletype",
-                        "value": ""
-                      },
-                      {
-                        "name": "externalresourcesrequired",
-                        "value": ""
-                      },
-                      {
-                        "name": "filterres",
-                        "value": ""
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg contentscripttype=\"\" contentstyletype=\"\" externalresourcesrequired=\"\" filterres=\"\"></svg></body></html>",
-        "noQuirksBodyHtml": "<svg contentScriptType=\"\" contentStyleType=\"\" externalResourcesRequired=\"\" filterres=\"\"></svg>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><svg contentscripttype='' contentstyletype='' externalresourcesrequired='' filterres=''></svg>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "attrs": [
-                      {
-                        "name": "contentscripttype",
-                        "value": ""
-                      },
-                      {
-                        "name": "contentstyletype",
-                        "value": ""
-                      },
-                      {
-                        "name": "externalresourcesrequired",
-                        "value": ""
-                      },
-                      {
-                        "name": "filterres",
-                        "value": ""
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg contentscripttype=\"\" contentstyletype=\"\" externalresourcesrequired=\"\" filterres=\"\"></svg></body></html>",
-        "noQuirksBodyHtml": "<svg contentScriptType=\"\" contentStyleType=\"\" externalResourcesRequired=\"\" filterres=\"\"></svg>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><math contentScriptType='' contentStyleType='' externalResourcesRequired='' filterRes=''></math>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "attrs": [
-                      {
-                        "name": "contentscripttype",
-                        "value": ""
-                      },
-                      {
-                        "name": "contentstyletype",
-                        "value": ""
-                      },
-                      {
-                        "name": "externalresourcesrequired",
-                        "value": ""
-                      },
-                      {
-                        "name": "filterres",
-                        "value": ""
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math contentscripttype=\"\" contentstyletype=\"\" externalresourcesrequired=\"\" filterres=\"\"></math></body></html>",
-        "noQuirksBodyHtml": "<math contentscripttype=\"\" contentstyletype=\"\" externalresourcesrequired=\"\" filterres=\"\"></math>"
-      }
-    },
-    {
-      "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>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg altGlyph": true,
-            "svg altGlyphDef": true,
-            "svg altGlyphItem": true,
-            "svg animateColor": true,
-            "svg animateMotion": true,
-            "svg animateTransform": true,
-            "svg clipPath": true,
-            "svg feBlend": true,
-            "svg feColorMatrix": true,
-            "svg feComponentTransfer": true,
-            "svg feComposite": true,
-            "svg feConvolveMatrix": true,
-            "svg feDiffuseLighting": true,
-            "svg feDisplacementMap": true,
-            "svg feDistantLight": true,
-            "svg feFlood": true,
-            "svg feFuncA": true,
-            "svg feFuncB": true,
-            "svg feFuncG": true,
-            "svg feFuncR": true,
-            "svg feGaussianBlur": true,
-            "svg feImage": true,
-            "svg feMerge": true,
-            "svg feMergeNode": true,
-            "svg feMorphology": true,
-            "svg feOffset": true,
-            "svg fePointLight": true,
-            "svg feSpecularLighting": true,
-            "svg feSpotLight": true,
-            "svg feTile": true,
-            "svg feTurbulence": true,
-            "svg foreignObject": true,
-            "svg glyphRef": true,
-            "svg linearGradient": true,
-            "svg radialGradient": true,
-            "svg textPath": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "altGlyph",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "altGlyphDef",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "altGlyphItem",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "animateColor",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "animateMotion",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "animateTransform",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "clipPath",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feBlend",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feColorMatrix",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feComponentTransfer",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feComposite",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feConvolveMatrix",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feDiffuseLighting",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feDisplacementMap",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feDistantLight",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feFlood",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feFuncA",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feFuncB",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feFuncG",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feFuncR",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feGaussianBlur",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feImage",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feMerge",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feMergeNode",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feMorphology",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feOffset",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "fePointLight",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feSpecularLighting",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feSpotLight",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feTile",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feTurbulence",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "foreignObject",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "glyphRef",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "linearGradient",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "radialGradient",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "textPath",
-                        "ns": "http://www.w3.org/2000/svg"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg><altGlyph></altGlyph><altGlyphDef></altGlyphDef><altGlyphItem></altGlyphItem><animateColor></animateColor><animateMotion></animateMotion><animateTransform></animateTransform><clipPath></clipPath><feBlend></feBlend><feColorMatrix></feColorMatrix><feComponentTransfer></feComponentTransfer><feComposite></feComposite><feConvolveMatrix></feConvolveMatrix><feDiffuseLighting></feDiffuseLighting><feDisplacementMap></feDisplacementMap><feDistantLight></feDistantLight><feFlood></feFlood><feFuncA></feFuncA><feFuncB></feFuncB><feFuncG></feFuncG><feFuncR></feFuncR><feGaussianBlur></feGaussianBlur><feImage></feImage><feMerge></feMerge><feMergeNode></feMergeNode><feMorphology></feMorphology><feOffset></feOffset><fePointLight></fePointLight><feSpecularLighting></feSpecularLighting><feSpotLight></feSpotLight><feTile></feTile><feTurbulence></feTurbulence><foreignObject></foreignObject><glyphRef></glyphRef><linearGradient></linearGradient><radialGradient></radialGradient><textPath></textPath></svg></body></html>",
-        "noQuirksBodyHtml": "<svg><altGlyph></altGlyph><altGlyphDef></altGlyphDef><altGlyphItem></altGlyphItem><animateColor></animateColor><animateMotion></animateMotion><animateTransform></animateTransform><clipPath></clipPath><feBlend></feBlend><feColorMatrix></feColorMatrix><feComponentTransfer></feComponentTransfer><feComposite></feComposite><feConvolveMatrix></feConvolveMatrix><feDiffuseLighting></feDiffuseLighting><feDisplacementMap></feDisplacementMap><feDistantLight></feDistantLight><feFlood></feFlood><feFuncA></feFuncA><feFuncB></feFuncB><feFuncG></feFuncG><feFuncR></feFuncR><feGaussianBlur></feGaussianBlur><feImage></feImage><feMerge></feMerge><feMergeNode></feMergeNode><feMorphology></feMorphology><feOffset></feOffset><fePointLight></fePointLight><feSpecularLighting></feSpecularLighting><feSpotLight></feSpotLight><feTile></feTile><feTurbulence></feTurbulence><foreignObject></foreignObject><glyphRef></glyphRef><linearGradient></linearGradient><radialGradient></radialGradient><textPath></textPath></svg>"
-      }
-    },
-    {
-      "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>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg altGlyph": true,
-            "svg altGlyphDef": true,
-            "svg altGlyphItem": true,
-            "svg animateColor": true,
-            "svg animateMotion": true,
-            "svg animateTransform": true,
-            "svg clipPath": true,
-            "svg feBlend": true,
-            "svg feColorMatrix": true,
-            "svg feComponentTransfer": true,
-            "svg feComposite": true,
-            "svg feConvolveMatrix": true,
-            "svg feDiffuseLighting": true,
-            "svg feDisplacementMap": true,
-            "svg feDistantLight": true,
-            "svg feFlood": true,
-            "svg feFuncA": true,
-            "svg feFuncB": true,
-            "svg feFuncG": true,
-            "svg feFuncR": true,
-            "svg feGaussianBlur": true,
-            "svg feImage": true,
-            "svg feMerge": true,
-            "svg feMergeNode": true,
-            "svg feMorphology": true,
-            "svg feOffset": true,
-            "svg fePointLight": true,
-            "svg feSpecularLighting": true,
-            "svg feSpotLight": true,
-            "svg feTile": true,
-            "svg feTurbulence": true,
-            "svg foreignObject": true,
-            "svg glyphRef": true,
-            "svg linearGradient": true,
-            "svg radialGradient": true,
-            "svg textPath": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "altGlyph",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "altGlyphDef",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "altGlyphItem",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "animateColor",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "animateMotion",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "animateTransform",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "clipPath",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feBlend",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feColorMatrix",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feComponentTransfer",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feComposite",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feConvolveMatrix",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feDiffuseLighting",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feDisplacementMap",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feDistantLight",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feFlood",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feFuncA",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feFuncB",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feFuncG",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feFuncR",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feGaussianBlur",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feImage",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feMerge",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feMergeNode",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feMorphology",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feOffset",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "fePointLight",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feSpecularLighting",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feSpotLight",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feTile",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feTurbulence",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "foreignObject",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "glyphRef",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "linearGradient",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "radialGradient",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "textPath",
-                        "ns": "http://www.w3.org/2000/svg"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg><altGlyph></altGlyph><altGlyphDef></altGlyphDef><altGlyphItem></altGlyphItem><animateColor></animateColor><animateMotion></animateMotion><animateTransform></animateTransform><clipPath></clipPath><feBlend></feBlend><feColorMatrix></feColorMatrix><feComponentTransfer></feComponentTransfer><feComposite></feComposite><feConvolveMatrix></feConvolveMatrix><feDiffuseLighting></feDiffuseLighting><feDisplacementMap></feDisplacementMap><feDistantLight></feDistantLight><feFlood></feFlood><feFuncA></feFuncA><feFuncB></feFuncB><feFuncG></feFuncG><feFuncR></feFuncR><feGaussianBlur></feGaussianBlur><feImage></feImage><feMerge></feMerge><feMergeNode></feMergeNode><feMorphology></feMorphology><feOffset></feOffset><fePointLight></fePointLight><feSpecularLighting></feSpecularLighting><feSpotLight></feSpotLight><feTile></feTile><feTurbulence></feTurbulence><foreignObject></foreignObject><glyphRef></glyphRef><linearGradient></linearGradient><radialGradient></radialGradient><textPath></textPath></svg></body></html>",
-        "noQuirksBodyHtml": "<svg><altGlyph></altGlyph><altGlyphDef></altGlyphDef><altGlyphItem></altGlyphItem><animateColor></animateColor><animateMotion></animateMotion><animateTransform></animateTransform><clipPath></clipPath><feBlend></feBlend><feColorMatrix></feColorMatrix><feComponentTransfer></feComponentTransfer><feComposite></feComposite><feConvolveMatrix></feConvolveMatrix><feDiffuseLighting></feDiffuseLighting><feDisplacementMap></feDisplacementMap><feDistantLight></feDistantLight><feFlood></feFlood><feFuncA></feFuncA><feFuncB></feFuncB><feFuncG></feFuncG><feFuncR></feFuncR><feGaussianBlur></feGaussianBlur><feImage></feImage><feMerge></feMerge><feMergeNode></feMergeNode><feMorphology></feMorphology><feOffset></feOffset><fePointLight></fePointLight><feSpecularLighting></feSpecularLighting><feSpotLight></feSpotLight><feTile></feTile><feTurbulence></feTurbulence><foreignObject></foreignObject><glyphRef></glyphRef><linearGradient></linearGradient><radialGradient></radialGradient><textPath></textPath></svg>"
-      }
-    },
-    {
-      "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>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg altGlyph": true,
-            "svg altGlyphDef": true,
-            "svg altGlyphItem": true,
-            "svg animateColor": true,
-            "svg animateMotion": true,
-            "svg animateTransform": true,
-            "svg clipPath": true,
-            "svg feBlend": true,
-            "svg feColorMatrix": true,
-            "svg feComponentTransfer": true,
-            "svg feComposite": true,
-            "svg feConvolveMatrix": true,
-            "svg feDiffuseLighting": true,
-            "svg feDisplacementMap": true,
-            "svg feDistantLight": true,
-            "svg feFlood": true,
-            "svg feFuncA": true,
-            "svg feFuncB": true,
-            "svg feFuncG": true,
-            "svg feFuncR": true,
-            "svg feGaussianBlur": true,
-            "svg feImage": true,
-            "svg feMerge": true,
-            "svg feMergeNode": true,
-            "svg feMorphology": true,
-            "svg feOffset": true,
-            "svg fePointLight": true,
-            "svg feSpecularLighting": true,
-            "svg feSpotLight": true,
-            "svg feTile": true,
-            "svg feTurbulence": true,
-            "svg foreignObject": true,
-            "svg glyphRef": true,
-            "svg linearGradient": true,
-            "svg radialGradient": true,
-            "svg textPath": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "altGlyph",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "altGlyphDef",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "altGlyphItem",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "animateColor",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "animateMotion",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "animateTransform",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "clipPath",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feBlend",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feColorMatrix",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feComponentTransfer",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feComposite",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feConvolveMatrix",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feDiffuseLighting",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feDisplacementMap",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feDistantLight",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feFlood",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feFuncA",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feFuncB",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feFuncG",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feFuncR",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feGaussianBlur",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feImage",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feMerge",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feMergeNode",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feMorphology",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feOffset",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "fePointLight",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feSpecularLighting",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feSpotLight",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feTile",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "feTurbulence",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "foreignObject",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "glyphRef",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "linearGradient",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "radialGradient",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "textPath",
-                        "ns": "http://www.w3.org/2000/svg"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg><altGlyph></altGlyph><altGlyphDef></altGlyphDef><altGlyphItem></altGlyphItem><animateColor></animateColor><animateMotion></animateMotion><animateTransform></animateTransform><clipPath></clipPath><feBlend></feBlend><feColorMatrix></feColorMatrix><feComponentTransfer></feComponentTransfer><feComposite></feComposite><feConvolveMatrix></feConvolveMatrix><feDiffuseLighting></feDiffuseLighting><feDisplacementMap></feDisplacementMap><feDistantLight></feDistantLight><feFlood></feFlood><feFuncA></feFuncA><feFuncB></feFuncB><feFuncG></feFuncG><feFuncR></feFuncR><feGaussianBlur></feGaussianBlur><feImage></feImage><feMerge></feMerge><feMergeNode></feMergeNode><feMorphology></feMorphology><feOffset></feOffset><fePointLight></fePointLight><feSpecularLighting></feSpecularLighting><feSpotLight></feSpotLight><feTile></feTile><feTurbulence></feTurbulence><foreignObject></foreignObject><glyphRef></glyphRef><linearGradient></linearGradient><radialGradient></radialGradient><textPath></textPath></svg></body></html>",
-        "noQuirksBodyHtml": "<svg><altGlyph></altGlyph><altGlyphDef></altGlyphDef><altGlyphItem></altGlyphItem><animateColor></animateColor><animateMotion></animateMotion><animateTransform></animateTransform><clipPath></clipPath><feBlend></feBlend><feColorMatrix></feColorMatrix><feComponentTransfer></feComponentTransfer><feComposite></feComposite><feConvolveMatrix></feConvolveMatrix><feDiffuseLighting></feDiffuseLighting><feDisplacementMap></feDisplacementMap><feDistantLight></feDistantLight><feFlood></feFlood><feFuncA></feFuncA><feFuncB></feFuncB><feFuncG></feFuncG><feFuncR></feFuncR><feGaussianBlur></feGaussianBlur><feImage></feImage><feMerge></feMerge><feMergeNode></feMergeNode><feMorphology></feMorphology><feOffset></feOffset><fePointLight></fePointLight><feSpecularLighting></feSpecularLighting><feSpotLight></feSpotLight><feTile></feTile><feTurbulence></feTurbulence><foreignObject></foreignObject><glyphRef></glyphRef><linearGradient></linearGradient><radialGradient></radialGradient><textPath></textPath></svg>"
-      }
-    },
-    {
-      "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>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math altglyph": true,
-            "math altglyphdef": true,
-            "math altglyphitem": true,
-            "math animatecolor": true,
-            "math animatemotion": true,
-            "math animatetransform": true,
-            "math clippath": true,
-            "math feblend": true,
-            "math fecolormatrix": true,
-            "math fecomponenttransfer": true,
-            "math fecomposite": true,
-            "math feconvolvematrix": true,
-            "math fediffuselighting": true,
-            "math fedisplacementmap": true,
-            "math fedistantlight": true,
-            "math feflood": true,
-            "math fefunca": true,
-            "math fefuncb": true,
-            "math fefuncg": true,
-            "math fefuncr": true,
-            "math fegaussianblur": true,
-            "math feimage": true,
-            "math femerge": true,
-            "math femergenode": true,
-            "math femorphology": true,
-            "math feoffset": true,
-            "math fepointlight": true,
-            "math fespecularlighting": true,
-            "math fespotlight": true,
-            "math fetile": true,
-            "math feturbulence": true,
-            "math foreignobject": true,
-            "math glyphref": true,
-            "math lineargradient": true,
-            "math radialgradient": true,
-            "math textpath": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "altglyph",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "altglyphdef",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "altglyphitem",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "animatecolor",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "animatemotion",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "animatetransform",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "clippath",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "feblend",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "fecolormatrix",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "fecomponenttransfer",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "fecomposite",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "feconvolvematrix",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "fediffuselighting",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "fedisplacementmap",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "fedistantlight",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "feflood",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "fefunca",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "fefuncb",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "fefuncg",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "fefuncr",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "fegaussianblur",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "feimage",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "femerge",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "femergenode",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "femorphology",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "feoffset",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "fepointlight",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "fespecularlighting",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "fespotlight",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "fetile",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "feturbulence",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "foreignobject",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "glyphref",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "lineargradient",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "radialgradient",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      },
-                      {
-                        "tag": "textpath",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math><altglyph></altglyph><altglyphdef></altglyphdef><altglyphitem></altglyphitem><animatecolor></animatecolor><animatemotion></animatemotion><animatetransform></animatetransform><clippath></clippath><feblend></feblend><fecolormatrix></fecolormatrix><fecomponenttransfer></fecomponenttransfer><fecomposite></fecomposite><feconvolvematrix></feconvolvematrix><fediffuselighting></fediffuselighting><fedisplacementmap></fedisplacementmap><fedistantlight></fedistantlight><feflood></feflood><fefunca></fefunca><fefuncb></fefuncb><fefuncg></fefuncg><fefuncr></fefuncr><fegaussianblur></fegaussianblur><feimage></feimage><femerge></femerge><femergenode></femergenode><femorphology></femorphology><feoffset></feoffset><fepointlight></fepointlight><fespecularlighting></fespecularlighting><fespotlight></fespotlight><fetile></fetile><feturbulence></feturbulence><foreignobject></foreignobject><glyphref></glyphref><lineargradient></lineargradient><radialgradient></radialgradient><textpath></textpath></math></body></html>",
-        "noQuirksBodyHtml": "<math><altglyph></altglyph><altglyphdef></altglyphdef><altglyphitem></altglyphitem><animatecolor></animatecolor><animatemotion></animatemotion><animatetransform></animatetransform><clippath></clippath><feblend></feblend><fecolormatrix></fecolormatrix><fecomponenttransfer></fecomponenttransfer><fecomposite></fecomposite><feconvolvematrix></feconvolvematrix><fediffuselighting></fediffuselighting><fedisplacementmap></fedisplacementmap><fedistantlight></fedistantlight><feflood></feflood><fefunca></fefunca><fefuncb></fefuncb><fefuncg></fefuncg><fefuncr></fefuncr><fegaussianblur></fegaussianblur><feimage></feimage><femerge></femerge><femergenode></femergenode><femorphology></femorphology><feoffset></feoffset><fepointlight></fepointlight><fespecularlighting></fespecularlighting><fespotlight></fespotlight><fetile></fetile><feturbulence></feturbulence><foreignobject></foreignobject><glyphref></glyphref><lineargradient></lineargradient><radialgradient></radialgradient><textpath></textpath></math>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><svg><solidColor /></svg>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg solidcolor": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "solidcolor",
-                        "ns": "http://www.w3.org/2000/svg"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg><solidcolor></solidcolor></svg></body></html>",
-        "noQuirksBodyHtml": "<svg><solidcolor></solidcolor></svg>"
-      }
-    }
-  ],
-  "tests12.dat": [
-    {
-      "data": "<!DOCTYPE html><body><p>foo<math><mtext><i>baz</i></mtext><annotation-xml><svg><desc><b>eggs</b></desc><g><foreignObject><P>spam<TABLE><tr><td><img></td></table></foreignObject></g><g>quux</g></svg></annotation-xml></math>bar",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "math math": true,
-            "math mtext": true,
-            "i": true,
-            "math annotation-xml": true,
-            "svg svg": true,
-            "svg desc": true,
-            "b": true,
-            "svg g": true,
-            "svg foreignObject": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "img": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "foo"
-                      },
-                      {
-                        "tag": "math",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "mtext",
-                            "ns": "http://www.w3.org/1998/Math/MathML",
-                            "children": [
-                              {
-                                "tag": "i",
-                                "children": [
-                                  {
-                                    "text": "baz"
-                                  }
-                                ]
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "annotation-xml",
-                            "ns": "http://www.w3.org/1998/Math/MathML",
-                            "children": [
-                              {
-                                "tag": "svg",
-                                "ns": "http://www.w3.org/2000/svg",
-                                "children": [
-                                  {
-                                    "tag": "desc",
-                                    "ns": "http://www.w3.org/2000/svg",
-                                    "children": [
-                                      {
-                                        "tag": "b",
-                                        "children": [
-                                          {
-                                            "text": "eggs"
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  },
-                                  {
-                                    "tag": "g",
-                                    "ns": "http://www.w3.org/2000/svg",
-                                    "children": [
-                                      {
-                                        "tag": "foreignObject",
-                                        "ns": "http://www.w3.org/2000/svg",
-                                        "children": [
-                                          {
-                                            "tag": "p",
-                                            "children": [
-                                              {
-                                                "text": "spam"
-                                              }
-                                            ]
-                                          },
-                                          {
-                                            "tag": "table",
-                                            "children": [
-                                              {
-                                                "tag": "tbody",
-                                                "children": [
-                                                  {
-                                                    "tag": "tr",
-                                                    "children": [
-                                                      {
-                                                        "tag": "td",
-                                                        "children": [
-                                                          {
-                                                            "tag": "img"
-                                                          }
-                                                        ]
-                                                      }
-                                                    ]
-                                                  }
-                                                ]
-                                              }
-                                            ]
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  },
-                                  {
-                                    "tag": "g",
-                                    "ns": "http://www.w3.org/2000/svg",
-                                    "children": [
-                                      {
-                                        "text": "quux"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "text": "bar"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p>foo<math><mtext><i>baz</i></mtext><annotation-xml><svg><desc><b>eggs</b></desc><g><foreignObject><p>spam</p><table><tbody><tr><td><img></td></tr></tbody></table></foreignObject></g><g>quux</g></svg></annotation-xml></math>bar</p></body></html>",
-        "noQuirksBodyHtml": "<p>foo<math><mtext><i>baz</i></mtext><annotation-xml><svg><desc><b>eggs</b></desc><g><foreignObject><p>spam</p><table><tbody><tr><td><img></td></tr></tbody></table></foreignObject></g><g>quux</g></svg></annotation-xml></math>bar</p>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body>foo<math><mtext><i>baz</i></mtext><annotation-xml><svg><desc><b>eggs</b></desc><g><foreignObject><P>spam<TABLE><tr><td><img></td></table></foreignObject></g><g>quux</g></svg></annotation-xml></math>bar",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mtext": true,
-            "i": true,
-            "math annotation-xml": true,
-            "svg svg": true,
-            "svg desc": true,
-            "b": true,
-            "svg g": true,
-            "svg foreignObject": true,
-            "p": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "img": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "foo"
-                  },
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mtext",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "text": "baz"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "annotation-xml",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "svg",
-                            "ns": "http://www.w3.org/2000/svg",
-                            "children": [
-                              {
-                                "tag": "desc",
-                                "ns": "http://www.w3.org/2000/svg",
-                                "children": [
-                                  {
-                                    "tag": "b",
-                                    "children": [
-                                      {
-                                        "text": "eggs"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              },
-                              {
-                                "tag": "g",
-                                "ns": "http://www.w3.org/2000/svg",
-                                "children": [
-                                  {
-                                    "tag": "foreignObject",
-                                    "ns": "http://www.w3.org/2000/svg",
-                                    "children": [
-                                      {
-                                        "tag": "p",
-                                        "children": [
-                                          {
-                                            "text": "spam"
-                                          }
-                                        ]
-                                      },
-                                      {
-                                        "tag": "table",
-                                        "children": [
-                                          {
-                                            "tag": "tbody",
-                                            "children": [
-                                              {
-                                                "tag": "tr",
-                                                "children": [
-                                                  {
-                                                    "tag": "td",
-                                                    "children": [
-                                                      {
-                                                        "tag": "img"
-                                                      }
-                                                    ]
-                                                  }
-                                                ]
-                                              }
-                                            ]
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              },
-                              {
-                                "tag": "g",
-                                "ns": "http://www.w3.org/2000/svg",
-                                "children": [
-                                  {
-                                    "text": "quux"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "text": "bar"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>foo<math><mtext><i>baz</i></mtext><annotation-xml><svg><desc><b>eggs</b></desc><g><foreignObject><p>spam</p><table><tbody><tr><td><img></td></tr></tbody></table></foreignObject></g><g>quux</g></svg></annotation-xml></math>bar</body></html>",
-        "noQuirksBodyHtml": "foo<math><mtext><i>baz</i></mtext><annotation-xml><svg><desc><b>eggs</b></desc><g><foreignObject><p>spam</p><table><tbody><tr><td><img></td></tr></tbody></table></foreignObject></g><g>quux</g></svg></annotation-xml></math>bar"
-      }
-    }
-  ],
-  "tests14.dat": [
-    {
-      "data": "<!DOCTYPE html><html><body><xyz:abc></xyz:abc>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "xyz:abc": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "xyz:abc"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><xyz:abc></xyz:abc></body></html>",
-        "noQuirksBodyHtml": "<xyz:abc></xyz:abc>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><html><body><xyz:abc></xyz:abc><span></span>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "xyz:abc": true,
-            "span": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "xyz:abc"
-                  },
-                  {
-                    "tag": "span"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><xyz:abc></xyz:abc><span></span></body></html>",
-        "noQuirksBodyHtml": "<xyz:abc></xyz:abc><span></span>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><html><html abc:def=gh><xyz:abc></xyz:abc>",
-      "errors": [
-        "(1,38): non-html-root"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "xyz:abc": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "attrs": [
-              {
-                "name": "abc:def",
-                "value": "gh"
-              }
-            ],
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "xyz:abc"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html abc:def=\"gh\"><head></head><body><xyz:abc></xyz:abc></body></html>",
-        "noQuirksBodyHtml": "<xyz:abc></xyz:abc>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><html xml:lang=bar><html xml:lang=foo>",
-      "errors": [
-        "(1,53): non-html-root"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "attrs": [
-              {
-                "name": "xml:lang",
-                "value": "bar"
-              }
-            ],
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html xml:lang=\"bar\"><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><html 123=456>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "attrs": [
-              {
-                "name": "123",
-                "value": "456"
-              }
-            ],
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html 123=\"456\"><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><html 123=456><html 789=012>",
-      "errors": [
-        "(1,43): non-html-root"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "attrs": [
-              {
-                "name": "123",
-                "value": "456"
-              },
-              {
-                "name": "789",
-                "value": "012"
-              }
-            ],
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html 123=\"456\" 789=\"012\"><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><html><body 789=012>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "attrs": [
-                  {
-                    "name": "789",
-                    "value": "012"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body 789=\"012\"></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    }
-  ],
-  "tests15.dat": [
-    {
-      "data": "<!DOCTYPE html><p><b><i><u></p> <p>X",
-      "errors": [
-        "(1,31): unexpected-end-tag",
-        "(1,36): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "b": true,
-            "i": true,
-            "u": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "tag": "u"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "i",
-                        "children": [
-                          {
-                            "tag": "u",
-                            "children": [
-                              {
-                                "text": " "
-                              },
-                              {
-                                "tag": "p",
-                                "children": [
-                                  {
-                                    "text": "X"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><b><i><u></u></i></b></p><b><i><u> <p>X</p></u></i></b></body></html>",
-        "noQuirksBodyHtml": "<p><b><i><u></u></i></b></p><b><i><u> <p>X</p></u></i></b>"
-      }
-    },
-    {
-      "data": "<p><b><i><u></p>\n<p>X",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag",
-        "(1,16): unexpected-end-tag",
-        "(2,4): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "b": true,
-            "i": true,
-            "u": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "tag": "u"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "i",
-                        "children": [
-                          {
-                            "tag": "u",
-                            "children": [
-                              {
-                                "text": "\n"
-                              },
-                              {
-                                "tag": "p",
-                                "children": [
-                                  {
-                                    "text": "X"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><p><b><i><u></u></i></b></p><b><i><u>\n<p>X</p></u></i></b></body></html>",
-        "noQuirksBodyHtml": "<p><b><i><u></u></i></b></p><b><i><u>\n<p>X</p></u></i></b>"
-      }
-    },
-    {
-      "data": "<!doctype html></html> <head>",
-      "errors": [
-        "(1,29): expected-eof-but-got-start-tag",
-        "(1,29): unexpected-start-tag-ignored"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": " "
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body> </body></html>",
-        "noQuirksBodyHtml": " "
-      }
-    },
-    {
-      "data": "<!doctype html></body><meta>",
-      "errors": [
-        "(1,28): unexpected-start-tag-after-body"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "meta": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "meta"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><meta></body></html>",
-        "noQuirksBodyHtml": "<meta>"
-      }
-    },
-    {
-      "data": "<html></html><!-- foo -->",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          },
-          {
-            "comment": " foo "
-          }
-        ],
-        "html": "<html><head></head><body></body></html><!-- foo -->",
-        "noQuirksBodyHtml": "<!-- foo -->"
-      }
-    },
-    {
-      "data": "<!doctype html></body><title>X</title>",
-      "errors": [
-        "(1,29): unexpected-start-tag-after-body"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "title": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "X"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><title>X</title></body></html>",
-        "noQuirksBodyHtml": "<title>X</title>"
-      }
-    },
-    {
-      "data": "<!doctype html><table> X<meta></table>",
-      "errors": [
-        "(1,23): foster-parenting-character",
-        "(1,24): foster-parenting-character",
-        "(1,30): foster-parenting-start-character"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "meta": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": " X"
-                  },
-                  {
-                    "tag": "meta"
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body> X<meta><table></table></body></html>",
-        "noQuirksBodyHtml": " X<meta><table></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><table> x</table>",
-      "errors": [
-        "(1,23): foster-parenting-character",
-        "(1,24): foster-parenting-character"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": " x"
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body> x<table></table></body></html>",
-        "noQuirksBodyHtml": " x<table></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><table> x </table>",
-      "errors": [
-        "(1,23): foster-parenting-character",
-        "(1,24): foster-parenting-character",
-        "(1,25): foster-parenting-character"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": " x "
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body> x <table></table></body></html>",
-        "noQuirksBodyHtml": " x <table></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><table><tr> x</table>",
-      "errors": [
-        "(1,27): foster-parenting-character",
-        "(1,28): foster-parenting-character"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": " x"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body> x<table><tbody><tr></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": " x<table><tbody><tr></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><table>X<style> <tr>x </style> </table>",
-      "errors": [
-        "(1,23): foster-parenting-character"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "style": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "X"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "style",
-                        "children": [
-                          {
-                            "text": " <tr>x ",
-                            "no_escape": true
-                          }
-                        ]
-                      },
-                      {
-                        "text": " "
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>X<table><style> <tr>x </style> </table></body></html>",
-        "noQuirksBodyHtml": "X<table><style> <tr>x </style> </table>"
-      }
-    },
-    {
-      "data": "<!doctype html><div><table><a>foo</a> <tr><td>bar</td> </tr></table></div>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "a": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "a",
-                        "children": [
-                          {
-                            "text": "foo"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "table",
-                        "children": [
-                          {
-                            "text": " "
-                          },
-                          {
-                            "tag": "tbody",
-                            "children": [
-                              {
-                                "tag": "tr",
-                                "children": [
-                                  {
-                                    "tag": "td",
-                                    "children": [
-                                      {
-                                        "text": "bar"
-                                      }
-                                    ]
-                                  },
-                                  {
-                                    "text": " "
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><div><a>foo</a><table> <tbody><tr><td>bar</td> </tr></tbody></table></div></body></html>",
-        "noQuirksBodyHtml": "<div><a>foo</a><table> <tbody><tr><td>bar</td> </tr></tbody></table></div>"
-      }
-    },
-    {
-      "data": "<frame></frame></frame><frameset><frame><frameset><frame></frameset><noframes></frameset><noframes>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true,
-            "frame": true,
-            "noframes": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset",
-                "children": [
-                  {
-                    "tag": "frame"
-                  },
-                  {
-                    "tag": "frameset",
-                    "children": [
-                      {
-                        "tag": "frame"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "noframes",
-                    "children": [
-                      {
-                        "text": "</frameset><noframes>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset><frame><frameset><frame></frameset><noframes></frameset><noframes></noframes></frameset></html>",
-        "noQuirksBodyHtml": "<noframes></frameset><noframes></noframes>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><object></html>",
-      "errors": [
-        "(1,30): expected-body-in-scope",
-        "(1,30): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "object": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "object"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><object></object></body></html>",
-        "noQuirksBodyHtml": "<object></object>"
-      }
-    }
-  ],
-  "tests16.dat": [
-    {
-      "data": "<!doctype html><script>",
-      "errors": [
-        "(1,23): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script"
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script>a",
-      "errors": [
-        "(1,24): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "a",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script>a</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script>a</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><",
-      "errors": [
-        "(1,24): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script></",
-      "errors": [
-        "(1,25): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script></</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script></S",
-      "errors": [
-        "(1,26): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</S",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script></S</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></S</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script></SC",
-      "errors": [
-        "(1,27): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</SC",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script></SC</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></SC</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script></SCR",
-      "errors": [
-        "(1,28): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</SCR",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script></SCR</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></SCR</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script></SCRI",
-      "errors": [
-        "(1,29): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</SCRI",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script></SCRI</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></SCRI</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script></SCRIP",
-      "errors": [
-        "(1,30): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</SCRIP",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script></SCRIP</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></SCRIP</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script></SCRIPT",
-      "errors": [
-        "(1,31): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</SCRIPT",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script></SCRIPT</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></SCRIPT</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script></SCRIPT ",
-      "errors": [
-        "(1,32): expected-attribute-name-but-got-eof",
-        "(1,32): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script"
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script></s",
-      "errors": [
-        "(1,26): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</s",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script></s</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></s</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script></sc",
-      "errors": [
-        "(1,27): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</sc",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script></sc</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></sc</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script></scr",
-      "errors": [
-        "(1,28): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</scr",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script></scr</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></scr</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script></scri",
-      "errors": [
-        "(1,29): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</scri",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script></scri</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></scri</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script></scrip",
-      "errors": [
-        "(1,30): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</scrip",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script></scrip</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></scrip</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script></script",
-      "errors": [
-        "(1,31): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</script",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script></script</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></script</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script></script ",
-      "errors": [
-        "(1,32): expected-attribute-name-but-got-eof",
-        "(1,32): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script"
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!",
-      "errors": [
-        "(1,25): expected-script-data-but-got-eof",
-        "(1,25): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!a",
-      "errors": [
-        "(1,26): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!a",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!a</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!a</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!-",
-      "errors": [
-        "(1,26): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!-",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!-</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!-</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!-a",
-      "errors": [
-        "(1,27): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!-a",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!-a</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!-a</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--",
-      "errors": [
-        "(1,27): expected-named-closing-tag-but-got-eof",
-        "(1,27): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--a",
-      "errors": [
-        "(1,28): expected-named-closing-tag-but-got-eof",
-        "(1,28): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--a",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--a</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--a</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<",
-      "errors": [
-        "(1,28): expected-named-closing-tag-but-got-eof",
-        "(1,28): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<a",
-      "errors": [
-        "(1,29): expected-named-closing-tag-but-got-eof",
-        "(1,29): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<a",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<a</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<a</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--</",
-      "errors": [
-        "(1,29): expected-named-closing-tag-but-got-eof",
-        "(1,29): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--</",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--</</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--</</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--</script",
-      "errors": [
-        "(1,35): expected-named-closing-tag-but-got-eof",
-        "(1,35): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--</script",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--</script</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--</script</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--</script ",
-      "errors": [
-        "(1,36): expected-attribute-name-but-got-eof",
-        "(1,36): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<s",
-      "errors": [
-        "(1,29): expected-named-closing-tag-but-got-eof",
-        "(1,29): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<s",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<s</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<s</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script",
-      "errors": [
-        "(1,34): expected-named-closing-tag-but-got-eof",
-        "(1,34): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script ",
-      "errors": [
-        "(1,35): eof-in-script-in-script",
-        "(1,35): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script ",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script </script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script <",
-      "errors": [
-        "(1,36): eof-in-script-in-script",
-        "(1,36): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script <",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script <</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script <</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script <a",
-      "errors": [
-        "(1,37): eof-in-script-in-script",
-        "(1,37): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script <a",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script <a</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script <a</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script </",
-      "errors": [
-        "(1,37): eof-in-script-in-script",
-        "(1,37): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script </</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script </s",
-      "errors": [
-        "(1,38): eof-in-script-in-script",
-        "(1,38): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </s",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script </s</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </s</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script </script",
-      "errors": [
-        "(1,43): eof-in-script-in-script",
-        "(1,43): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </script",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script </script</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script </scripta",
-      "errors": [
-        "(1,44): eof-in-script-in-script",
-        "(1,44): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </scripta",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script </scripta</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </scripta</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script </script ",
-      "errors": [
-        "(1,44): expected-named-closing-tag-but-got-eof",
-        "(1,44): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </script ",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script </script </script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script </script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script </script>",
-      "errors": [
-        "(1,44): expected-named-closing-tag-but-got-eof",
-        "(1,44): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </script>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script </script></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script></script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script </script/",
-      "errors": [
-        "(1,44): expected-named-closing-tag-but-got-eof",
-        "(1,44): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </script/",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script </script/</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script/</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script </script <",
-      "errors": [
-        "(1,45): expected-named-closing-tag-but-got-eof",
-        "(1,45): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </script <",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script </script <</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script <</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script </script <a",
-      "errors": [
-        "(1,46): expected-named-closing-tag-but-got-eof",
-        "(1,46): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </script <a",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script </script <a</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script <a</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script </script </",
-      "errors": [
-        "(1,46): expected-named-closing-tag-but-got-eof",
-        "(1,46): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </script </",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script </script </</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script </</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script </script </script",
-      "errors": [
-        "(1,52): expected-named-closing-tag-but-got-eof",
-        "(1,52): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </script </script",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script </script </script</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script </script</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script </script </script ",
-      "errors": [
-        "(1,53): expected-attribute-name-but-got-eof",
-        "(1,53): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </script ",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script </script </script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script </script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script </script </script/",
-      "errors": [
-        "(1,53): unexpected-EOF-after-solidus-in-tag",
-        "(1,53): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </script ",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script </script </script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script </script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script </script </script>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </script ",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script </script </script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script </script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script -",
-      "errors": [
-        "(1,36): eof-in-script-in-script",
-        "(1,36): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script -",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script -</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script -</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script -a",
-      "errors": [
-        "(1,37): eof-in-script-in-script",
-        "(1,37): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script -a",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script -a</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script -a</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script -<",
-      "errors": [
-        "(1,37): eof-in-script-in-script",
-        "(1,37): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script -<",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script -<</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script -<</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script --",
-      "errors": [
-        "(1,37): eof-in-script-in-script",
-        "(1,37): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script --",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script --</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script --</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script --a",
-      "errors": [
-        "(1,38): eof-in-script-in-script",
-        "(1,38): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script --a",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script --a</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script --a</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script --<",
-      "errors": [
-        "(1,38): eof-in-script-in-script",
-        "(1,38): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script --<",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script --<</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script --<</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script -->",
-      "errors": [
-        "(1,38): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script -->",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script --></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script --></script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script --><",
-      "errors": [
-        "(1,39): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script --><",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script --><</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script --><</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script --></",
-      "errors": [
-        "(1,40): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script --></",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script --></</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script --></</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script --></script",
-      "errors": [
-        "(1,46): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script --></script",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script --></script</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script --></script</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script --></script ",
-      "errors": [
-        "(1,47): expected-attribute-name-but-got-eof",
-        "(1,47): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script -->",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script --></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script --></script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script --></script/",
-      "errors": [
-        "(1,47): unexpected-EOF-after-solidus-in-tag",
-        "(1,47): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script -->",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script --></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script --></script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script --></script>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script -->",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script --></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script --></script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script><\\/script>--></script>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script><\\/script>-->",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script><\\/script>--></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script><\\/script>--></script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script></scr'+'ipt>--></script>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script></scr'+'ipt>-->",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script></scr'+'ipt>--></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script></scr'+'ipt>--></script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script></script><script></script></script>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script></script><script></script>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script></script><script></script></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script></script><script></script></script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script></script><script></script>--><!--</script>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script></script><script></script>--><!--",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script></script><script></script>--><!--</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script></script><script></script>--><!--</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script></script><script></script>-- ></script>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script></script><script></script>-- >",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script></script><script></script>-- ></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script></script><script></script>-- ></script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script></script><script></script>- -></script>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script></script><script></script>- ->",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script></script><script></script>- -></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script></script><script></script>- -></script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script></script><script></script>- - ></script>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script></script><script></script>- - >",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script></script><script></script>- - ></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script></script><script></script>- - ></script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script></script><script></script>-></script>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script></script><script></script>->",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script></script><script></script>-></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script></script><script></script>-></script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script>--!></script>X",
-      "errors": [
-        "(1,49): expected-named-closing-tag-but-got-eof",
-        "(1,49): unexpected-EOF-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script>--!></script>X",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script>--!></script>X</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script>--!></script>X</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<scr'+'ipt></script>--></script>",
-      "errors": [
-        "(1,59): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<scr'+'ipt>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<scr'+'ipt></script></head><body>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<script><!--<scr'+'ipt></script>--&gt;"
-      }
-    },
-    {
-      "data": "<!doctype html><script><!--<script></scr'+'ipt></script>X",
-      "errors": [
-        "(1,57): expected-named-closing-tag-but-got-eof",
-        "(1,57): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script></scr'+'ipt></script>X",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script><!--<script></scr'+'ipt></script>X</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script></scr'+'ipt></script>X</script>"
-      }
-    },
-    {
-      "data": "<!doctype html><style><!--<style></style>--></style>",
-      "errors": [
-        "(1,52): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": "<!--<style>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><style><!--<style></style></head><body>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<style><!--<style></style>--&gt;"
-      }
-    },
-    {
-      "data": "<!doctype html><style><!--</style>X",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": "<!--",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "X"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><style><!--</style></head><body>X</body></html>",
-        "noQuirksBodyHtml": "<style><!--</style>X"
-      }
-    },
-    {
-      "data": "<!doctype html><style><!--...</style>...--></style>",
-      "errors": [
-        "(1,51): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": "<!--...",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "...-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><style><!--...</style></head><body>...--&gt;</body></html>",
-        "noQuirksBodyHtml": "<style><!--...</style>...--&gt;"
-      }
-    },
-    {
-      "data": "<!doctype html><style><!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style></style>X",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": "<!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "X"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><style><!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style></style></head><body>X</body></html>",
-        "noQuirksBodyHtml": "<style><!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style></style>X"
-      }
-    },
-    {
-      "data": "<!doctype html><style><!--...<style><!--...--!></style>--></style>",
-      "errors": [
-        "(1,66): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": "<!--...<style><!--...--!>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><style><!--...<style><!--...--!></style></head><body>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<style><!--...<style><!--...--!></style>--&gt;"
-      }
-    },
-    {
-      "data": "<!doctype html><style><!--...</style><!-- --><style>@import ...</style>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": "<!--...",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "comment": " "
-                  },
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": "@import ...",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><style><!--...</style><!-- --><style>@import ...</style></head><body></body></html>",
-        "noQuirksBodyHtml": "<style><!--...</style><!-- --><style>@import ...</style>"
-      }
-    },
-    {
-      "data": "<!doctype html><style>...<style><!--...</style><!-- --></style>",
-      "errors": [
-        "(1,63): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": "...<style><!--...",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "comment": " "
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><style>...<style><!--...</style><!-- --></head><body></body></html>",
-        "noQuirksBodyHtml": "<style>...<style><!--...</style><!-- -->"
-      }
-    },
-    {
-      "data": "<!doctype html><style>...<!--[if IE]><style>...</style>X",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": "...<!--[if IE]><style>...",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "X"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><style>...<!--[if IE]><style>...</style></head><body>X</body></html>",
-        "noQuirksBodyHtml": "<style>...<!--[if IE]><style>...</style>X"
-      }
-    },
-    {
-      "data": "<!doctype html><title><!--<title></title>--></title>",
-      "errors": [
-        "(1,52): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "title": true,
-            "body": true
-          },
-          "doctype": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "<!--<title>",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><title>&lt;!--&lt;title&gt;</title></head><body>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<title>&lt;!--&lt;title&gt;</title>--&gt;"
-      }
-    },
-    {
-      "data": "<!doctype html><title>&lt;/title></title>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "title": true,
-            "body": true
-          },
-          "doctype": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "</title>",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><title>&lt;/title&gt;</title></head><body></body></html>",
-        "noQuirksBodyHtml": "<title>&lt;/title&gt;</title>"
-      }
-    },
-    {
-      "data": "<!doctype html><title>foo/title><link></head><body>X",
-      "errors": [
-        "(1,52): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "title": true,
-            "body": true
-          },
-          "doctype": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "foo/title><link></head><body>X",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><title>foo/title&gt;&lt;link&gt;&lt;/head&gt;&lt;body&gt;X</title></head><body></body></html>",
-        "noQuirksBodyHtml": "<title>foo/title&gt;&lt;link&gt;&lt;/head&gt;&lt;body&gt;X</title>"
-      }
-    },
-    {
-      "data": "<!doctype html><noscript><!--<noscript></noscript>--></noscript>",
-      "errors": [
-        "(1,64): unexpected-end-tag"
-      ],
-      "script": "on",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "text": "<!--<noscript>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><noscript><!--<noscript></noscript></head><body>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<noscript><!--<noscript></noscript>--></noscript>"
-      }
-    },
-    {
-      "data": "<!doctype html><noscript><!--<noscript></noscript>--></noscript>",
-      "errors": [],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true
-          },
-          "doctype": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "comment": "<noscript></noscript>"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><noscript><!--<noscript></noscript>--></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript><!--<noscript></noscript>--></noscript>"
-      }
-    },
-    {
-      "data": "<!doctype html><noscript><!--</noscript>X<noscript>--></noscript>",
-      "errors": [],
-      "script": "on",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "text": "<!--",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "X"
-                  },
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "text": "-->",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><noscript><!--</noscript></head><body>X<noscript>--></noscript></body></html>",
-        "noQuirksBodyHtml": "<noscript><!--</noscript>X<noscript>--></noscript>"
-      }
-    },
-    {
-      "data": "<!doctype html><noscript><!--</noscript>X<noscript>--></noscript>",
-      "errors": [],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true
-          },
-          "doctype": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "comment": "</noscript>X<noscript>"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><noscript><!--</noscript>X<noscript>--></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript><!--</noscript>X<noscript>--></noscript>"
-      }
-    },
-    {
-      "data": "<!doctype html><noscript><iframe></noscript>X",
-      "errors": [],
-      "script": "on",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "text": "<iframe>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "X"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><noscript><iframe></noscript></head><body>X</body></html>",
-        "noQuirksBodyHtml": "<noscript><iframe></noscript>X</iframe></noscript>"
-      }
-    },
-    {
-      "data": "<!doctype html><noscript><iframe></noscript>X",
-      "errors": [
-        " * (1,34) unexpected token in head noscript",
-        " * (1,46) unexpected EOF"
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true,
-            "iframe": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript"
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "iframe",
-                    "children": [
-                      {
-                        "text": "</noscript>X",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><noscript></noscript></head><body><iframe></noscript>X</iframe></body></html>",
-        "noQuirksBodyHtml": "<noscript><iframe></noscript>X</iframe></noscript>"
-      }
-    },
-    {
-      "data": "<!doctype html><noframes><!--<noframes></noframes>--></noframes>",
-      "errors": [
-        "(1,64): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noframes": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noframes",
-                    "children": [
-                      {
-                        "text": "<!--<noframes>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><noframes><!--<noframes></noframes></head><body>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<noframes><!--<noframes></noframes>--&gt;"
-      }
-    },
-    {
-      "data": "<!doctype html><noframes><body><script><!--...</script></body></noframes></html>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noframes": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noframes",
-                    "children": [
-                      {
-                        "text": "<body><script><!--...</script></body>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><noframes><body><script><!--...</script></body></noframes></head><body></body></html>",
-        "noQuirksBodyHtml": "<noframes><body><script><!--...</script></body></noframes>"
-      }
-    },
-    {
-      "data": "<!doctype html><textarea><!--<textarea></textarea>--></textarea>",
-      "errors": [
-        "(1,64): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "textarea": true
-          },
-          "doctype": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "textarea",
-                    "children": [
-                      {
-                        "text": "<!--<textarea>",
-                        "escaped": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><textarea>&lt;!--&lt;textarea&gt;</textarea>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<textarea>&lt;!--&lt;textarea&gt;</textarea>--&gt;"
-      }
-    },
-    {
-      "data": "<!doctype html><textarea>&lt;/textarea></textarea>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "textarea": true
-          },
-          "doctype": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "textarea",
-                    "children": [
-                      {
-                        "text": "</textarea>",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><textarea>&lt;/textarea&gt;</textarea></body></html>",
-        "noQuirksBodyHtml": "<textarea>&lt;/textarea&gt;</textarea>"
-      }
-    },
-    {
-      "data": "<!doctype html><textarea>&lt;</textarea>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "textarea": true
-          },
-          "doctype": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "textarea",
-                    "children": [
-                      {
-                        "text": "<",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><textarea>&lt;</textarea></body></html>",
-        "noQuirksBodyHtml": "<textarea>&lt;</textarea>"
-      }
-    },
-    {
-      "data": "<!doctype html><textarea>a&lt;b</textarea>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "textarea": true
-          },
-          "doctype": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "textarea",
-                    "children": [
-                      {
-                        "text": "a<b",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><textarea>a&lt;b</textarea></body></html>",
-        "noQuirksBodyHtml": "<textarea>a&lt;b</textarea>"
-      }
-    },
-    {
-      "data": "<!doctype html><iframe><!--<iframe></iframe>--></iframe>",
-      "errors": [
-        "(1,56): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "iframe": true
-          },
-          "doctype": true,
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "iframe",
-                    "children": [
-                      {
-                        "text": "<!--<iframe>",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><iframe><!--<iframe></iframe>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<iframe><!--<iframe></iframe>--&gt;"
-      }
-    },
-    {
-      "data": "<!doctype html><iframe>...<!--X->...<!--/X->...</iframe>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "iframe": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "iframe",
-                    "children": [
-                      {
-                        "text": "...<!--X->...<!--/X->...",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><iframe>...<!--X->...<!--/X->...</iframe></body></html>",
-        "noQuirksBodyHtml": "<iframe>...<!--X->...<!--/X->...</iframe>"
-      }
-    },
-    {
-      "data": "<!doctype html><xmp><!--<xmp></xmp>--></xmp>",
-      "errors": [
-        "(1,44): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "xmp": true
-          },
-          "doctype": true,
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "xmp",
-                    "children": [
-                      {
-                        "text": "<!--<xmp>",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><xmp><!--<xmp></xmp>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<xmp><!--<xmp></xmp>--&gt;"
-      }
-    },
-    {
-      "data": "<!doctype html><noembed><!--<noembed></noembed>--></noembed>",
-      "errors": [
-        "(1,60): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "noembed": true
-          },
-          "doctype": true,
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "noembed",
-                    "children": [
-                      {
-                        "text": "<!--<noembed>",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><noembed><!--<noembed></noembed>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<noembed><!--<noembed></noembed>--&gt;"
-      }
-    },
-    {
-      "data": "<script>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,8): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script"
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></script>"
-      }
-    },
-    {
-      "data": "<script>a",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,9): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "a",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script>a</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script>a</script>"
-      }
-    },
-    {
-      "data": "<script><",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,9): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><</script>"
-      }
-    },
-    {
-      "data": "<script></",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,10): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script></</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></</script>"
-      }
-    },
-    {
-      "data": "<script></S",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,11): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</S",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script></S</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></S</script>"
-      }
-    },
-    {
-      "data": "<script></SC",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,12): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</SC",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script></SC</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></SC</script>"
-      }
-    },
-    {
-      "data": "<script></SCR",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,13): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</SCR",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script></SCR</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></SCR</script>"
-      }
-    },
-    {
-      "data": "<script></SCRI",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,14): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</SCRI",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script></SCRI</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></SCRI</script>"
-      }
-    },
-    {
-      "data": "<script></SCRIP",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,15): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</SCRIP",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script></SCRIP</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></SCRIP</script>"
-      }
-    },
-    {
-      "data": "<script></SCRIPT",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,16): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</SCRIPT",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script></SCRIPT</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></SCRIPT</script>"
-      }
-    },
-    {
-      "data": "<script></SCRIPT ",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,17): expected-attribute-name-but-got-eof",
-        "(1,17): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script"
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></script>"
-      }
-    },
-    {
-      "data": "<script></s",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,11): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</s",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script></s</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></s</script>"
-      }
-    },
-    {
-      "data": "<script></sc",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,12): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</sc",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script></sc</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></sc</script>"
-      }
-    },
-    {
-      "data": "<script></scr",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,13): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</scr",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script></scr</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></scr</script>"
-      }
-    },
-    {
-      "data": "<script></scri",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,14): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</scri",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script></scri</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></scri</script>"
-      }
-    },
-    {
-      "data": "<script></scrip",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,15): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</scrip",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script></scrip</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></scrip</script>"
-      }
-    },
-    {
-      "data": "<script></script",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,16): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</script",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script></script</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></script</script>"
-      }
-    },
-    {
-      "data": "<script></script ",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,17): expected-attribute-name-but-got-eof",
-        "(1,17): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script"
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></script>"
-      }
-    },
-    {
-      "data": "<script><!",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,10): expected-script-data-but-got-eof",
-        "(1,10): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!</script>"
-      }
-    },
-    {
-      "data": "<script><!a",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,11): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!a",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!a</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!a</script>"
-      }
-    },
-    {
-      "data": "<script><!-",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,11): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!-",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!-</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!-</script>"
-      }
-    },
-    {
-      "data": "<script><!-a",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,12): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!-a",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!-a</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!-a</script>"
-      }
-    },
-    {
-      "data": "<script><!--",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,12): expected-named-closing-tag-but-got-eof",
-        "(1,12): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--</script>"
-      }
-    },
-    {
-      "data": "<script><!--a",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,13): expected-named-closing-tag-but-got-eof",
-        "(1,13): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--a",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--a</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--a</script>"
-      }
-    },
-    {
-      "data": "<script><!--<",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,13): expected-named-closing-tag-but-got-eof",
-        "(1,13): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<</script>"
-      }
-    },
-    {
-      "data": "<script><!--<a",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,14): expected-named-closing-tag-but-got-eof",
-        "(1,14): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<a",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<a</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<a</script>"
-      }
-    },
-    {
-      "data": "<script><!--</",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,14): expected-named-closing-tag-but-got-eof",
-        "(1,14): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--</",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--</</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--</</script>"
-      }
-    },
-    {
-      "data": "<script><!--</script",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,20): expected-named-closing-tag-but-got-eof",
-        "(1,20): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--</script",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--</script</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--</script</script>"
-      }
-    },
-    {
-      "data": "<script><!--</script ",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,21): expected-attribute-name-but-got-eof",
-        "(1,21): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--</script>"
-      }
-    },
-    {
-      "data": "<script><!--<s",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,14): expected-named-closing-tag-but-got-eof",
-        "(1,14): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<s",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<s</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<s</script>"
-      }
-    },
-    {
-      "data": "<script><!--<script",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,19): expected-named-closing-tag-but-got-eof",
-        "(1,19): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script</script>"
-      }
-    },
-    {
-      "data": "<script><!--<script ",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,20): eof-in-script-in-script",
-        "(1,20): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script ",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script </script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script>"
-      }
-    },
-    {
-      "data": "<script><!--<script <",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,21): eof-in-script-in-script",
-        "(1,21): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script <",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script <</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script <</script>"
-      }
-    },
-    {
-      "data": "<script><!--<script <a",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,22): eof-in-script-in-script",
-        "(1,22): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script <a",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script <a</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script <a</script>"
-      }
-    },
-    {
-      "data": "<script><!--<script </",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,22): eof-in-script-in-script",
-        "(1,22): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script </</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </</script>"
-      }
-    },
-    {
-      "data": "<script><!--<script </s",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,23): eof-in-script-in-script",
-        "(1,23): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </s",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script </s</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </s</script>"
-      }
-    },
-    {
-      "data": "<script><!--<script </script",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,28): eof-in-script-in-script",
-        "(1,28): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </script",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script </script</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script</script>"
-      }
-    },
-    {
-      "data": "<script><!--<script </scripta",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,29): eof-in-script-in-script",
-        "(1,29): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </scripta",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script </scripta</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </scripta</script>"
-      }
-    },
-    {
-      "data": "<script><!--<script </script ",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,29): expected-named-closing-tag-but-got-eof",
-        "(1,29): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </script ",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script </script </script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script </script>"
-      }
-    },
-    {
-      "data": "<script><!--<script </script>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,29): expected-named-closing-tag-but-got-eof",
-        "(1,29): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </script>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script </script></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script></script>"
-      }
-    },
-    {
-      "data": "<script><!--<script </script/",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,29): expected-named-closing-tag-but-got-eof",
-        "(1,29): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </script/",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script </script/</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script/</script>"
-      }
-    },
-    {
-      "data": "<script><!--<script </script <",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,30): expected-named-closing-tag-but-got-eof",
-        "(1,30): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </script <",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script </script <</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script <</script>"
-      }
-    },
-    {
-      "data": "<script><!--<script </script <a",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,31): expected-named-closing-tag-but-got-eof",
-        "(1,31): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </script <a",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script </script <a</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script <a</script>"
-      }
-    },
-    {
-      "data": "<script><!--<script </script </",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,31): expected-named-closing-tag-but-got-eof",
-        "(1,31): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </script </",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script </script </</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script </</script>"
-      }
-    },
-    {
-      "data": "<script><!--<script </script </script",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,37): expected-named-closing-tag-but-got-eof",
-        "(1,37): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </script </script",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script </script </script</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script </script</script>"
-      }
-    },
-    {
-      "data": "<script><!--<script </script </script ",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,38): expected-attribute-name-but-got-eof",
-        "(1,38): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </script ",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script </script </script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script </script>"
-      }
-    },
-    {
-      "data": "<script><!--<script </script </script/",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,38): unexpected-EOF-after-solidus-in-tag",
-        "(1,38): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </script ",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script </script </script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script </script>"
-      }
-    },
-    {
-      "data": "<script><!--<script </script </script>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script </script ",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script </script </script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script </script </script>"
-      }
-    },
-    {
-      "data": "<script><!--<script -",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,21): eof-in-script-in-script",
-        "(1,21): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script -",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script -</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script -</script>"
-      }
-    },
-    {
-      "data": "<script><!--<script -a",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,22): eof-in-script-in-script",
-        "(1,22): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script -a",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script -a</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script -a</script>"
-      }
-    },
-    {
-      "data": "<script><!--<script --",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,22): eof-in-script-in-script",
-        "(1,22): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script --",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script --</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script --</script>"
-      }
-    },
-    {
-      "data": "<script><!--<script --a",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,23): eof-in-script-in-script",
-        "(1,23): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script --a",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script --a</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script --a</script>"
-      }
-    },
-    {
-      "data": "<script><!--<script -->",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,23): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script -->",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script --></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script --></script>"
-      }
-    },
-    {
-      "data": "<script><!--<script --><",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,24): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script --><",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script --><</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script --><</script>"
-      }
-    },
-    {
-      "data": "<script><!--<script --></",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,25): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script --></",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script --></</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script --></</script>"
-      }
-    },
-    {
-      "data": "<script><!--<script --></script",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,31): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script --></script",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script --></script</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script --></script</script>"
-      }
-    },
-    {
-      "data": "<script><!--<script --></script ",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,32): expected-attribute-name-but-got-eof",
-        "(1,32): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script -->",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script --></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script --></script>"
-      }
-    },
-    {
-      "data": "<script><!--<script --></script/",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,32): unexpected-EOF-after-solidus-in-tag",
-        "(1,32): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script -->",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script --></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script --></script>"
-      }
-    },
-    {
-      "data": "<script><!--<script --></script>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script -->",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script --></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script --></script>"
-      }
-    },
-    {
-      "data": "<script><!--<script><\\/script>--></script>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script><\\/script>-->",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script><\\/script>--></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script><\\/script>--></script>"
-      }
-    },
-    {
-      "data": "<script><!--<script></scr'+'ipt>--></script>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script></scr'+'ipt>-->",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script></scr'+'ipt>--></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script></scr'+'ipt>--></script>"
-      }
-    },
-    {
-      "data": "<script><!--<script></script><script></script></script>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script></script><script></script>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script></script><script></script></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script></script><script></script></script>"
-      }
-    },
-    {
-      "data": "<script><!--<script></script><script></script>--><!--</script>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script></script><script></script>--><!--",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script></script><script></script>--><!--</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script></script><script></script>--><!--</script>"
-      }
-    },
-    {
-      "data": "<script><!--<script></script><script></script>-- ></script>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script></script><script></script>-- >",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script></script><script></script>-- ></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script></script><script></script>-- ></script>"
-      }
-    },
-    {
-      "data": "<script><!--<script></script><script></script>- -></script>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script></script><script></script>- ->",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script></script><script></script>- -></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script></script><script></script>- -></script>"
-      }
-    },
-    {
-      "data": "<script><!--<script></script><script></script>- - ></script>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script></script><script></script>- - >",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script></script><script></script>- - ></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script></script><script></script>- - ></script>"
-      }
-    },
-    {
-      "data": "<script><!--<script></script><script></script>-></script>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script></script><script></script>->",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script></script><script></script>-></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script></script><script></script>-></script>"
-      }
-    },
-    {
-      "data": "<script><!--<script>--!></script>X",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,34): expected-named-closing-tag-but-got-eof",
-        "(1,34): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script>--!></script>X",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script>--!></script>X</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script>--!></script>X</script>"
-      }
-    },
-    {
-      "data": "<script><!--<scr'+'ipt></script>--></script>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,44): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<scr'+'ipt>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<scr'+'ipt></script></head><body>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<script><!--<scr'+'ipt></script>--&gt;"
-      }
-    },
-    {
-      "data": "<script><!--<script></scr'+'ipt></script>X",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,42): expected-named-closing-tag-but-got-eof",
-        "(1,42): unexpected-eof-in-text-mode"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "<!--<script></scr'+'ipt></script>X",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script><!--<script></scr'+'ipt></script>X</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script><!--<script></scr'+'ipt></script>X</script>"
-      }
-    },
-    {
-      "data": "<style><!--<style></style>--></style>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,37): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": "<!--<style>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><style><!--<style></style></head><body>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<style><!--<style></style>--&gt;"
-      }
-    },
-    {
-      "data": "<style><!--</style>X",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": "<!--",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "X"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><style><!--</style></head><body>X</body></html>",
-        "noQuirksBodyHtml": "<style><!--</style>X"
-      }
-    },
-    {
-      "data": "<style><!--...</style>...--></style>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,36): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": "<!--...",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "...-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><style><!--...</style></head><body>...--&gt;</body></html>",
-        "noQuirksBodyHtml": "<style><!--...</style>...--&gt;"
-      }
-    },
-    {
-      "data": "<style><!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style></style>X",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": "<!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "X"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><style><!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style></style></head><body>X</body></html>",
-        "noQuirksBodyHtml": "<style><!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style></style>X"
-      }
-    },
-    {
-      "data": "<style><!--...<style><!--...--!></style>--></style>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,51): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": "<!--...<style><!--...--!>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><style><!--...<style><!--...--!></style></head><body>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<style><!--...<style><!--...--!></style>--&gt;"
-      }
-    },
-    {
-      "data": "<style><!--...</style><!-- --><style>@import ...</style>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "no_escape": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": "<!--...",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "comment": " "
-                  },
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": "@import ...",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><style><!--...</style><!-- --><style>@import ...</style></head><body></body></html>",
-        "noQuirksBodyHtml": "<style><!--...</style><!-- --><style>@import ...</style>"
-      }
-    },
-    {
-      "data": "<style>...<style><!--...</style><!-- --></style>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,48): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "no_escape": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": "...<style><!--...",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "comment": " "
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><style>...<style><!--...</style><!-- --></head><body></body></html>",
-        "noQuirksBodyHtml": "<style>...<style><!--...</style><!-- -->"
-      }
-    },
-    {
-      "data": "<style>...<!--[if IE]><style>...</style>X",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": "...<!--[if IE]><style>...",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "X"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><style>...<!--[if IE]><style>...</style></head><body>X</body></html>",
-        "noQuirksBodyHtml": "<style>...<!--[if IE]><style>...</style>X"
-      }
-    },
-    {
-      "data": "<title><!--<title></title>--></title>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,37): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "title": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "<!--<title>",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><title>&lt;!--&lt;title&gt;</title></head><body>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<title>&lt;!--&lt;title&gt;</title>--&gt;"
-      }
-    },
-    {
-      "data": "<title>&lt;/title></title>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "title": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "</title>",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><title>&lt;/title&gt;</title></head><body></body></html>",
-        "noQuirksBodyHtml": "<title>&lt;/title&gt;</title>"
-      }
-    },
-    {
-      "data": "<title>foo/title><link></head><body>X",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,37): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "title": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "foo/title><link></head><body>X",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><title>foo/title&gt;&lt;link&gt;&lt;/head&gt;&lt;body&gt;X</title></head><body></body></html>",
-        "noQuirksBodyHtml": "<title>foo/title&gt;&lt;link&gt;&lt;/head&gt;&lt;body&gt;X</title>"
-      }
-    },
-    {
-      "data": "<noscript><!--<noscript></noscript>--></noscript>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag",
-        "(1,49): unexpected-end-tag"
-      ],
-      "script": "on",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true
-          },
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "text": "<!--<noscript>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript><!--<noscript></noscript></head><body>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<noscript><!--<noscript></noscript>--></noscript>"
-      }
-    },
-    {
-      "data": "<noscript><!--<noscript></noscript>--></noscript>",
-      "errors": [
-        " * (1,11) missing DOCTYPE"
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "comment": "<noscript></noscript>"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript><!--<noscript></noscript>--></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript><!--<noscript></noscript>--></noscript>"
-      }
-    },
-    {
-      "data": "<noscript><!--</noscript>X<noscript>--></noscript>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag"
-      ],
-      "script": "on",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "text": "<!--",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "X"
-                  },
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "text": "-->",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript><!--</noscript></head><body>X<noscript>--></noscript></body></html>",
-        "noQuirksBodyHtml": "<noscript><!--</noscript>X<noscript>--></noscript>"
-      }
-    },
-    {
-      "data": "<noscript><!--</noscript>X<noscript>--></noscript>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag"
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "comment": "</noscript>X<noscript>"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript><!--</noscript>X<noscript>--></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript><!--</noscript>X<noscript>--></noscript>"
-      }
-    },
-    {
-      "data": "<noscript><iframe></noscript>X",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag"
-      ],
-      "script": "on",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "text": "<iframe>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "X"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript><iframe></noscript></head><body>X</body></html>",
-        "noQuirksBodyHtml": "<noscript><iframe></noscript>X</iframe></noscript>"
-      }
-    },
-    {
-      "data": "<noscript><iframe></noscript>X",
-      "errors": [
-        " * (1,11) missing DOCTYPE",
-        " * (1,19) unexpected token in head noscript",
-        " * (1,31) unexpected EOF"
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true,
-            "iframe": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript"
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "iframe",
-                    "children": [
-                      {
-                        "text": "</noscript>X",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript></noscript></head><body><iframe></noscript>X</iframe></body></html>",
-        "noQuirksBodyHtml": "<noscript><iframe></noscript>X</iframe></noscript>"
-      }
-    },
-    {
-      "data": "<noframes><!--<noframes></noframes>--></noframes>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag",
-        "(1,49): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noframes": true,
-            "body": true
-          },
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noframes",
-                    "children": [
-                      {
-                        "text": "<!--<noframes>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noframes><!--<noframes></noframes></head><body>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<noframes><!--<noframes></noframes>--&gt;"
-      }
-    },
-    {
-      "data": "<noframes><body><script><!--...</script></body></noframes></html>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noframes": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noframes",
-                    "children": [
-                      {
-                        "text": "<body><script><!--...</script></body>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noframes><body><script><!--...</script></body></noframes></head><body></body></html>",
-        "noQuirksBodyHtml": "<noframes><body><script><!--...</script></body></noframes>"
-      }
-    },
-    {
-      "data": "<textarea><!--<textarea></textarea>--></textarea>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag",
-        "(1,49): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "textarea": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "textarea",
-                    "children": [
-                      {
-                        "text": "<!--<textarea>",
-                        "escaped": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><textarea>&lt;!--&lt;textarea&gt;</textarea>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<textarea>&lt;!--&lt;textarea&gt;</textarea>--&gt;"
-      }
-    },
-    {
-      "data": "<textarea>&lt;/textarea></textarea>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "textarea": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "textarea",
-                    "children": [
-                      {
-                        "text": "</textarea>",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><textarea>&lt;/textarea&gt;</textarea></body></html>",
-        "noQuirksBodyHtml": "<textarea>&lt;/textarea&gt;</textarea>"
-      }
-    },
-    {
-      "data": "<iframe><!--<iframe></iframe>--></iframe>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,41): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "iframe": true
-          },
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "iframe",
-                    "children": [
-                      {
-                        "text": "<!--<iframe>",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><iframe><!--<iframe></iframe>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<iframe><!--<iframe></iframe>--&gt;"
-      }
-    },
-    {
-      "data": "<iframe>...<!--X->...<!--/X->...</iframe>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "iframe": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "iframe",
-                    "children": [
-                      {
-                        "text": "...<!--X->...<!--/X->...",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><iframe>...<!--X->...<!--/X->...</iframe></body></html>",
-        "noQuirksBodyHtml": "<iframe>...<!--X->...<!--/X->...</iframe>"
-      }
-    },
-    {
-      "data": "<xmp><!--<xmp></xmp>--></xmp>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,29): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "xmp": true
-          },
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "xmp",
-                    "children": [
-                      {
-                        "text": "<!--<xmp>",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><xmp><!--<xmp></xmp>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<xmp><!--<xmp></xmp>--&gt;"
-      }
-    },
-    {
-      "data": "<noembed><!--<noembed></noembed>--></noembed>",
-      "errors": [
-        "(1,9): expected-doctype-but-got-start-tag",
-        "(1,45): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "noembed": true
-          },
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "noembed",
-                    "children": [
-                      {
-                        "text": "<!--<noembed>",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><noembed><!--<noembed></noembed>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<noembed><!--<noembed></noembed>--&gt;"
-      }
-    },
-    {
-      "data": "<!doctype html><table>\n",
-      "errors": [
-        "(2,0): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "text": "\n"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table>\n</table></body></html>",
-        "noQuirksBodyHtml": "<table>\n</table>"
-      }
-    },
-    {
-      "data": "<!doctype html><table><td><span><font></span><span>",
-      "errors": [
-        "(1,26): unexpected-cell-in-table-body",
-        "(1,45): unexpected-end-tag",
-        "(1,51): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "span": true,
-            "font": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "span",
-                                    "children": [
-                                      {
-                                        "tag": "font"
-                                      }
-                                    ]
-                                  },
-                                  {
-                                    "tag": "font",
-                                    "children": [
-                                      {
-                                        "tag": "span"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><span><font></font></span><font><span></span></font></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><span><font></font></span><font><span></span></font></td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><form><table></form><form></table></form>",
-      "errors": [
-        "(1,35): unexpected-end-tag-implies-table-voodoo",
-        "(1,35): unexpected-end-tag",
-        "(1,41): unexpected-form-in-table",
-        "(1,56): unexpected-end-tag",
-        "(1,56): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "form": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "form",
-                    "children": [
-                      {
-                        "tag": "table",
-                        "children": [
-                          {
-                            "tag": "form"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><form><table><form></form></table></form></body></html>",
-        "noQuirksBodyHtml": "<form><table><form></form></table></form>"
-      }
-    }
-  ],
-  "tests17.dat": [
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "table": true,
-            "tbody": true,
-            "tr": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select></select><table><tbody><tr></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<select></select><table><tbody><tr></tr></tbody></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select></select><table><tbody><tr><td></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<select></select><table><tbody><tr><td></td></tr></tbody></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "select": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "select"
-                                  }
-                                ]
-                              },
-                              {
-                                "tag": "td"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><select></select></td><td></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><select></select></td><td></td></tr></tbody></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "th": true,
-            "select": true,
-            "td": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "th",
-                                "children": [
-                                  {
-                                    "tag": "select"
-                                  }
-                                ]
-                              },
-                              {
-                                "tag": "td"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><th><select></select></th><td></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><th><select></select></th><td></td></tr></tbody></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "caption": true,
-            "select": true,
-            "tbody": true,
-            "tr": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "caption",
-                        "children": [
-                          {
-                            "tag": "select"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><caption><select></select></caption><tbody><tr></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><caption><select></select></caption><tbody><tr></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><select><tr>",
-      "errors": [
-        "(1,27): unexpected-start-tag-in-select",
-        "(1,27): eof-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select></select></body></html>",
-        "noQuirksBodyHtml": "<select></select>"
-      }
-    },
-    {
-      "data": "<!doctype html><select><td>",
-      "errors": [
-        "(1,27): unexpected-start-tag-in-select",
-        "(1,27): eof-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select></select></body></html>",
-        "noQuirksBodyHtml": "<select></select>"
-      }
-    },
-    {
-      "data": "<!doctype html><select><th>",
-      "errors": [
-        "(1,27): unexpected-start-tag-in-select",
-        "(1,27): eof-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select></select></body></html>",
-        "noQuirksBodyHtml": "<select></select>"
-      }
-    },
-    {
-      "data": "<!doctype html><select><tbody>",
-      "errors": [
-        "(1,30): unexpected-start-tag-in-select",
-        "(1,30): eof-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select></select></body></html>",
-        "noQuirksBodyHtml": "<select></select>"
-      }
-    },
-    {
-      "data": "<!doctype html><select><thead>",
-      "errors": [
-        "(1,30): unexpected-start-tag-in-select",
-        "(1,30): eof-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select></select></body></html>",
-        "noQuirksBodyHtml": "<select></select>"
-      }
-    },
-    {
-      "data": "<!doctype html><select><tfoot>",
-      "errors": [
-        "(1,30): unexpected-start-tag-in-select",
-        "(1,30): eof-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select></select></body></html>",
-        "noQuirksBodyHtml": "<select></select>"
-      }
-    },
-    {
-      "data": "<!doctype html><select><caption>",
-      "errors": [
-        "(1,32): unexpected-start-tag-in-select",
-        "(1,32): eof-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select></select></body></html>",
-        "noQuirksBodyHtml": "<select></select>"
-      }
-    },
-    {
-      "data": "<!doctype html><table><tr></table>a",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "text": "a"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr></tr></tbody></table>a</body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr></tr></tbody></table>a"
-      }
-    }
-  ],
-  "tests18.dat": [
-    {
-      "data": "<!doctype html><plaintext></plaintext>",
-      "errors": [
-        "(1,38): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "plaintext": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "plaintext",
-                    "children": [
-                      {
-                        "text": "</plaintext>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><plaintext></plaintext></plaintext></body></html>",
-        "noQuirksBodyHtml": "<plaintext></plaintext></plaintext>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "plaintext": true,
-            "table": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "plaintext",
-                    "children": [
-                      {
-                        "text": "</plaintext>",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><plaintext></plaintext></plaintext><table></table></body></html>",
-        "noQuirksBodyHtml": "<plaintext></plaintext></plaintext><table></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "plaintext": true,
-            "table": true,
-            "tbody": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "plaintext",
-                    "children": [
-                      {
-                        "text": "</plaintext>",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><plaintext></plaintext></plaintext><table><tbody></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<plaintext></plaintext></plaintext><table><tbody></tbody></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "plaintext": true,
-            "table": true,
-            "tbody": true,
-            "tr": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "plaintext",
-                    "children": [
-                      {
-                        "text": "</plaintext>",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><plaintext></plaintext></plaintext><table><tbody><tr></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<plaintext></plaintext></plaintext><table><tbody><tr></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><table><td><plaintext></plaintext>",
-      "errors": [
-        "(1,26): unexpected-cell-in-table-body",
-        "(1,49): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "plaintext": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "plaintext",
-                                    "children": [
-                                      {
-                                        "text": "</plaintext>",
-                                        "no_escape": true
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><plaintext></plaintext></plaintext></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><plaintext></plaintext></plaintext></td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><table><caption><plaintext></plaintext>",
-      "errors": [
-        "(1,54): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "caption": true,
-            "plaintext": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "caption",
-                        "children": [
-                          {
-                            "tag": "plaintext",
-                            "children": [
-                              {
-                                "text": "</plaintext>",
-                                "no_escape": true
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><caption><plaintext></plaintext></plaintext></caption></table></body></html>",
-        "noQuirksBodyHtml": "<table><caption><plaintext></plaintext></plaintext></caption></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "style": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "abc"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "style",
-                                "children": [
-                                  {
-                                    "text": "</script>",
-                                    "no_escape": true
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>abc<table><tbody><tr><style></script></style></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "abc<table><tbody><tr><style></script></style></tr></tbody></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "script": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "abc"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "script",
-                                "children": [
-                                  {
-                                    "text": "</style>",
-                                    "no_escape": true
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>abc<table><tbody><tr><script></style></script></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "abc<table><tbody><tr><script></style></script></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><table><caption><style></script></style>abc",
-      "errors": [
-        "(1,58): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "caption": true,
-            "style": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "caption",
-                        "children": [
-                          {
-                            "tag": "style",
-                            "children": [
-                              {
-                                "text": "</script>",
-                                "no_escape": true
-                              }
-                            ]
-                          },
-                          {
-                            "text": "abc"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><caption><style></script></style>abc</caption></table></body></html>",
-        "noQuirksBodyHtml": "<table><caption><style></script></style>abc</caption></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "style": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "style",
-                                    "children": [
-                                      {
-                                        "text": "</script>",
-                                        "no_escape": true
-                                      }
-                                    ]
-                                  },
-                                  {
-                                    "text": "abc"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><style></script></style>abc</td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><style></script></style>abc</td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><select><script></style></script>abc",
-      "errors": [
-        "(1,51): eof-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "script": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "script",
-                        "children": [
-                          {
-                            "text": "</style>",
-                            "no_escape": true
-                          }
-                        ]
-                      },
-                      {
-                        "text": "abc"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select><script></style></script>abc</select></body></html>",
-        "noQuirksBodyHtml": "<select><script></style></script>abc</select>"
-      }
-    },
-    {
-      "data": "<!doctype html><table><select><script></style></script>abc",
-      "errors": [
-        "(1,30): unexpected-start-tag-implies-table-voodoo",
-        "(1,58): eof-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "script": true,
-            "table": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "script",
-                        "children": [
-                          {
-                            "text": "</style>",
-                            "no_escape": true
-                          }
-                        ]
-                      },
-                      {
-                        "text": "abc"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select><script></style></script>abc</select><table></table></body></html>",
-        "noQuirksBodyHtml": "<select><script></style></script>abc</select><table></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "script": true,
-            "table": true,
-            "tbody": true,
-            "tr": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "script",
-                        "children": [
-                          {
-                            "text": "</style>",
-                            "no_escape": true
-                          }
-                        ]
-                      },
-                      {
-                        "text": "abc"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select><script></style></script>abc</select><table><tbody><tr></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<select><script></style></script>abc</select><table><tbody><tr></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><frameset></frameset><noframes>abc",
-      "errors": [
-        "(1,49): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true,
-            "noframes": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              },
-              {
-                "tag": "noframes",
-                "children": [
-                  {
-                    "text": "abc",
-                    "no_escape": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset></frameset><noframes>abc</noframes></html>",
-        "noQuirksBodyHtml": "<noframes>abc</noframes>"
-      }
-    },
-    {
-      "data": "<!doctype html><frameset></frameset><noframes>abc</noframes><!--abc-->",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true,
-            "noframes": true
-          },
-          "doctype": true,
-          "no_escape": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              },
-              {
-                "tag": "noframes",
-                "children": [
-                  {
-                    "text": "abc",
-                    "no_escape": true
-                  }
-                ]
-              },
-              {
-                "comment": "abc"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset></frameset><noframes>abc</noframes><!--abc--></html>",
-        "noQuirksBodyHtml": "<noframes>abc</noframes><!--abc-->"
-      }
-    },
-    {
-      "data": "<!doctype html><frameset></frameset></html><noframes>abc",
-      "errors": [
-        "(1,56): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true,
-            "noframes": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              },
-              {
-                "tag": "noframes",
-                "children": [
-                  {
-                    "text": "abc",
-                    "no_escape": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset></frameset><noframes>abc</noframes></html>",
-        "noQuirksBodyHtml": "<noframes>abc</noframes>"
-      }
-    },
-    {
-      "data": "<!doctype html><frameset></frameset></html><noframes>abc</noframes><!--abc-->",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true,
-            "noframes": true
-          },
-          "doctype": true,
-          "no_escape": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              },
-              {
-                "tag": "noframes",
-                "children": [
-                  {
-                    "text": "abc",
-                    "no_escape": true
-                  }
-                ]
-              }
-            ]
-          },
-          {
-            "comment": "abc"
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset></frameset><noframes>abc</noframes></html><!--abc-->",
-        "noQuirksBodyHtml": "<noframes>abc</noframes><!--abc-->"
-      }
-    },
-    {
-      "data": "<!doctype html><table><tr></tbody><tfoot>",
-      "errors": [
-        "(1,41): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "tfoot": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "tfoot"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr></tr></tbody><tfoot></tfoot></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr></tr></tbody><tfoot></tfoot></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "svg svg": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "svg",
-                                    "ns": "http://www.w3.org/2000/svg"
-                                  },
-                                  {
-                                    "text": "abc"
-                                  }
-                                ]
-                              },
-                              {
-                                "tag": "td"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><svg></svg>abc</td><td></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><svg></svg>abc</td><td></td></tr></tbody></table>"
-      }
-    }
-  ],
-  "tests19.dat": [
-    {
-      "data": "<!doctype html><math><mn DefinitionUrl=\"foo\">",
-      "errors": [
-        "(1,45): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mn": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mn",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "attrs": [
-                          {
-                            "name": "definitionURL",
-                            "value": "foo"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math><mn definitionURL=\"foo\"></mn></math></body></html>",
-        "noQuirksBodyHtml": "<math><mn definitionURL=\"foo\"></mn></math>"
-      }
-    },
-    {
-      "data": "<!doctype html><html></p><!--foo-->",
-      "errors": [
-        "(1,25): end-tag-after-implied-root"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "comment": "foo"
-              },
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><!--foo--><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<p></p><!--foo-->"
-      }
-    },
-    {
-      "data": "<!doctype html><head></head></p><!--foo-->",
-      "errors": [
-        "(1,32): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "comment": "foo"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><!--foo--><body></body></html>",
-        "noQuirksBodyHtml": "<p></p><!--foo-->"
-      }
-    },
-    {
-      "data": "<!doctype html><body><p><pre>",
-      "errors": [
-        "(1,29): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "pre": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p"
-                  },
-                  {
-                    "tag": "pre"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p></p><pre></pre></body></html>",
-        "noQuirksBodyHtml": "<p></p><pre></pre>"
-      }
-    },
-    {
-      "data": "<!doctype html><body><p><listing>",
-      "errors": [
-        "(1,33): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "listing": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p"
-                  },
-                  {
-                    "tag": "listing"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p></p><listing></listing></body></html>",
-        "noQuirksBodyHtml": "<p></p><listing></listing>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><plaintext>",
-      "errors": [
-        "(1,29): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "plaintext": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p"
-                  },
-                  {
-                    "tag": "plaintext"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p></p><plaintext></plaintext></body></html>",
-        "noQuirksBodyHtml": "<p></p><plaintext></plaintext>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><h1>",
-      "errors": [
-        "(1,22): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "h1": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p"
-                  },
-                  {
-                    "tag": "h1"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p></p><h1></h1></body></html>",
-        "noQuirksBodyHtml": "<p></p><h1></h1>"
-      }
-    },
-    {
-      "data": "<!doctype html><isindex type=\"hidden\">",
-      "errors": [
-        "(1,38): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "isindex": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "isindex",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "hidden"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><isindex type=\"hidden\"></isindex></body></html>",
-        "noQuirksBodyHtml": "<isindex type=\"hidden\"></isindex>"
-      }
-    },
-    {
-      "data": "<!doctype html><ruby><p><rp>",
-      "errors": [
-        "(1,28): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "p": true,
-            "rp": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "tag": "p"
-                      },
-                      {
-                        "tag": "rp"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><ruby><p></p><rp></rp></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby><p></p><rp></rp></ruby>"
-      }
-    },
-    {
-      "data": "<!doctype html><ruby><div><span><rp>",
-      "errors": [
-        "(1,36): XXX-undefined-error",
-        "(1,36): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "div": true,
-            "span": true,
-            "rp": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "tag": "div",
-                        "children": [
-                          {
-                            "tag": "span",
-                            "children": [
-                              {
-                                "tag": "rp"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><ruby><div><span><rp></rp></span></div></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby><div><span><rp></rp></span></div></ruby>"
-      }
-    },
-    {
-      "data": "<!doctype html><ruby><div><p><rp>",
-      "errors": [
-        "(1,33): XXX-undefined-error",
-        "(1,33): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "div": true,
-            "p": true,
-            "rp": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "tag": "div",
-                        "children": [
-                          {
-                            "tag": "p"
-                          },
-                          {
-                            "tag": "rp"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><ruby><div><p></p><rp></rp></div></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby><div><p></p><rp></rp></div></ruby>"
-      }
-    },
-    {
-      "data": "<!doctype html><ruby><p><rt>",
-      "errors": [
-        "(1,28): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "p": true,
-            "rt": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "tag": "p"
-                      },
-                      {
-                        "tag": "rt"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><ruby><p></p><rt></rt></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby><p></p><rt></rt></ruby>"
-      }
-    },
-    {
-      "data": "<!doctype html><ruby><div><span><rt>",
-      "errors": [
-        "(1,36): XXX-undefined-error",
-        "(1,36): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "div": true,
-            "span": true,
-            "rt": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "tag": "div",
-                        "children": [
-                          {
-                            "tag": "span",
-                            "children": [
-                              {
-                                "tag": "rt"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><ruby><div><span><rt></rt></span></div></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby><div><span><rt></rt></span></div></ruby>"
-      }
-    },
-    {
-      "data": "<!doctype html><ruby><div><p><rt>",
-      "errors": [
-        "(1,33): XXX-undefined-error",
-        "(1,33): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "div": true,
-            "p": true,
-            "rt": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "tag": "div",
-                        "children": [
-                          {
-                            "tag": "p"
-                          },
-                          {
-                            "tag": "rt"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><ruby><div><p></p><rt></rt></div></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby><div><p></p><rt></rt></div></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rb>b<rt></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rb": true,
-            "rt": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rb",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "rt"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rb>b</rb><rt></rt></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rb>b</rb><rt></rt></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rp>b<rt></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rp": true,
-            "rt": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rp",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "rt"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rp>b</rp><rt></rt></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rp>b</rp><rt></rt></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rt>b<rt></ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rt": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rt",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "rt"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rt>b</rt><rt></rt></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rt>b</rt><rt></rt></ruby>"
-      }
-    },
-    {
-      "data": "<html><ruby>a<rtc>b<rt>c<rb>d</ruby></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "rtc": true,
-            "rt": true,
-            "rb": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "rtc",
-                        "children": [
-                          {
-                            "text": "b"
-                          },
-                          {
-                            "tag": "rt",
-                            "children": [
-                              {
-                                "text": "c"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "rb",
-                        "children": [
-                          {
-                            "text": "d"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby>a<rtc>b<rt>c</rt></rtc><rb>d</rb></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby>a<rtc>b<rt>c</rt></rtc><rb>d</rb></ruby>"
-      }
-    },
-    {
-      "data": "<!doctype html><math/><foo>",
-      "errors": [
-        "(1,27): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "foo": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML"
-                  },
-                  {
-                    "tag": "foo"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math></math><foo></foo></body></html>",
-        "noQuirksBodyHtml": "<math></math><foo></foo>"
-      }
-    },
-    {
-      "data": "<!doctype html><svg/><foo>",
-      "errors": [
-        "(1,26): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "foo": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg"
-                  },
-                  {
-                    "tag": "foo"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg></svg><foo></foo></body></html>",
-        "noQuirksBodyHtml": "<svg></svg><foo></foo>"
-      }
-    },
-    {
-      "data": "<!doctype html><div></body><!--foo-->",
-      "errors": [
-        "(1,27): expected-one-end-tag-but-got-another"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          },
-          "doctype": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div"
-                  }
-                ]
-              },
-              {
-                "comment": "foo"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><div></div></body><!--foo--></html>",
-        "noQuirksBodyHtml": "<div><!--foo--></div>"
-      }
-    },
-    {
-      "data": "<!doctype html><h1><div><h3><span></h1>foo",
-      "errors": [
-        "(1,39): end-tag-too-early",
-        "(1,42): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "h1": true,
-            "div": true,
-            "h3": true,
-            "span": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "h1",
-                    "children": [
-                      {
-                        "tag": "div",
-                        "children": [
-                          {
-                            "tag": "h3",
-                            "children": [
-                              {
-                                "tag": "span"
-                              }
-                            ]
-                          },
-                          {
-                            "text": "foo"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><h1><div><h3><span></span></h3>foo</div></h1></body></html>",
-        "noQuirksBodyHtml": "<h1><div><h3><span></span></h3>foo</div></h1>"
-      }
-    },
-    {
-      "data": "<!doctype html><p></h3>foo",
-      "errors": [
-        "(1,23): end-tag-too-early"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "foo"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p>foo</p></body></html>",
-        "noQuirksBodyHtml": "<p>foo</p>"
-      }
-    },
-    {
-      "data": "<!doctype html><h3><li>abc</h2>foo",
-      "errors": [
-        "(1,31): end-tag-too-early"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "h3": true,
-            "li": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "h3",
-                    "children": [
-                      {
-                        "tag": "li",
-                        "children": [
-                          {
-                            "text": "abc"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "text": "foo"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><h3><li>abc</li></h3>foo</body></html>",
-        "noQuirksBodyHtml": "<h3><li>abc</li></h3>foo"
-      }
-    },
-    {
-      "data": "<!doctype html><table>abc<!--foo-->",
-      "errors": [
-        "(1,23): foster-parenting-character",
-        "(1,24): foster-parenting-character",
-        "(1,25): foster-parenting-character",
-        "(1,35): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true
-          },
-          "doctype": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "abc"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "comment": "foo"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>abc<table><!--foo--></table></body></html>",
-        "noQuirksBodyHtml": "abc<table><!--foo--></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><table>  <!--foo-->",
-      "errors": [
-        "(1,34): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true
-          },
-          "doctype": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "text": "  "
-                      },
-                      {
-                        "comment": "foo"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table>  <!--foo--></table></body></html>",
-        "noQuirksBodyHtml": "<table>  <!--foo--></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><table> b <!--foo-->",
-      "errors": [
-        "(1,23): foster-parenting-character",
-        "(1,24): foster-parenting-character",
-        "(1,25): foster-parenting-character",
-        "(1,35): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true
-          },
-          "doctype": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": " b "
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "comment": "foo"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body> b <table><!--foo--></table></body></html>",
-        "noQuirksBodyHtml": " b <table><!--foo--></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><select><option><option>",
-      "errors": [
-        "(1,39): eof-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "option": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "option"
-                      },
-                      {
-                        "tag": "option"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select><option></option><option></option></select></body></html>",
-        "noQuirksBodyHtml": "<select><option></option><option></option></select>"
-      }
-    },
-    {
-      "data": "<!doctype html><select><option></optgroup>",
-      "errors": [
-        "(1,42): unexpected-end-tag-in-select",
-        "(1,42): eof-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "option": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "option"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select><option></option></select></body></html>",
-        "noQuirksBodyHtml": "<select><option></option></select>"
-      }
-    },
-    {
-      "data": "<!doctype html><select><option></optgroup>",
-      "errors": [
-        "(1,42): unexpected-end-tag-in-select",
-        "(1,42): eof-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "option": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "option"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select><option></option></select></body></html>",
-        "noQuirksBodyHtml": "<select><option></option></select>"
-      }
-    },
-    {
-      "data": "<!doctype html><dd><optgroup><dd>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "dd": true,
-            "optgroup": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "dd",
-                    "children": [
-                      {
-                        "tag": "optgroup"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "dd"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><dd><optgroup></optgroup></dd><dd></dd></body></html>",
-        "noQuirksBodyHtml": "<dd><optgroup></optgroup></dd><dd></dd>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><math><mi><p><h1>",
-      "errors": [
-        "(1,35): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "math math": true,
-            "math mi": true,
-            "h1": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "math",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "mi",
-                            "ns": "http://www.w3.org/1998/Math/MathML",
-                            "children": [
-                              {
-                                "tag": "p"
-                              },
-                              {
-                                "tag": "h1"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><math><mi><p></p><h1></h1></mi></math></p></body></html>",
-        "noQuirksBodyHtml": "<p><math><mi><p></p><h1></h1></mi></math></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><math><mo><p><h1>",
-      "errors": [
-        "(1,35): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "math math": true,
-            "math mo": true,
-            "h1": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "math",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "mo",
-                            "ns": "http://www.w3.org/1998/Math/MathML",
-                            "children": [
-                              {
-                                "tag": "p"
-                              },
-                              {
-                                "tag": "h1"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><math><mo><p></p><h1></h1></mo></math></p></body></html>",
-        "noQuirksBodyHtml": "<p><math><mo><p></p><h1></h1></mo></math></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><math><mn><p><h1>",
-      "errors": [
-        "(1,35): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "math math": true,
-            "math mn": true,
-            "h1": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "math",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "mn",
-                            "ns": "http://www.w3.org/1998/Math/MathML",
-                            "children": [
-                              {
-                                "tag": "p"
-                              },
-                              {
-                                "tag": "h1"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><math><mn><p></p><h1></h1></mn></math></p></body></html>",
-        "noQuirksBodyHtml": "<p><math><mn><p></p><h1></h1></mn></math></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><math><ms><p><h1>",
-      "errors": [
-        "(1,35): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "math math": true,
-            "math ms": true,
-            "h1": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "math",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "ms",
-                            "ns": "http://www.w3.org/1998/Math/MathML",
-                            "children": [
-                              {
-                                "tag": "p"
-                              },
-                              {
-                                "tag": "h1"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><math><ms><p></p><h1></h1></ms></math></p></body></html>",
-        "noQuirksBodyHtml": "<p><math><ms><p></p><h1></h1></ms></math></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><math><mtext><p><h1>",
-      "errors": [
-        "(1,38): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "math math": true,
-            "math mtext": true,
-            "h1": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "math",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "mtext",
-                            "ns": "http://www.w3.org/1998/Math/MathML",
-                            "children": [
-                              {
-                                "tag": "p"
-                              },
-                              {
-                                "tag": "h1"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><math><mtext><p></p><h1></h1></mtext></math></p></body></html>",
-        "noQuirksBodyHtml": "<p><math><mtext><p></p><h1></h1></mtext></math></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><frameset></noframes>",
-      "errors": [
-        "(1,36): unexpected-end-tag-in-frameset",
-        "(1,36): eof-in-frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<!doctype html><html c=d><body></html><html a=b>",
-      "errors": [
-        "(1,48): non-html-root"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "attrs": [
-              {
-                "name": "a",
-                "value": "b"
-              },
-              {
-                "name": "c",
-                "value": "d"
-              }
-            ],
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html c=\"d\" a=\"b\"><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<!doctype html><html c=d><frameset></frameset></html><html a=b>",
-      "errors": [
-        "(1,63): non-html-root"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "attrs": [
-              {
-                "name": "a",
-                "value": "b"
-              },
-              {
-                "name": "c",
-                "value": "d"
-              }
-            ],
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html c=\"d\" a=\"b\"><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<!doctype html><html><frameset></frameset></html><!--foo-->",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          },
-          "doctype": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          },
-          {
-            "comment": "foo"
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html><!--foo-->",
-        "noQuirksBodyHtml": "<!--foo-->"
-      }
-    },
-    {
-      "data": "<!doctype html><html><frameset></frameset></html>  ",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              },
-              {
-                "text": "  "
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset></frameset>  </html>",
-        "noQuirksBodyHtml": "  "
-      }
-    },
-    {
-      "data": "<!doctype html><html><frameset></frameset></html>abc",
-      "errors": [
-        "(1,50): expected-eof-but-got-char",
-        "(1,51): expected-eof-but-got-char",
-        "(1,52): expected-eof-but-got-char"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "abc"
-      }
-    },
-    {
-      "data": "<!doctype html><html><frameset></frameset></html><p>",
-      "errors": [
-        "(1,52): expected-eof-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "<p></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><html><frameset></frameset></html></p>",
-      "errors": [
-        "(1,53): expected-eof-but-got-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "<p></p>"
-      }
-    },
-    {
-      "data": "<html><frameset></frameset></html><!doctype html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,49): unexpected-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<!doctype html><body><frameset>",
-      "errors": [
-        "(1,31): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<!doctype html><p><frameset><frame>",
-      "errors": [
-        "(1,28): unexpected-start-tag",
-        "(1,35): eof-in-frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true,
-            "frame": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset",
-                "children": [
-                  {
-                    "tag": "frame"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset><frame></frameset></html>",
-        "noQuirksBodyHtml": "<p></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p>a<frameset>",
-      "errors": [
-        "(1,29): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "a"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p>a</p></body></html>",
-        "noQuirksBodyHtml": "<p>a</p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p> <frameset><frame>",
-      "errors": [
-        "(1,29): unexpected-start-tag",
-        "(1,36): eof-in-frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true,
-            "frame": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset",
-                "children": [
-                  {
-                    "tag": "frame"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset><frame></frameset></html>",
-        "noQuirksBodyHtml": "<p> </p>"
-      }
-    },
-    {
-      "data": "<!doctype html><pre><frameset>",
-      "errors": [
-        "(1,30): unexpected-start-tag",
-        "(1,30): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "pre": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "pre"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><pre></pre></body></html>",
-        "noQuirksBodyHtml": "<pre></pre>"
-      }
-    },
-    {
-      "data": "<!doctype html><listing><frameset>",
-      "errors": [
-        "(1,34): unexpected-start-tag",
-        "(1,34): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "listing": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "listing"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><listing></listing></body></html>",
-        "noQuirksBodyHtml": "<listing></listing>"
-      }
-    },
-    {
-      "data": "<!doctype html><li><frameset>",
-      "errors": [
-        "(1,29): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "li": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "li"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><li></li></body></html>",
-        "noQuirksBodyHtml": "<li></li>"
-      }
-    },
-    {
-      "data": "<!doctype html><dd><frameset>",
-      "errors": [
-        "(1,29): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "dd": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "dd"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><dd></dd></body></html>",
-        "noQuirksBodyHtml": "<dd></dd>"
-      }
-    },
-    {
-      "data": "<!doctype html><dt><frameset>",
-      "errors": [
-        "(1,29): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "dt": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "dt"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><dt></dt></body></html>",
-        "noQuirksBodyHtml": "<dt></dt>"
-      }
-    },
-    {
-      "data": "<!doctype html><button><frameset>",
-      "errors": [
-        "(1,33): unexpected-start-tag",
-        "(1,33): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "button": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "button"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><button></button></body></html>",
-        "noQuirksBodyHtml": "<button></button>"
-      }
-    },
-    {
-      "data": "<!doctype html><applet><frameset>",
-      "errors": [
-        "(1,33): unexpected-start-tag",
-        "(1,33): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "applet": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "applet"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><applet></applet></body></html>",
-        "noQuirksBodyHtml": "<applet></applet>"
-      }
-    },
-    {
-      "data": "<!doctype html><marquee><frameset>",
-      "errors": [
-        "(1,34): unexpected-start-tag",
-        "(1,34): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "marquee": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "marquee"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><marquee></marquee></body></html>",
-        "noQuirksBodyHtml": "<marquee></marquee>"
-      }
-    },
-    {
-      "data": "<!doctype html><object><frameset>",
-      "errors": [
-        "(1,33): unexpected-start-tag",
-        "(1,33): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "object": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "object"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><object></object></body></html>",
-        "noQuirksBodyHtml": "<object></object>"
-      }
-    },
-    {
-      "data": "<!doctype html><table><frameset>",
-      "errors": [
-        "(1,32): unexpected-start-tag-implies-table-voodoo",
-        "(1,32): unexpected-start-tag",
-        "(1,32): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table></table></body></html>",
-        "noQuirksBodyHtml": "<table></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><area><frameset>",
-      "errors": [
-        "(1,31): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "area": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "area"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><area></body></html>",
-        "noQuirksBodyHtml": "<area>"
-      }
-    },
-    {
-      "data": "<!doctype html><basefont><frameset>",
-      "errors": [
-        "(1,35): eof-in-frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "basefont": true,
-            "frameset": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "basefont"
-                  }
-                ]
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><basefont></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "<basefont>"
-      }
-    },
-    {
-      "data": "<!doctype html><bgsound><frameset>",
-      "errors": [
-        "(1,34): eof-in-frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "bgsound": true,
-            "frameset": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "bgsound"
-                  }
-                ]
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><bgsound></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "<bgsound>"
-      }
-    },
-    {
-      "data": "<!doctype html><br><frameset>",
-      "errors": [
-        "(1,29): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "br": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "br"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><br></body></html>",
-        "noQuirksBodyHtml": "<br>"
-      }
-    },
-    {
-      "data": "<!doctype html><embed><frameset>",
-      "errors": [
-        "(1,32): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "embed": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "embed"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><embed></body></html>",
-        "noQuirksBodyHtml": "<embed>"
-      }
-    },
-    {
-      "data": "<!doctype html><img><frameset>",
-      "errors": [
-        "(1,30): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "img": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "img"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><img></body></html>",
-        "noQuirksBodyHtml": "<img>"
-      }
-    },
-    {
-      "data": "<!doctype html><input><frameset>",
-      "errors": [
-        "(1,32): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "input": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "input"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><input></body></html>",
-        "noQuirksBodyHtml": "<input>"
-      }
-    },
-    {
-      "data": "<!doctype html><keygen><frameset>",
-      "errors": [
-        "(1,33): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "keygen": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "keygen"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><keygen></body></html>",
-        "noQuirksBodyHtml": "<keygen>"
-      }
-    },
-    {
-      "data": "<!doctype html><wbr><frameset>",
-      "errors": [
-        "(1,30): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "wbr": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "wbr"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><wbr></body></html>",
-        "noQuirksBodyHtml": "<wbr>"
-      }
-    },
-    {
-      "data": "<!doctype html><hr><frameset>",
-      "errors": [
-        "(1,29): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "hr": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "hr"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><hr></body></html>",
-        "noQuirksBodyHtml": "<hr>"
-      }
-    },
-    {
-      "data": "<!doctype html><textarea></textarea><frameset>",
-      "errors": [
-        "(1,46): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "textarea": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "textarea"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><textarea></textarea></body></html>",
-        "noQuirksBodyHtml": "<textarea></textarea>"
-      }
-    },
-    {
-      "data": "<!doctype html><xmp></xmp><frameset>",
-      "errors": [
-        "(1,36): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "xmp": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "xmp"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><xmp></xmp></body></html>",
-        "noQuirksBodyHtml": "<xmp></xmp>"
-      }
-    },
-    {
-      "data": "<!doctype html><iframe></iframe><frameset>",
-      "errors": [
-        "(1,42): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "iframe": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "iframe"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><iframe></iframe></body></html>",
-        "noQuirksBodyHtml": "<iframe></iframe>"
-      }
-    },
-    {
-      "data": "<!doctype html><select></select><frameset>",
-      "errors": [
-        "(1,42): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select></select></body></html>",
-        "noQuirksBodyHtml": "<select></select>"
-      }
-    },
-    {
-      "data": "<!doctype html><svg></svg><frameset><frame>",
-      "errors": [
-        "(1,36): unexpected-start-tag",
-        "(1,43): eof-in-frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true,
-            "frame": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset",
-                "children": [
-                  {
-                    "tag": "frame"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset><frame></frameset></html>",
-        "noQuirksBodyHtml": "<svg></svg>"
-      }
-    },
-    {
-      "data": "<!doctype html><math></math><frameset><frame>",
-      "errors": [
-        "(1,38): unexpected-start-tag",
-        "(1,45): eof-in-frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true,
-            "frame": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset",
-                "children": [
-                  {
-                    "tag": "frame"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset><frame></frameset></html>",
-        "noQuirksBodyHtml": "<math></math>"
-      }
-    },
-    {
-      "data": "<!doctype html><svg><foreignObject><div> <frameset><frame>",
-      "errors": [
-        "(1,51): unexpected-start-tag",
-        "(1,58): eof-in-frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true,
-            "frame": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset",
-                "children": [
-                  {
-                    "tag": "frame"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset><frame></frameset></html>",
-        "noQuirksBodyHtml": "<svg><foreignObject><div> </div></foreignObject></svg>"
-      }
-    },
-    {
-      "data": "<!doctype html><svg>a</svg><frameset><frame>",
-      "errors": [
-        "(1,37): unexpected-start-tag",
-        "(1,44): unexpected-start-tag-ignored"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "a"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg>a</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>a</svg>"
-      }
-    },
-    {
-      "data": "<!doctype html><svg> </svg><frameset><frame>",
-      "errors": [
-        "(1,37): unexpected-start-tag",
-        "(1,44): eof-in-frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true,
-            "frame": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset",
-                "children": [
-                  {
-                    "tag": "frame"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset><frame></frameset></html>",
-        "noQuirksBodyHtml": "<svg> </svg>"
-      }
-    },
-    {
-      "data": "<html>aaa<frameset></frameset>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,19): unexpected-start-tag",
-        "(1,30): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "aaa"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>aaa</body></html>",
-        "noQuirksBodyHtml": "aaa"
-      }
-    },
-    {
-      "data": "<html> a <frameset></frameset>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,19): unexpected-start-tag",
-        "(1,30): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "a "
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>a </body></html>",
-        "noQuirksBodyHtml": " a "
-      }
-    },
-    {
-      "data": "<!doctype html><div><frameset>",
-      "errors": [
-        "(1,30): unexpected-start-tag",
-        "(1,30): eof-in-frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "<div></div>"
-      }
-    },
-    {
-      "data": "<!doctype html><div><body><frameset>",
-      "errors": [
-        "(1,26): unexpected-start-tag",
-        "(1,36): unexpected-start-tag",
-        "(1,36): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><div></div></body></html>",
-        "noQuirksBodyHtml": "<div></div>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><math></p>a",
-      "errors": [
-        "(1,28): unexpected-end-tag",
-        "(1,28): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "math math": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "math",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      }
-                    ]
-                  },
-                  {
-                    "text": "a"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><math></math></p>a</body></html>",
-        "noQuirksBodyHtml": "<p><math></math></p>a"
-      }
-    },
-    {
-      "data": "<!doctype html><p><math><mn><span></p>a",
-      "errors": [
-        "(1,38): unexpected-end-tag",
-        "(1,39): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "math math": true,
-            "math mn": true,
-            "span": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "math",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "mn",
-                            "ns": "http://www.w3.org/1998/Math/MathML",
-                            "children": [
-                              {
-                                "tag": "span",
-                                "children": [
-                                  {
-                                    "tag": "p"
-                                  },
-                                  {
-                                    "text": "a"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><math><mn><span><p></p>a</span></mn></math></p></body></html>",
-        "noQuirksBodyHtml": "<p><math><mn><span><p></p>a</span></mn></math></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><math></html>",
-      "errors": [
-        "(1,28): unexpected-end-tag",
-        "(1,28): expected-one-end-tag-but-got-another",
-        "(1,28): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math></math></body></html>",
-        "noQuirksBodyHtml": "<math></math>"
-      }
-    },
-    {
-      "data": "<!doctype html><meta charset=\"ascii\">",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "meta": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "meta",
-                    "attrs": [
-                      {
-                        "name": "charset",
-                        "value": "ascii"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><meta charset=\"ascii\"></head><body></body></html>",
-        "noQuirksBodyHtml": "<meta charset=\"ascii\">"
-      }
-    },
-    {
-      "data": "<!doctype html><meta http-equiv=\"content-type\" content=\"text/html;charset=ascii\">",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "meta": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "meta",
-                    "attrs": [
-                      {
-                        "name": "content",
-                        "value": "text/html;charset=ascii"
-                      },
-                      {
-                        "name": "http-equiv",
-                        "value": "content-type"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><meta http-equiv=\"content-type\" content=\"text/html;charset=ascii\"></head><body></body></html>",
-        "noQuirksBodyHtml": "<meta http-equiv=\"content-type\" content=\"text/html;charset=ascii\">"
-      }
-    },
-    {
-      "data": "<!doctype html><head><!--aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--><meta charset=\"utf8\">",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "meta": true,
-            "body": true
-          },
-          "doctype": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "comment": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
-                  },
-                  {
-                    "tag": "meta",
-                    "attrs": [
-                      {
-                        "name": "charset",
-                        "value": "utf8"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><!--aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--><meta charset=\"utf8\"></head><body></body></html>",
-        "noQuirksBodyHtml": "<!--aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--><meta charset=\"utf8\">"
-      }
-    },
-    {
-      "data": "<!doctype html><html a=b><head></head><html c=d>",
-      "errors": [
-        "(1,48): non-html-root"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "attrs": [
-              {
-                "name": "a",
-                "value": "b"
-              },
-              {
-                "name": "c",
-                "value": "d"
-              }
-            ],
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html a=\"b\" c=\"d\"><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<!doctype html><image/>",
-      "errors": [
-        "(1,23): image-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "img": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "img"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><img></body></html>",
-        "noQuirksBodyHtml": "<img>"
-      }
-    },
-    {
-      "data": "<!doctype html>a<i>b<table>c<b>d</i>e</b>f",
-      "errors": [
-        "(1,28): foster-parenting-character",
-        "(1,31): foster-parenting-start-tag",
-        "(1,32): foster-parenting-character",
-        "(1,36): foster-parenting-end-tag",
-        "(1,36): adoption-agency-1.3",
-        "(1,37): foster-parenting-character",
-        "(1,41): foster-parenting-end-tag",
-        "(1,42): foster-parenting-character",
-        "(1,42): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "i": true,
-            "b": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "a"
-                  },
-                  {
-                    "tag": "i",
-                    "children": [
-                      {
-                        "text": "bc"
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": "de"
-                          }
-                        ]
-                      },
-                      {
-                        "text": "f"
-                      },
-                      {
-                        "tag": "table"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>a<i>bc<b>de</b>f<table></table></i></body></html>",
-        "noQuirksBodyHtml": "a<i>bc<b>de</b>f<table></table></i>"
-      }
-    },
-    {
-      "data": "<!doctype html><table><i>a<b>b<div>c<a>d</i>e</b>f",
-      "errors": [
-        "(1,25): foster-parenting-start-tag",
-        "(1,26): foster-parenting-character",
-        "(1,29): foster-parenting-start-tag",
-        "(1,30): foster-parenting-character",
-        "(1,35): foster-parenting-start-tag",
-        "(1,36): foster-parenting-character",
-        "(1,39): foster-parenting-start-tag",
-        "(1,40): foster-parenting-character",
-        "(1,44): foster-parenting-end-tag",
-        "(1,44): adoption-agency-1.3",
-        "(1,44): adoption-agency-1.3",
-        "(1,45): foster-parenting-character",
-        "(1,49): foster-parenting-end-tag",
-        "(1,49): adoption-agency-1.3",
-        "(1,49): adoption-agency-1.3",
-        "(1,50): foster-parenting-character",
-        "(1,50): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "i": true,
-            "b": true,
-            "div": true,
-            "a": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "i",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "b"
-                  },
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "text": "c"
-                              },
-                              {
-                                "tag": "a",
-                                "children": [
-                                  {
-                                    "text": "d"
-                                  }
-                                ]
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "a",
-                            "children": [
-                              {
-                                "text": "e"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "a",
-                        "children": [
-                          {
-                            "text": "f"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><i>a<b>b</b></i><b></b><div><b><i>c<a>d</a></i><a>e</a></b><a>f</a></div><table></table></body></html>",
-        "noQuirksBodyHtml": "<i>a<b>b</b></i><b></b><div><b><i>c<a>d</a></i><a>e</a></b><a>f</a></div><table></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><i>a<b>b<div>c<a>d</i>e</b>f",
-      "errors": [
-        "(1,37): adoption-agency-1.3",
-        "(1,37): adoption-agency-1.3",
-        "(1,42): adoption-agency-1.3",
-        "(1,42): adoption-agency-1.3",
-        "(1,43): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "i": true,
-            "b": true,
-            "div": true,
-            "a": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "i",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "b"
-                  },
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "text": "c"
-                              },
-                              {
-                                "tag": "a",
-                                "children": [
-                                  {
-                                    "text": "d"
-                                  }
-                                ]
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "a",
-                            "children": [
-                              {
-                                "text": "e"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "a",
-                        "children": [
-                          {
-                            "text": "f"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><i>a<b>b</b></i><b></b><div><b><i>c<a>d</a></i><a>e</a></b><a>f</a></div></body></html>",
-        "noQuirksBodyHtml": "<i>a<b>b</b></i><b></b><div><b><i>c<a>d</a></i><a>e</a></b><a>f</a></div>"
-      }
-    },
-    {
-      "data": "<!doctype html><table><i>a<b>b<div>c</i>",
-      "errors": [
-        "(1,25): foster-parenting-start-tag",
-        "(1,26): foster-parenting-character",
-        "(1,29): foster-parenting-start-tag",
-        "(1,30): foster-parenting-character",
-        "(1,35): foster-parenting-start-tag",
-        "(1,36): foster-parenting-character",
-        "(1,40): foster-parenting-end-tag",
-        "(1,40): adoption-agency-1.3",
-        "(1,40): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "i": true,
-            "b": true,
-            "div": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "i",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "div",
-                        "children": [
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "text": "c"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><i>a<b>b</b></i><b><div><i>c</i></div></b><table></table></body></html>",
-        "noQuirksBodyHtml": "<i>a<b>b</b></i><b><div><i>c</i></div></b><table></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><table><i>a<b>b<div>c<a>d</i>e</b>f",
-      "errors": [
-        "(1,25): foster-parenting-start-tag",
-        "(1,26): foster-parenting-character",
-        "(1,29): foster-parenting-start-tag",
-        "(1,30): foster-parenting-character",
-        "(1,35): foster-parenting-start-tag",
-        "(1,36): foster-parenting-character",
-        "(1,39): foster-parenting-start-tag",
-        "(1,40): foster-parenting-character",
-        "(1,44): foster-parenting-end-tag",
-        "(1,44): adoption-agency-1.3",
-        "(1,44): adoption-agency-1.3",
-        "(1,45): foster-parenting-character",
-        "(1,49): foster-parenting-end-tag",
-        "(1,44): adoption-agency-1.3",
-        "(1,44): adoption-agency-1.3",
-        "(1,50): foster-parenting-character",
-        "(1,50): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "i": true,
-            "b": true,
-            "div": true,
-            "a": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "i",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "b"
-                  },
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "text": "c"
-                              },
-                              {
-                                "tag": "a",
-                                "children": [
-                                  {
-                                    "text": "d"
-                                  }
-                                ]
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "a",
-                            "children": [
-                              {
-                                "text": "e"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "a",
-                        "children": [
-                          {
-                            "text": "f"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><i>a<b>b</b></i><b></b><div><b><i>c<a>d</a></i><a>e</a></b><a>f</a></div><table></table></body></html>",
-        "noQuirksBodyHtml": "<i>a<b>b</b></i><b></b><div><b><i>c<a>d</a></i><a>e</a></b><a>f</a></div><table></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><table><i>a<div>b<tr>c<b>d</i>e",
-      "errors": [
-        "(1,25): foster-parenting-start-tag",
-        "(1,26): foster-parenting-character",
-        "(1,31): foster-parenting-start-tag",
-        "(1,32): foster-parenting-character",
-        "(1,37): foster-parenting-character",
-        "(1,40): foster-parenting-start-tag",
-        "(1,41): foster-parenting-character",
-        "(1,45): foster-parenting-end-tag",
-        "(1,45): adoption-agency-1.3",
-        "(1,46): foster-parenting-character",
-        "(1,46): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "i": true,
-            "div": true,
-            "b": true,
-            "table": true,
-            "tbody": true,
-            "tr": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "i",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "div",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "i",
-                    "children": [
-                      {
-                        "text": "c"
-                      },
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": "d"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "text": "e"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><i>a<div>b</div></i><i>c<b>d</b></i><b>e</b><table><tbody><tr></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<i>a<div>b</div></i><i>c<b>d</b></i><b>e</b><table><tbody><tr></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><table><td><table><i>a<div>b<b>c</i>d",
-      "errors": [
-        "(1,26): unexpected-cell-in-table-body",
-        "(1,36): foster-parenting-start-tag",
-        "(1,37): foster-parenting-character",
-        "(1,42): foster-parenting-start-tag",
-        "(1,43): foster-parenting-character",
-        "(1,46): foster-parenting-start-tag",
-        "(1,47): foster-parenting-character",
-        "(1,51): foster-parenting-end-tag",
-        "(1,51): adoption-agency-1.3",
-        "(1,51): adoption-agency-1.3",
-        "(1,52): foster-parenting-character",
-        "(1,52): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "i": true,
-            "div": true,
-            "b": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "i",
-                                    "children": [
-                                      {
-                                        "text": "a"
-                                      }
-                                    ]
-                                  },
-                                  {
-                                    "tag": "div",
-                                    "children": [
-                                      {
-                                        "tag": "i",
-                                        "children": [
-                                          {
-                                            "text": "b"
-                                          },
-                                          {
-                                            "tag": "b",
-                                            "children": [
-                                              {
-                                                "text": "c"
-                                              }
-                                            ]
-                                          }
-                                        ]
-                                      },
-                                      {
-                                        "tag": "b",
-                                        "children": [
-                                          {
-                                            "text": "d"
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  },
-                                  {
-                                    "tag": "table"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><i>a</i><div><i>b<b>c</b></i><b>d</b></div><table></table></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><i>a</i><div><i>b<b>c</b></i><b>d</b></div><table></table></td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><body><bgsound>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "bgsound": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "bgsound"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><bgsound></body></html>",
-        "noQuirksBodyHtml": "<bgsound>"
-      }
-    },
-    {
-      "data": "<!doctype html><body><basefont>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "basefont": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "basefont"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><basefont></body></html>",
-        "noQuirksBodyHtml": "<basefont>"
-      }
-    },
-    {
-      "data": "<!doctype html><a><b></a><basefont>",
-      "errors": [
-        "(1,25): adoption-agency-1.3"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "b": true,
-            "basefont": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "tag": "b"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "basefont"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><a><b></b></a><basefont></body></html>",
-        "noQuirksBodyHtml": "<a><b></b></a><basefont>"
-      }
-    },
-    {
-      "data": "<!doctype html><a><b></a><bgsound>",
-      "errors": [
-        "(1,25): adoption-agency-1.3"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "b": true,
-            "bgsound": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "tag": "b"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "bgsound"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><a><b></b></a><bgsound></body></html>",
-        "noQuirksBodyHtml": "<a><b></b></a><bgsound>"
-      }
-    },
-    {
-      "data": "<!doctype html><figcaption><article></figcaption>a",
-      "errors": [
-        "(1,49): end-tag-too-early"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "figcaption": true,
-            "article": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "figcaption",
-                    "children": [
-                      {
-                        "tag": "article"
-                      }
-                    ]
-                  },
-                  {
-                    "text": "a"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><figcaption><article></article></figcaption>a</body></html>",
-        "noQuirksBodyHtml": "<figcaption><article></article></figcaption>a"
-      }
-    },
-    {
-      "data": "<!doctype html><summary><article></summary>a",
-      "errors": [
-        "(1,43): end-tag-too-early"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "summary": true,
-            "article": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "summary",
-                    "children": [
-                      {
-                        "tag": "article"
-                      }
-                    ]
-                  },
-                  {
-                    "text": "a"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><summary><article></article></summary>a</body></html>",
-        "noQuirksBodyHtml": "<summary><article></article></summary>a"
-      }
-    },
-    {
-      "data": "<!doctype html><p><a><plaintext>b",
-      "errors": [
-        "(1,32): unexpected-end-tag",
-        "(1,33): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "a": true,
-            "plaintext": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "a"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "plaintext",
-                    "children": [
-                      {
-                        "tag": "a",
-                        "children": [
-                          {
-                            "text": "b"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><a></a></p><plaintext><a>b</a></plaintext></body></html>",
-        "noQuirksBodyHtml": "<p><a></a></p><plaintext><a>b</a></plaintext>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><div>a<a></div>b<p>c</p>d",
-      "errors": [
-        "(1,30): end-tag-too-early",
-        "(1,40): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "a": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "a"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "text": "b"
-                      },
-                      {
-                        "tag": "p",
-                        "children": [
-                          {
-                            "text": "c"
-                          }
-                        ]
-                      },
-                      {
-                        "text": "d"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><div>a<a></a></div><a>b<p>c</p>d</a></body></html>",
-        "noQuirksBodyHtml": "<div>a<a></a></div><a>b<p>c</p>d</a>"
-      }
-    }
-  ],
-  "tests2.dat": [
-    {
-      "data": "<!DOCTYPE html>Test",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Test"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>Test</body></html>",
-        "noQuirksBodyHtml": "Test"
-      }
-    },
-    {
-      "data": "<textarea>test</div>test",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag",
-        "(1,24): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "textarea": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "textarea",
-                    "children": [
-                      {
-                        "text": "test</div>test",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><textarea>test&lt;/div&gt;test</textarea></body></html>",
-        "noQuirksBodyHtml": "<textarea>test&lt;/div&gt;test</textarea>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><tr><td></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td></td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<table><td>test</tbody></table>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,11): unexpected-cell-in-table-body"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "text": "test"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><tr><td>test</td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td>test</td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<frame>test",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,7): unexpected-start-tag-ignored"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "test"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>test</body></html>",
-        "noQuirksBodyHtml": "test"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><frameset>test",
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "test"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset",
-                "children": [
-                  {
-                    "text": "  "
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset>  </frameset></html>",
-        "noQuirksBodyHtml": " te st"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              },
-              {
-                "text": "  "
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset></frameset>  </html>",
-        "noQuirksBodyHtml": " te st"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><frameset><!DOCTYPE html>",
-      "errors": [
-        "(1,40): unexpected-doctype",
-        "(1,40): eof-in-frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><font><p><b>test</font>",
-      "errors": [
-        "(1,38): adoption-agency-1.3",
-        "(1,38): adoption-agency-1.3"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "font": true,
-            "p": true,
-            "b": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "font"
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "font",
-                        "children": [
-                          {
-                            "tag": "b",
-                            "children": [
-                              {
-                                "text": "test"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><font></font><p><font><b>test</b></font></p></body></html>",
-        "noQuirksBodyHtml": "<font></font><p><font><b>test</b></font></p>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><dt><div><dd>",
-      "errors": [
-        "(1,28): end-tag-too-early"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "dt": true,
-            "div": true,
-            "dd": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "dt",
-                    "children": [
-                      {
-                        "tag": "div"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "dd"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><dt><div></div></dt><dd></dd></body></html>",
-        "noQuirksBodyHtml": "<dt><div></div></dt><dd></dd>"
-      }
-    },
-    {
-      "data": "<script></x",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,11): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "</x",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script></x</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></x</script>"
-      }
-    },
-    {
-      "data": "<table><plaintext><td>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "plaintext": true,
-            "table": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "plaintext",
-                    "children": [
-                      {
-                        "text": "<td>",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><plaintext><td></plaintext><table></table></body></html>",
-        "noQuirksBodyHtml": "<plaintext><td></plaintext><table></table>"
-      }
-    },
-    {
-      "data": "<plaintext></plaintext>",
-      "errors": [
-        "(1,11): expected-doctype-but-got-start-tag",
-        "(1,23): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "plaintext": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "plaintext",
-                    "children": [
-                      {
-                        "text": "</plaintext>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><plaintext></plaintext></plaintext></body></html>",
-        "noQuirksBodyHtml": "<plaintext></plaintext></plaintext>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><table><tr>TEST",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "TEST"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>TEST<table><tbody><tr></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "TEST<table><tbody><tr></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body t1=1><body t2=2><body t3=3 t4=4>",
-      "errors": [
-        "(1,37): unexpected-start-tag",
-        "(1,53): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "attrs": [
-                  {
-                    "name": "t1",
-                    "value": "1"
-                  },
-                  {
-                    "name": "t2",
-                    "value": "2"
-                  },
-                  {
-                    "name": "t3",
-                    "value": "3"
-                  },
-                  {
-                    "name": "t4",
-                    "value": "4"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body t1=\"1\" t2=\"2\" t3=\"3\" t4=\"4\"></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "</b test",
-      "errors": [
-        "(1,8): eof-in-attribute-name",
-        "(1,8): expected-doctype-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<!DOCTYPE html></b test<b &=&amp>X",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "X"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>X</body></html>",
-        "noQuirksBodyHtml": "X"
-      }
-    },
-    {
-      "data": "<!doctypehtml><scrIPt type=text/x-foobar;baz>X</SCRipt",
-      "errors": [
-        "(1,9): need-space-after-doctype",
-        "(1,54): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "text/x-foobar;baz"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "X</SCRipt",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script type=\"text/x-foobar;baz\">X</SCRipt</script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script type=\"text/x-foobar;baz\">X</SCRipt</script>"
-      }
-    },
-    {
-      "data": "&",
-      "errors": [
-        "(1,1): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "&",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>&amp;</body></html>",
-        "noQuirksBodyHtml": "&amp;"
-      }
-    },
-    {
-      "data": "&#",
-      "errors": [
-        "(1,2): expected-numeric-entity",
-        "(1,2): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "&#",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>&amp;#</body></html>",
-        "noQuirksBodyHtml": "&amp;#"
-      }
-    },
-    {
-      "data": "&#X",
-      "errors": [
-        "(1,3): expected-numeric-entity",
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "&#X",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>&amp;#X</body></html>",
-        "noQuirksBodyHtml": "&amp;#X"
-      }
-    },
-    {
-      "data": "&#x",
-      "errors": [
-        "(1,3): expected-numeric-entity",
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "&#x",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>&amp;#x</body></html>",
-        "noQuirksBodyHtml": "&amp;#x"
-      }
-    },
-    {
-      "data": "&#45",
-      "errors": [
-        "(1,4): numeric-entity-without-semicolon",
-        "(1,4): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "-"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>-</body></html>",
-        "noQuirksBodyHtml": "-"
-      }
-    },
-    {
-      "data": "&x-test",
-      "errors": [
-        "(1,2): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "&x-test",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>&amp;x-test</body></html>",
-        "noQuirksBodyHtml": "&amp;x-test"
-      }
-    },
-    {
-      "data": "<!doctypehtml><p><li>",
-      "errors": [
-        "(1,9): need-space-after-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "li": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p"
-                  },
-                  {
-                    "tag": "li"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p></p><li></li></body></html>",
-        "noQuirksBodyHtml": "<p></p><li></li>"
-      }
-    },
-    {
-      "data": "<!doctypehtml><p><dt>",
-      "errors": [
-        "(1,9): need-space-after-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "dt": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p"
-                  },
-                  {
-                    "tag": "dt"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p></p><dt></dt></body></html>",
-        "noQuirksBodyHtml": "<p></p><dt></dt>"
-      }
-    },
-    {
-      "data": "<!doctypehtml><p><dd>",
-      "errors": [
-        "(1,9): need-space-after-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "dd": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p"
-                  },
-                  {
-                    "tag": "dd"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p></p><dd></dd></body></html>",
-        "noQuirksBodyHtml": "<p></p><dd></dd>"
-      }
-    },
-    {
-      "data": "<!doctypehtml><p><form>",
-      "errors": [
-        "(1,9): need-space-after-doctype",
-        "(1,23): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "form": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p"
-                  },
-                  {
-                    "tag": "form"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p></p><form></form></body></html>",
-        "noQuirksBodyHtml": "<p></p><form></form>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><p></P>X",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p"
-                  },
-                  {
-                    "text": "X"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p></p>X</body></html>",
-        "noQuirksBodyHtml": "<p></p>X"
-      }
-    },
-    {
-      "data": "&AMP",
-      "errors": [
-        "(1,4): named-entity-without-semicolon",
-        "(1,4): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "&",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>&amp;</body></html>",
-        "noQuirksBodyHtml": "&amp;"
-      }
-    },
-    {
-      "data": "&AMp;",
-      "errors": [
-        "(1,3): expected-named-entity",
-        "(1,3): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "&AMp;",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>&amp;AMp;</body></html>",
-        "noQuirksBodyHtml": "&amp;AMp;"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><html><head></head><body><thisISasillyTESTelementNameToMakeSureCrazyTagNamesArePARSEDcorrectLY>",
-      "errors": [
-        "(1,110): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "thisisasillytestelementnametomakesurecrazytagnamesareparsedcorrectly": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "thisisasillytestelementnametomakesurecrazytagnamesareparsedcorrectly"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><thisisasillytestelementnametomakesurecrazytagnamesareparsedcorrectly></thisisasillytestelementnametomakesurecrazytagnamesareparsedcorrectly></body></html>",
-        "noQuirksBodyHtml": "<thisisasillytestelementnametomakesurecrazytagnamesareparsedcorrectly></thisisasillytestelementnametomakesurecrazytagnamesareparsedcorrectly>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html>X</body>X",
-      "errors": [
-        "(1,24): unexpected-char-after-body"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "XX"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>XX</body></html>",
-        "noQuirksBodyHtml": "XX"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><!-- X",
-      "errors": [
-        "(1,21): eof-in-comment"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "comment": " X"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><!-- X--><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!-- X-->"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><table><caption>test TEST</caption><td>test",
-      "errors": [
-        "(1,54): unexpected-cell-in-table-body",
-        "(1,58): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "caption": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "caption",
-                        "children": [
-                          {
-                            "text": "test TEST"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "text": "test"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><caption>test TEST</caption><tbody><tr><td>test</td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><caption>test TEST</caption><tbody><tr><td>test</td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><select><option><optgroup>",
-      "errors": [
-        "(1,41): eof-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "option": true,
-            "optgroup": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "option"
-                      },
-                      {
-                        "tag": "optgroup"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select><option></option><optgroup></optgroup></select></body></html>",
-        "noQuirksBodyHtml": "<select><option></option><optgroup></optgroup></select>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><select><optgroup><option></optgroup><option><select><option>",
-      "errors": [
-        "(1,68): unexpected-select-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "optgroup": true,
-            "option": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "optgroup",
-                        "children": [
-                          {
-                            "tag": "option"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "option"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "option"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select><optgroup><option></option></optgroup><option></option></select><option></option></body></html>",
-        "noQuirksBodyHtml": "<select><optgroup><option></option></optgroup><option></option></select><option></option>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><select><optgroup><option><optgroup>",
-      "errors": [
-        "(1,51): eof-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "optgroup": true,
-            "option": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "optgroup",
-                        "children": [
-                          {
-                            "tag": "option"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "optgroup"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select><optgroup><option></option></optgroup><optgroup></optgroup></select></body></html>",
-        "noQuirksBodyHtml": "<select><optgroup><option></option></optgroup><optgroup></optgroup></select>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><datalist><option>foo</datalist>bar",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "datalist": true,
-            "option": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "datalist",
-                    "children": [
-                      {
-                        "tag": "option",
-                        "children": [
-                          {
-                            "text": "foo"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "text": "bar"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><datalist><option>foo</option></datalist>bar</body></html>",
-        "noQuirksBodyHtml": "<datalist><option>foo</option></datalist>bar"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><font><input><input></font>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "font": true,
-            "input": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "font",
-                    "children": [
-                      {
-                        "tag": "input"
-                      },
-                      {
-                        "tag": "input"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><font><input><input></font></body></html>",
-        "noQuirksBodyHtml": "<font><input><input></font>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><!-- XXX - XXX -->",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "comment": " XXX - XXX "
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><!-- XXX - XXX --><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!-- XXX - XXX -->"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><!-- XXX - XXX",
-      "errors": [
-        "(1,29): eof-in-comment"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "comment": " XXX - XXX"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><!-- XXX - XXX--><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!-- XXX - XXX-->"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><!-- XXX - XXX - XXX -->",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "comment": " XXX - XXX - XXX "
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><!-- XXX - XXX - XXX --><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!-- XXX - XXX - XXX -->"
-      }
-    },
-    {
-      "data": "test\ntest",
-      "errors": [
-        "(2,4): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "test\ntest"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>test\ntest</body></html>",
-        "noQuirksBodyHtml": "test\ntest"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><title>test</body></title>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "title": true
-          },
-          "doctype": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "test</body>",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><title>test&lt;/body&gt;</title></body></html>",
-        "noQuirksBodyHtml": "<title>test&lt;/body&gt;</title>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><title>X</title><meta name=z><link rel=foo><style>\nx { content:\"</style\" } </style>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "title": true,
-            "meta": true,
-            "link": true,
-            "style": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "X"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "meta",
-                    "attrs": [
-                      {
-                        "name": "name",
-                        "value": "z"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "link",
-                    "attrs": [
-                      {
-                        "name": "rel",
-                        "value": "foo"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": "\nx { content:\"</style\" } ",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><title>X</title><meta name=\"z\"><link rel=\"foo\"><style>\nx { content:\"</style\" } </style></body></html>",
-        "noQuirksBodyHtml": "<title>X</title><meta name=\"z\"><link rel=\"foo\"><style>\nx { content:\"</style\" } </style>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><select><optgroup></optgroup></select>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "optgroup": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "optgroup"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select><optgroup></optgroup></select></body></html>",
-        "noQuirksBodyHtml": "<select><optgroup></optgroup></select>"
-      }
-    },
-    {
-      "data": " \n ",
-      "errors": [
-        "(2,1): expected-doctype-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": " \n "
-      }
-    },
-    {
-      "data": "<!DOCTYPE html>  <html>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "  "
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><script>\n</script>  <title>x</title>  </head>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "title": true,
-            "body": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "\n",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "  "
-                  },
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "x"
-                      }
-                    ]
-                  },
-                  {
-                    "text": "  "
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><script>\n</script>  <title>x</title>  </head><body></body></html>",
-        "noQuirksBodyHtml": "<script>\n</script>  <title>x</title>  "
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><html><body><html id=x>",
-      "errors": [
-        "(1,38): non-html-root"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "attrs": [
-              {
-                "name": "id",
-                "value": "x"
-              }
-            ],
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html id=\"x\"><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<!DOCTYPE html>X</body><html id=\"x\">",
-      "errors": [
-        "(1,36): non-html-root"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "attrs": [
-              {
-                "name": "id",
-                "value": "x"
-              }
-            ],
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "X"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html id=\"x\"><head></head><body>X</body></html>",
-        "noQuirksBodyHtml": "X"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><head><html id=x>",
-      "errors": [
-        "(1,32): non-html-root"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "attrs": [
-              {
-                "name": "id",
-                "value": "x"
-              }
-            ],
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html id=\"x\"><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<!DOCTYPE html>X</html>X",
-      "errors": [
-        "(1,24): expected-eof-but-got-char"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "XX"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>XX</body></html>",
-        "noQuirksBodyHtml": "XX"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html>X</html> ",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "X "
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>X </body></html>",
-        "noQuirksBodyHtml": "X "
-      }
-    },
-    {
-      "data": "<!DOCTYPE html>X</html><p>X",
-      "errors": [
-        "(1,26): expected-eof-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "X"
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "X"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>X<p>X</p></body></html>",
-        "noQuirksBodyHtml": "X<p>X</p>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html>X<p/x/y/z>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "X"
-                  },
-                  {
-                    "tag": "p",
-                    "attrs": [
-                      {
-                        "name": "x",
-                        "value": ""
-                      },
-                      {
-                        "name": "y",
-                        "value": ""
-                      },
-                      {
-                        "name": "z",
-                        "value": ""
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>X<p x=\"\" y=\"\" z=\"\"></p></body></html>",
-        "noQuirksBodyHtml": "X<p x=\"\" y=\"\" z=\"\"></p>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><!--x--",
-      "errors": [
-        "(1,22): eof-in-comment-double-dash"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "comment": "x"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><!--x--><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!--x-->"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><table><tr><td></p></table>",
-      "errors": [
-        "(1,34): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "p"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><p></p></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><p></p></td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE <!DOCTYPE HTML>><!--<!--x-->-->",
-      "errors": [
-        "(1,20): expected-space-or-right-bracket-in-doctype",
-        "(1,25): unknown-doctype",
-        "(1,35): unexpected-char-in-comment"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true,
-          "escaped": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "<!doctype"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": ">",
-                    "escaped": true
-                  },
-                  {
-                    "comment": "<!--x"
-                  },
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE <!doctype><html><head></head><body>&gt;<!--<!--x-->--&gt;</body></html>",
-        "noQuirksBodyHtml": "&gt;<!--<!--x-->--&gt;"
-      }
-    },
-    {
-      "data": "<!doctype html><div><form></form><div></div></div>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "form": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "form"
-                      },
-                      {
-                        "tag": "div"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><div><form></form><div></div></div></body></html>",
-        "noQuirksBodyHtml": "<div><form></form><div></div></div>"
-      }
-    }
-  ],
-  "tests20.dat": [
-    {
-      "data": "<!doctype html><p><button><button>",
-      "errors": [
-        "(1,34): unexpected-start-tag-implies-end-tag",
-        "(1,34): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "button": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "button"
-                      },
-                      {
-                        "tag": "button"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><button></button><button></button></p></body></html>",
-        "noQuirksBodyHtml": "<p><button></button><button></button></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><button><address>",
-      "errors": [
-        "(1,35): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "button": true,
-            "address": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "button",
-                        "children": [
-                          {
-                            "tag": "address"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><button><address></address></button></p></body></html>",
-        "noQuirksBodyHtml": "<p><button><address></address></button></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><button><blockquote>",
-      "errors": [
-        "(1,38): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "button": true,
-            "blockquote": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "button",
-                        "children": [
-                          {
-                            "tag": "blockquote"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><button><blockquote></blockquote></button></p></body></html>",
-        "noQuirksBodyHtml": "<p><button><blockquote></blockquote></button></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><button><menu>",
-      "errors": [
-        "(1,32): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "button": true,
-            "menu": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "button",
-                        "children": [
-                          {
-                            "tag": "menu"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><button><menu></menu></button></p></body></html>",
-        "noQuirksBodyHtml": "<p><button><menu></menu></button></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><button><p>",
-      "errors": [
-        "(1,29): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "button": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "button",
-                        "children": [
-                          {
-                            "tag": "p"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><button><p></p></button></p></body></html>",
-        "noQuirksBodyHtml": "<p><button><p></p></button></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><button><ul>",
-      "errors": [
-        "(1,30): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "button": true,
-            "ul": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "button",
-                        "children": [
-                          {
-                            "tag": "ul"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><button><ul></ul></button></p></body></html>",
-        "noQuirksBodyHtml": "<p><button><ul></ul></button></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><button><h1>",
-      "errors": [
-        "(1,30): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "button": true,
-            "h1": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "button",
-                        "children": [
-                          {
-                            "tag": "h1"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><button><h1></h1></button></p></body></html>",
-        "noQuirksBodyHtml": "<p><button><h1></h1></button></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><button><h6>",
-      "errors": [
-        "(1,30): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "button": true,
-            "h6": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "button",
-                        "children": [
-                          {
-                            "tag": "h6"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><button><h6></h6></button></p></body></html>",
-        "noQuirksBodyHtml": "<p><button><h6></h6></button></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><button><listing>",
-      "errors": [
-        "(1,35): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "button": true,
-            "listing": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "button",
-                        "children": [
-                          {
-                            "tag": "listing"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><button><listing></listing></button></p></body></html>",
-        "noQuirksBodyHtml": "<p><button><listing></listing></button></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><button><pre>",
-      "errors": [
-        "(1,31): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "button": true,
-            "pre": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "button",
-                        "children": [
-                          {
-                            "tag": "pre"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><button><pre></pre></button></p></body></html>",
-        "noQuirksBodyHtml": "<p><button><pre></pre></button></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><button><form>",
-      "errors": [
-        "(1,32): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "button": true,
-            "form": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "button",
-                        "children": [
-                          {
-                            "tag": "form"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><button><form></form></button></p></body></html>",
-        "noQuirksBodyHtml": "<p><button><form></form></button></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><button><li>",
-      "errors": [
-        "(1,30): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "button": true,
-            "li": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "button",
-                        "children": [
-                          {
-                            "tag": "li"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><button><li></li></button></p></body></html>",
-        "noQuirksBodyHtml": "<p><button><li></li></button></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><button><dd>",
-      "errors": [
-        "(1,30): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "button": true,
-            "dd": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "button",
-                        "children": [
-                          {
-                            "tag": "dd"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><button><dd></dd></button></p></body></html>",
-        "noQuirksBodyHtml": "<p><button><dd></dd></button></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><button><dt>",
-      "errors": [
-        "(1,30): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "button": true,
-            "dt": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "button",
-                        "children": [
-                          {
-                            "tag": "dt"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><button><dt></dt></button></p></body></html>",
-        "noQuirksBodyHtml": "<p><button><dt></dt></button></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><button><plaintext>",
-      "errors": [
-        "(1,37): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "button": true,
-            "plaintext": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "button",
-                        "children": [
-                          {
-                            "tag": "plaintext"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><button><plaintext></plaintext></button></p></body></html>",
-        "noQuirksBodyHtml": "<p><button><plaintext></plaintext></button></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><button><table>",
-      "errors": [
-        "(1,33): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "button": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "button",
-                        "children": [
-                          {
-                            "tag": "table"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><button><table></table></button></p></body></html>",
-        "noQuirksBodyHtml": "<p><button><table></table></button></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><button><hr>",
-      "errors": [
-        "(1,30): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "button": true,
-            "hr": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "button",
-                        "children": [
-                          {
-                            "tag": "hr"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><button><hr></button></p></body></html>",
-        "noQuirksBodyHtml": "<p><button><hr></button></p>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "button": true,
-            "xmp": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "button",
-                        "children": [
-                          {
-                            "tag": "xmp"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><button><xmp></xmp></button></p></body></html>",
-        "noQuirksBodyHtml": "<p><button><xmp></xmp></button></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><button></p>",
-      "errors": [
-        "(1,30): unexpected-end-tag",
-        "(1,30): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "button": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "button",
-                        "children": [
-                          {
-                            "tag": "p"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><button><p></p></button></p></body></html>",
-        "noQuirksBodyHtml": "<p><button><p></p></button></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><address><button></address>a",
-      "errors": [
-        "(1,42): end-tag-too-early"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "address": true,
-            "button": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "address",
-                    "children": [
-                      {
-                        "tag": "button"
-                      }
-                    ]
-                  },
-                  {
-                    "text": "a"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><address><button></button></address>a</body></html>",
-        "noQuirksBodyHtml": "<address><button></button></address>a"
-      }
-    },
-    {
-      "data": "<!doctype html><address><button></address>a",
-      "errors": [
-        "(1,42): end-tag-too-early"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "address": true,
-            "button": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "address",
-                    "children": [
-                      {
-                        "tag": "button"
-                      }
-                    ]
-                  },
-                  {
-                    "text": "a"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><address><button></button></address>a</body></html>",
-        "noQuirksBodyHtml": "<address><button></button></address>a"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "table": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "p"
-                      },
-                      {
-                        "tag": "table"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><p><p></p><table></table></p></body></html>",
-        "noQuirksBodyHtml": "<p></p><p></p><table></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><svg>",
-      "errors": [
-        "(1,20): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg></svg></body></html>",
-        "noQuirksBodyHtml": "<svg></svg>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><figcaption>",
-      "errors": [
-        "(1,30): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "figcaption": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p"
-                  },
-                  {
-                    "tag": "figcaption"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p></p><figcaption></figcaption></body></html>",
-        "noQuirksBodyHtml": "<p></p><figcaption></figcaption>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><summary>",
-      "errors": [
-        "(1,27): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "summary": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p"
-                  },
-                  {
-                    "tag": "summary"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p></p><summary></summary></body></html>",
-        "noQuirksBodyHtml": "<p></p><summary></summary>"
-      }
-    },
-    {
-      "data": "<!doctype html><form><table><form>",
-      "errors": [
-        "(1,34): unexpected-form-in-table",
-        "(1,34): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "form": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "form",
-                    "children": [
-                      {
-                        "tag": "table"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><form><table></table></form></body></html>",
-        "noQuirksBodyHtml": "<form><table></table></form>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "form": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "form"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><form></form></table></body></html>",
-        "noQuirksBodyHtml": "<table><form></form></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><table><form></table><form>",
-      "errors": [
-        "(1,28): unexpected-form-in-table",
-        "(1,42): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "form": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "form"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><form></form></table></body></html>",
-        "noQuirksBodyHtml": "<table><form></form></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><svg><foreignObject><p>",
-      "errors": [
-        "(1,38): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg foreignObject": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "foreignObject",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "tag": "p"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg><foreignObject><p></p></foreignObject></svg></body></html>",
-        "noQuirksBodyHtml": "<svg><foreignObject><p></p></foreignObject></svg>"
-      }
-    },
-    {
-      "data": "<!doctype html><svg><title>abc",
-      "errors": [
-        "(1,30): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg title": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "title",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "text": "abc"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg><title>abc</title></svg></body></html>",
-        "noQuirksBodyHtml": "<svg><title>abc</title></svg>"
-      }
-    },
-    {
-      "data": "<option><span><option>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,22): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "option": true,
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "option",
-                    "children": [
-                      {
-                        "tag": "span",
-                        "children": [
-                          {
-                            "tag": "option"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><option><span><option></option></span></option></body></html>",
-        "noQuirksBodyHtml": "<option><span><option></option></span></option>"
-      }
-    },
-    {
-      "data": "<option><option>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "option": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "option"
-                  },
-                  {
-                    "tag": "option"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><option></option><option></option></body></html>",
-        "noQuirksBodyHtml": "<option></option><option></option>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math annotation-xml": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "annotation-xml",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "div"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><annotation-xml></annotation-xml></math><div></div></body></html>",
-        "noQuirksBodyHtml": "<math><annotation-xml><div></div></annotation-xml></math>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math annotation-xml": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "annotation-xml",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "attrs": [
-                          {
-                            "name": "encoding",
-                            "value": "application/svg+xml"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "div"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><annotation-xml encoding=\"application/svg+xml\"></annotation-xml></math><div></div></body></html>",
-        "noQuirksBodyHtml": "<math><annotation-xml encoding=\"application/svg+xml\"><div></div></annotation-xml></math>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math annotation-xml": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "annotation-xml",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "attrs": [
-                          {
-                            "name": "encoding",
-                            "value": "application/xhtml+xml"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "tag": "div"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><annotation-xml encoding=\"application/xhtml+xml\"><div></div></annotation-xml></math></body></html>",
-        "noQuirksBodyHtml": "<math><annotation-xml encoding=\"application/xhtml+xml\"><div></div></annotation-xml></math>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math annotation-xml": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "annotation-xml",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "attrs": [
-                          {
-                            "name": "encoding",
-                            "value": "aPPlication/xhtmL+xMl"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "tag": "div"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><annotation-xml encoding=\"aPPlication/xhtmL+xMl\"><div></div></annotation-xml></math></body></html>",
-        "noQuirksBodyHtml": "<math><annotation-xml encoding=\"aPPlication/xhtmL+xMl\"><div></div></annotation-xml></math>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math annotation-xml": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "annotation-xml",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "attrs": [
-                          {
-                            "name": "encoding",
-                            "value": "text/html"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "tag": "div"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><annotation-xml encoding=\"text/html\"><div></div></annotation-xml></math></body></html>",
-        "noQuirksBodyHtml": "<math><annotation-xml encoding=\"text/html\"><div></div></annotation-xml></math>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math annotation-xml": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "annotation-xml",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "attrs": [
-                          {
-                            "name": "encoding",
-                            "value": "Text/htmL"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "tag": "div"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><annotation-xml encoding=\"Text/htmL\"><div></div></annotation-xml></math></body></html>",
-        "noQuirksBodyHtml": "<math><annotation-xml encoding=\"Text/htmL\"><div></div></annotation-xml></math>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math annotation-xml": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "annotation-xml",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "attrs": [
-                          {
-                            "name": "encoding",
-                            "value": " text/html "
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "div"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><annotation-xml encoding=\" text/html \"></annotation-xml></math><div></div></body></html>",
-        "noQuirksBodyHtml": "<math><annotation-xml encoding=\" text/html \"><div></div></annotation-xml></math>"
-      }
-    },
-    {
-      "data": "<math><annotation-xml> </annotation-xml>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,40): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math annotation-xml": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "annotation-xml",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "text": " "
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><annotation-xml> </annotation-xml></math></body></html>",
-        "noQuirksBodyHtml": "<math><annotation-xml> </annotation-xml></math>"
-      }
-    },
-    {
-      "data": "<math><annotation-xml>c</annotation-xml>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,40): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math annotation-xml": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "annotation-xml",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "text": "c"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><annotation-xml>c</annotation-xml></math></body></html>",
-        "noQuirksBodyHtml": "<math><annotation-xml>c</annotation-xml></math>"
-      }
-    },
-    {
-      "data": "<math><annotation-xml><!--foo-->",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,32): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math annotation-xml": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "annotation-xml",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "comment": "foo"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><annotation-xml><!--foo--></annotation-xml></math></body></html>",
-        "noQuirksBodyHtml": "<math><annotation-xml><!--foo--></annotation-xml></math>"
-      }
-    },
-    {
-      "data": "<math><annotation-xml></svg>x",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,28): unexpected-end-tag",
-        "(1,29): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math annotation-xml": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "annotation-xml",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "text": "x"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><annotation-xml>x</annotation-xml></math></body></html>",
-        "noQuirksBodyHtml": "<math><annotation-xml>x</annotation-xml></math>"
-      }
-    },
-    {
-      "data": "<math><annotation-xml><svg>x",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,28): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math annotation-xml": true,
-            "svg svg": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "annotation-xml",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "svg",
-                            "ns": "http://www.w3.org/2000/svg",
-                            "children": [
-                              {
-                                "text": "x"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><annotation-xml><svg>x</svg></annotation-xml></math></body></html>",
-        "noQuirksBodyHtml": "<math><annotation-xml><svg>x</svg></annotation-xml></math>"
-      }
-    }
-  ],
-  "tests21.dat": [
-    {
-      "data": "<svg><![CDATA[foo]]>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,20): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "foo"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>foo</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>foo</svg>"
-      }
-    },
-    {
-      "data": "<math><![CDATA[foo]]>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,21): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "text": "foo"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math>foo</math></body></html>",
-        "noQuirksBodyHtml": "<math>foo</math>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "comment": "[CDATA[foo]]"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div><!--[CDATA[foo]]--></div></body></html>",
-        "noQuirksBodyHtml": "<div><!--[CDATA[foo]]--></div>"
-      }
-    },
-    {
-      "data": "<svg><![CDATA[foo",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,17): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "foo"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>foo</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>foo</svg>"
-      }
-    },
-    {
-      "data": "<svg><![CDATA[foo",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,17): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "foo"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>foo</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>foo</svg>"
-      }
-    },
-    {
-      "data": "<svg><![CDATA[",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,14): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg></svg></body></html>",
-        "noQuirksBodyHtml": "<svg></svg>"
-      }
-    },
-    {
-      "data": "<svg><![CDATA[]]>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,17): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg></svg></body></html>",
-        "noQuirksBodyHtml": "<svg></svg>"
-      }
-    },
-    {
-      "data": "<svg><![CDATA[]] >]]>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,21): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "]] >",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>]] &gt;</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>]] &gt;</svg>"
-      }
-    },
-    {
-      "data": "<svg><![CDATA[]] >]]>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,21): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "]] >",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>]] &gt;</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>]] &gt;</svg>"
-      }
-    },
-    {
-      "data": "<svg><![CDATA[]]",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,16): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "]]"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>]]</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>]]</svg>"
-      }
-    },
-    {
-      "data": "<svg><![CDATA[]",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,15): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "]"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>]</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>]</svg>"
-      }
-    },
-    {
-      "data": "<svg><![CDATA[]>a",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,17): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "]>a",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>]&gt;a</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>]&gt;a</svg>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><svg><![CDATA[foo]]]>",
-      "errors": [
-        "(1,36): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "foo]"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg>foo]</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>foo]</svg>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><svg><![CDATA[foo]]]]>",
-      "errors": [
-        "(1,37): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "foo]]"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg>foo]]</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>foo]]</svg>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><svg><![CDATA[foo]]]]]>",
-      "errors": [
-        "(1,38): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "foo]]]"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg>foo]]]</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>foo]]]</svg>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg foreignObject": true,
-            "div": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "foreignObject",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "tag": "div",
-                            "children": [
-                              {
-                                "comment": "[CDATA[foo]]"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg><foreignObject><div><!--[CDATA[foo]]--></div></foreignObject></svg></body></html>",
-        "noQuirksBodyHtml": "<svg><foreignObject><div><!--[CDATA[foo]]--></div></foreignObject></svg>"
-      }
-    },
-    {
-      "data": "<svg><![CDATA[<svg>]]>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,22): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "<svg>",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>&lt;svg&gt;</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>&lt;svg&gt;</svg>"
-      }
-    },
-    {
-      "data": "<svg><![CDATA[</svg>a]]>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,24): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "</svg>a",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>&lt;/svg&gt;a</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>&lt;/svg&gt;a</svg>"
-      }
-    },
-    {
-      "data": "<svg><![CDATA[<svg>a",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,20): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "<svg>a",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>&lt;svg&gt;a</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>&lt;svg&gt;a</svg>"
-      }
-    },
-    {
-      "data": "<svg><![CDATA[</svg>a",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,21): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "</svg>a",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>&lt;/svg&gt;a</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>&lt;/svg&gt;a</svg>"
-      }
-    },
-    {
-      "data": "<svg><![CDATA[<svg>]]><path>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,28): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg path": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "<svg>",
-                        "escaped": true
-                      },
-                      {
-                        "tag": "path",
-                        "ns": "http://www.w3.org/2000/svg"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>&lt;svg&gt;<path></path></svg></body></html>",
-        "noQuirksBodyHtml": "<svg>&lt;svg&gt;<path></path></svg>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "<svg>",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>&lt;svg&gt;</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>&lt;svg&gt;</svg>"
-      }
-    },
-    {
-      "data": "<svg><![CDATA[<svg>]]><!--path-->",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,33): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "escaped": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "<svg>",
-                        "escaped": true
-                      },
-                      {
-                        "comment": "path"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>&lt;svg&gt;<!--path--></svg></body></html>",
-        "noQuirksBodyHtml": "<svg>&lt;svg&gt;<!--path--></svg>"
-      }
-    },
-    {
-      "data": "<svg><![CDATA[<svg>]]>path",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,26): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "<svg>path",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>&lt;svg&gt;path</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>&lt;svg&gt;path</svg>"
-      }
-    },
-    {
-      "data": "<svg><![CDATA[<!--svg-->]]>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,27): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "text": "<!--svg-->",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg>&lt;!--svg--&gt;</svg></body></html>",
-        "noQuirksBodyHtml": "<svg>&lt;!--svg--&gt;</svg>"
-      }
-    }
-  ],
-  "tests22.dat": [
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "b": true,
-            "big": true,
-            "em": true,
-            "strong": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "tag": "big",
-                            "children": [
-                              {
-                                "tag": "em",
-                                "children": [
-                                  {
-                                    "tag": "strong"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "big",
-                    "children": [
-                      {
-                        "tag": "em",
-                        "children": [
-                          {
-                            "tag": "strong",
-                            "children": [
-                              {
-                                "tag": "div",
-                                "children": [
-                                  {
-                                    "tag": "a",
-                                    "children": [
-                                      {
-                                        "text": "X"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a><b><big><em><strong></strong></em></big></b></a><big><em><strong><div><a>X</a></div></strong></em></big></body></html>",
-        "noQuirksBodyHtml": "<a><b><big><em><strong></strong></em></big></b></a><big><em><strong><div><a>X</a></div></strong></em></big>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "b": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "tag": "b"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "div",
-                        "attrs": [
-                          {
-                            "name": "id",
-                            "value": "1"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "tag": "a"
-                          },
-                          {
-                            "tag": "div",
-                            "attrs": [
-                              {
-                                "name": "id",
-                                "value": "2"
-                              }
-                            ],
-                            "children": [
-                              {
-                                "tag": "a"
-                              },
-                              {
-                                "tag": "div",
-                                "attrs": [
-                                  {
-                                    "name": "id",
-                                    "value": "3"
-                                  }
-                                ],
-                                "children": [
-                                  {
-                                    "tag": "a"
-                                  },
-                                  {
-                                    "tag": "div",
-                                    "attrs": [
-                                      {
-                                        "name": "id",
-                                        "value": "4"
-                                      }
-                                    ],
-                                    "children": [
-                                      {
-                                        "tag": "a"
-                                      },
-                                      {
-                                        "tag": "div",
-                                        "attrs": [
-                                          {
-                                            "name": "id",
-                                            "value": "5"
-                                          }
-                                        ],
-                                        "children": [
-                                          {
-                                            "tag": "a"
-                                          },
-                                          {
-                                            "tag": "div",
-                                            "attrs": [
-                                              {
-                                                "name": "id",
-                                                "value": "6"
-                                              }
-                                            ],
-                                            "children": [
-                                              {
-                                                "tag": "a"
-                                              },
-                                              {
-                                                "tag": "div",
-                                                "attrs": [
-                                                  {
-                                                    "name": "id",
-                                                    "value": "7"
-                                                  }
-                                                ],
-                                                "children": [
-                                                  {
-                                                    "tag": "a"
-                                                  },
-                                                  {
-                                                    "tag": "div",
-                                                    "attrs": [
-                                                      {
-                                                        "name": "id",
-                                                        "value": "8"
-                                                      }
-                                                    ],
-                                                    "children": [
-                                                      {
-                                                        "tag": "a",
-                                                        "children": [
-                                                          {
-                                                            "text": "A"
-                                                          }
-                                                        ]
-                                                      }
-                                                    ]
-                                                  }
-                                                ]
-                                              }
-                                            ]
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a><b></b></a><b><div id=\"1\"><a></a><div id=\"2\"><a></a><div id=\"3\"><a></a><div id=\"4\"><a></a><div id=\"5\"><a></a><div id=\"6\"><a></a><div id=\"7\"><a></a><div id=\"8\"><a>A</a></div></div></div></div></div></div></div></div></b></body></html>",
-        "noQuirksBodyHtml": "<a><b></b></a><b><div id=\"1\"><a></a><div id=\"2\"><a></a><div id=\"3\"><a></a><div id=\"4\"><a></a><div id=\"5\"><a></a><div id=\"6\"><a></a><div id=\"7\"><a></a><div id=\"8\"><a>A</a></div></div></div></div></div></div></div></div></b>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "b": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "tag": "b"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "div",
-                        "attrs": [
-                          {
-                            "name": "id",
-                            "value": "1"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "tag": "a"
-                          },
-                          {
-                            "tag": "div",
-                            "attrs": [
-                              {
-                                "name": "id",
-                                "value": "2"
-                              }
-                            ],
-                            "children": [
-                              {
-                                "tag": "a"
-                              },
-                              {
-                                "tag": "div",
-                                "attrs": [
-                                  {
-                                    "name": "id",
-                                    "value": "3"
-                                  }
-                                ],
-                                "children": [
-                                  {
-                                    "tag": "a"
-                                  },
-                                  {
-                                    "tag": "div",
-                                    "attrs": [
-                                      {
-                                        "name": "id",
-                                        "value": "4"
-                                      }
-                                    ],
-                                    "children": [
-                                      {
-                                        "tag": "a"
-                                      },
-                                      {
-                                        "tag": "div",
-                                        "attrs": [
-                                          {
-                                            "name": "id",
-                                            "value": "5"
-                                          }
-                                        ],
-                                        "children": [
-                                          {
-                                            "tag": "a"
-                                          },
-                                          {
-                                            "tag": "div",
-                                            "attrs": [
-                                              {
-                                                "name": "id",
-                                                "value": "6"
-                                              }
-                                            ],
-                                            "children": [
-                                              {
-                                                "tag": "a"
-                                              },
-                                              {
-                                                "tag": "div",
-                                                "attrs": [
-                                                  {
-                                                    "name": "id",
-                                                    "value": "7"
-                                                  }
-                                                ],
-                                                "children": [
-                                                  {
-                                                    "tag": "a"
-                                                  },
-                                                  {
-                                                    "tag": "div",
-                                                    "attrs": [
-                                                      {
-                                                        "name": "id",
-                                                        "value": "8"
-                                                      }
-                                                    ],
-                                                    "children": [
-                                                      {
-                                                        "tag": "a",
-                                                        "children": [
-                                                          {
-                                                            "tag": "div",
-                                                            "attrs": [
-                                                              {
-                                                                "name": "id",
-                                                                "value": "9"
-                                                              }
-                                                            ],
-                                                            "children": [
-                                                              {
-                                                                "text": "A"
-                                                              }
-                                                            ]
-                                                          }
-                                                        ]
-                                                      }
-                                                    ]
-                                                  }
-                                                ]
-                                              }
-                                            ]
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a><b></b></a><b><div id=\"1\"><a></a><div id=\"2\"><a></a><div id=\"3\"><a></a><div id=\"4\"><a></a><div id=\"5\"><a></a><div id=\"6\"><a></a><div id=\"7\"><a></a><div id=\"8\"><a><div id=\"9\">A</div></a></div></div></div></div></div></div></div></div></b></body></html>",
-        "noQuirksBodyHtml": "<a><b></b></a><b><div id=\"1\"><a></a><div id=\"2\"><a></a><div id=\"3\"><a></a><div id=\"4\"><a></a><div id=\"5\"><a></a><div id=\"6\"><a></a><div id=\"7\"><a></a><div id=\"8\"><a><div id=\"9\">A</div></a></div></div></div></div></div></div></div></div></b>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "b": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "tag": "b"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "div",
-                        "attrs": [
-                          {
-                            "name": "id",
-                            "value": "1"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "tag": "a"
-                          },
-                          {
-                            "tag": "div",
-                            "attrs": [
-                              {
-                                "name": "id",
-                                "value": "2"
-                              }
-                            ],
-                            "children": [
-                              {
-                                "tag": "a"
-                              },
-                              {
-                                "tag": "div",
-                                "attrs": [
-                                  {
-                                    "name": "id",
-                                    "value": "3"
-                                  }
-                                ],
-                                "children": [
-                                  {
-                                    "tag": "a"
-                                  },
-                                  {
-                                    "tag": "div",
-                                    "attrs": [
-                                      {
-                                        "name": "id",
-                                        "value": "4"
-                                      }
-                                    ],
-                                    "children": [
-                                      {
-                                        "tag": "a"
-                                      },
-                                      {
-                                        "tag": "div",
-                                        "attrs": [
-                                          {
-                                            "name": "id",
-                                            "value": "5"
-                                          }
-                                        ],
-                                        "children": [
-                                          {
-                                            "tag": "a"
-                                          },
-                                          {
-                                            "tag": "div",
-                                            "attrs": [
-                                              {
-                                                "name": "id",
-                                                "value": "6"
-                                              }
-                                            ],
-                                            "children": [
-                                              {
-                                                "tag": "a"
-                                              },
-                                              {
-                                                "tag": "div",
-                                                "attrs": [
-                                                  {
-                                                    "name": "id",
-                                                    "value": "7"
-                                                  }
-                                                ],
-                                                "children": [
-                                                  {
-                                                    "tag": "a"
-                                                  },
-                                                  {
-                                                    "tag": "div",
-                                                    "attrs": [
-                                                      {
-                                                        "name": "id",
-                                                        "value": "8"
-                                                      }
-                                                    ],
-                                                    "children": [
-                                                      {
-                                                        "tag": "a",
-                                                        "children": [
-                                                          {
-                                                            "tag": "div",
-                                                            "attrs": [
-                                                              {
-                                                                "name": "id",
-                                                                "value": "9"
-                                                              }
-                                                            ],
-                                                            "children": [
-                                                              {
-                                                                "tag": "div",
-                                                                "attrs": [
-                                                                  {
-                                                                    "name": "id",
-                                                                    "value": "10"
-                                                                  }
-                                                                ],
-                                                                "children": [
-                                                                  {
-                                                                    "text": "A"
-                                                                  }
-                                                                ]
-                                                              }
-                                                            ]
-                                                          }
-                                                        ]
-                                                      }
-                                                    ]
-                                                  }
-                                                ]
-                                              }
-                                            ]
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a><b></b></a><b><div id=\"1\"><a></a><div id=\"2\"><a></a><div id=\"3\"><a></a><div id=\"4\"><a></a><div id=\"5\"><a></a><div id=\"6\"><a></a><div id=\"7\"><a></a><div id=\"8\"><a><div id=\"9\"><div id=\"10\">A</div></div></a></div></div></div></div></div></div></div></div></b></body></html>",
-        "noQuirksBodyHtml": "<a><b></b></a><b><div id=\"1\"><a></a><div id=\"2\"><a></a><div id=\"3\"><a></a><div id=\"4\"><a></a><div id=\"5\"><a></a><div id=\"6\"><a></a><div id=\"7\"><a></a><div id=\"8\"><a><div id=\"9\"><div id=\"10\">A</div></div></a></div></div></div></div></div></div></div></div></b>"
-      }
-    },
-    {
-      "data": "<cite><b><cite><i><cite><i><cite><i><div>X</b>TEST",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,46): adoption-agency-1.3",
-        "(1,50): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "cite": true,
-            "b": true,
-            "i": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "cite",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "tag": "cite",
-                            "children": [
-                              {
-                                "tag": "i",
-                                "children": [
-                                  {
-                                    "tag": "cite",
-                                    "children": [
-                                      {
-                                        "tag": "i",
-                                        "children": [
-                                          {
-                                            "tag": "cite",
-                                            "children": [
-                                              {
-                                                "tag": "i"
-                                              }
-                                            ]
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "i",
-                        "children": [
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "tag": "div",
-                                "children": [
-                                  {
-                                    "tag": "b",
-                                    "children": [
-                                      {
-                                        "text": "X"
-                                      }
-                                    ]
-                                  },
-                                  {
-                                    "text": "TEST"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><cite><b><cite><i><cite><i><cite><i></i></cite></i></cite></i></cite></b><i><i><div><b>X</b>TEST</div></i></i></cite></body></html>",
-        "noQuirksBodyHtml": "<cite><b><cite><i><cite><i><cite><i></i></cite></i></cite></i></cite></b><i><i><div><b>X</b>TEST</div></i></i></cite>"
-      }
-    }
-  ],
-  "tests23.dat": [
-    {
-      "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": [
-        "(1,3): expected-doctype-but-got-start-tag",
-        "(1,116): unexpected-end-tag",
-        "(1,117): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "font": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "font",
-                        "attrs": [
-                          {
-                            "name": "size",
-                            "value": "4"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "tag": "font",
-                            "attrs": [
-                              {
-                                "name": "color",
-                                "value": "red"
-                              }
-                            ],
-                            "children": [
-                              {
-                                "tag": "font",
-                                "attrs": [
-                                  {
-                                    "name": "size",
-                                    "value": "4"
-                                  }
-                                ],
-                                "children": [
-                                  {
-                                    "tag": "font",
-                                    "attrs": [
-                                      {
-                                        "name": "size",
-                                        "value": "4"
-                                      }
-                                    ],
-                                    "children": [
-                                      {
-                                        "tag": "font",
-                                        "attrs": [
-                                          {
-                                            "name": "size",
-                                            "value": "4"
-                                          }
-                                        ],
-                                        "children": [
-                                          {
-                                            "tag": "font",
-                                            "attrs": [
-                                              {
-                                                "name": "size",
-                                                "value": "4"
-                                              }
-                                            ],
-                                            "children": [
-                                              {
-                                                "tag": "font",
-                                                "attrs": [
-                                                  {
-                                                    "name": "size",
-                                                    "value": "4"
-                                                  }
-                                                ],
-                                                "children": [
-                                                  {
-                                                    "tag": "font",
-                                                    "attrs": [
-                                                      {
-                                                        "name": "color",
-                                                        "value": "red"
-                                                      }
-                                                    ]
-                                                  }
-                                                ]
-                                              }
-                                            ]
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "font",
-                        "attrs": [
-                          {
-                            "name": "color",
-                            "value": "red"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "tag": "font",
-                            "attrs": [
-                              {
-                                "name": "size",
-                                "value": "4"
-                              }
-                            ],
-                            "children": [
-                              {
-                                "tag": "font",
-                                "attrs": [
-                                  {
-                                    "name": "size",
-                                    "value": "4"
-                                  }
-                                ],
-                                "children": [
-                                  {
-                                    "tag": "font",
-                                    "attrs": [
-                                      {
-                                        "name": "size",
-                                        "value": "4"
-                                      }
-                                    ],
-                                    "children": [
-                                      {
-                                        "tag": "font",
-                                        "attrs": [
-                                          {
-                                            "name": "color",
-                                            "value": "red"
-                                          }
-                                        ],
-                                        "children": [
-                                          {
-                                            "text": "X"
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><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\"></font></font></font></font></font></font></font></font></p><p><font color=\"red\"><font size=\"4\"><font size=\"4\"><font size=\"4\"><font color=\"red\">X</font></font></font></font></font></p></body></html>",
-        "noQuirksBodyHtml": "<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\"></font></font></font></font></font></font></font></font></p><p><font color=\"red\"><font size=\"4\"><font size=\"4\"><font size=\"4\"><font color=\"red\">X</font></font></font></font></font></p>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "font": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "font",
-                        "attrs": [
-                          {
-                            "name": "size",
-                            "value": "4"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "tag": "font",
-                            "attrs": [
-                              {
-                                "name": "size",
-                                "value": "4"
-                              }
-                            ],
-                            "children": [
-                              {
-                                "tag": "font",
-                                "attrs": [
-                                  {
-                                    "name": "size",
-                                    "value": "4"
-                                  }
-                                ],
-                                "children": [
-                                  {
-                                    "tag": "font",
-                                    "attrs": [
-                                      {
-                                        "name": "size",
-                                        "value": "4"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "font",
-                        "attrs": [
-                          {
-                            "name": "size",
-                            "value": "4"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "tag": "font",
-                            "attrs": [
-                              {
-                                "name": "size",
-                                "value": "4"
-                              }
-                            ],
-                            "children": [
-                              {
-                                "tag": "font",
-                                "attrs": [
-                                  {
-                                    "name": "size",
-                                    "value": "4"
-                                  }
-                                ],
-                                "children": [
-                                  {
-                                    "text": "X"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><p><font size=\"4\"><font size=\"4\"><font size=\"4\"><font size=\"4\"></font></font></font></font></p><p><font size=\"4\"><font size=\"4\"><font size=\"4\">X</font></font></font></p></body></html>",
-        "noQuirksBodyHtml": "<p><font size=\"4\"><font size=\"4\"><font size=\"4\"><font size=\"4\"></font></font></font></font></p><p><font size=\"4\"><font size=\"4\"><font size=\"4\">X</font></font></font></p>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "font": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "font",
-                        "attrs": [
-                          {
-                            "name": "size",
-                            "value": "4"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "tag": "font",
-                            "attrs": [
-                              {
-                                "name": "size",
-                                "value": "4"
-                              }
-                            ],
-                            "children": [
-                              {
-                                "tag": "font",
-                                "attrs": [
-                                  {
-                                    "name": "size",
-                                    "value": "4"
-                                  }
-                                ],
-                                "children": [
-                                  {
-                                    "tag": "font",
-                                    "attrs": [
-                                      {
-                                        "name": "size",
-                                        "value": "5"
-                                      }
-                                    ],
-                                    "children": [
-                                      {
-                                        "tag": "font",
-                                        "attrs": [
-                                          {
-                                            "name": "size",
-                                            "value": "4"
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "font",
-                        "attrs": [
-                          {
-                            "name": "size",
-                            "value": "4"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "tag": "font",
-                            "attrs": [
-                              {
-                                "name": "size",
-                                "value": "4"
-                              }
-                            ],
-                            "children": [
-                              {
-                                "tag": "font",
-                                "attrs": [
-                                  {
-                                    "name": "size",
-                                    "value": "5"
-                                  }
-                                ],
-                                "children": [
-                                  {
-                                    "tag": "font",
-                                    "attrs": [
-                                      {
-                                        "name": "size",
-                                        "value": "4"
-                                      }
-                                    ],
-                                    "children": [
-                                      {
-                                        "text": "X"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><p><font size=\"4\"><font size=\"4\"><font size=\"4\"><font size=\"5\"><font size=\"4\"></font></font></font></font></font></p><p><font size=\"4\"><font size=\"4\"><font size=\"5\"><font size=\"4\">X</font></font></font></font></p></body></html>",
-        "noQuirksBodyHtml": "<p><font size=\"4\"><font size=\"4\"><font size=\"4\"><font size=\"5\"><font size=\"4\"></font></font></font></font></font></p><p><font size=\"4\"><font size=\"4\"><font size=\"5\"><font size=\"4\">X</font></font></font></font></p>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "font": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "font",
-                        "attrs": [
-                          {
-                            "name": "id",
-                            "value": "a"
-                          },
-                          {
-                            "name": "size",
-                            "value": "4"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "tag": "font",
-                            "attrs": [
-                              {
-                                "name": "id",
-                                "value": "b"
-                              },
-                              {
-                                "name": "size",
-                                "value": "4"
-                              }
-                            ],
-                            "children": [
-                              {
-                                "tag": "font",
-                                "attrs": [
-                                  {
-                                    "name": "size",
-                                    "value": "4"
-                                  }
-                                ],
-                                "children": [
-                                  {
-                                    "tag": "font",
-                                    "attrs": [
-                                      {
-                                        "name": "size",
-                                        "value": "4"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "font",
-                        "attrs": [
-                          {
-                            "name": "id",
-                            "value": "a"
-                          },
-                          {
-                            "name": "size",
-                            "value": "4"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "tag": "font",
-                            "attrs": [
-                              {
-                                "name": "id",
-                                "value": "b"
-                              },
-                              {
-                                "name": "size",
-                                "value": "4"
-                              }
-                            ],
-                            "children": [
-                              {
-                                "tag": "font",
-                                "attrs": [
-                                  {
-                                    "name": "size",
-                                    "value": "4"
-                                  }
-                                ],
-                                "children": [
-                                  {
-                                    "tag": "font",
-                                    "attrs": [
-                                      {
-                                        "name": "size",
-                                        "value": "4"
-                                      }
-                                    ],
-                                    "children": [
-                                      {
-                                        "text": "X"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><p><font size=\"4\" id=\"a\"><font size=\"4\" id=\"b\"><font size=\"4\"><font size=\"4\"></font></font></font></font></p><p><font size=\"4\" id=\"a\"><font size=\"4\" id=\"b\"><font size=\"4\"><font size=\"4\">X</font></font></font></font></p></body></html>",
-        "noQuirksBodyHtml": "<p><font size=\"4\" id=\"a\"><font size=\"4\" id=\"b\"><font size=\"4\"><font size=\"4\"></font></font></font></font></p><p><font size=\"4\" id=\"a\"><font size=\"4\" id=\"b\"><font size=\"4\"><font size=\"4\">X</font></font></font></font></p>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "b": true,
-            "object": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "attrs": [
-                          {
-                            "name": "id",
-                            "value": "a"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "tag": "b",
-                            "attrs": [
-                              {
-                                "name": "id",
-                                "value": "a"
-                              }
-                            ],
-                            "children": [
-                              {
-                                "tag": "b",
-                                "attrs": [
-                                  {
-                                    "name": "id",
-                                    "value": "a"
-                                  }
-                                ],
-                                "children": [
-                                  {
-                                    "tag": "b",
-                                    "children": [
-                                      {
-                                        "tag": "object",
-                                        "children": [
-                                          {
-                                            "tag": "b",
-                                            "attrs": [
-                                              {
-                                                "name": "id",
-                                                "value": "a"
-                                              }
-                                            ],
-                                            "children": [
-                                              {
-                                                "tag": "b",
-                                                "attrs": [
-                                                  {
-                                                    "name": "id",
-                                                    "value": "a"
-                                                  }
-                                                ],
-                                                "children": [
-                                                  {
-                                                    "text": "X"
-                                                  }
-                                                ]
-                                              }
-                                            ]
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "attrs": [
-                          {
-                            "name": "id",
-                            "value": "a"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "tag": "b",
-                            "attrs": [
-                              {
-                                "name": "id",
-                                "value": "a"
-                              }
-                            ],
-                            "children": [
-                              {
-                                "tag": "b",
-                                "attrs": [
-                                  {
-                                    "name": "id",
-                                    "value": "a"
-                                  }
-                                ],
-                                "children": [
-                                  {
-                                    "tag": "b",
-                                    "children": [
-                                      {
-                                        "text": "Y"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><p><b id=\"a\"><b id=\"a\"><b id=\"a\"><b><object><b id=\"a\"><b id=\"a\">X</b></b></object></b></b></b></b></p><p><b id=\"a\"><b id=\"a\"><b id=\"a\"><b>Y</b></b></b></b></p></body></html>",
-        "noQuirksBodyHtml": "<p><b id=\"a\"><b id=\"a\"><b id=\"a\"><b><object><b id=\"a\"><b id=\"a\">X</b></b></object></b></b></b></b></p><p><b id=\"a\"><b id=\"a\"><b id=\"a\"><b>Y</b></b></b></b></p>"
-      }
-    }
-  ],
-  "tests24.dat": [
-    {
-      "data": "<!DOCTYPE html>&NotEqualTilde;",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "≂̸"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>≂̸</body></html>",
-        "noQuirksBodyHtml": "≂̸"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html>&NotEqualTilde;A",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "≂̸A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>≂̸A</body></html>",
-        "noQuirksBodyHtml": "≂̸A"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html>&ThickSpace;",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "  "
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>  </body></html>",
-        "noQuirksBodyHtml": "  "
-      }
-    },
-    {
-      "data": "<!DOCTYPE html>&ThickSpace;A",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "  A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>  A</body></html>",
-        "noQuirksBodyHtml": "  A"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html>&NotSubset;",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "⊂⃒"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>⊂⃒</body></html>",
-        "noQuirksBodyHtml": "⊂⃒"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html>&NotSubset;A",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "⊂⃒A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>⊂⃒A</body></html>",
-        "noQuirksBodyHtml": "⊂⃒A"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html>&Gopf;",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "𝔾"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>𝔾</body></html>",
-        "noQuirksBodyHtml": "𝔾"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html>&Gopf;A",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "𝔾A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>𝔾A</body></html>",
-        "noQuirksBodyHtml": "𝔾A"
-      }
-    }
-  ],
-  "tests25.dat": [
-    {
-      "data": "<!DOCTYPE html><body><foo>A",
-      "errors": [
-        "(1,27): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "foo": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "foo",
-                    "children": [
-                      {
-                        "text": "A"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><foo>A</foo></body></html>",
-        "noQuirksBodyHtml": "<foo>A</foo>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><area>A",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "area": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "area"
-                  },
-                  {
-                    "text": "A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><area>A</body></html>",
-        "noQuirksBodyHtml": "<area>A"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><base>A",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "base": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "base"
-                  },
-                  {
-                    "text": "A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><base>A</body></html>",
-        "noQuirksBodyHtml": "<base>A"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><basefont>A",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "basefont": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "basefont"
-                  },
-                  {
-                    "text": "A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><basefont>A</body></html>",
-        "noQuirksBodyHtml": "<basefont>A"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><bgsound>A",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "bgsound": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "bgsound"
-                  },
-                  {
-                    "text": "A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><bgsound>A</body></html>",
-        "noQuirksBodyHtml": "<bgsound>A"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><br>A",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "br": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "br"
-                  },
-                  {
-                    "text": "A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><br>A</body></html>",
-        "noQuirksBodyHtml": "<br>A"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><col>A",
-      "errors": [
-        "(1,26): unexpected-start-tag-ignored"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>A</body></html>",
-        "noQuirksBodyHtml": "A"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><command>A",
-      "errors": [
-        "eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "command": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "command",
-                    "children": [
-                      {
-                        "text": "A"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><command>A</command></body></html>",
-        "noQuirksBodyHtml": "<command>A</command>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><embed>A",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "embed": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "embed"
-                  },
-                  {
-                    "text": "A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><embed>A</body></html>",
-        "noQuirksBodyHtml": "<embed>A"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><frame>A",
-      "errors": [
-        "(1,28): unexpected-start-tag-ignored"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>A</body></html>",
-        "noQuirksBodyHtml": "A"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><hr>A",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "hr": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "hr"
-                  },
-                  {
-                    "text": "A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><hr>A</body></html>",
-        "noQuirksBodyHtml": "<hr>A"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><img>A",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "img": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "img"
-                  },
-                  {
-                    "text": "A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><img>A</body></html>",
-        "noQuirksBodyHtml": "<img>A"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><input>A",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "input": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "input"
-                  },
-                  {
-                    "text": "A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><input>A</body></html>",
-        "noQuirksBodyHtml": "<input>A"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><keygen>A",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "keygen": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "keygen"
-                  },
-                  {
-                    "text": "A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><keygen>A</body></html>",
-        "noQuirksBodyHtml": "<keygen>A"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><link>A",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "link": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "link"
-                  },
-                  {
-                    "text": "A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><link>A</body></html>",
-        "noQuirksBodyHtml": "<link>A"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><meta>A",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "meta": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "meta"
-                  },
-                  {
-                    "text": "A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><meta>A</body></html>",
-        "noQuirksBodyHtml": "<meta>A"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><param>A",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "param": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "param"
-                  },
-                  {
-                    "text": "A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><param>A</body></html>",
-        "noQuirksBodyHtml": "<param>A"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><source>A",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "source": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "source"
-                  },
-                  {
-                    "text": "A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><source>A</body></html>",
-        "noQuirksBodyHtml": "<source>A"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><track>A",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "track": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "track"
-                  },
-                  {
-                    "text": "A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><track>A</body></html>",
-        "noQuirksBodyHtml": "<track>A"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><wbr>A",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "wbr": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "wbr"
-                  },
-                  {
-                    "text": "A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><wbr>A</body></html>",
-        "noQuirksBodyHtml": "<wbr>A"
-      }
-    }
-  ],
-  "tests26.dat": [
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "nobr": true,
-            "br": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "attrs": [
-                      {
-                        "name": "href",
-                        "value": "#1"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "tag": "nobr",
-                        "children": [
-                          {
-                            "text": "1"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "nobr"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "nobr",
-                    "children": [
-                      {
-                        "tag": "br"
-                      },
-                      {
-                        "tag": "a",
-                        "attrs": [
-                          {
-                            "name": "href",
-                            "value": "#2"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "a",
-                    "attrs": [
-                      {
-                        "name": "href",
-                        "value": "#2"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "tag": "nobr",
-                        "children": [
-                          {
-                            "text": "2"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "nobr"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "nobr",
-                    "children": [
-                      {
-                        "tag": "br"
-                      },
-                      {
-                        "tag": "a",
-                        "attrs": [
-                          {
-                            "name": "href",
-                            "value": "#3"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "a",
-                    "attrs": [
-                      {
-                        "name": "href",
-                        "value": "#3"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "tag": "nobr",
-                        "children": [
-                          {
-                            "text": "3"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "nobr"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><a href=\"#1\"><nobr>1</nobr><nobr></nobr></a><nobr><br><a href=\"#2\"></a></nobr><a href=\"#2\"><nobr>2</nobr><nobr></nobr></a><nobr><br><a href=\"#3\"></a></nobr><a href=\"#3\"><nobr>3</nobr><nobr></nobr></a></body></html>",
-        "noQuirksBodyHtml": "<a href=\"#1\"><nobr>1</nobr><nobr></nobr></a><nobr><br><a href=\"#2\"></a></nobr><a href=\"#2\"><nobr>2</nobr><nobr></nobr></a><nobr><br><a href=\"#3\"></a></nobr><a href=\"#3\"><nobr>3</nobr><nobr></nobr></a>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "nobr": true,
-            "i": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "nobr",
-                        "children": [
-                          {
-                            "text": "1"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "nobr"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "nobr",
-                    "children": [
-                      {
-                        "tag": "i"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "i",
-                    "children": [
-                      {
-                        "tag": "nobr",
-                        "children": [
-                          {
-                            "text": "2"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "nobr"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "nobr",
-                    "children": [
-                      {
-                        "text": "3"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><b><nobr>1</nobr><nobr></nobr></b><nobr><i></i></nobr><i><nobr>2</nobr><nobr></nobr></i><nobr>3</nobr></body></html>",
-        "noQuirksBodyHtml": "<b><nobr>1</nobr><nobr></nobr></b><nobr><i></i></nobr><i><nobr>2</nobr><nobr></nobr></i><nobr>3</nobr>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "nobr": true,
-            "i": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "nobr",
-                        "children": [
-                          {
-                            "text": "1"
-                          },
-                          {
-                            "tag": "nobr",
-                            "children": [
-                              {
-                                "tag": "i"
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "tag": "nobr",
-                                "children": [
-                                  {
-                                    "text": "2"
-                                  }
-                                ]
-                              },
-                              {
-                                "tag": "nobr"
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "nobr",
-                            "children": [
-                              {
-                                "text": "3"
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "table"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><b><nobr>1<nobr><i></i></nobr><i><nobr>2</nobr><nobr></nobr></i><nobr>3</nobr><table></table></nobr></b></body></html>",
-        "noQuirksBodyHtml": "<b><nobr>1<nobr><i></i></nobr><i><nobr>2</nobr><nobr></nobr></i><nobr>3</nobr><table></table></nobr></b>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "nobr": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "i": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "nobr",
-                        "children": [
-                          {
-                            "text": "1"
-                          },
-                          {
-                            "tag": "table",
-                            "children": [
-                              {
-                                "tag": "tbody",
-                                "children": [
-                                  {
-                                    "tag": "tr",
-                                    "children": [
-                                      {
-                                        "tag": "td",
-                                        "children": [
-                                          {
-                                            "tag": "nobr",
-                                            "children": [
-                                              {
-                                                "tag": "i"
-                                              }
-                                            ]
-                                          },
-                                          {
-                                            "tag": "i",
-                                            "children": [
-                                              {
-                                                "tag": "nobr",
-                                                "children": [
-                                                  {
-                                                    "text": "2"
-                                                  }
-                                                ]
-                                              },
-                                              {
-                                                "tag": "nobr"
-                                              }
-                                            ]
-                                          },
-                                          {
-                                            "tag": "nobr",
-                                            "children": [
-                                              {
-                                                "text": "3"
-                                              }
-                                            ]
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><b><nobr>1<table><tbody><tr><td><nobr><i></i></nobr><i><nobr>2</nobr><nobr></nobr></i><nobr>3</nobr></td></tr></tbody></table></nobr></b></body></html>",
-        "noQuirksBodyHtml": "<b><nobr>1<table><tbody><tr><td><nobr><i></i></nobr><i><nobr>2</nobr><nobr></nobr></i><nobr>3</nobr></td></tr></tbody></table></nobr></b>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "nobr": true,
-            "div": true,
-            "i": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "nobr",
-                        "children": [
-                          {
-                            "text": "1"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "tag": "nobr"
-                          },
-                          {
-                            "tag": "nobr"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "nobr",
-                        "children": [
-                          {
-                            "tag": "i"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "i",
-                        "children": [
-                          {
-                            "tag": "nobr",
-                            "children": [
-                              {
-                                "text": "2"
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "nobr"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "nobr",
-                        "children": [
-                          {
-                            "text": "3"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><b><nobr>1</nobr></b><div><b><nobr></nobr><nobr></nobr></b><nobr><i></i></nobr><i><nobr>2</nobr><nobr></nobr></i><nobr>3</nobr></div></body></html>",
-        "noQuirksBodyHtml": "<b><nobr>1</nobr></b><div><b><nobr></nobr><nobr></nobr></b><nobr><i></i></nobr><i><nobr>2</nobr><nobr></nobr></i><nobr>3</nobr></div>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "nobr": true,
-            "div": true,
-            "i": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "nobr",
-                        "children": [
-                          {
-                            "text": "1"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "nobr"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "nobr",
-                        "children": [
-                          {
-                            "tag": "i"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "i",
-                        "children": [
-                          {
-                            "tag": "nobr",
-                            "children": [
-                              {
-                                "text": "2"
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "nobr"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "nobr",
-                        "children": [
-                          {
-                            "text": "3"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><b><nobr>1</nobr><nobr></nobr></b><div><nobr><i></i></nobr><i><nobr>2</nobr><nobr></nobr></i><nobr>3</nobr></div></body></html>",
-        "noQuirksBodyHtml": "<b><nobr>1</nobr><nobr></nobr></b><div><nobr><i></i></nobr><i><nobr>2</nobr><nobr></nobr></i><nobr>3</nobr></div>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "nobr": true,
-            "ins": true,
-            "i": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "nobr",
-                        "children": [
-                          {
-                            "text": "1"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "nobr",
-                        "children": [
-                          {
-                            "tag": "ins"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "nobr",
-                    "children": [
-                      {
-                        "tag": "i"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "i",
-                    "children": [
-                      {
-                        "tag": "nobr"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><b><nobr>1</nobr><nobr><ins></ins></nobr></b><nobr><i></i></nobr><i><nobr></nobr></i></body></html>",
-        "noQuirksBodyHtml": "<b><nobr>1</nobr><nobr><ins></ins></nobr></b><nobr><i></i></nobr><i><nobr></nobr></i>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "nobr": true,
-            "ins": true,
-            "i": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "nobr",
-                        "children": [
-                          {
-                            "text": "1"
-                          },
-                          {
-                            "tag": "ins"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "nobr"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "nobr",
-                    "children": [
-                      {
-                        "tag": "i",
-                        "children": [
-                          {
-                            "text": "2"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><b><nobr>1<ins></ins></nobr><nobr></nobr></b><nobr><i>2</i></nobr></body></html>",
-        "noQuirksBodyHtml": "<b><nobr>1<ins></ins></nobr><nobr></nobr></b><nobr><i>2</i></nobr>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "nobr": true,
-            "i": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "text": "1"
-                      },
-                      {
-                        "tag": "nobr"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "nobr",
-                    "children": [
-                      {
-                        "tag": "i"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "i",
-                    "children": [
-                      {
-                        "tag": "nobr",
-                        "children": [
-                          {
-                            "text": "2"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><b>1<nobr></nobr></b><nobr><i></i></nobr><i><nobr>2</nobr></i></body></html>",
-        "noQuirksBodyHtml": "<b>1<nobr></nobr></b><nobr><i></i></nobr><i><nobr>2</nobr></i>"
-      }
-    },
-    {
-      "data": "<p><code x</code></p>\n",
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "code": true
-          },
-          "attrWithFunnyChar": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "code",
-                        "attrs": [
-                          {
-                            "name": "code",
-                            "value": ""
-                          },
-                          {
-                            "name": "x<",
-                            "value": ""
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "code",
-                    "attrs": [
-                      {
-                        "name": "code",
-                        "value": ""
-                      },
-                      {
-                        "name": "x<",
-                        "value": ""
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "\n"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><p><code x<=\"\" code=\"\"></code></p><code x<=\"\" code=\"\">\n</code></body></html>",
-        "noQuirksBodyHtml": "<p><code x<=\"\" code=\"\"></code></p><code x<=\"\" code=\"\">\n</code>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><svg><foreignObject><p><i></p>a",
-      "errors": [
-        "(1,45): unexpected-end-tag",
-        "(1,46): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg foreignObject": true,
-            "p": true,
-            "i": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "foreignObject",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "tag": "p",
-                            "children": [
-                              {
-                                "tag": "i"
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "text": "a"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><svg><foreignObject><p><i></i></p><i>a</i></foreignObject></svg></body></html>",
-        "noQuirksBodyHtml": "<svg><foreignObject><p><i></i></p><i>a</i></foreignObject></svg>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><table><tr><td><svg><foreignObject><p><i></p>a",
-      "errors": [
-        "(1,60): unexpected-end-tag",
-        "(1,61): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "svg svg": true,
-            "svg foreignObject": true,
-            "p": true,
-            "i": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "svg",
-                                    "ns": "http://www.w3.org/2000/svg",
-                                    "children": [
-                                      {
-                                        "tag": "foreignObject",
-                                        "ns": "http://www.w3.org/2000/svg",
-                                        "children": [
-                                          {
-                                            "tag": "p",
-                                            "children": [
-                                              {
-                                                "tag": "i"
-                                              }
-                                            ]
-                                          },
-                                          {
-                                            "tag": "i",
-                                            "children": [
-                                              {
-                                                "text": "a"
-                                              }
-                                            ]
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><svg><foreignObject><p><i></i></p><i>a</i></foreignObject></svg></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><svg><foreignObject><p><i></i></p><i>a</i></foreignObject></svg></td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><math><mtext><p><i></p>a",
-      "errors": [
-        "(1,38): unexpected-end-tag",
-        "(1,39): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mtext": true,
-            "p": true,
-            "i": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mtext",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "p",
-                            "children": [
-                              {
-                                "tag": "i"
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "text": "a"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math><mtext><p><i></i></p><i>a</i></mtext></math></body></html>",
-        "noQuirksBodyHtml": "<math><mtext><p><i></i></p><i>a</i></mtext></math>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><table><tr><td><math><mtext><p><i></p>a",
-      "errors": [
-        "(1,53): unexpected-end-tag",
-        "(1,54): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "math math": true,
-            "math mtext": true,
-            "p": true,
-            "i": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "math",
-                                    "ns": "http://www.w3.org/1998/Math/MathML",
-                                    "children": [
-                                      {
-                                        "tag": "mtext",
-                                        "ns": "http://www.w3.org/1998/Math/MathML",
-                                        "children": [
-                                          {
-                                            "tag": "p",
-                                            "children": [
-                                              {
-                                                "tag": "i"
-                                              }
-                                            ]
-                                          },
-                                          {
-                                            "tag": "i",
-                                            "children": [
-                                              {
-                                                "text": "a"
-                                              }
-                                            ]
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><math><mtext><p><i></i></p><i>a</i></mtext></math></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><math><mtext><p><i></i></p><i>a</i></mtext></math></td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><div><!/div>a",
-      "errors": [
-        "(1,28): expected-dashes-or-doctype",
-        "(1,34): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          },
-          "doctype": true,
-          "comment": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "comment": "/div"
-                      },
-                      {
-                        "text": "a"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><div><!--/div-->a</div></body></html>",
-        "noQuirksBodyHtml": "<div><!--/div-->a</div>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "button": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "button",
-                    "children": [
-                      {
-                        "tag": "p"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "button"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><button><p></p></button><button></button></body></html>",
-        "noQuirksBodyHtml": "<button><p></p></button><button></button>"
-      }
-    }
-  ],
-  "tests3.dat": [
-    {
-      "data": "<head></head><style></style>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,20): unexpected-start-tag-out-of-my-head"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style"
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><style></style></head><body></body></html>",
-        "noQuirksBodyHtml": "<style></style>"
-      }
-    },
-    {
-      "data": "<head></head><script></script>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,21): unexpected-start-tag-out-of-my-head"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script"
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script></script></head><body></body></html>",
-        "noQuirksBodyHtml": "<script></script>"
-      }
-    },
-    {
-      "data": "<head></head><!-- --><style></style><!-- --><script></script>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "script": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style"
-                  },
-                  {
-                    "tag": "script"
-                  }
-                ]
-              },
-              {
-                "comment": " "
-              },
-              {
-                "comment": " "
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><style></style><script></script></head><!-- --><!-- --><body></body></html>",
-        "noQuirksBodyHtml": "<!-- --><style></style><!-- --><script></script>"
-      }
-    },
-    {
-      "data": "<head></head><!-- -->x<style></style><!-- --><script></script>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "style": true,
-            "script": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "comment": " "
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "x"
-                  },
-                  {
-                    "tag": "style"
-                  },
-                  {
-                    "comment": " "
-                  },
-                  {
-                    "tag": "script"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><!-- --><body>x<style></style><!-- --><script></script></body></html>",
-        "noQuirksBodyHtml": "<!-- -->x<style></style><!-- --><script></script>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><html><head></head><body><pre>\n</pre></body></html>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "pre": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "pre"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><pre></pre></body></html>",
-        "noQuirksBodyHtml": "<pre></pre>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><html><head></head><body><pre>\nfoo</pre></body></html>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "pre": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "pre",
-                    "children": [
-                      {
-                        "text": "foo"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><pre>foo</pre></body></html>",
-        "noQuirksBodyHtml": "<pre>foo</pre>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><html><head></head><body><pre>\n\nfoo</pre></body></html>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "pre": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "pre",
-                    "children": [
-                      {
-                        "text": "\nfoo"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><pre>\nfoo</pre></body></html>",
-        "noQuirksBodyHtml": "<pre>\nfoo</pre>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><html><head></head><body><pre>\nfoo\n</pre></body></html>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "pre": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "pre",
-                    "children": [
-                      {
-                        "text": "foo\n"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><pre>foo\n</pre></body></html>",
-        "noQuirksBodyHtml": "<pre>foo\n</pre>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><html><head></head><body><pre>x</pre><span>\n</span></body></html>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "pre": true,
-            "span": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "pre",
-                    "children": [
-                      {
-                        "text": "x"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "span",
-                    "children": [
-                      {
-                        "text": "\n"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><pre>x</pre><span>\n</span></body></html>",
-        "noQuirksBodyHtml": "<pre>x</pre><span>\n</span>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><html><head></head><body><pre>x\ny</pre></body></html>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "pre": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "pre",
-                    "children": [
-                      {
-                        "text": "x\ny"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><pre>x\ny</pre></body></html>",
-        "noQuirksBodyHtml": "<pre>x\ny</pre>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><html><head></head><body><pre>x<div>\ny</pre></body></html>",
-      "errors": [
-        "(2,7): end-tag-too-early"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "pre": true,
-            "div": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "pre",
-                    "children": [
-                      {
-                        "text": "x"
-                      },
-                      {
-                        "tag": "div",
-                        "children": [
-                          {
-                            "text": "\ny"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><pre>x<div>\ny</div></pre></body></html>",
-        "noQuirksBodyHtml": "<pre>x<div>\ny</div></pre>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><pre>&#x0a;&#x0a;A</pre>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "pre": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "pre",
-                    "children": [
-                      {
-                        "text": "\nA"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><pre>\nA</pre></body></html>",
-        "noQuirksBodyHtml": "<pre>\nA</pre>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><HTML><META><HEAD></HEAD></HTML>",
-      "errors": [
-        "(1,33): two-heads-are-not-better-than-one"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "meta": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "meta"
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><meta></head><body></body></html>",
-        "noQuirksBodyHtml": "<meta>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><HTML><HEAD><head></HEAD></HTML>",
-      "errors": [
-        "(1,33): two-heads-are-not-better-than-one"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<textarea>foo<span>bar</span><i>baz",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag",
-        "(1,35): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "textarea": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "textarea",
-                    "children": [
-                      {
-                        "text": "foo<span>bar</span><i>baz",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><textarea>foo&lt;span&gt;bar&lt;/span&gt;&lt;i&gt;baz</textarea></body></html>",
-        "noQuirksBodyHtml": "<textarea>foo&lt;span&gt;bar&lt;/span&gt;&lt;i&gt;baz</textarea>"
-      }
-    },
-    {
-      "data": "<title>foo<span>bar</em><i>baz",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,30): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "title": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "foo<span>bar</em><i>baz",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><title>foo&lt;span&gt;bar&lt;/em&gt;&lt;i&gt;baz</title></head><body></body></html>",
-        "noQuirksBodyHtml": "<title>foo&lt;span&gt;bar&lt;/em&gt;&lt;i&gt;baz</title>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><textarea>\n</textarea>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "textarea": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "textarea"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><textarea></textarea></body></html>",
-        "noQuirksBodyHtml": "<textarea></textarea>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><textarea>\nfoo</textarea>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "textarea": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "textarea",
-                    "children": [
-                      {
-                        "text": "foo"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><textarea>foo</textarea></body></html>",
-        "noQuirksBodyHtml": "<textarea>foo</textarea>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><textarea>\n\nfoo</textarea>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "textarea": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "textarea",
-                    "children": [
-                      {
-                        "text": "\nfoo"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><textarea>\nfoo</textarea></body></html>",
-        "noQuirksBodyHtml": "<textarea>\nfoo</textarea>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><html><head></head><body><ul><li><div><p><li></ul></body></html>",
-      "errors": [
-        "(1,60): end-tag-too-early"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ul": true,
-            "li": true,
-            "div": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ul",
-                    "children": [
-                      {
-                        "tag": "li",
-                        "children": [
-                          {
-                            "tag": "div",
-                            "children": [
-                              {
-                                "tag": "p"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "li"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><ul><li><div><p></p></div></li><li></li></ul></body></html>",
-        "noQuirksBodyHtml": "<ul><li><div><p></p></div></li><li></li></ul>"
-      }
-    },
-    {
-      "data": "<!doctype html><nobr><nobr><nobr>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "nobr": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "nobr"
-                  },
-                  {
-                    "tag": "nobr"
-                  },
-                  {
-                    "tag": "nobr"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><nobr></nobr><nobr></nobr><nobr></nobr></body></html>",
-        "noQuirksBodyHtml": "<nobr></nobr><nobr></nobr><nobr></nobr>"
-      }
-    },
-    {
-      "data": "<!doctype html><nobr><nobr></nobr><nobr>",
-      "errors": [
-        "(1,27): unexpected-start-tag-implies-end-tag",
-        "(1,40): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "nobr": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "nobr"
-                  },
-                  {
-                    "tag": "nobr"
-                  },
-                  {
-                    "tag": "nobr"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><nobr></nobr><nobr></nobr><nobr></nobr></body></html>",
-        "noQuirksBodyHtml": "<nobr></nobr><nobr></nobr><nobr></nobr>"
-      }
-    },
-    {
-      "data": "<!doctype html><html><body><p><table></table></body></html>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p"
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p></p><table></table></body></html>",
-        "noQuirksBodyHtml": "<p></p><table></table>"
-      }
-    },
-    {
-      "data": "<p><table></table>",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "table": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "table"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><p><table></table></p></body></html>",
-        "noQuirksBodyHtml": "<p></p><table></table>"
-      }
-    }
-  ],
-  "tests4.dat": [
-    {
-      "data": "direct div content",
-      "errors": [],
-      "fragment": {
-        "name": "div"
-      },
-      "document": {
-        "props": {
-          "tags": {}
-        },
-        "tree": [
-          {
-            "text": "direct div content"
-          }
-        ],
-        "html": "direct div content",
-        "noQuirksBodyHtml": "direct div content"
-      }
-    },
-    {
-      "data": "direct textarea content",
-      "errors": [],
-      "fragment": {
-        "name": "textarea"
-      },
-      "document": {
-        "props": {
-          "tags": {}
-        },
-        "tree": [
-          {
-            "text": "direct textarea content"
-          }
-        ],
-        "html": "direct textarea content",
-        "noQuirksBodyHtml": "direct textarea content"
-      }
-    },
-    {
-      "data": "textarea content with <em>pseudo</em> <foo>markup",
-      "errors": [],
-      "fragment": {
-        "name": "textarea"
-      },
-      "document": {
-        "props": {
-          "tags": {},
-          "escaped": true
-        },
-        "tree": [
-          {
-            "text": "textarea content with <em>pseudo</em> <foo>markup",
-            "escaped": true
-          }
-        ],
-        "html": "textarea content with &lt;em&gt;pseudo&lt;/em&gt; &lt;foo&gt;markup",
-        "noQuirksBodyHtml": "textarea content with <em>pseudo</em> <foo>markup</foo>"
-      }
-    },
-    {
-      "data": "this is &#x0043;DATA inside a <style> element",
-      "errors": [],
-      "fragment": {
-        "name": "style"
-      },
-      "document": {
-        "props": {
-          "tags": {},
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "text": "this is &#x0043;DATA inside a <style> element",
-            "no_escape": true
-          }
-        ],
-        "html": "this is &#x0043;DATA inside a <style> element",
-        "noQuirksBodyHtml": "this is CDATA inside a <style> element</style>"
-      }
-    },
-    {
-      "data": "</plaintext>",
-      "errors": [],
-      "fragment": {
-        "name": "plaintext"
-      },
-      "document": {
-        "props": {
-          "tags": {},
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "text": "</plaintext>",
-            "no_escape": true
-          }
-        ],
-        "html": "</plaintext>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "setting html's innerHTML",
-      "errors": [],
-      "fragment": {
-        "name": "html"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "head"
-          },
-          {
-            "tag": "body",
-            "children": [
-              {
-                "text": "setting html's innerHTML"
-              }
-            ]
-          }
-        ],
-        "html": "<head></head><body>setting html's innerHTML</body>",
-        "noQuirksBodyHtml": "setting html's innerHTML"
-      }
-    },
-    {
-      "data": "<title>setting head's innerHTML</title>",
-      "errors": [],
-      "fragment": {
-        "name": "head"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "title": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "title",
-            "children": [
-              {
-                "text": "setting head's innerHTML"
-              }
-            ]
-          }
-        ],
-        "html": "<title>setting head's innerHTML</title>",
-        "noQuirksBodyHtml": "<title>setting head's innerHTML</title>"
-      }
-    }
-  ],
-  "tests5.dat": [
-    {
-      "data": "<style> <!-- </style>x",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": " <!-- ",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "x"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><style> <!-- </style></head><body>x</body></html>",
-        "noQuirksBodyHtml": "<style> <!-- </style>x"
-      }
-    },
-    {
-      "data": "<style> <!-- </style> --> </style>x",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,34): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": " <!-- ",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": " "
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "--> x",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><style> <!-- </style> </head><body>--&gt; x</body></html>",
-        "noQuirksBodyHtml": "<style> <!-- </style> --&gt; x"
-      }
-    },
-    {
-      "data": "<style> <!--> </style>x",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": " <!--> ",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "x"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><style> <!--> </style></head><body>x</body></html>",
-        "noQuirksBodyHtml": "<style> <!--> </style>x"
-      }
-    },
-    {
-      "data": "<style> <!---> </style>x",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": " <!---> ",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "x"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><style> <!---> </style></head><body>x</body></html>",
-        "noQuirksBodyHtml": "<style> <!---> </style>x"
-      }
-    },
-    {
-      "data": "<iframe> <!---> </iframe>x",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "iframe": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "iframe",
-                    "children": [
-                      {
-                        "text": " <!---> ",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "x"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><iframe> <!---> </iframe>x</body></html>",
-        "noQuirksBodyHtml": "<iframe> <!---> </iframe>x"
-      }
-    },
-    {
-      "data": "<iframe> <!--- </iframe>->x</iframe> --> </iframe>x",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,36): unexpected-end-tag",
-        "(1,50): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "iframe": true
-          },
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "iframe",
-                    "children": [
-                      {
-                        "text": " <!--- ",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "->x --> x",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><iframe> <!--- </iframe>-&gt;x --&gt; x</body></html>",
-        "noQuirksBodyHtml": "<iframe> <!--- </iframe>-&gt;x --&gt; x"
-      }
-    },
-    {
-      "data": "<script> <!-- </script> --> </script>x",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,37): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "script": true,
-            "body": true
-          },
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": " <!-- ",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": " "
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "--> x",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><script> <!-- </script> </head><body>--&gt; x</body></html>",
-        "noQuirksBodyHtml": "<script> <!-- </script> --&gt; x"
-      }
-    },
-    {
-      "data": "<title> <!-- </title> --> </title>x",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,34): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "title": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": " <!-- ",
-                        "escaped": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": " "
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "--> x",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><title> &lt;!-- </title> </head><body>--&gt; x</body></html>",
-        "noQuirksBodyHtml": "<title> &lt;!-- </title> --&gt; x"
-      }
-    },
-    {
-      "data": "<textarea> <!--- </textarea>->x</textarea> --> </textarea>x",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag",
-        "(1,42): unexpected-end-tag",
-        "(1,58): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "textarea": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "textarea",
-                    "children": [
-                      {
-                        "text": " <!--- ",
-                        "escaped": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "->x --> x",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><textarea> &lt;!--- </textarea>-&gt;x --&gt; x</body></html>",
-        "noQuirksBodyHtml": "<textarea> &lt;!--- </textarea>-&gt;x --&gt; x"
-      }
-    },
-    {
-      "data": "<style> <!</-- </style>x",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style",
-                    "children": [
-                      {
-                        "text": " <!</-- ",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "x"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><style> <!</-- </style></head><body>x</body></html>",
-        "noQuirksBodyHtml": "<style> <!</-- </style>x"
-      }
-    },
-    {
-      "data": "<p><xmp></xmp>",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "xmp": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p"
-                  },
-                  {
-                    "tag": "xmp"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><p></p><xmp></xmp></body></html>",
-        "noQuirksBodyHtml": "<p></p><xmp></xmp>"
-      }
-    },
-    {
-      "data": "<xmp> <!-- > --> </xmp>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "xmp": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "xmp",
-                    "children": [
-                      {
-                        "text": " <!-- > --> ",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><xmp> <!-- > --> </xmp></body></html>",
-        "noQuirksBodyHtml": "<xmp> <!-- > --> </xmp>"
-      }
-    },
-    {
-      "data": "<title>&amp;</title>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "title": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "&",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><title>&amp;</title></head><body></body></html>",
-        "noQuirksBodyHtml": "<title>&amp;</title>"
-      }
-    },
-    {
-      "data": "<title><!--&amp;--></title>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "title": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "<!--&-->",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><title>&lt;!--&amp;--&gt;</title></head><body></body></html>",
-        "noQuirksBodyHtml": "<title>&lt;!--&amp;--&gt;</title>"
-      }
-    },
-    {
-      "data": "<title><!--</title>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "title": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "<!--",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><title>&lt;!--</title></head><body></body></html>",
-        "noQuirksBodyHtml": "<title>&lt;!--</title>"
-      }
-    },
-    {
-      "data": "<noscript><!--</noscript>--></noscript>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag",
-        "(1,39): unexpected-end-tag"
-      ],
-      "script": "on",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true
-          },
-          "no_escape": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "text": "<!--",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "-->",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript><!--</noscript></head><body>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<noscript><!--</noscript>--></noscript>"
-      }
-    },
-    {
-      "data": "<noscript><!--</noscript>--></noscript>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag"
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "noscript": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "noscript",
-                    "children": [
-                      {
-                        "comment": "</noscript>"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><noscript><!--</noscript>--></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript><!--</noscript>--></noscript>"
-      }
-    }
-  ],
-  "tests6.dat": [
-    {
-      "data": "<!doctype html></head> <head>",
-      "errors": [
-        "(1,29): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "text": " "
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head> <body></body></html>",
-        "noQuirksBodyHtml": " "
-      }
-    },
-    {
-      "data": "<!doctype html><form><div></form><div>",
-      "errors": [
-        "(1,33): end-tag-too-early-ignored",
-        "(1,38): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "form": true,
-            "div": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "form",
-                    "children": [
-                      {
-                        "tag": "div",
-                        "children": [
-                          {
-                            "tag": "div"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><form><div><div></div></div></form></body></html>",
-        "noQuirksBodyHtml": "<form><div><div></div></div></form>"
-      }
-    },
-    {
-      "data": "<!doctype html><title>&amp;</title>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "title": true,
-            "body": true
-          },
-          "doctype": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "&",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><title>&amp;</title></head><body></body></html>",
-        "noQuirksBodyHtml": "<title>&amp;</title>"
-      }
-    },
-    {
-      "data": "<!doctype html><title><!--&amp;--></title>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "title": true,
-            "body": true
-          },
-          "doctype": true,
-          "escaped": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "<!--&-->",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><title>&lt;!--&amp;--&gt;</title></head><body></body></html>",
-        "noQuirksBodyHtml": "<title>&lt;!--&amp;--&gt;</title>"
-      }
-    },
-    {
-      "data": "<!doctype>",
-      "errors": [
-        "(1,9): need-space-after-doctype",
-        "(1,10): expected-doctype-name-but-got-right-bracket",
-        "(1,10): unknown-doctype"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": ""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE ><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<!---x",
-      "errors": [
-        "(1,6): eof-in-comment",
-        "(1,6): expected-doctype-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "comment": "-x"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!---x--><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!---x-->"
-      }
-    },
-    {
-      "data": "<body>\n<div>",
-      "errors": [
-        "(1,6): unexpected-start-tag",
-        "(2,5): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "div"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "text": "\n"
-          },
-          {
-            "tag": "div"
-          }
-        ],
-        "html": "\n<div></div>",
-        "noQuirksBodyHtml": "\n<div></div>"
-      }
-    },
-    {
-      "data": "<frameset></frameset>\nfoo",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              },
-              {
-                "text": "\n"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset>\n</html>",
-        "noQuirksBodyHtml": "\nfoo"
-      }
-    },
-    {
-      "data": "<frameset></frameset>\n<noframes>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag",
-        "(2,10): expected-named-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true,
-            "noframes": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              },
-              {
-                "text": "\n"
-              },
-              {
-                "tag": "noframes"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset>\n<noframes></noframes></html>",
-        "noQuirksBodyHtml": "\n<noframes></noframes>"
-      }
-    },
-    {
-      "data": "<frameset></frameset>\n<div>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag",
-        "(2,5): unexpected-start-tag-after-frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              },
-              {
-                "text": "\n"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset>\n</html>",
-        "noQuirksBodyHtml": "\n<div></div>"
-      }
-    },
-    {
-      "data": "<frameset></frameset>\n</html>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              },
-              {
-                "text": "\n"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset>\n</html>",
-        "noQuirksBodyHtml": "\n"
-      }
-    },
-    {
-      "data": "<frameset></frameset>\n</div>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag",
-        "(2,6): unexpected-end-tag-after-frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              },
-              {
-                "text": "\n"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset>\n</html>",
-        "noQuirksBodyHtml": "\n"
-      }
-    },
-    {
-      "data": "<form><form>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,12): unexpected-start-tag",
-        "(1,12): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "form": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "form"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><form></form></body></html>",
-        "noQuirksBodyHtml": "<form></form>"
-      }
-    },
-    {
-      "data": "<button><button>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "button": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "button"
-                  },
-                  {
-                    "tag": "button"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><button></button><button></button></body></html>",
-        "noQuirksBodyHtml": "<button></button><button></button>"
-      }
-    },
-    {
-      "data": "<table><tr><td></th>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,20): unexpected-end-tag",
-        "(1,20): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><tr><td></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td></td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<table><caption><td>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,20): unexpected-cell-in-table-body",
-        "(1,20): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "caption": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "caption"
-                      },
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><caption></caption><tbody><tr><td></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><caption></caption><tbody><tr><td></td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<table><caption><div>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,21): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "caption": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "caption",
-                        "children": [
-                          {
-                            "tag": "div"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><caption><div></div></caption></table></body></html>",
-        "noQuirksBodyHtml": "<table><caption><div></div></caption></table>"
-      }
-    },
-    {
-      "data": "</caption><div>",
-      "errors": [
-        "(1,10): XXX-undefined-error",
-        "(1,15): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "caption"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "div"
-          }
-        ],
-        "html": "<div></div>",
-        "noQuirksBodyHtml": "<div></div>"
-      }
-    },
-    {
-      "data": "<table><caption><div></caption>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,31): expected-one-end-tag-but-got-another",
-        "(1,31): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "caption": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "caption",
-                        "children": [
-                          {
-                            "tag": "div"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><caption><div></div></caption></table></body></html>",
-        "noQuirksBodyHtml": "<table><caption><div></div></caption></table>"
-      }
-    },
-    {
-      "data": "<table><caption></table>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "caption": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "caption"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><caption></caption></table></body></html>",
-        "noQuirksBodyHtml": "<table><caption></caption></table>"
-      }
-    },
-    {
-      "data": "</table><div>",
-      "errors": [
-        "(1,8): unexpected-end-tag",
-        "(1,13): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "caption"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "div"
-          }
-        ],
-        "html": "<div></div>",
-        "noQuirksBodyHtml": "<div></div>"
-      }
-    },
-    {
-      "data": "<table><caption></body></col></colgroup></html></tbody></td></tfoot></th></thead></tr>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "caption": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "caption"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><caption></caption></table></body></html>",
-        "noQuirksBodyHtml": "<table><caption></caption></table>"
-      }
-    },
-    {
-      "data": "<table><caption><div></div>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,27): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "caption": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "caption",
-                        "children": [
-                          {
-                            "tag": "div"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><caption><div></div></caption></table></body></html>",
-        "noQuirksBodyHtml": "<table><caption><div></div></caption></table>"
-      }
-    },
-    {
-      "data": "<table><tr><td></body></caption></col></colgroup></html>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><tr><td></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td></td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "</table></tbody></tfoot></thead></tr><div>",
-      "errors": [
-        "(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"
-      ],
-      "fragment": {
-        "name": "td"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "div"
-          }
-        ],
-        "html": "<div></div>",
-        "noQuirksBodyHtml": "<div></div>"
-      }
-    },
-    {
-      "data": "<table><colgroup>foo",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "colgroup": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "foo"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "colgroup"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>foo<table><colgroup></colgroup></table></body></html>",
-        "noQuirksBodyHtml": "foo<table><colgroup></colgroup></table>"
-      }
-    },
-    {
-      "data": "foo<col>",
-      "errors": [
-        "(1,1): unexpected-character-in-colgroup",
-        "(1,2): unexpected-character-in-colgroup",
-        "(1,3): unexpected-character-in-colgroup"
-      ],
-      "fragment": {
-        "name": "colgroup"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "col": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "col"
-          }
-        ],
-        "html": "<col>",
-        "noQuirksBodyHtml": "foo"
-      }
-    },
-    {
-      "data": "<table><colgroup></col>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,23): no-end-tag",
-        "(1,23): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "colgroup": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "colgroup"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><colgroup></colgroup></table></body></html>",
-        "noQuirksBodyHtml": "<table><colgroup></colgroup></table>"
-      }
-    },
-    {
-      "data": "<frameset><div>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag",
-        "(1,15): unexpected-start-tag-in-frameset",
-        "(1,15): eof-in-frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "<div></div>"
-      }
-    },
-    {
-      "data": "</frameset><frame>",
-      "errors": [
-        "(1,11): unexpected-frameset-in-frameset-innerhtml"
-      ],
-      "fragment": {
-        "name": "frameset"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "frame": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "frame"
-          }
-        ],
-        "html": "<frame>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<frameset></div>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag",
-        "(1,16): unexpected-end-tag-in-frameset",
-        "(1,16): eof-in-frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "</body><div>",
-      "errors": [
-        "(1,7): unexpected-close-tag",
-        "(1,12): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "body"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "div"
-          }
-        ],
-        "html": "<div></div>",
-        "noQuirksBodyHtml": "<div></div>"
-      }
-    },
-    {
-      "data": "<table><tr><div>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,16): unexpected-start-tag-implies-table-voodoo",
-        "(1,16): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "table": true,
-            "tbody": true,
-            "tr": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div></div><table><tbody><tr></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<div></div><table><tbody><tr></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "</tr><td>",
-      "errors": [
-        "(1,5): unexpected-end-tag"
-      ],
-      "fragment": {
-        "name": "tr"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "td"
-          }
-        ],
-        "html": "<td></td>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "</tbody></tfoot></thead><td>",
-      "errors": [
-        "(1,8): unexpected-end-tag",
-        "(1,16): unexpected-end-tag",
-        "(1,24): unexpected-end-tag"
-      ],
-      "fragment": {
-        "name": "tr"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "td"
-          }
-        ],
-        "html": "<td></td>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<table><tr><div><td>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,16): foster-parenting-start-tag",
-        "(1,20): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div></div><table><tbody><tr><td></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<div></div><table><tbody><tr><td></td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<caption><col><colgroup><tbody><tfoot><thead><tr>",
-      "errors": [
-        "(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"
-      ],
-      "fragment": {
-        "name": "tbody"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "tr": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "tr"
-          }
-        ],
-        "html": "<tr></tr>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<table><tbody></thead>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,22): unexpected-end-tag-in-table-body",
-        "(1,22): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody></tbody></table>"
-      }
-    },
-    {
-      "data": "</table><tr>",
-      "errors": [
-        "(1,8): unexpected-end-tag"
-      ],
-      "fragment": {
-        "name": "tbody"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "tr": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "tr"
-          }
-        ],
-        "html": "<tr></tr>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<table><tbody></body></caption></col></colgroup></html></td></th></tr>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody></tbody></table>"
-      }
-    },
-    {
-      "data": "<table><tbody></div>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody></tbody></table>"
-      }
-    },
-    {
-      "data": "<table><table>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,14): unexpected-start-tag-implies-end-tag",
-        "(1,14): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table"
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table></table><table></table></body></html>",
-        "noQuirksBodyHtml": "<table></table><table></table>"
-      }
-    },
-    {
-      "data": "<table></body></caption></col></colgroup></html></tbody></td></tfoot></th></thead></tr>",
-      "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,87): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table></table></body></html>",
-        "noQuirksBodyHtml": "<table></table>"
-      }
-    },
-    {
-      "data": "</table><tr>",
-      "errors": [
-        "(1,8): unexpected-end-tag"
-      ],
-      "fragment": {
-        "name": "table"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "tbody": true,
-            "tr": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "tbody",
-            "children": [
-              {
-                "tag": "tr"
-              }
-            ]
-          }
-        ],
-        "html": "<tbody><tr></tr></tbody>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<body></body></html>",
-      "errors": [
-        "(1,20): unexpected-end-tag-after-body-innerhtml"
-      ],
-      "fragment": {
-        "name": "html"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "head"
-          },
-          {
-            "tag": "body"
-          }
-        ],
-        "html": "<head></head><body></body>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<html><frameset></frameset></html> ",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              },
-              {
-                "text": " "
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset> </html>",
-        "noQuirksBodyHtml": " "
-      }
-    },
-    {
-      "data": "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\"><html></html>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html \"-//W3C//DTD HTML 4.01//EN\" \"\""
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<param><frameset></frameset>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,17): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "<param>"
-      }
-    },
-    {
-      "data": "<source><frameset></frameset>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,18): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "<source>"
-      }
-    },
-    {
-      "data": "<track><frameset></frameset>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,17): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "<track>"
-      }
-    },
-    {
-      "data": "</html><frameset></frameset>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-end-tag",
-        "(1,17): expected-eof-but-got-start-tag",
-        "(1,17): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "</body><frameset></frameset>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-end-tag",
-        "(1,17): unexpected-start-tag-after-body",
-        "(1,17): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": ""
-      }
-    }
-  ],
-  "tests7.dat": [
-    {
-      "data": "<!doctype html><body><title>X</title>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "title": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "X"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><title>X</title></body></html>",
-        "noQuirksBodyHtml": "<title>X</title>"
-      }
-    },
-    {
-      "data": "<!doctype html><table><title>X</title></table>",
-      "errors": [
-        "(1,29): unexpected-start-tag-implies-table-voodoo"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "title": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "X"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><title>X</title><table></table></body></html>",
-        "noQuirksBodyHtml": "<title>X</title><table></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><head></head><title>X</title>",
-      "errors": [
-        "(1,35): unexpected-start-tag-out-of-my-head"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "title": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "X"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><title>X</title></head><body></body></html>",
-        "noQuirksBodyHtml": "<title>X</title>"
-      }
-    },
-    {
-      "data": "<!doctype html></head><title>X</title>",
-      "errors": [
-        "(1,29): unexpected-start-tag-out-of-my-head"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "title": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "title",
-                    "children": [
-                      {
-                        "text": "X"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head><title>X</title></head><body></body></html>",
-        "noQuirksBodyHtml": "<title>X</title>"
-      }
-    },
-    {
-      "data": "<!doctype html><table><meta></table>",
-      "errors": [
-        "(1,28): unexpected-start-tag-implies-table-voodoo"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "meta": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "meta"
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><meta><table></table></body></html>",
-        "noQuirksBodyHtml": "<meta><table></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><table>X<tr><td><table> <meta></table></table>",
-      "errors": [
-        "unexpected text in table",
-        "(1,45): unexpected-start-tag-implies-table-voodoo"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "meta": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "X"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "meta"
-                                  },
-                                  {
-                                    "tag": "table",
-                                    "children": [
-                                      {
-                                        "text": " "
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>X<table><tbody><tr><td><meta><table> </table></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "X<table><tbody><tr><td><meta><table> </table></td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><html> <head>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": " "
-      }
-    },
-    {
-      "data": "<!doctype html> <head>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": " "
-      }
-    },
-    {
-      "data": "<!doctype html><table><style> <tr>x </style> </table>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "style": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "style",
-                        "children": [
-                          {
-                            "text": " <tr>x ",
-                            "no_escape": true
-                          }
-                        ]
-                      },
-                      {
-                        "text": " "
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><style> <tr>x </style> </table></body></html>",
-        "noQuirksBodyHtml": "<table><style> <tr>x </style> </table>"
-      }
-    },
-    {
-      "data": "<!doctype html><table><TBODY><script> <tr>x </script> </table>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "script": true
-          },
-          "doctype": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "script",
-                            "children": [
-                              {
-                                "text": " <tr>x ",
-                                "no_escape": true
-                              }
-                            ]
-                          },
-                          {
-                            "text": " "
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><script> <tr>x </script> </tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><script> <tr>x </script> </tbody></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><applet><p>X</p></applet>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "applet": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "applet",
-                        "children": [
-                          {
-                            "tag": "p",
-                            "children": [
-                              {
-                                "text": "X"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><applet><p>X</p></applet></p></body></html>",
-        "noQuirksBodyHtml": "<p><applet><p>X</p></applet></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><p><object type=\"application/x-non-existant-plugin\"><p>X</p></object>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "object": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "object",
-                        "attrs": [
-                          {
-                            "name": "type",
-                            "value": "application/x-non-existant-plugin"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "tag": "p",
-                            "children": [
-                              {
-                                "text": "X"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><p><object type=\"application/x-non-existant-plugin\"><p>X</p></object></p></body></html>",
-        "noQuirksBodyHtml": "<p><object type=\"application/x-non-existant-plugin\"><p>X</p></object></p>"
-      }
-    },
-    {
-      "data": "<!doctype html><listing>\nX</listing>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "listing": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "listing",
-                    "children": [
-                      {
-                        "text": "X"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><listing>X</listing></body></html>",
-        "noQuirksBodyHtml": "<listing>X</listing>"
-      }
-    },
-    {
-      "data": "<!doctype html><select><input>X",
-      "errors": [
-        "(1,30): unexpected-input-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "input": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select"
-                  },
-                  {
-                    "tag": "input"
-                  },
-                  {
-                    "text": "X"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select></select><input>X</body></html>",
-        "noQuirksBodyHtml": "<select></select><input>X"
-      }
-    },
-    {
-      "data": "<!doctype html><select><select>X",
-      "errors": [
-        "(1,31): unexpected-select-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select"
-                  },
-                  {
-                    "text": "X"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select></select>X</body></html>",
-        "noQuirksBodyHtml": "<select></select>X"
-      }
-    },
-    {
-      "data": "<!doctype html><table><input type=hidDEN></table>",
-      "errors": [
-        "(1,41): unexpected-hidden-input-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "input": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "input",
-                        "attrs": [
-                          {
-                            "name": "type",
-                            "value": "hidDEN"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><input type=\"hidDEN\"></table></body></html>",
-        "noQuirksBodyHtml": "<table><input type=\"hidDEN\"></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><table>X<input type=hidDEN></table>",
-      "errors": [
-        "(1,23): foster-parenting-character",
-        "(1,42): unexpected-hidden-input-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "input": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "X"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "input",
-                        "attrs": [
-                          {
-                            "name": "type",
-                            "value": "hidDEN"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body>X<table><input type=\"hidDEN\"></table></body></html>",
-        "noQuirksBodyHtml": "X<table><input type=\"hidDEN\"></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><table>  <input type=hidDEN></table>",
-      "errors": [
-        "(1,43): unexpected-hidden-input-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "input": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "text": "  "
-                      },
-                      {
-                        "tag": "input",
-                        "attrs": [
-                          {
-                            "name": "type",
-                            "value": "hidDEN"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table>  <input type=\"hidDEN\"></table></body></html>",
-        "noQuirksBodyHtml": "<table>  <input type=\"hidDEN\"></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><table>  <input type='hidDEN'></table>",
-      "errors": [
-        "(1,45): unexpected-hidden-input-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "input": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "text": "  "
-                      },
-                      {
-                        "tag": "input",
-                        "attrs": [
-                          {
-                            "name": "type",
-                            "value": "hidDEN"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table>  <input type=\"hidDEN\"></table></body></html>",
-        "noQuirksBodyHtml": "<table>  <input type=\"hidDEN\"></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><table><input type=\" hidden\"><input type=hidDEN></table>",
-      "errors": [
-        "(1,44): unexpected-start-tag-implies-table-voodoo",
-        "(1,63): unexpected-hidden-input-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "input": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "input",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": " hidden"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "input",
-                        "attrs": [
-                          {
-                            "name": "type",
-                            "value": "hidDEN"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><input type=\" hidden\"><table><input type=\"hidDEN\"></table></body></html>",
-        "noQuirksBodyHtml": "<input type=\" hidden\"><table><input type=\"hidDEN\"></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><table><select>X<tr>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "table": true,
-            "tbody": true,
-            "tr": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "text": "X"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select>X</select><table><tbody><tr></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<select>X</select><table><tbody><tr></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!doctype html><select>X</select>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "text": "X"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select>X</select></body></html>",
-        "noQuirksBodyHtml": "<select>X</select>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE hTmL><html></html>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<!DOCTYPE HTML><html></html>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<body>X</body></body>",
-      "errors": [
-        "(1,21): unexpected-end-tag-after-body"
-      ],
-      "fragment": {
-        "name": "html"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "head"
-          },
-          {
-            "tag": "body",
-            "children": [
-              {
-                "text": "X"
-              }
-            ]
-          }
-        ],
-        "html": "<head></head><body>X</body>",
-        "noQuirksBodyHtml": "X"
-      }
-    },
-    {
-      "data": "<div><p>a</x> b",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,13): unexpected-end-tag",
-        "(1,15): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "p",
-                        "children": [
-                          {
-                            "text": "a b"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div><p>a b</p></div></body></html>",
-        "noQuirksBodyHtml": "<div><p>a b</p></div>"
-      }
-    },
-    {
-      "data": "<table><tr><td><code></code> </table>",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "code": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "code"
-                                  },
-                                  {
-                                    "text": " "
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><tr><td><code></code> </td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><code></code> </td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<table><b><tr><td>aaa</td></tr>bbb</table>ccc",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b"
-                  },
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "text": "bbb"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "text": "aaa"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "text": "ccc"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b></b><b>bbb</b><table><tbody><tr><td>aaa</td></tr></tbody></table><b>ccc</b></body></html>",
-        "noQuirksBodyHtml": "<b></b><b>bbb</b><table><tbody><tr><td>aaa</td></tr></tbody></table><b>ccc</b>"
-      }
-    },
-    {
-      "data": "A<table><tr> B</tr> B</table>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "A B B"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>A B B<table><tbody><tr></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "A B B<table><tbody><tr></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "A<table><tr> B</tr> </em>C</table>",
-      "errors": [
-        "(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,25): unexpected-end-tag-in-special-element",
-        "(1,26): foster-parenting-character"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "A BC"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          },
-                          {
-                            "text": " "
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>A BC<table><tbody><tr></tr> </tbody></table></body></html>",
-        "noQuirksBodyHtml": "A BC<table><tbody><tr></tr> </tbody></table>"
-      }
-    },
-    {
-      "data": "<select><keygen>",
-      "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,16): unexpected-input-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "keygen": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select"
-                  },
-                  {
-                    "tag": "keygen"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><select></select><keygen></body></html>",
-        "noQuirksBodyHtml": "<select></select><keygen>"
-      }
-    }
-  ],
-  "tests8.dat": [
-    {
-      "data": "<div>\n<div></div>\n</span>x",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(3,7): unexpected-end-tag",
-        "(3,8): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": "\n"
-                      },
-                      {
-                        "tag": "div"
-                      },
-                      {
-                        "text": "\nx"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div>\n<div></div>\nx</div></body></html>",
-        "noQuirksBodyHtml": "<div>\n<div></div>\nx</div>"
-      }
-    },
-    {
-      "data": "<div>x<div></div>\n</span>x",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(2,7): unexpected-end-tag",
-        "(2,8): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": "x"
-                      },
-                      {
-                        "tag": "div"
-                      },
-                      {
-                        "text": "\nx"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div>x<div></div>\nx</div></body></html>",
-        "noQuirksBodyHtml": "<div>x<div></div>\nx</div>"
-      }
-    },
-    {
-      "data": "<div>x<div></div>x</span>x",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,25): unexpected-end-tag",
-        "(1,26): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": "x"
-                      },
-                      {
-                        "tag": "div"
-                      },
-                      {
-                        "text": "xx"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div>x<div></div>xx</div></body></html>",
-        "noQuirksBodyHtml": "<div>x<div></div>xx</div>"
-      }
-    },
-    {
-      "data": "<div>x<div></div>y</span>z",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,25): unexpected-end-tag",
-        "(1,26): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": "x"
-                      },
-                      {
-                        "tag": "div"
-                      },
-                      {
-                        "text": "yz"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div>x<div></div>yz</div></body></html>",
-        "noQuirksBodyHtml": "<div>x<div></div>yz</div>"
-      }
-    },
-    {
-      "data": "<table><div>x<div></div>x</span>x",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "table": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": "x"
-                      },
-                      {
-                        "tag": "div"
-                      },
-                      {
-                        "text": "xx"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div>x<div></div>xx</div><table></table></body></html>",
-        "noQuirksBodyHtml": "<div>x<div></div>xx</div><table></table>"
-      }
-    },
-    {
-      "data": "x<table>x",
-      "errors": [
-        "(1,1): expected-doctype-but-got-chars",
-        "(1,9): foster-parenting-character",
-        "(1,9): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "xx"
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>xx<table></table></body></html>",
-        "noQuirksBodyHtml": "xx<table></table>"
-      }
-    },
-    {
-      "data": "x<table><table>x",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "x"
-                  },
-                  {
-                    "tag": "table"
-                  },
-                  {
-                    "text": "x"
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>x<table></table>x<table></table></body></html>",
-        "noQuirksBodyHtml": "x<table></table>x<table></table>"
-      }
-    },
-    {
-      "data": "<b>a<div></div><div></b>y",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag",
-        "(1,24): adoption-agency-1.3",
-        "(1,25): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "text": "a"
-                      },
-                      {
-                        "tag": "div"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "b"
-                      },
-                      {
-                        "text": "y"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b>a<div></div></b><div><b></b>y</div></body></html>",
-        "noQuirksBodyHtml": "<b>a<div></div></b><div><b></b>y</div>"
-      }
-    },
-    {
-      "data": "<a><div><p></a>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "div": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a"
-                  },
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "a"
-                      },
-                      {
-                        "tag": "p",
-                        "children": [
-                          {
-                            "tag": "a"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a></a><div><a></a><p><a></a></p></div></body></html>",
-        "noQuirksBodyHtml": "<a></a><div><a></a><p><a></a></p></div>"
-      }
-    }
-  ],
-  "tests9.dat": [
-    {
-      "data": "<!DOCTYPE html><math></math>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math></math></body></html>",
-        "noQuirksBodyHtml": "<math></math>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><math></math>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math></math></body></html>",
-        "noQuirksBodyHtml": "<math></math>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><math><mi>",
-      "errors": [
-        "(1,25) expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mi": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math><mi></mi></math></body></html>",
-        "noQuirksBodyHtml": "<math><mi></mi></math>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><math><annotation-xml><svg><u>",
-      "errors": [
-        "(1,45) unexpected-html-element-in-foreign-content",
-        "(1,45) expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math annotation-xml": true,
-            "svg svg": true,
-            "u": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "annotation-xml",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "svg",
-                            "ns": "http://www.w3.org/2000/svg"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "u"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math><annotation-xml><svg></svg></annotation-xml></math><u></u></body></html>",
-        "noQuirksBodyHtml": "<math><annotation-xml><svg><u></u></svg></annotation-xml></math>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><select><math></math></select>",
-      "errors": [
-        "(1,35) unexpected-start-tag-in-select",
-        "(1,42) unexpected-end-tag-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select></select></body></html>",
-        "noQuirksBodyHtml": "<select></select>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><select><option><math></math></option></select>",
-      "errors": [
-        "(1,43) unexpected-start-tag-in-select",
-        "(1,50) unexpected-end-tag-in-select"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "option": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "option"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select><option></option></select></body></html>",
-        "noQuirksBodyHtml": "<select><option></option></select>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><math></math></table>",
-      "errors": [
-        "(1,34) unexpected-start-tag-implies-table-voodoo"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML"
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math></math><table></table></body></html>",
-        "noQuirksBodyHtml": "<math></math><table></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><math><mi>foo</mi></math></table>",
-      "errors": [
-        "(1,34) foster-parenting-start-token",
-        "(1,39) foster-parenting-character",
-        "(1,40) foster-parenting-character",
-        "(1,41) foster-parenting-character"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mi": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "text": "foo"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math><mi>foo</mi></math><table></table></body></html>",
-        "noQuirksBodyHtml": "<math><mi>foo</mi></math><table></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><math><mi>foo</mi><mi>bar</mi></math></table>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mi": true,
-            "table": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "text": "foo"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "text": "bar"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math><mi>foo</mi><mi>bar</mi></math><table></table></body></html>",
-        "noQuirksBodyHtml": "<math><mi>foo</mi><mi>bar</mi></math><table></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><tbody><math><mi>foo</mi><mi>bar</mi></math></tbody></table>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mi": true,
-            "table": true,
-            "tbody": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "text": "foo"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "text": "bar"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math><mi>foo</mi><mi>bar</mi></math><table><tbody></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<math><mi>foo</mi><mi>bar</mi></math><table><tbody></tbody></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><tbody><tr><math><mi>foo</mi><mi>bar</mi></math></tr></tbody></table>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mi": true,
-            "table": true,
-            "tbody": true,
-            "tr": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "text": "foo"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "text": "bar"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math><mi>foo</mi><mi>bar</mi></math><table><tbody><tr></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<math><mi>foo</mi><mi>bar</mi></math><table><tbody><tr></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><tbody><tr><td><math><mi>foo</mi><mi>bar</mi></math></td></tr></tbody></table>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "math math": true,
-            "math mi": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "math",
-                                    "ns": "http://www.w3.org/1998/Math/MathML",
-                                    "children": [
-                                      {
-                                        "tag": "mi",
-                                        "ns": "http://www.w3.org/1998/Math/MathML",
-                                        "children": [
-                                          {
-                                            "text": "foo"
-                                          }
-                                        ]
-                                      },
-                                      {
-                                        "tag": "mi",
-                                        "ns": "http://www.w3.org/1998/Math/MathML",
-                                        "children": [
-                                          {
-                                            "text": "bar"
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><math><mi>foo</mi><mi>bar</mi></math></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><math><mi>foo</mi><mi>bar</mi></math></td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><tbody><tr><td><math><mi>foo</mi><mi>bar</mi></math><p>baz</td></tr></tbody></table>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "math math": true,
-            "math mi": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "math",
-                                    "ns": "http://www.w3.org/1998/Math/MathML",
-                                    "children": [
-                                      {
-                                        "tag": "mi",
-                                        "ns": "http://www.w3.org/1998/Math/MathML",
-                                        "children": [
-                                          {
-                                            "text": "foo"
-                                          }
-                                        ]
-                                      },
-                                      {
-                                        "tag": "mi",
-                                        "ns": "http://www.w3.org/1998/Math/MathML",
-                                        "children": [
-                                          {
-                                            "text": "bar"
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  },
-                                  {
-                                    "tag": "p",
-                                    "children": [
-                                      {
-                                        "text": "baz"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><math><mi>foo</mi><mi>bar</mi></math><p>baz</p></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><math><mi>foo</mi><mi>bar</mi></math><p>baz</p></td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><caption><math><mi>foo</mi><mi>bar</mi></math><p>baz</caption></table>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "caption": true,
-            "math math": true,
-            "math mi": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "caption",
-                        "children": [
-                          {
-                            "tag": "math",
-                            "ns": "http://www.w3.org/1998/Math/MathML",
-                            "children": [
-                              {
-                                "tag": "mi",
-                                "ns": "http://www.w3.org/1998/Math/MathML",
-                                "children": [
-                                  {
-                                    "text": "foo"
-                                  }
-                                ]
-                              },
-                              {
-                                "tag": "mi",
-                                "ns": "http://www.w3.org/1998/Math/MathML",
-                                "children": [
-                                  {
-                                    "text": "bar"
-                                  }
-                                ]
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "p",
-                            "children": [
-                              {
-                                "text": "baz"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><caption><math><mi>foo</mi><mi>bar</mi></math><p>baz</p></caption></table></body></html>",
-        "noQuirksBodyHtml": "<table><caption><math><mi>foo</mi><mi>bar</mi></math><p>baz</p></caption></table>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><caption><math><mi>foo</mi><mi>bar</mi><p>baz</table><p>quux",
-      "errors": [
-        "(1,70) unexpected-html-element-in-foreign-content"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "caption": true,
-            "math math": true,
-            "math mi": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "caption",
-                        "children": [
-                          {
-                            "tag": "math",
-                            "ns": "http://www.w3.org/1998/Math/MathML",
-                            "children": [
-                              {
-                                "tag": "mi",
-                                "ns": "http://www.w3.org/1998/Math/MathML",
-                                "children": [
-                                  {
-                                    "text": "foo"
-                                  }
-                                ]
-                              },
-                              {
-                                "tag": "mi",
-                                "ns": "http://www.w3.org/1998/Math/MathML",
-                                "children": [
-                                  {
-                                    "text": "bar"
-                                  }
-                                ]
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "p",
-                            "children": [
-                              {
-                                "text": "baz"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "quux"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><caption><math><mi>foo</mi><mi>bar</mi></math><p>baz</p></caption></table><p>quux</p></body></html>",
-        "noQuirksBodyHtml": "<table><caption><math><mi>foo</mi><mi>bar</mi><p>baz</p></math></caption></table><p>quux</p>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><caption><math><mi>foo</mi><mi>bar</mi>baz</table><p>quux",
-      "errors": [
-        "(1,78) unexpected-end-tag",
-        "(1,78) expected-one-end-tag-but-got-another"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "caption": true,
-            "math math": true,
-            "math mi": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "caption",
-                        "children": [
-                          {
-                            "tag": "math",
-                            "ns": "http://www.w3.org/1998/Math/MathML",
-                            "children": [
-                              {
-                                "tag": "mi",
-                                "ns": "http://www.w3.org/1998/Math/MathML",
-                                "children": [
-                                  {
-                                    "text": "foo"
-                                  }
-                                ]
-                              },
-                              {
-                                "tag": "mi",
-                                "ns": "http://www.w3.org/1998/Math/MathML",
-                                "children": [
-                                  {
-                                    "text": "bar"
-                                  }
-                                ]
-                              },
-                              {
-                                "text": "baz"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "quux"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><caption><math><mi>foo</mi><mi>bar</mi>baz</math></caption></table><p>quux</p></body></html>",
-        "noQuirksBodyHtml": "<table><caption><math><mi>foo</mi><mi>bar</mi>baz</math></caption></table><p>quux</p>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><colgroup><math><mi>foo</mi><mi>bar</mi><p>baz</table><p>quux",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mi": true,
-            "p": true,
-            "table": true,
-            "colgroup": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "text": "foo"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "text": "bar"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "baz"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "colgroup"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "quux"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math><mi>foo</mi><mi>bar</mi></math><p>baz</p><table><colgroup></colgroup></table><p>quux</p></body></html>",
-        "noQuirksBodyHtml": "<math><mi>foo</mi><mi>bar</mi><p>baz</p></math><table><colgroup></colgroup></table><p>quux</p>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><tr><td><select><math><mi>foo</mi><mi>bar</mi><p>baz</table><p>quux",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "select": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "select",
-                                    "children": [
-                                      {
-                                        "text": "foobarbaz"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "quux"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><select>foobarbaz</select></td></tr></tbody></table><p>quux</p></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><select>foobarbaz</select></td></tr></tbody></table><p>quux</p>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body><table><select><math><mi>foo</mi><mi>bar</mi><p>baz</table><p>quux",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "table": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "text": "foobarbaz"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table"
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "quux"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><select>foobarbaz</select><table></table><p>quux</p></body></html>",
-        "noQuirksBodyHtml": "<select>foobarbaz</select><table></table><p>quux</p>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body></body></html><math><mi>foo</mi><mi>bar</mi><p>baz",
-      "errors": [
-        "(1,41) expected-eof-but-got-start-tag",
-        "(1,68) unexpected-html-element-in-foreign-content"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mi": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "text": "foo"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "text": "bar"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "baz"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math><mi>foo</mi><mi>bar</mi></math><p>baz</p></body></html>",
-        "noQuirksBodyHtml": "<math><mi>foo</mi><mi>bar</mi><p>baz</p></math>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body></body><math><mi>foo</mi><mi>bar</mi><p>baz",
-      "errors": [
-        "(1,34) unexpected-start-tag-after-body",
-        "(1,61) unexpected-html-element-in-foreign-content"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mi": true,
-            "p": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "text": "foo"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "text": "bar"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "baz"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><math><mi>foo</mi><mi>bar</mi></math><p>baz</p></body></html>",
-        "noQuirksBodyHtml": "<math><mi>foo</mi><mi>bar</mi><p>baz</p></math>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><frameset><math><mi></mi><mi></mi><p><span>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "<math><mi></mi><mi></mi><p><span></span></p></math>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><frameset></frameset><math><mi></mi><mi></mi><p><span>",
-      "errors": [
-        "(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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "<math><mi></mi><mi></mi><p><span></span></p></math>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body xlink:href=foo><math xlink:href=foo></math>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "attrs": [
-                  {
-                    "name": "xlink:href",
-                    "value": "foo"
-                  }
-                ],
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "attrs": [
-                      {
-                        "name": "href",
-                        "ns": "http://www.w3.org/1999/xlink",
-                        "value": "foo"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body xlink:href=\"foo\"><math xlink:href=\"foo\"></math></body></html>",
-        "noQuirksBodyHtml": "<math xlink:href=\"foo\"></math>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body xlink:href=foo xml:lang=en><math><mi xml:lang=en xlink:href=foo></mi></math>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mi": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "attrs": [
-                  {
-                    "name": "xlink:href",
-                    "value": "foo"
-                  },
-                  {
-                    "name": "xml:lang",
-                    "value": "en"
-                  }
-                ],
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "attrs": [
-                          {
-                            "name": "href",
-                            "ns": "http://www.w3.org/1999/xlink",
-                            "value": "foo"
-                          },
-                          {
-                            "name": "lang",
-                            "ns": "http://www.w3.org/XML/1998/namespace",
-                            "value": "en"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body xlink:href=\"foo\" xml:lang=\"en\"><math><mi xml:lang=\"en\" xlink:href=\"foo\"></mi></math></body></html>",
-        "noQuirksBodyHtml": "<math><mi xml:lang=\"en\" xlink:href=\"foo\"></mi></math>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body xlink:href=foo xml:lang=en><math><mi xml:lang=en xlink:href=foo /></math>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mi": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "attrs": [
-                  {
-                    "name": "xlink:href",
-                    "value": "foo"
-                  },
-                  {
-                    "name": "xml:lang",
-                    "value": "en"
-                  }
-                ],
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "attrs": [
-                          {
-                            "name": "href",
-                            "ns": "http://www.w3.org/1999/xlink",
-                            "value": "foo"
-                          },
-                          {
-                            "name": "lang",
-                            "ns": "http://www.w3.org/XML/1998/namespace",
-                            "value": "en"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body xlink:href=\"foo\" xml:lang=\"en\"><math><mi xml:lang=\"en\" xlink:href=\"foo\"></mi></math></body></html>",
-        "noQuirksBodyHtml": "<math><mi xml:lang=\"en\" xlink:href=\"foo\"></mi></math>"
-      }
-    },
-    {
-      "data": "<!DOCTYPE html><body xlink:href=foo xml:lang=en><math><mi xml:lang=en xlink:href=foo />bar</math>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mi": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "attrs": [
-                  {
-                    "name": "xlink:href",
-                    "value": "foo"
-                  },
-                  {
-                    "name": "xml:lang",
-                    "value": "en"
-                  }
-                ],
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mi",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "attrs": [
-                          {
-                            "name": "href",
-                            "ns": "http://www.w3.org/1999/xlink",
-                            "value": "foo"
-                          },
-                          {
-                            "name": "lang",
-                            "ns": "http://www.w3.org/XML/1998/namespace",
-                            "value": "en"
-                          }
-                        ]
-                      },
-                      {
-                        "text": "bar"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body xlink:href=\"foo\" xml:lang=\"en\"><math><mi xml:lang=\"en\" xlink:href=\"foo\"></mi>bar</math></body></html>",
-        "noQuirksBodyHtml": "<math><mi xml:lang=\"en\" xlink:href=\"foo\"></mi>bar</math>"
-      }
-    }
-  ],
-  "tests_innerHTML_1.dat": [
-    {
-      "data": "<body><span>",
-      "errors": [
-        "(1,6): unexpected-start-tag",
-        "(1,12): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "body"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "span"
-          }
-        ],
-        "html": "<span></span>",
-        "noQuirksBodyHtml": "<span></span>"
-      }
-    },
-    {
-      "data": "<span><body>",
-      "errors": [
-        "(1,12): unexpected-start-tag",
-        "(1,12): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "body"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "span"
-          }
-        ],
-        "html": "<span></span>",
-        "noQuirksBodyHtml": "<span></span>"
-      }
-    },
-    {
-      "data": "<span><body>",
-      "errors": [
-        "(1,12): unexpected-start-tag",
-        "(1,12): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "div"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "span"
-          }
-        ],
-        "html": "<span></span>",
-        "noQuirksBodyHtml": "<span></span>"
-      }
-    },
-    {
-      "data": "<body><span>",
-      "errors": [
-        "(1,12): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "html"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "head": true,
-            "body": true,
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "head"
-          },
-          {
-            "tag": "body",
-            "children": [
-              {
-                "tag": "span"
-              }
-            ]
-          }
-        ],
-        "html": "<head></head><body><span></span></body>",
-        "noQuirksBodyHtml": "<span></span>"
-      }
-    },
-    {
-      "data": "<frameset><span>",
-      "errors": [
-        "(1,10): unexpected-start-tag",
-        "(1,16): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "body"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "span"
-          }
-        ],
-        "html": "<span></span>",
-        "noQuirksBodyHtml": "<span></span>"
-      }
-    },
-    {
-      "data": "<span><frameset>",
-      "errors": [
-        "(1,16): unexpected-start-tag",
-        "(1,16): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "body"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "span"
-          }
-        ],
-        "html": "<span></span>",
-        "noQuirksBodyHtml": "<span></span>"
-      }
-    },
-    {
-      "data": "<span><frameset>",
-      "errors": [
-        "(1,16): unexpected-start-tag",
-        "(1,16): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "div"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "span"
-          }
-        ],
-        "html": "<span></span>",
-        "noQuirksBodyHtml": "<span></span>"
-      }
-    },
-    {
-      "data": "<frameset><span>",
-      "errors": [
-        "(1,16): unexpected-start-tag-in-frameset",
-        "(1,16): eof-in-frameset"
-      ],
-      "fragment": {
-        "name": "html"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "head": true,
-            "frameset": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "head"
-          },
-          {
-            "tag": "frameset"
-          }
-        ],
-        "html": "<head></head><frameset></frameset>",
-        "noQuirksBodyHtml": "<span></span>"
-      }
-    },
-    {
-      "data": "<table><tr>",
-      "errors": [
-        "(1,7): unexpected-start-tag"
-      ],
-      "fragment": {
-        "name": "table"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "tbody": true,
-            "tr": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "tbody",
-            "children": [
-              {
-                "tag": "tr"
-              }
-            ]
-          }
-        ],
-        "html": "<tbody><tr></tr></tbody>",
-        "noQuirksBodyHtml": "<table><tbody><tr></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "</table><tr>",
-      "errors": [
-        "(1,8): unexpected-end-tag"
-      ],
-      "fragment": {
-        "name": "table"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "tbody": true,
-            "tr": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "tbody",
-            "children": [
-              {
-                "tag": "tr"
-              }
-            ]
-          }
-        ],
-        "html": "<tbody><tr></tr></tbody>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<a>",
-      "errors": [
-        "(1,3): unexpected-start-tag-implies-table-voodoo",
-        "(1,3): eof-in-table"
-      ],
-      "fragment": {
-        "name": "table"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<a>",
-      "errors": [
-        "(1,3): unexpected-start-tag-implies-table-voodoo",
-        "(1,3): eof-in-table"
-      ],
-      "fragment": {
-        "name": "table"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<a><caption>a",
-      "errors": [
-        "(1,3): unexpected-start-tag-implies-table-voodoo",
-        "(1,13): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "table"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true,
-            "caption": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          },
-          {
-            "tag": "caption",
-            "children": [
-              {
-                "text": "a"
-              }
-            ]
-          }
-        ],
-        "html": "<a></a><caption>a</caption>",
-        "noQuirksBodyHtml": "<a>a</a>"
-      }
-    },
-    {
-      "data": "<a><colgroup><col>",
-      "errors": [
-        "(1,3): foster-parenting-start-token",
-        "(1,18): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "table"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true,
-            "colgroup": true,
-            "col": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          },
-          {
-            "tag": "colgroup",
-            "children": [
-              {
-                "tag": "col"
-              }
-            ]
-          }
-        ],
-        "html": "<a></a><colgroup><col></colgroup>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<a><tbody><tr>",
-      "errors": [
-        "(1,3): foster-parenting-start-tag"
-      ],
-      "fragment": {
-        "name": "table"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true,
-            "tbody": true,
-            "tr": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          },
-          {
-            "tag": "tbody",
-            "children": [
-              {
-                "tag": "tr"
-              }
-            ]
-          }
-        ],
-        "html": "<a></a><tbody><tr></tr></tbody>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<a><tfoot><tr>",
-      "errors": [
-        "(1,3): foster-parenting-start-tag"
-      ],
-      "fragment": {
-        "name": "table"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true,
-            "tfoot": true,
-            "tr": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          },
-          {
-            "tag": "tfoot",
-            "children": [
-              {
-                "tag": "tr"
-              }
-            ]
-          }
-        ],
-        "html": "<a></a><tfoot><tr></tr></tfoot>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<a><thead><tr>",
-      "errors": [
-        "(1,3): foster-parenting-start-tag"
-      ],
-      "fragment": {
-        "name": "table"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true,
-            "thead": true,
-            "tr": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          },
-          {
-            "tag": "thead",
-            "children": [
-              {
-                "tag": "tr"
-              }
-            ]
-          }
-        ],
-        "html": "<a></a><thead><tr></tr></thead>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<a><tr>",
-      "errors": [
-        "(1,3): foster-parenting-start-tag"
-      ],
-      "fragment": {
-        "name": "table"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true,
-            "tbody": true,
-            "tr": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          },
-          {
-            "tag": "tbody",
-            "children": [
-              {
-                "tag": "tr"
-              }
-            ]
-          }
-        ],
-        "html": "<a></a><tbody><tr></tr></tbody>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<a><th>",
-      "errors": [
-        "(1,3): unexpected-start-tag-implies-table-voodoo",
-        "(1,7): unexpected-cell-in-table-body"
-      ],
-      "fragment": {
-        "name": "table"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true,
-            "tbody": true,
-            "tr": true,
-            "th": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          },
-          {
-            "tag": "tbody",
-            "children": [
-              {
-                "tag": "tr",
-                "children": [
-                  {
-                    "tag": "th"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<a></a><tbody><tr><th></th></tr></tbody>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<a><td>",
-      "errors": [
-        "(1,3): unexpected-start-tag-implies-table-voodoo",
-        "(1,7): unexpected-cell-in-table-body"
-      ],
-      "fragment": {
-        "name": "table"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          },
-          {
-            "tag": "tbody",
-            "children": [
-              {
-                "tag": "tr",
-                "children": [
-                  {
-                    "tag": "td"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<a></a><tbody><tr><td></td></tr></tbody>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<table></table><tbody>",
-      "errors": [
-        "(1,22): unexpected-start-tag"
-      ],
-      "fragment": {
-        "name": "caption"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "table": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "table"
-          }
-        ],
-        "html": "<table></table>",
-        "noQuirksBodyHtml": "<table></table>"
-      }
-    },
-    {
-      "data": "</table><span>",
-      "errors": [
-        "(1,8): unexpected-end-tag",
-        "(1,14): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "caption"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "span"
-          }
-        ],
-        "html": "<span></span>",
-        "noQuirksBodyHtml": "<span></span>"
-      }
-    },
-    {
-      "data": "<span></table>",
-      "errors": [
-        "(1,14): unexpected-end-tag",
-        "(1,14): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "caption"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "span"
-          }
-        ],
-        "html": "<span></span>",
-        "noQuirksBodyHtml": "<span></span>"
-      }
-    },
-    {
-      "data": "</caption><span>",
-      "errors": [
-        "(1,10): XXX-undefined-error",
-        "(1,16): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "caption"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "span"
-          }
-        ],
-        "html": "<span></span>",
-        "noQuirksBodyHtml": "<span></span>"
-      }
-    },
-    {
-      "data": "<span></caption><span>",
-      "errors": [
-        "(1,16): XXX-undefined-error",
-        "(1,22): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "caption"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "span",
-            "children": [
-              {
-                "tag": "span"
-              }
-            ]
-          }
-        ],
-        "html": "<span><span></span></span>",
-        "noQuirksBodyHtml": "<span><span></span></span>"
-      }
-    },
-    {
-      "data": "<span><caption><span>",
-      "errors": [
-        "(1,15): unexpected-start-tag",
-        "(1,21): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "caption"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "span",
-            "children": [
-              {
-                "tag": "span"
-              }
-            ]
-          }
-        ],
-        "html": "<span><span></span></span>",
-        "noQuirksBodyHtml": "<span><span></span></span>"
-      }
-    },
-    {
-      "data": "<span><col><span>",
-      "errors": [
-        "(1,11): unexpected-start-tag",
-        "(1,17): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "caption"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "span",
-            "children": [
-              {
-                "tag": "span"
-              }
-            ]
-          }
-        ],
-        "html": "<span><span></span></span>",
-        "noQuirksBodyHtml": "<span><span></span></span>"
-      }
-    },
-    {
-      "data": "<span><colgroup><span>",
-      "errors": [
-        "(1,16): unexpected-start-tag",
-        "(1,22): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "caption"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "span",
-            "children": [
-              {
-                "tag": "span"
-              }
-            ]
-          }
-        ],
-        "html": "<span><span></span></span>",
-        "noQuirksBodyHtml": "<span><span></span></span>"
-      }
-    },
-    {
-      "data": "<span><html><span>",
-      "errors": [
-        "(1,12): non-html-root",
-        "(1,18): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "caption"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "span",
-            "children": [
-              {
-                "tag": "span"
-              }
-            ]
-          }
-        ],
-        "html": "<span><span></span></span>",
-        "noQuirksBodyHtml": "<span><span></span></span>"
-      }
-    },
-    {
-      "data": "<span><tbody><span>",
-      "errors": [
-        "(1,13): unexpected-start-tag",
-        "(1,19): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "caption"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "span",
-            "children": [
-              {
-                "tag": "span"
-              }
-            ]
-          }
-        ],
-        "html": "<span><span></span></span>",
-        "noQuirksBodyHtml": "<span><span></span></span>"
-      }
-    },
-    {
-      "data": "<span><td><span>",
-      "errors": [
-        "(1,10): unexpected-start-tag",
-        "(1,16): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "caption"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "span",
-            "children": [
-              {
-                "tag": "span"
-              }
-            ]
-          }
-        ],
-        "html": "<span><span></span></span>",
-        "noQuirksBodyHtml": "<span><span></span></span>"
-      }
-    },
-    {
-      "data": "<span><tfoot><span>",
-      "errors": [
-        "(1,13): unexpected-start-tag",
-        "(1,19): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "caption"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "span",
-            "children": [
-              {
-                "tag": "span"
-              }
-            ]
-          }
-        ],
-        "html": "<span><span></span></span>",
-        "noQuirksBodyHtml": "<span><span></span></span>"
-      }
-    },
-    {
-      "data": "<span><thead><span>",
-      "errors": [
-        "(1,13): unexpected-start-tag",
-        "(1,19): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "caption"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "span",
-            "children": [
-              {
-                "tag": "span"
-              }
-            ]
-          }
-        ],
-        "html": "<span><span></span></span>",
-        "noQuirksBodyHtml": "<span><span></span></span>"
-      }
-    },
-    {
-      "data": "<span><th><span>",
-      "errors": [
-        "(1,10): unexpected-start-tag",
-        "(1,16): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "caption"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "span",
-            "children": [
-              {
-                "tag": "span"
-              }
-            ]
-          }
-        ],
-        "html": "<span><span></span></span>",
-        "noQuirksBodyHtml": "<span><span></span></span>"
-      }
-    },
-    {
-      "data": "<span><tr><span>",
-      "errors": [
-        "(1,10): unexpected-start-tag",
-        "(1,16): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "caption"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "span",
-            "children": [
-              {
-                "tag": "span"
-              }
-            ]
-          }
-        ],
-        "html": "<span><span></span></span>",
-        "noQuirksBodyHtml": "<span><span></span></span>"
-      }
-    },
-    {
-      "data": "<span></table><span>",
-      "errors": [
-        "(1,14): unexpected-end-tag",
-        "(1,20): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "caption"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "span",
-            "children": [
-              {
-                "tag": "span"
-              }
-            ]
-          }
-        ],
-        "html": "<span><span></span></span>",
-        "noQuirksBodyHtml": "<span><span></span></span>"
-      }
-    },
-    {
-      "data": "</colgroup><col>",
-      "errors": [
-        "(1,11): XXX-undefined-error"
-      ],
-      "fragment": {
-        "name": "colgroup"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "col": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "col"
-          }
-        ],
-        "html": "<col>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<a><col>",
-      "errors": [
-        "(1,3): XXX-undefined-error"
-      ],
-      "fragment": {
-        "name": "colgroup"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "col": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "col"
-          }
-        ],
-        "html": "<col>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<caption><a>",
-      "errors": [
-        "(1,9): XXX-undefined-error",
-        "(1,12): unexpected-start-tag-implies-table-voodoo",
-        "(1,12): eof-in-table"
-      ],
-      "fragment": {
-        "name": "tbody"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<col><a>",
-      "errors": [
-        "(1,5): XXX-undefined-error",
-        "(1,8): unexpected-start-tag-implies-table-voodoo",
-        "(1,8): eof-in-table"
-      ],
-      "fragment": {
-        "name": "tbody"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<colgroup><a>",
-      "errors": [
-        "(1,10): XXX-undefined-error",
-        "(1,13): unexpected-start-tag-implies-table-voodoo",
-        "(1,13): eof-in-table"
-      ],
-      "fragment": {
-        "name": "tbody"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<tbody><a>",
-      "errors": [
-        "(1,7): XXX-undefined-error",
-        "(1,10): unexpected-start-tag-implies-table-voodoo",
-        "(1,10): eof-in-table"
-      ],
-      "fragment": {
-        "name": "tbody"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<tfoot><a>",
-      "errors": [
-        "(1,7): XXX-undefined-error",
-        "(1,10): unexpected-start-tag-implies-table-voodoo",
-        "(1,10): eof-in-table"
-      ],
-      "fragment": {
-        "name": "tbody"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<thead><a>",
-      "errors": [
-        "(1,7): XXX-undefined-error",
-        "(1,10): unexpected-start-tag-implies-table-voodoo",
-        "(1,10): eof-in-table"
-      ],
-      "fragment": {
-        "name": "tbody"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "</table><a>",
-      "errors": [
-        "(1,8): XXX-undefined-error",
-        "(1,11): unexpected-start-tag-implies-table-voodoo",
-        "(1,11): eof-in-table"
-      ],
-      "fragment": {
-        "name": "tbody"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<a><tr>",
-      "errors": [
-        "(1,3): unexpected-start-tag-implies-table-voodoo"
-      ],
-      "fragment": {
-        "name": "tbody"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true,
-            "tr": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          },
-          {
-            "tag": "tr"
-          }
-        ],
-        "html": "<a></a><tr></tr>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<a><td>",
-      "errors": [
-        "(1,3): unexpected-start-tag-implies-table-voodoo",
-        "(1,7): unexpected-cell-in-table-body"
-      ],
-      "fragment": {
-        "name": "tbody"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          },
-          {
-            "tag": "tr",
-            "children": [
-              {
-                "tag": "td"
-              }
-            ]
-          }
-        ],
-        "html": "<a></a><tr><td></td></tr>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<a><td>",
-      "errors": [
-        "(1,3): unexpected-start-tag-implies-table-voodoo",
-        "(1,7): unexpected-cell-in-table-body"
-      ],
-      "fragment": {
-        "name": "tbody"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          },
-          {
-            "tag": "tr",
-            "children": [
-              {
-                "tag": "td"
-              }
-            ]
-          }
-        ],
-        "html": "<a></a><tr><td></td></tr>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<a><td>",
-      "errors": [
-        "(1,3): unexpected-start-tag-implies-table-voodoo",
-        "(1,7): unexpected-cell-in-table-body"
-      ],
-      "fragment": {
-        "name": "tbody"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          },
-          {
-            "tag": "tr",
-            "children": [
-              {
-                "tag": "td"
-              }
-            ]
-          }
-        ],
-        "html": "<a></a><tr><td></td></tr>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "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"
-      ],
-      "fragment": {
-        "name": "tbody"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "tr": true,
-            "td": true,
-            "a": true,
-            "table": true,
-            "tbody": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "tr",
-            "children": [
-              {
-                "tag": "td",
-                "children": [
-                  {
-                    "tag": "a"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<tr><td><a></a><table><tbody><tr></tr></tbody></table></td></tr>",
-        "noQuirksBodyHtml": "<a></a><table><tbody><tr></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "</tr><td>",
-      "errors": [
-        "(1,5): XXX-undefined-error"
-      ],
-      "fragment": {
-        "name": "tr"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "td"
-          }
-        ],
-        "html": "<td></td>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<td><table><a><tr></tr><tr>",
-      "errors": [
-        "(1,14): unexpected-start-tag-implies-table-voodoo",
-        "(1,27): eof-in-table"
-      ],
-      "fragment": {
-        "name": "tr"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "td": true,
-            "a": true,
-            "table": true,
-            "tbody": true,
-            "tr": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "td",
-            "children": [
-              {
-                "tag": "a"
-              },
-              {
-                "tag": "table",
-                "children": [
-                  {
-                    "tag": "tbody",
-                    "children": [
-                      {
-                        "tag": "tr"
-                      },
-                      {
-                        "tag": "tr"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<td><a></a><table><tbody><tr></tr><tr></tr></tbody></table></td>",
-        "noQuirksBodyHtml": "<a></a><table><tbody><tr></tr><tr></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<caption><td>",
-      "errors": [
-        "(1,9): XXX-undefined-error"
-      ],
-      "fragment": {
-        "name": "tr"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "td"
-          }
-        ],
-        "html": "<td></td>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<col><td>",
-      "errors": [
-        "(1,5): XXX-undefined-error"
-      ],
-      "fragment": {
-        "name": "tr"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "td"
-          }
-        ],
-        "html": "<td></td>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<colgroup><td>",
-      "errors": [
-        "(1,10): XXX-undefined-error"
-      ],
-      "fragment": {
-        "name": "tr"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "td"
-          }
-        ],
-        "html": "<td></td>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<tbody><td>",
-      "errors": [
-        "(1,7): XXX-undefined-error"
-      ],
-      "fragment": {
-        "name": "tr"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "td"
-          }
-        ],
-        "html": "<td></td>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<tfoot><td>",
-      "errors": [
-        "(1,7): XXX-undefined-error"
-      ],
-      "fragment": {
-        "name": "tr"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "td"
-          }
-        ],
-        "html": "<td></td>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<thead><td>",
-      "errors": [
-        "(1,7): XXX-undefined-error"
-      ],
-      "fragment": {
-        "name": "tr"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "td"
-          }
-        ],
-        "html": "<td></td>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<tr><td>",
-      "errors": [
-        "(1,4): XXX-undefined-error"
-      ],
-      "fragment": {
-        "name": "tr"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "td"
-          }
-        ],
-        "html": "<td></td>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "</table><td>",
-      "errors": [
-        "(1,8): XXX-undefined-error"
-      ],
-      "fragment": {
-        "name": "tr"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "td"
-          }
-        ],
-        "html": "<td></td>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<td><table></table><td>",
-      "errors": [],
-      "fragment": {
-        "name": "tr"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "td": true,
-            "table": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "td",
-            "children": [
-              {
-                "tag": "table"
-              }
-            ]
-          },
-          {
-            "tag": "td"
-          }
-        ],
-        "html": "<td><table></table></td><td></td>",
-        "noQuirksBodyHtml": "<table></table>"
-      }
-    },
-    {
-      "data": "<td><table></table><td>",
-      "errors": [],
-      "fragment": {
-        "name": "tr"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "td": true,
-            "table": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "td",
-            "children": [
-              {
-                "tag": "table"
-              }
-            ]
-          },
-          {
-            "tag": "td"
-          }
-        ],
-        "html": "<td><table></table></td><td></td>",
-        "noQuirksBodyHtml": "<table></table>"
-      }
-    },
-    {
-      "data": "<caption><a>",
-      "errors": [
-        "(1,9): XXX-undefined-error",
-        "(1,12): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "td"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<col><a>",
-      "errors": [
-        "(1,5): XXX-undefined-error",
-        "(1,8): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "td"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<colgroup><a>",
-      "errors": [
-        "(1,10): XXX-undefined-error",
-        "(1,13): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "td"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<tbody><a>",
-      "errors": [
-        "(1,7): XXX-undefined-error",
-        "(1,10): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "td"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<tfoot><a>",
-      "errors": [
-        "(1,7): XXX-undefined-error",
-        "(1,10): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "td"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<th><a>",
-      "errors": [
-        "(1,4): XXX-undefined-error",
-        "(1,7): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "td"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<thead><a>",
-      "errors": [
-        "(1,7): XXX-undefined-error",
-        "(1,10): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "td"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<tr><a>",
-      "errors": [
-        "(1,4): XXX-undefined-error",
-        "(1,7): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "td"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "</table><a>",
-      "errors": [
-        "(1,8): XXX-undefined-error",
-        "(1,11): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "td"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "</tbody><a>",
-      "errors": [
-        "(1,8): XXX-undefined-error",
-        "(1,11): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "td"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "</td><a>",
-      "errors": [
-        "(1,5): unexpected-end-tag",
-        "(1,8): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "td"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "</tfoot><a>",
-      "errors": [
-        "(1,8): XXX-undefined-error",
-        "(1,11): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "td"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "</thead><a>",
-      "errors": [
-        "(1,8): XXX-undefined-error",
-        "(1,11): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "td"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "</th><a>",
-      "errors": [
-        "(1,5): unexpected-end-tag",
-        "(1,8): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "td"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "</tr><a>",
-      "errors": [
-        "(1,5): XXX-undefined-error",
-        "(1,8): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "td"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "a"
-          }
-        ],
-        "html": "<a></a>",
-        "noQuirksBodyHtml": "<a></a>"
-      }
-    },
-    {
-      "data": "<table><td><td>",
-      "errors": [
-        "(1,11): unexpected-cell-in-table-body",
-        "(1,15): expected-closing-tag-but-got-eof"
-      ],
-      "fragment": {
-        "name": "td"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "table",
-            "children": [
-              {
-                "tag": "tbody",
-                "children": [
-                  {
-                    "tag": "tr",
-                    "children": [
-                      {
-                        "tag": "td"
-                      },
-                      {
-                        "tag": "td"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<table><tbody><tr><td></td><td></td></tr></tbody></table>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td></td><td></td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "</select><option>",
-      "errors": [
-        "(1,9): XXX-undefined-error"
-      ],
-      "fragment": {
-        "name": "select"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "option": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "option"
-          }
-        ],
-        "html": "<option></option>",
-        "noQuirksBodyHtml": "<option></option>"
-      }
-    },
-    {
-      "data": "<input><option>",
-      "errors": [
-        "(1,7): unexpected-input-in-select"
-      ],
-      "fragment": {
-        "name": "select"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "option": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "option"
-          }
-        ],
-        "html": "<option></option>",
-        "noQuirksBodyHtml": "<input><option></option>"
-      }
-    },
-    {
-      "data": "<keygen><option>",
-      "errors": [
-        "(1,8): unexpected-input-in-select"
-      ],
-      "fragment": {
-        "name": "select"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "option": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "option"
-          }
-        ],
-        "html": "<option></option>",
-        "noQuirksBodyHtml": "<keygen><option></option>"
-      }
-    },
-    {
-      "data": "<textarea><option>",
-      "errors": [
-        "(1,10): unexpected-input-in-select"
-      ],
-      "fragment": {
-        "name": "select"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "option": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "option"
-          }
-        ],
-        "html": "<option></option>",
-        "noQuirksBodyHtml": "<textarea>&lt;option&gt;</textarea>"
-      }
-    },
-    {
-      "data": "</html><!--abc-->",
-      "errors": [
-        "(1,7): unexpected-end-tag-after-body-innerhtml"
-      ],
-      "fragment": {
-        "name": "html"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "head"
-          },
-          {
-            "tag": "body"
-          },
-          {
-            "comment": "abc"
-          }
-        ],
-        "html": "<head></head><body></body><!--abc-->",
-        "noQuirksBodyHtml": "<!--abc-->"
-      }
-    },
-    {
-      "data": "</frameset><frame>",
-      "errors": [
-        "(1,11): unexpected-frameset-in-frameset-innerhtml"
-      ],
-      "fragment": {
-        "name": "frameset"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "frame": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "frame"
-          }
-        ],
-        "html": "<frame>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "",
-      "errors": [],
-      "fragment": {
-        "name": "html"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "head"
-          },
-          {
-            "tag": "body"
-          }
-        ],
-        "html": "<head></head><body></body>",
-        "noQuirksBodyHtml": ""
-      }
-    }
-  ],
-  "tricky01.dat": [
-    {
-      "data": "<b><p>Bold </b> Not bold</p>\nAlso not bold.",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag",
-        "(1,15): adoption-agency-1.3"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b"
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "text": "Bold "
-                          }
-                        ]
-                      },
-                      {
-                        "text": " Not bold"
-                      }
-                    ]
-                  },
-                  {
-                    "text": "\nAlso not bold."
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b></b><p><b>Bold </b> Not bold</p>\nAlso not bold.</body></html>",
-        "noQuirksBodyHtml": "<b></b><p><b>Bold </b> Not bold</p>\nAlso not bold."
-      }
-    },
-    {
-      "data": "<html>\n<font color=red><i>Italic and Red<p>Italic and Red </font> Just italic.</p> Italic only.</i> Plain\n<p>I should not be red. <font color=red>Red. <i>Italic and red.</p>\n<p>Italic and red. </i> Red.</font> I should not be red.</p>\n<b>Bold <i>Bold and italic</b> Only Italic </i> Plain",
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "font": true,
-            "i": true,
-            "p": true,
-            "b": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "font",
-                    "attrs": [
-                      {
-                        "name": "color",
-                        "value": "red"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "tag": "i",
-                        "children": [
-                          {
-                            "text": "Italic and Red"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "i",
-                    "children": [
-                      {
-                        "tag": "p",
-                        "children": [
-                          {
-                            "tag": "font",
-                            "attrs": [
-                              {
-                                "name": "color",
-                                "value": "red"
-                              }
-                            ],
-                            "children": [
-                              {
-                                "text": "Italic and Red "
-                              }
-                            ]
-                          },
-                          {
-                            "text": " Just italic."
-                          }
-                        ]
-                      },
-                      {
-                        "text": " Italic only."
-                      }
-                    ]
-                  },
-                  {
-                    "text": " Plain\n"
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "I should not be red. "
-                      },
-                      {
-                        "tag": "font",
-                        "attrs": [
-                          {
-                            "name": "color",
-                            "value": "red"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "text": "Red. "
-                          },
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "text": "Italic and red."
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "font",
-                    "attrs": [
-                      {
-                        "name": "color",
-                        "value": "red"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "tag": "i",
-                        "children": [
-                          {
-                            "text": "\n"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "font",
-                        "attrs": [
-                          {
-                            "name": "color",
-                            "value": "red"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "text": "Italic and red. "
-                              }
-                            ]
-                          },
-                          {
-                            "text": " Red."
-                          }
-                        ]
-                      },
-                      {
-                        "text": " I should not be red."
-                      }
-                    ]
-                  },
-                  {
-                    "text": "\n"
-                  },
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "text": "Bold "
-                      },
-                      {
-                        "tag": "i",
-                        "children": [
-                          {
-                            "text": "Bold and italic"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "i",
-                    "children": [
-                      {
-                        "text": " Only Italic "
-                      }
-                    ]
-                  },
-                  {
-                    "text": " Plain"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><font color=\"red\"><i>Italic and Red</i></font><i><p><font color=\"red\">Italic and Red </font> Just italic.</p> Italic only.</i> Plain\n<p>I should not be red. <font color=\"red\">Red. <i>Italic and red.</i></font></p><font color=\"red\"><i>\n</i></font><p><font color=\"red\"><i>Italic and red. </i> Red.</font> I should not be red.</p>\n<b>Bold <i>Bold and italic</i></b><i> Only Italic </i> Plain</body></html>",
-        "noQuirksBodyHtml": "\n<font color=\"red\"><i>Italic and Red</i></font><i><p><font color=\"red\">Italic and Red </font> Just italic.</p> Italic only.</i> Plain\n<p>I should not be red. <font color=\"red\">Red. <i>Italic and red.</i></font></p><font color=\"red\"><i>\n</i></font><p><font color=\"red\"><i>Italic and red. </i> Red.</font> I should not be red.</p>\n<b>Bold <i>Bold and italic</i></b><i> Only Italic </i> Plain"
-      }
-    },
-    {
-      "data": "<html><body>\n<p><font size=\"7\">First paragraph.</p>\n<p>Second paragraph.</p></font>\n<b><p><i>Bold and Italic</b> Italic</p>",
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "font": true,
-            "b": true,
-            "i": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "\n"
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "font",
-                        "attrs": [
-                          {
-                            "name": "size",
-                            "value": "7"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "text": "First paragraph."
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "font",
-                    "attrs": [
-                      {
-                        "name": "size",
-                        "value": "7"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "\n"
-                      },
-                      {
-                        "tag": "p",
-                        "children": [
-                          {
-                            "text": "Second paragraph."
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "text": "\n"
-                  },
-                  {
-                    "tag": "b"
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "tag": "i",
-                            "children": [
-                              {
-                                "text": "Bold and Italic"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "i",
-                        "children": [
-                          {
-                            "text": " Italic"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>\n<p><font size=\"7\">First paragraph.</font></p><font size=\"7\">\n<p>Second paragraph.</p></font>\n<b></b><p><b><i>Bold and Italic</i></b><i> Italic</i></p></body></html>",
-        "noQuirksBodyHtml": "\n<p><font size=\"7\">First paragraph.</font></p><font size=\"7\">\n<p>Second paragraph.</p></font>\n<b></b><p><b><i>Bold and Italic</i></b><i> Italic</i></p>"
-      }
-    },
-    {
-      "data": "<html>\n<dl>\n<dt><b>Boo\n<dd>Goo?\n</dl>\n</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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "dl": true,
-            "dt": true,
-            "b": true,
-            "dd": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "dl",
-                    "children": [
-                      {
-                        "text": "\n"
-                      },
-                      {
-                        "tag": "dt",
-                        "children": [
-                          {
-                            "tag": "b",
-                            "children": [
-                              {
-                                "text": "Boo\n"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "dd",
-                        "children": [
-                          {
-                            "tag": "b",
-                            "children": [
-                              {
-                                "text": "Goo?\n"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "text": "\n"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><dl>\n<dt><b>Boo\n</b></dt><dd><b>Goo?\n</b></dd></dl><b>\n</b></body></html>",
-        "noQuirksBodyHtml": "\n<dl>\n<dt><b>Boo\n</b></dt><dd><b>Goo?\n</b></dd></dl><b>\n</b>"
-      }
-    },
-    {
-      "data": "<html><body>\n<label><a><div>Hello<div>World</div></a></label>  \n</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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "label": true,
-            "a": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "\n"
-                  },
-                  {
-                    "tag": "label",
-                    "children": [
-                      {
-                        "tag": "a"
-                      },
-                      {
-                        "tag": "div",
-                        "children": [
-                          {
-                            "tag": "a",
-                            "children": [
-                              {
-                                "text": "Hello"
-                              },
-                              {
-                                "tag": "div",
-                                "children": [
-                                  {
-                                    "text": "World"
-                                  }
-                                ]
-                              }
-                            ]
-                          },
-                          {
-                            "text": "  \n"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>\n<label><a></a><div><a>Hello<div>World</div></a>  \n</div></label></body></html>",
-        "noQuirksBodyHtml": "\n<label><a></a><div><a>Hello<div>World</div></a>  \n</div></label>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "center": true,
-            "font": true,
-            "img": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "center",
-                    "children": [
-                      {
-                        "text": " "
-                      },
-                      {
-                        "tag": "font",
-                        "children": [
-                          {
-                            "text": "a"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "font",
-                    "children": [
-                      {
-                        "tag": "img"
-                      },
-                      {
-                        "text": " "
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "text": " "
-                      },
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "text": " "
-                                  }
-                                ]
-                              },
-                              {
-                                "text": " "
-                              }
-                            ]
-                          },
-                          {
-                            "text": " "
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><center> <font>a</font></center><font><img> </font><table> <tbody><tr><td> </td> </tr> </tbody></table></body></html>",
-        "noQuirksBodyHtml": "<center> <font>a</font></center><font><img> </font><table> <tbody><tr><td> </td> </tr> </tbody></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "a": true,
-            "table": true,
-            "tbody": true,
-            "tr": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "a"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "a",
-                        "children": [
-                          {
-                            "text": "You should see this text."
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><p><a></a></p><p><a>You should see this text.</a></p><table><tbody><tr></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<p><a></a></p><p><a>You should see this text.</a></p><table><tbody><tr></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<TABLE>\n<TR>\n<CENTER><CENTER><TD></TD></TR><TR>\n<FONT>\n<TABLE><tr></tr></TABLE>\n</P>\n<a></font><font></a>\nThis page contains an insanely badly-nested tag sequence.",
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "center": true,
-            "font": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "p": true,
-            "a": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "center",
-                    "children": [
-                      {
-                        "tag": "center"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "font",
-                    "children": [
-                      {
-                        "text": "\n"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "text": "\n"
-                      },
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "text": "\n"
-                              },
-                              {
-                                "tag": "td"
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "text": "\n"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "font",
-                    "children": [
-                      {
-                        "text": "\n"
-                      },
-                      {
-                        "tag": "p"
-                      },
-                      {
-                        "text": "\n"
-                      },
-                      {
-                        "tag": "a"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "tag": "font"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "font",
-                    "children": [
-                      {
-                        "text": "\nThis page contains an insanely badly-nested tag sequence."
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><center><center></center></center><font>\n</font><table>\n<tbody><tr>\n<td></td></tr><tr>\n</tr></tbody></table><table><tbody><tr></tr></tbody></table><font>\n<p></p>\n<a></a></font><a><font></font></a><font>\nThis page contains an insanely badly-nested tag sequence.</font></body></html>",
-        "noQuirksBodyHtml": "<center><center></center></center><font>\n</font><table>\n<tbody><tr>\n<td></td></tr><tr>\n</tr></tbody></table><table><tbody><tr></tr></tbody></table><font>\n<p></p>\n<a></a></font><a><font></font></a><font>\nThis page contains an insanely badly-nested tag sequence.</font>"
-      }
-    },
-    {
-      "data": "<html>\n<body>\n<b><nobr><div>This text is in a div inside a nobr</nobr>More text that should not be in the nobr, i.e., the\nnobr should have closed the div inside it implicitly. </b><pre>A pre tag outside everything else.</pre>\n</body>\n</html>",
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "nobr": true,
-            "div": true,
-            "pre": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "\n"
-                  },
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "nobr"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "tag": "nobr",
-                            "children": [
-                              {
-                                "text": "This text is in a div inside a nobr"
-                              }
-                            ]
-                          },
-                          {
-                            "text": "More text that should not be in the nobr, i.e., the\nnobr should have closed the div inside it implicitly. "
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "pre",
-                        "children": [
-                          {
-                            "text": "A pre tag outside everything else."
-                          }
-                        ]
-                      },
-                      {
-                        "text": "\n\n"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>\n<b><nobr></nobr></b><div><b><nobr>This text is in a div inside a nobr</nobr>More text that should not be in the nobr, i.e., the\nnobr should have closed the div inside it implicitly. </b><pre>A pre tag outside everything else.</pre>\n\n</div></body></html>",
-        "noQuirksBodyHtml": "\n\n<b><nobr></nobr></b><div><b><nobr>This text is in a div inside a nobr</nobr>More text that should not be in the nobr, i.e., the\nnobr should have closed the div inside it implicitly. </b><pre>A pre tag outside everything else.</pre>\n\n</div>"
-      }
-    }
-  ],
-  "webkit01.dat": [
-    {
-      "data": "Test",
-      "errors": [
-        "(1,4): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "Test"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>Test</body></html>",
-        "noQuirksBodyHtml": "Test"
-      }
-    },
-    {
-      "data": "<div></div>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div></div></body></html>",
-        "noQuirksBodyHtml": "<div></div>"
-      }
-    },
-    {
-      "data": "<div>Test</div>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": "Test"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div>Test</div></body></html>",
-        "noQuirksBodyHtml": "<div>Test</div>"
-      }
-    },
-    {
-      "data": "<di",
-      "errors": [
-        "(1,3): eof-in-tag-name",
-        "(1,3): expected-doctype-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<div>Hello</div>\n<script>\nconsole.log(\"PASS\");\n</script>\n<div>Bye</div>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": "Hello"
-                      }
-                    ]
-                  },
-                  {
-                    "text": "\n"
-                  },
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "\nconsole.log(\"PASS\");\n",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "\n"
-                  },
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": "Bye"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div>Hello</div>\n<script>\nconsole.log(\"PASS\");\n</script>\n<div>Bye</div></body></html>",
-        "noQuirksBodyHtml": "<div>Hello</div>\n<script>\nconsole.log(\"PASS\");\n</script>\n<div>Bye</div>"
-      }
-    },
-    {
-      "data": "<div foo=\"bar\">Hello</div>",
-      "errors": [
-        "(1,15): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "foo",
-                        "value": "bar"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "text": "Hello"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div foo=\"bar\">Hello</div></body></html>",
-        "noQuirksBodyHtml": "<div foo=\"bar\">Hello</div>"
-      }
-    },
-    {
-      "data": "<div>Hello</div>\n<script>\nconsole.log(\"FOO<span>BAR</span>BAZ\");\n</script>\n<div>Bye</div>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "script": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": "Hello"
-                      }
-                    ]
-                  },
-                  {
-                    "text": "\n"
-                  },
-                  {
-                    "tag": "script",
-                    "children": [
-                      {
-                        "text": "\nconsole.log(\"FOO<span>BAR</span>BAZ\");\n",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "text": "\n"
-                  },
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "text": "Bye"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div>Hello</div>\n<script>\nconsole.log(\"FOO<span>BAR</span>BAZ\");\n</script>\n<div>Bye</div></body></html>",
-        "noQuirksBodyHtml": "<div>Hello</div>\n<script>\nconsole.log(\"FOO<span>BAR</span>BAZ\");\n</script>\n<div>Bye</div>"
-      }
-    },
-    {
-      "data": "<foo bar=\"baz\"></foo><potato quack=\"duck\"></potato>",
-      "errors": [
-        "(1,15): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "foo": true,
-            "potato": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "foo",
-                    "attrs": [
-                      {
-                        "name": "bar",
-                        "value": "baz"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "potato",
-                    "attrs": [
-                      {
-                        "name": "quack",
-                        "value": "duck"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><foo bar=\"baz\"></foo><potato quack=\"duck\"></potato></body></html>",
-        "noQuirksBodyHtml": "<foo bar=\"baz\"></foo><potato quack=\"duck\"></potato>"
-      }
-    },
-    {
-      "data": "<foo bar=\"baz\"><potato quack=\"duck\"></potato></foo>",
-      "errors": [
-        "(1,15): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "foo": true,
-            "potato": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "foo",
-                    "attrs": [
-                      {
-                        "name": "bar",
-                        "value": "baz"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "tag": "potato",
-                        "attrs": [
-                          {
-                            "name": "quack",
-                            "value": "duck"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><foo bar=\"baz\"><potato quack=\"duck\"></potato></foo></body></html>",
-        "noQuirksBodyHtml": "<foo bar=\"baz\"><potato quack=\"duck\"></potato></foo>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "foo": true,
-            "potato": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "foo"
-                  },
-                  {
-                    "tag": "potato"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><foo></foo><potato></potato></body></html>",
-        "noQuirksBodyHtml": "<foo></foo><potato></potato>"
-      }
-    },
-    {
-      "data": "</ tttt>",
-      "errors": [
-        "(1,2): expected-closing-tag-but-got-char",
-        "(1,8): expected-doctype-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "comment": " tttt"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<!-- tttt--><html><head></head><body></body></html>",
-        "noQuirksBodyHtml": "<!-- tttt-->"
-      }
-    },
-    {
-      "data": "<div FOO ><img><img></div>",
-      "errors": [
-        "(1,10): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "img": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "attrs": [
-                      {
-                        "name": "foo",
-                        "value": ""
-                      }
-                    ],
-                    "children": [
-                      {
-                        "tag": "img"
-                      },
-                      {
-                        "tag": "img"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div foo=\"\"><img><img></div></body></html>",
-        "noQuirksBodyHtml": "<div foo=\"\"><img><img></div>"
-      }
-    },
-    {
-      "data": "<p>Test</p<p>Test2</p>",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag",
-        "(1,13): unexpected-end-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "text": "TestTest2"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><p>TestTest2</p></body></html>",
-        "noQuirksBodyHtml": "<p>TestTest2</p>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "rdar:": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "rdar:",
-                    "attrs": [
-                      {
-                        "name": "6869687",
-                        "value": ""
-                      },
-                      {
-                        "name": "problem",
-                        "value": ""
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><rdar: problem=\"\" 6869687=\"\"></rdar:></body></html>",
-        "noQuirksBodyHtml": "<rdar: problem=\"\" 6869687=\"\"></rdar:>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a",
-                    "children": [
-                      {
-                        "text": "test< /A>",
-                        "escaped": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a>test&lt; /A&gt;</a></body></html>",
-        "noQuirksBodyHtml": "<a>test&lt; /A&gt;</a>"
-      }
-    },
-    {
-      "data": "&lt;",
-      "errors": [
-        "(1,4): expected-doctype-but-got-chars"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "escaped": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "<",
-                    "escaped": true
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>&lt;</body></html>",
-        "noQuirksBodyHtml": "&lt;"
-      }
-    },
-    {
-      "data": "<body foo='bar'><body foo='baz' yo='mama'>",
-      "errors": [
-        "(1,16): expected-doctype-but-got-start-tag",
-        "(1,42): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "attrs": [
-                  {
-                    "name": "foo",
-                    "value": "bar"
-                  },
-                  {
-                    "name": "yo",
-                    "value": "mama"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body foo=\"bar\" yo=\"mama\"></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "br": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "br"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><br></body></html>",
-        "noQuirksBodyHtml": "<br>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "bdy": true,
-            "br": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "bdy",
-                    "children": [
-                      {
-                        "tag": "br",
-                        "attrs": [
-                          {
-                            "name": "foo",
-                            "value": "bar"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><bdy><br foo=\"bar\"></bdy></body></html>",
-        "noQuirksBodyHtml": "<bdy><br foo=\"bar\"></bdy>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "br": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "br"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><br></body></html>",
-        "noQuirksBodyHtml": "<br>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "bdy": true,
-            "br": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "bdy",
-                    "children": [
-                      {
-                        "tag": "br",
-                        "attrs": [
-                          {
-                            "name": "foo",
-                            "value": "bar"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><bdy><br foo=\"bar\"></bdy></body></html>",
-        "noQuirksBodyHtml": "<bdy><br foo=\"bar\"></bdy>"
-      }
-    },
-    {
-      "data": "<html><body></body></html><!-- Hi there -->",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          },
-          {
-            "comment": " Hi there "
-          }
-        ],
-        "html": "<html><head></head><body></body></html><!-- Hi there -->",
-        "noQuirksBodyHtml": "<!-- Hi there -->"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "x"
-                  },
-                  {
-                    "comment": " Hi there "
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>x<!-- Hi there --></body></html>",
-        "noQuirksBodyHtml": "x<!-- Hi there -->"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "x"
-                  },
-                  {
-                    "comment": " Hi there "
-                  }
-                ]
-              }
-            ]
-          },
-          {
-            "comment": " Again "
-          }
-        ],
-        "html": "<html><head></head><body>x<!-- Hi there --></body></html><!-- Again -->",
-        "noQuirksBodyHtml": "x<!-- Hi there --><!-- Again -->"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          },
-          "comment": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "x"
-                  },
-                  {
-                    "comment": " Hi there "
-                  }
-                ]
-              }
-            ]
-          },
-          {
-            "comment": " Again "
-          }
-        ],
-        "html": "<html><head></head><body>x<!-- Hi there --></body></html><!-- Again -->",
-        "noQuirksBodyHtml": "x<!-- Hi there --><!-- Again -->"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "div": true,
-            "rp": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "tag": "div",
-                        "children": [
-                          {
-                            "tag": "rp",
-                            "children": [
-                              {
-                                "text": "xx"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby><div><rp>xx</rp></div></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby><div><rp>xx</rp></div></ruby>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ruby": true,
-            "div": true,
-            "rt": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ruby",
-                    "children": [
-                      {
-                        "tag": "div",
-                        "children": [
-                          {
-                            "tag": "rt",
-                            "children": [
-                              {
-                                "text": "xx"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ruby><div><rt>xx</rt></div></ruby></body></html>",
-        "noQuirksBodyHtml": "<ruby><div><rt>xx</rt></div></ruby>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true,
-            "noframes": true
-          },
-          "comment": true,
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset",
-                "children": [
-                  {
-                    "comment": "1"
-                  },
-                  {
-                    "tag": "noframes",
-                    "children": [
-                      {
-                        "text": "A",
-                        "no_escape": true
-                      }
-                    ]
-                  },
-                  {
-                    "comment": "2"
-                  }
-                ]
-              },
-              {
-                "comment": "3"
-              },
-              {
-                "tag": "noframes",
-                "children": [
-                  {
-                    "text": "B",
-                    "no_escape": true
-                  }
-                ]
-              },
-              {
-                "comment": "4"
-              },
-              {
-                "tag": "noframes",
-                "children": [
-                  {
-                    "text": "C",
-                    "no_escape": true
-                  }
-                ]
-              }
-            ]
-          },
-          {
-            "comment": "5"
-          },
-          {
-            "comment": "6"
-          }
-        ],
-        "html": "<html><head></head><frameset><!--1--><noframes>A</noframes><!--2--></frameset><!--3--><noframes>B</noframes><!--4--><noframes>C</noframes></html><!--5--><!--6-->",
-        "noQuirksBodyHtml": "<!--1--><noframes>A</noframes><!--2--><!--3--><noframes>B</noframes><!--4--><!--5--><noframes>C</noframes><!--6-->"
-      }
-    },
-    {
-      "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"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "select": true,
-            "option": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "select",
-                    "children": [
-                      {
-                        "tag": "option",
-                        "children": [
-                          {
-                            "text": "A"
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "option",
-                    "children": [
-                      {
-                        "text": "B"
-                      },
-                      {
-                        "tag": "select",
-                        "children": [
-                          {
-                            "tag": "option",
-                            "children": [
-                              {
-                                "text": "C"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "option",
-                    "children": [
-                      {
-                        "text": "D"
-                      },
-                      {
-                        "tag": "select",
-                        "children": [
-                          {
-                            "tag": "option",
-                            "children": [
-                              {
-                                "text": "E"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "option",
-                    "children": [
-                      {
-                        "text": "F"
-                      },
-                      {
-                        "tag": "select",
-                        "children": [
-                          {
-                            "tag": "option",
-                            "children": [
-                              {
-                                "text": "G"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><select><option>A</option></select><option>B<select><option>C</option></select></option><option>D<select><option>E</option></select></option><option>F<select><option>G</option></select></option></body></html>",
-        "noQuirksBodyHtml": "<select><option>A</option></select><option>B<select><option>C</option></select></option><option>D<select><option>E</option></select></option><option>F<select><option>G</option></select></option>"
-      }
-    },
-    {
-      "data": "<dd><dd><dt><dt><dd><li><li>",
-      "errors": [
-        "(1,4): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "dd": true,
-            "dt": true,
-            "li": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "dd"
-                  },
-                  {
-                    "tag": "dd"
-                  },
-                  {
-                    "tag": "dt"
-                  },
-                  {
-                    "tag": "dt"
-                  },
-                  {
-                    "tag": "dd",
-                    "children": [
-                      {
-                        "tag": "li"
-                      },
-                      {
-                        "tag": "li"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><dd></dd><dd></dd><dt></dt><dt></dt><dd><li></li><li></li></dd></body></html>",
-        "noQuirksBodyHtml": "<dd></dd><dd></dd><dt></dt><dt></dt><dd><li></li><li></li></dd>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "b": true,
-            "nobr": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "b"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "b",
-                        "children": [
-                          {
-                            "tag": "nobr",
-                            "children": [
-                              {
-                                "text": "a"
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "nobr"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div><b></b></div><div><b><nobr>a</nobr><nobr></nobr></b></div></body></html>",
-        "noQuirksBodyHtml": "<div><b></b></div><div><b><nobr>a</nobr><nobr></nobr></b></div>"
-      }
-    },
-    {
-      "data": "<head></head>\n<body></body>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "text": "\n"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head>\n<body></body></html>",
-        "noQuirksBodyHtml": "\n"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "style": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head",
-                "children": [
-                  {
-                    "tag": "style"
-                  }
-                ]
-              },
-              {
-                "text": " "
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "ddd"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head><style></style></head> <body>ddd</body></html>",
-        "noQuirksBodyHtml": " <style></style>ddd"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "kbd": true,
-            "select": true,
-            "table": true,
-            "colgroup": true,
-            "col": true,
-            "tbody": true,
-            "tr": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "kbd",
-                    "children": [
-                      {
-                        "tag": "select"
-                      },
-                      {
-                        "tag": "table",
-                        "children": [
-                          {
-                            "tag": "colgroup",
-                            "children": [
-                              {
-                                "tag": "col"
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "tbody",
-                            "children": [
-                              {
-                                "tag": "tr"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><kbd><select></select><table><colgroup><col></colgroup><tbody><tr></tr></tbody></table></kbd></body></html>",
-        "noQuirksBodyHtml": "<kbd><select></select><table><colgroup><col></colgroup><tbody><tr></tr></tbody></table></kbd>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "kbd": true,
-            "select": true,
-            "table": true,
-            "colgroup": true,
-            "col": true,
-            "tbody": true,
-            "tr": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "kbd",
-                    "children": [
-                      {
-                        "tag": "select"
-                      },
-                      {
-                        "tag": "table",
-                        "children": [
-                          {
-                            "tag": "colgroup",
-                            "children": [
-                              {
-                                "tag": "col"
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "tbody",
-                            "children": [
-                              {
-                                "tag": "tr"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "div"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><kbd><select></select><table><colgroup><col></colgroup><tbody><tr></tr></tbody></table><div></div></kbd></body></html>",
-        "noQuirksBodyHtml": "<kbd><select></select><table><colgroup><col></colgroup><tbody><tr></tr></tbody></table><div></div></kbd>"
-      }
-    },
-    {
-      "data": "<a><li><style></style><title></title></a>",
-      "errors": [
-        "(1,3): expected-doctype-but-got-start-tag",
-        "(1,41): adoption-agency-1.3"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "li": true,
-            "style": true,
-            "title": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a"
-                  },
-                  {
-                    "tag": "li",
-                    "children": [
-                      {
-                        "tag": "a",
-                        "children": [
-                          {
-                            "tag": "style"
-                          },
-                          {
-                            "tag": "title"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a></a><li><a><style></style><title></title></a></li></body></html>",
-        "noQuirksBodyHtml": "<a></a><li><a><style></style><title></title></a></li>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "font": true,
-            "p": true,
-            "meta": true,
-            "title": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "font",
-                    "children": [
-                      {
-                        "tag": "p"
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "p",
-                    "children": [
-                      {
-                        "tag": "font",
-                        "children": [
-                          {
-                            "tag": "meta"
-                          },
-                          {
-                            "tag": "title"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><font><p></p></font><p><font><meta><title></title></font></p></body></html>",
-        "noQuirksBodyHtml": "<font><p></p></font><p><font><meta><title></title></font></p>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "a": true,
-            "center": true,
-            "title": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "a"
-                  },
-                  {
-                    "tag": "center",
-                    "children": [
-                      {
-                        "tag": "a",
-                        "children": [
-                          {
-                            "tag": "title"
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "a"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><a></a><center><a><title></title></a><a></a></center></body></html>",
-        "noQuirksBodyHtml": "<a></a><center><a><title></title></a><a></a></center>"
-      }
-    },
-    {
-      "data": "<svg><title><div>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,17): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg title": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "title",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "tag": "div"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg><title><div></div></title></svg></body></html>",
-        "noQuirksBodyHtml": "<svg><title><div></div></title></svg>"
-      }
-    },
-    {
-      "data": "<svg><title><rect><div>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag",
-        "(1,23): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg title": true,
-            "rect": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "title",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "tag": "rect",
-                            "children": [
-                              {
-                                "tag": "div"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg><title><rect><div></div></rect></title></svg></body></html>",
-        "noQuirksBodyHtml": "<svg><title><rect><div></div></rect></title></svg>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg title": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "title",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "tag": "svg",
-                            "ns": "http://www.w3.org/2000/svg"
-                          },
-                          {
-                            "tag": "div"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg><title><svg></svg><div></div></title></svg></body></html>",
-        "noQuirksBodyHtml": "<svg><title><svg><div></div></svg></title></svg>"
-      }
-    },
-    {
-      "data": "<img <=\"\" FAIL>",
-      "errors": [
-        "(1,6): invalid-character-in-attribute-name",
-        "(1,15): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "img": true
-          },
-          "attrWithFunnyChar": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "img",
-                    "attrs": [
-                      {
-                        "name": "<",
-                        "value": ""
-                      },
-                      {
-                        "name": "fail",
-                        "value": ""
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><img <=\"\" fail=\"\"></body></html>",
-        "noQuirksBodyHtml": "<img <=\"\" fail=\"\">"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "ul": true,
-            "li": true,
-            "div": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "ul",
-                    "children": [
-                      {
-                        "tag": "li",
-                        "children": [
-                          {
-                            "tag": "div",
-                            "attrs": [
-                              {
-                                "name": "id",
-                                "value": "foo"
-                              }
-                            ],
-                            "children": [
-                              {
-                                "text": "A"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "li",
-                        "children": [
-                          {
-                            "text": "B"
-                          },
-                          {
-                            "tag": "div",
-                            "children": [
-                              {
-                                "text": "C"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><ul><li><div id=\"foo\">A</div></li><li>B<div>C</div></li></ul></body></html>",
-        "noQuirksBodyHtml": "<ul><li><div id=\"foo\">A</div></li><li>B<div>C</div></li></ul>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "em": true,
-            "desc": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg"
-                  },
-                  {
-                    "tag": "em",
-                    "children": [
-                      {
-                        "tag": "desc"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg></svg><em><desc></desc></em></body></html>",
-        "noQuirksBodyHtml": "<svg><em><desc></desc></em></svg>"
-      }
-    },
-    {
-      "data": "<table><tr><td><svg><desc><td></desc><circle>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "svg svg": true,
-            "svg desc": true,
-            "circle": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "svg",
-                                    "ns": "http://www.w3.org/2000/svg",
-                                    "children": [
-                                      {
-                                        "tag": "desc",
-                                        "ns": "http://www.w3.org/2000/svg"
-                                      }
-                                    ]
-                                  }
-                                ]
-                              },
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "tag": "circle"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><tr><td><svg><desc></desc></svg></td><td><circle></circle></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td><svg><desc></desc></svg></td><td><circle></circle></td></tr></tbody></table>"
-      }
-    },
-    {
-      "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": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg tfoot": true,
-            "svg td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "tfoot",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "tag": "td",
-                            "ns": "http://www.w3.org/2000/svg"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg><tfoot><td></td></tfoot></svg></body></html>",
-        "noQuirksBodyHtml": "<svg><tfoot><td></td></tfoot></svg>"
-      }
-    },
-    {
-      "data": "<math><mrow><mrow><mn>1</mn></mrow><mi>a</mi></mrow></math>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "math math": true,
-            "math mrow": true,
-            "math mn": true,
-            "math mi": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "math",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
-                    "children": [
-                      {
-                        "tag": "mrow",
-                        "ns": "http://www.w3.org/1998/Math/MathML",
-                        "children": [
-                          {
-                            "tag": "mrow",
-                            "ns": "http://www.w3.org/1998/Math/MathML",
-                            "children": [
-                              {
-                                "tag": "mn",
-                                "ns": "http://www.w3.org/1998/Math/MathML",
-                                "children": [
-                                  {
-                                    "text": "1"
-                                  }
-                                ]
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "mi",
-                            "ns": "http://www.w3.org/1998/Math/MathML",
-                            "children": [
-                              {
-                                "text": "a"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><math><mrow><mrow><mn>1</mn></mrow><mi>a</mi></mrow></math></body></html>",
-        "noQuirksBodyHtml": "<math><mrow><mrow><mn>1</mn></mrow><mi>a</mi></mrow></math>"
-      }
-    },
-    {
-      "data": "<!doctype html><input type=\"hidden\"><frameset>",
-      "errors": [
-        "(1,46): unexpected-start-tag",
-        "(1,46): eof-in-frameset"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "frameset": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "frameset"
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
-        "noQuirksBodyHtml": "<input type=\"hidden\">"
-      }
-    },
-    {
-      "data": "<!doctype html><input type=\"button\"><frameset>",
-      "errors": [
-        "(1,46): unexpected-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "input": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "input",
-                    "attrs": [
-                      {
-                        "name": "type",
-                        "value": "button"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><input type=\"button\"></body></html>",
-        "noQuirksBodyHtml": "<input type=\"button\">"
-      }
-    }
-  ],
-  "webkit02.dat": [
-    {
-      "data": "<foo bar=qux/>",
-      "errors": [
-        "(1,14): expected-doctype-but-got-start-tag",
-        "(1,14): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "foo": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "foo",
-                    "attrs": [
-                      {
-                        "name": "bar",
-                        "value": "qux/"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><foo bar=\"qux/\"></foo></body></html>",
-        "noQuirksBodyHtml": "<foo bar=\"qux/\"></foo>"
-      }
-    },
-    {
-      "data": "<p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p>",
-      "errors": [
-        "(1,15): expected-doctype-but-got-start-tag"
-      ],
-      "script": "on",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "noscript": true,
-            "span": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "attrs": [
-                      {
-                        "name": "id",
-                        "value": "status"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "tag": "noscript",
-                        "children": [
-                          {
-                            "text": "<strong>A</strong>",
-                            "no_escape": true
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "span",
-                        "children": [
-                          {
-                            "text": "B"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p></body></html>",
-        "noQuirksBodyHtml": "<p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p>"
-      }
-    },
-    {
-      "data": "<p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p>",
-      "errors": [
-        "(1,15): expected-doctype-but-got-start-tag"
-      ],
-      "script": "off",
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "p": true,
-            "noscript": true,
-            "strong": true,
-            "span": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "p",
-                    "attrs": [
-                      {
-                        "name": "id",
-                        "value": "status"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "tag": "noscript",
-                        "children": [
-                          {
-                            "tag": "strong",
-                            "children": [
-                              {
-                                "text": "A"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "span",
-                        "children": [
-                          {
-                            "text": "B"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p></body></html>",
-        "noQuirksBodyHtml": "<p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p>"
-      }
-    },
-    {
-      "data": "<div><sarcasm><div></div></sarcasm></div>",
-      "errors": [
-        "(1,5): expected-doctype-but-got-start-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "div": true,
-            "sarcasm": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "div",
-                    "children": [
-                      {
-                        "tag": "sarcasm",
-                        "children": [
-                          {
-                            "tag": "div"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><div><sarcasm><div></div></sarcasm></div></body></html>",
-        "noQuirksBodyHtml": "<div><sarcasm><div></div></sarcasm></div>"
-      }
-    },
-    {
-      "data": "<html><body><img src=\"\" border=\"0\" alt=\"><div>A</div></body></html>",
-      "errors": [
-        "(1,6): expected-doctype-but-got-start-tag",
-        "(1,67): eof-in-attribute-value-double-quote"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body"
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body></body></html>",
-        "noQuirksBodyHtml": ""
-      }
-    },
-    {
-      "data": "<table><td></tbody>A",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,11): unexpected-cell-in-table-body",
-        "(1,20): foster-parenting-character",
-        "(1,20): eof-in-table"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "text": "A"
-                  },
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body>A<table><tbody><tr><td></td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "A<table><tbody><tr><td></td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<table><td></thead>A",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,11): unexpected-cell-in-table-body",
-        "(1,19): XXX-undefined-error",
-        "(1,20): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "text": "A"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><tr><td>A</td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td>A</td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<table><td></tfoot>A",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,11): unexpected-cell-in-table-body",
-        "(1,19): XXX-undefined-error",
-        "(1,20): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "tbody",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "text": "A"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><tbody><tr><td>A</td></tr></tbody></table></body></html>",
-        "noQuirksBodyHtml": "<table><tbody><tr><td>A</td></tr></tbody></table>"
-      }
-    },
-    {
-      "data": "<table><thead><td></tbody>A",
-      "errors": [
-        "(1,7): expected-doctype-but-got-start-tag",
-        "(1,18): unexpected-cell-in-table-body",
-        "(1,26): XXX-undefined-error",
-        "(1,27): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "table": true,
-            "thead": true,
-            "tr": true,
-            "td": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "table",
-                    "children": [
-                      {
-                        "tag": "thead",
-                        "children": [
-                          {
-                            "tag": "tr",
-                            "children": [
-                              {
-                                "tag": "td",
-                                "children": [
-                                  {
-                                    "text": "A"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><table><thead><tr><td>A</td></tr></thead></table></body></html>",
-        "noQuirksBodyHtml": "<table><thead><tr><td>A</td></tr></thead></table>"
-      }
-    },
-    {
-      "data": "<legend>test</legend>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "legend": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "legend",
-                    "children": [
-                      {
-                        "text": "test"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><legend>test</legend></body></html>",
-        "noQuirksBodyHtml": "<legend>test</legend>"
-      }
-    },
-    {
-      "data": "<table><input>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "input": true,
-            "table": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "input"
-                  },
-                  {
-                    "tag": "table"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><input><table></table></body></html>",
-        "noQuirksBodyHtml": "<input><table></table>"
-      }
-    },
-    {
-      "data": "<b><em><foo><foo><aside></b>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "em": true,
-            "foo": true,
-            "aside": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "em",
-                        "children": [
-                          {
-                            "tag": "foo",
-                            "children": [
-                              {
-                                "tag": "foo"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "em",
-                    "children": [
-                      {
-                        "tag": "aside",
-                        "children": [
-                          {
-                            "tag": "b"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b><em><foo><foo></foo></foo></em></b><em><aside><b></b></aside></em></body></html>",
-        "noQuirksBodyHtml": "<b><em><foo><foo></foo></foo></em></b><em><aside><b></b></aside></em>"
-      }
-    },
-    {
-      "data": "<b><em><foo><foo><aside></b></em>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "em": true,
-            "foo": true,
-            "aside": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "em",
-                        "children": [
-                          {
-                            "tag": "foo",
-                            "children": [
-                              {
-                                "tag": "foo"
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "em"
-                  },
-                  {
-                    "tag": "aside",
-                    "children": [
-                      {
-                        "tag": "em",
-                        "children": [
-                          {
-                            "tag": "b"
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b><em><foo><foo></foo></foo></em></b><em></em><aside><em><b></b></em></aside></body></html>",
-        "noQuirksBodyHtml": "<b><em><foo><foo></foo></foo></em></b><em></em><aside><em><b></b></em></aside>"
-      }
-    },
-    {
-      "data": "<b><em><foo><foo><foo><aside></b>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "em": true,
-            "foo": true,
-            "aside": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "em",
-                        "children": [
-                          {
-                            "tag": "foo",
-                            "children": [
-                              {
-                                "tag": "foo",
-                                "children": [
-                                  {
-                                    "tag": "foo"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "aside",
-                    "children": [
-                      {
-                        "tag": "b"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b><em><foo><foo><foo></foo></foo></foo></em></b><aside><b></b></aside></body></html>",
-        "noQuirksBodyHtml": "<b><em><foo><foo><foo></foo></foo></foo></em></b><aside><b></b></aside>"
-      }
-    },
-    {
-      "data": "<b><em><foo><foo><foo><aside></b></em>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "b": true,
-            "em": true,
-            "foo": true,
-            "aside": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "b",
-                    "children": [
-                      {
-                        "tag": "em",
-                        "children": [
-                          {
-                            "tag": "foo",
-                            "children": [
-                              {
-                                "tag": "foo",
-                                "children": [
-                                  {
-                                    "tag": "foo"
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  },
-                  {
-                    "tag": "aside",
-                    "children": [
-                      {
-                        "tag": "b"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><b><em><foo><foo><foo></foo></foo></foo></em></b><aside><b></b></aside></body></html>",
-        "noQuirksBodyHtml": "<b><em><foo><foo><foo></foo></foo></foo></em></b><aside><b></b></aside>"
-      }
-    },
-    {
-      "data": "<b><em><foo><foo><foo><foo><foo><foo><foo><foo><foo><foo><aside></b></em>",
-      "errors": [],
-      "fragment": {
-        "name": "div"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "b": true,
-            "em": true,
-            "foo": true,
-            "aside": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "b",
-            "children": [
-              {
-                "tag": "em",
-                "children": [
-                  {
-                    "tag": "foo",
-                    "children": [
-                      {
-                        "tag": "foo",
-                        "children": [
-                          {
-                            "tag": "foo",
-                            "children": [
-                              {
-                                "tag": "foo",
-                                "children": [
-                                  {
-                                    "tag": "foo",
-                                    "children": [
-                                      {
-                                        "tag": "foo",
-                                        "children": [
-                                          {
-                                            "tag": "foo",
-                                            "children": [
-                                              {
-                                                "tag": "foo",
-                                                "children": [
-                                                  {
-                                                    "tag": "foo",
-                                                    "children": [
-                                                      {
-                                                        "tag": "foo"
-                                                      }
-                                                    ]
-                                                  }
-                                                ]
-                                              }
-                                            ]
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          },
-          {
-            "tag": "aside",
-            "children": [
-              {
-                "tag": "b"
-              }
-            ]
-          }
-        ],
-        "html": "<b><em><foo><foo><foo><foo><foo><foo><foo><foo><foo><foo></foo></foo></foo></foo></foo></foo></foo></foo></foo></foo></em></b><aside><b></b></aside>",
-        "noQuirksBodyHtml": "<b><em><foo><foo><foo><foo><foo><foo><foo><foo><foo><foo></foo></foo></foo></foo></foo></foo></foo></foo></foo></foo></em></b><aside><b></b></aside>"
-      }
-    },
-    {
-      "data": "<b><em><foo><foob><foob><foob><foob><fooc><fooc><fooc><fooc><food><aside></b></em>",
-      "errors": [],
-      "fragment": {
-        "name": "div"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "b": true,
-            "em": true,
-            "foo": true,
-            "foob": true,
-            "fooc": true,
-            "food": true,
-            "aside": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "b",
-            "children": [
-              {
-                "tag": "em",
-                "children": [
-                  {
-                    "tag": "foo",
-                    "children": [
-                      {
-                        "tag": "foob",
-                        "children": [
-                          {
-                            "tag": "foob",
-                            "children": [
-                              {
-                                "tag": "foob",
-                                "children": [
-                                  {
-                                    "tag": "foob",
-                                    "children": [
-                                      {
-                                        "tag": "fooc",
-                                        "children": [
-                                          {
-                                            "tag": "fooc",
-                                            "children": [
-                                              {
-                                                "tag": "fooc",
-                                                "children": [
-                                                  {
-                                                    "tag": "fooc",
-                                                    "children": [
-                                                      {
-                                                        "tag": "food"
-                                                      }
-                                                    ]
-                                                  }
-                                                ]
-                                              }
-                                            ]
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          },
-          {
-            "tag": "aside",
-            "children": [
-              {
-                "tag": "b"
-              }
-            ]
-          }
-        ],
-        "html": "<b><em><foo><foob><foob><foob><foob><fooc><fooc><fooc><fooc><food></food></fooc></fooc></fooc></fooc></foob></foob></foob></foob></foo></em></b><aside><b></b></aside>",
-        "noQuirksBodyHtml": "<b><em><foo><foob><foob><foob><foob><fooc><fooc><fooc><fooc><food></food></fooc></fooc></fooc></fooc></foob></foob></foob></foob></foo></em></b><aside><b></b></aside>"
-      }
-    },
-    {
-      "data": "<option><XH<optgroup></optgroup>",
-      "errors": [],
-      "fragment": {
-        "name": "select"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "option": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "option"
-          }
-        ],
-        "html": "<option></option>",
-        "noQuirksBodyHtml": "<option><xh<optgroup></xh<optgroup></option>"
-      }
-    },
-    {
-      "data": "<svg><foreignObject><div>foo</div><plaintext></foreignObject></svg><div>bar</div>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg foreignObject": true,
-            "div": true,
-            "plaintext": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "foreignObject",
-                        "ns": "http://www.w3.org/2000/svg",
-                        "children": [
-                          {
-                            "tag": "div",
-                            "children": [
-                              {
-                                "text": "foo"
-                              }
-                            ]
-                          },
-                          {
-                            "tag": "plaintext",
-                            "children": [
-                              {
-                                "text": "</foreignObject></svg><div>bar</div>",
-                                "no_escape": true
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg><foreignObject><div>foo</div><plaintext></foreignObject></svg><div>bar</div></plaintext></foreignObject></svg></body></html>",
-        "noQuirksBodyHtml": "<svg><foreignObject><div>foo</div><plaintext></foreignObject></svg><div>bar</div></plaintext></foreignObject></svg>"
-      }
-    },
-    {
-      "data": "<svg><foreignObject></foreignObject><title></svg>foo",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "svg svg": true,
-            "svg foreignObject": true,
-            "svg title": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
-                    "children": [
-                      {
-                        "tag": "foreignObject",
-                        "ns": "http://www.w3.org/2000/svg"
-                      },
-                      {
-                        "tag": "title",
-                        "ns": "http://www.w3.org/2000/svg"
-                      }
-                    ]
-                  },
-                  {
-                    "text": "foo"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><svg><foreignObject></foreignObject><title></title></svg>foo</body></html>",
-        "noQuirksBodyHtml": "<svg><foreignObject></foreignObject><title></title></svg>foo"
-      }
-    },
-    {
-      "data": "</foreignObject><plaintext><div>foo</div>",
-      "errors": [],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "plaintext": true
-          },
-          "no_escape": true
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "plaintext",
-                    "children": [
-                      {
-                        "text": "<div>foo</div>",
-                        "no_escape": true
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><plaintext><div>foo</div></plaintext></body></html>",
-        "noQuirksBodyHtml": "<plaintext><div>foo</div></plaintext>"
-      }
-    }
-  ]
-}
\ No newline at end of file
diff --git a/tests/phpunit/includes/utils/AvroValidatorTest.php b/tests/phpunit/includes/utils/AvroValidatorTest.php
deleted file mode 100644 (file)
index cf45f9f..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-<?php
-/**
- * Tests for IP validity functions.
- *
- * Ported from /t/inc/IP.t by avar.
- *
- * @todo Test methods in this call should be split into a method and a
- * dataprovider.
- */
-
-/**
- * @group IP
- * @covers AvroValidator
- */
-class AvroValidatorTest extends PHPUnit\Framework\TestCase {
-
-       use MediaWikiCoversValidator;
-
-       public function setUp() {
-               if ( !class_exists( 'AvroSchema' ) ) {
-                       $this->markTestSkipped( 'Avro is required to run the AvroValidatorTest' );
-               }
-               parent::setUp();
-       }
-
-       public function getErrorsProvider() {
-               $stringSchema = AvroSchema::parse( json_encode( [ 'type' => 'string' ] ) );
-               $stringArraySchema = AvroSchema::parse( json_encode( [
-                       'type' => 'array',
-                       'items' => 'string',
-               ] ) );
-               $recordSchema = AvroSchema::parse( json_encode( [
-                       'type' => 'record',
-                       'name' => 'ut',
-                       'fields' => [
-                               [ 'name' => 'id', 'type' => 'int', 'required' => true ],
-                       ],
-               ] ) );
-               $enumSchema = AvroSchema::parse( json_encode( [
-                       'type' => 'record',
-                       'name' => 'ut',
-                       'fields' => [
-                               [ 'name' => 'count', 'type' => [ 'int', 'null' ] ],
-                       ],
-               ] ) );
-
-               return [
-                       [
-                               'No errors with a simple string serialization',
-                               $stringSchema, 'foobar', [],
-                       ],
-
-                       [
-                               'Cannot serialize integer into string',
-                               $stringSchema, 5, 'Expected string, but recieved integer',
-                       ],
-
-                       [
-                               'Cannot serialize array into string',
-                               $stringSchema, [], 'Expected string, but recieved array',
-                       ],
-
-                       [
-                               'allows and ignores extra fields',
-                               $recordSchema, [ 'id' => 4, 'foo' => 'bar' ], [],
-                       ],
-
-                       [
-                               'detects missing fields',
-                               $recordSchema, [], [ 'id' => 'Missing expected field' ],
-                       ],
-
-                       [
-                               'handles first element in enum',
-                               $enumSchema, [ 'count' => 4 ], [],
-                       ],
-
-                       [
-                               'handles second element in enum',
-                               $enumSchema, [ 'count' => null ], [],
-                       ],
-
-                       [
-                               'rejects element not in union',
-                               $enumSchema, [ 'count' => 'invalid' ], [ 'count' => [
-                                       'Expected any one of these to be true',
-                                       [
-                                               'Expected integer, but recieved string',
-                                               'Expected null, but recieved string',
-                                       ]
-                               ] ]
-                       ],
-                       [
-                               'Empty array is accepted',
-                               $stringArraySchema, [], []
-                       ],
-                       [
-                               'correct array element accepted',
-                               $stringArraySchema, [ 'fizzbuzz' ], []
-                       ],
-                       [
-                               'incorrect array element rejected',
-                               $stringArraySchema, [ '12', 34 ], [ 'Expected string, but recieved integer' ]
-                       ],
-               ];
-       }
-
-       /**
-        * @dataProvider getErrorsProvider
-        */
-       public function testGetErrors( $message, $schema, $datum, $expected ) {
-               $this->assertEquals(
-                       $expected,
-                       AvroValidator::getErrors( $schema, $datum ),
-                       $message
-               );
-       }
-}
diff --git a/tests/phpunit/includes/utils/ClassCollectorTest.php b/tests/phpunit/includes/utils/ClassCollectorTest.php
deleted file mode 100644 (file)
index 6f8aa52..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-
-/**
- * @covers ClassCollector
- */
-class ClassCollectorTest extends PHPUnit\Framework\TestCase {
-
-       use MediaWikiCoversValidator;
-
-       public static function provideCases() {
-               return [
-                       [
-                               "class Foo {}",
-                               [ 'Foo' ],
-                       ],
-                       [
-                               "namespace Example;\nclass Foo {}\nclass Bar {}",
-                               [ 'Example\Foo', 'Example\Bar' ],
-                       ],
-                       [
-                               "class_alias( 'Foo', 'Bar' );",
-                               [ 'Bar' ],
-                       ],
-                       [
-                               "namespace Example;\nclass Foo {}\nclass_alias( 'Example\Foo', 'Foo' );",
-                               [ 'Example\Foo', 'Foo' ],
-                       ],
-                       [
-                               "namespace Example;\nclass Foo {}\nclass_alias( 'Example\Foo', 'Bar' );",
-                               [ 'Example\Foo', 'Bar' ],
-                       ],
-                       [
-                               // Support a multiline 'class' statement
-                               "namespace Example;\nclass Foo extends\n\tFooBase {\n\t"
-                                               . "public function x() {}\n}\nclass_alias( 'Example\Foo', 'Bar' );",
-                               [ 'Example\Foo', 'Bar' ],
-                       ],
-                       [
-                               "class_alias( Foo::class, 'Bar' );",
-                               [ 'Bar' ],
-                       ],
-                       [
-                               // Support nested class_alias() calls
-                                       "if ( false ) {\n\tclass_alias( Foo::class, 'Bar' );\n}",
-                                       [ 'Bar' ],
-                       ],
-                       [
-                               // Namespaced class is not currently supported. Must use namespace declaration
-                               // earlier in the file.
-                               "class_alias( Example\Foo::class, 'Bar' );",
-                               [],
-                       ],
-                       [
-                               "namespace Example;\nclass Foo {}\nclass_alias( Foo::class, 'Bar' );",
-                               [ 'Example\Foo', 'Bar' ],
-                       ],
-                       [
-                               "new class() extends Foo {}",
-                               []
-                       ]
-               ];
-       }
-
-       /**
-        * @dataProvider provideCases
-        */
-       public function testGetClasses( $code, array $classes, $message = null ) {
-               $cc = new ClassCollector();
-               $this->assertEquals( $classes, $cc->getClasses( "<?php\n$code" ), $message );
-       }
-}
diff --git a/tests/phpunit/includes/utils/MWCryptHashTest.php b/tests/phpunit/includes/utils/MWCryptHashTest.php
deleted file mode 100644 (file)
index 94705bf..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-
-/**
- * @group Hash
- *
- * @covers MWCryptHash
- */
-class MWCryptHashTest extends PHPUnit\Framework\TestCase {
-
-       use MediaWikiCoversValidator;
-
-       public function testHashLength() {
-               if ( MWCryptHash::hashAlgo() !== 'whirlpool' ) {
-                       $this->markTestSkipped( 'Hash algorithm isn\'t whirlpool' );
-               }
-
-               $this->assertEquals( 64, MWCryptHash::hashLength(), 'Raw hash length' );
-               $this->assertEquals( 128, MWCryptHash::hashLength( false ), 'Hex hash length' );
-       }
-
-       public function testHash() {
-               if ( MWCryptHash::hashAlgo() !== 'whirlpool' ) {
-                       $this->markTestSkipped( 'Hash algorithm isn\'t whirlpool' );
-               }
-
-               $data = 'foobar';
-               // phpcs:ignore Generic.Files.LineLength
-               $hash = '9923afaec3a86f865bb231a588f453f84e8151a2deb4109aebc6de4284be5bebcff4fab82a7e51d920237340a043736e9d13bab196006dcca0fe65314d68eab9';
-
-               $this->assertEquals(
-                       hex2bin( $hash ),
-                       MWCryptHash::hash( $data ),
-                       'Raw hash'
-               );
-               $this->assertEquals(
-                       $hash,
-                       MWCryptHash::hash( $data, false ),
-                       'Hex hash'
-               );
-       }
-
-       public function testHmac() {
-               if ( MWCryptHash::hashAlgo() !== 'whirlpool' ) {
-                       $this->markTestSkipped( 'Hash algorithm isn\'t whirlpool' );
-               }
-
-               $data = 'foobar';
-               $key = 'secret';
-               // phpcs:ignore Generic.Files.LineLength
-               $hash = 'ddc94177b2020e55ce2049199fd9cc6327f416ff6dc621cc34cb43d9bec61d73372b4790c0e24957f565ecaf2d42821e6303619093e99cbe14a3b9250bda5f81';
-
-               $this->assertEquals(
-                       hex2bin( $hash ),
-                       MWCryptHash::hmac( $data, $key ),
-                       'Raw hmac'
-               );
-               $this->assertEquals(
-                       $hash,
-                       MWCryptHash::hmac( $data, $key, false ),
-                       'Hex hmac'
-               );
-       }
-
-}
diff --git a/tests/phpunit/includes/utils/MWRestrictionsTest.php b/tests/phpunit/includes/utils/MWRestrictionsTest.php
deleted file mode 100644 (file)
index abdfbb1..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-<?php
-class MWRestrictionsTest extends PHPUnit\Framework\TestCase {
-
-       use MediaWikiCoversValidator;
-
-       protected static $restrictionsForChecks;
-
-       public static function setUpBeforeClass() {
-               self::$restrictionsForChecks = MWRestrictions::newFromArray( [
-                       'IPAddresses' => [
-                               '10.0.0.0/8',
-                               '172.16.0.0/12',
-                               '2001:db8::/33',
-                       ]
-               ] );
-       }
-
-       /**
-        * @covers MWRestrictions::newDefault
-        * @covers MWRestrictions::__construct
-        */
-       public function testNewDefault() {
-               $ret = MWRestrictions::newDefault();
-               $this->assertInstanceOf( MWRestrictions::class, $ret );
-               $this->assertSame(
-                       '{"IPAddresses":["0.0.0.0/0","::/0"]}',
-                       $ret->toJson()
-               );
-       }
-
-       /**
-        * @covers MWRestrictions::newFromArray
-        * @covers MWRestrictions::__construct
-        * @covers MWRestrictions::loadFromArray
-        * @covers MWRestrictions::toArray
-        * @dataProvider provideArray
-        * @param array $data
-        * @param bool|InvalidArgumentException $expect True if the call succeeds,
-        *  otherwise the exception that should be thrown.
-        */
-       public function testArray( $data, $expect ) {
-               if ( $expect === true ) {
-                       $ret = MWRestrictions::newFromArray( $data );
-                       $this->assertInstanceOf( MWRestrictions::class, $ret );
-                       $this->assertSame( $data, $ret->toArray() );
-               } else {
-                       try {
-                               MWRestrictions::newFromArray( $data );
-                               $this->fail( 'Expected exception not thrown' );
-                       } catch ( InvalidArgumentException $ex ) {
-                               $this->assertEquals( $expect, $ex );
-                       }
-               }
-       }
-
-       public static function provideArray() {
-               return [
-                       [ [ 'IPAddresses' => [] ], true ],
-                       [ [ 'IPAddresses' => [ '127.0.0.1/32' ] ], true ],
-                       [
-                               [ 'IPAddresses' => [ '256.0.0.1/32' ] ],
-                               new InvalidArgumentException( 'Invalid IP address: 256.0.0.1/32' )
-                       ],
-                       [
-                               [ 'IPAddresses' => '127.0.0.1/32' ],
-                               new InvalidArgumentException( 'IPAddresses is not an array' )
-                       ],
-                       [
-                               [],
-                               new InvalidArgumentException( 'Array is missing required keys: IPAddresses' )
-                       ],
-                       [
-                               [ 'foo' => 'bar', 'bar' => 42 ],
-                               new InvalidArgumentException( 'Array contains invalid keys: foo, bar' )
-                       ],
-               ];
-       }
-
-       /**
-        * @covers MWRestrictions::newFromJson
-        * @covers MWRestrictions::__construct
-        * @covers MWRestrictions::loadFromArray
-        * @covers MWRestrictions::toJson
-        * @covers MWRestrictions::__toString
-        * @dataProvider provideJson
-        * @param string $json
-        * @param array|InvalidArgumentException $expect
-        */
-       public function testJson( $json, $expect ) {
-               if ( is_array( $expect ) ) {
-                       $ret = MWRestrictions::newFromJson( $json );
-                       $this->assertInstanceOf( MWRestrictions::class, $ret );
-                       $this->assertSame( $expect, $ret->toArray() );
-
-                       $this->assertSame( $json, $ret->toJson( false ) );
-                       $this->assertSame( $json, (string)$ret );
-
-                       $this->assertSame(
-                               FormatJson::encode( $expect, true, FormatJson::ALL_OK ),
-                               $ret->toJson( true )
-                       );
-               } else {
-                       try {
-                               MWRestrictions::newFromJson( $json );
-                               $this->fail( 'Expected exception not thrown' );
-                       } catch ( InvalidArgumentException $ex ) {
-                               $this->assertTrue( true );
-                       }
-               }
-       }
-
-       public static function provideJson() {
-               return [
-                       [
-                               '{"IPAddresses":[]}',
-                               [ 'IPAddresses' => [] ]
-                       ],
-                       [
-                               '{"IPAddresses":["127.0.0.1/32"]}',
-                               [ 'IPAddresses' => [ '127.0.0.1/32' ] ]
-                       ],
-                       [
-                               '{"IPAddresses":["256.0.0.1/32"]}',
-                               new InvalidArgumentException( 'Invalid IP address: 256.0.0.1/32' )
-                       ],
-                       [
-                               '{"IPAddresses":"127.0.0.1/32"}',
-                               new InvalidArgumentException( 'IPAddresses is not an array' )
-                       ],
-                       [
-                               '{}',
-                               new InvalidArgumentException( 'Array is missing required keys: IPAddresses' )
-                       ],
-                       [
-                               '{"foo":"bar","bar":42}',
-                               new InvalidArgumentException( 'Array contains invalid keys: foo, bar' )
-                       ],
-                       [
-                               '{"IPAddresses":[]',
-                               new InvalidArgumentException( 'Invalid restrictions JSON' )
-                       ],
-                       [
-                               '"IPAddresses"',
-                               new InvalidArgumentException( 'Invalid restrictions JSON' )
-                       ],
-               ];
-       }
-
-       /**
-        * @covers MWRestrictions::checkIP
-        * @dataProvider provideCheckIP
-        * @param string $ip
-        * @param bool $pass
-        */
-       public function testCheckIP( $ip, $pass ) {
-               $this->assertSame( $pass, self::$restrictionsForChecks->checkIP( $ip ) );
-       }
-
-       public static function provideCheckIP() {
-               return [
-                       [ '10.0.0.1', true ],
-                       [ '172.16.0.0', true ],
-                       [ '192.0.2.1', false ],
-                       [ '2001:db8:1::', true ],
-                       [ '2001:0db8:0000:0000:0000:0000:0000:0000', true ],
-                       [ '2001:0DB8:8000::', false ],
-               ];
-       }
-
-       /**
-        * @covers MWRestrictions::check
-        * @dataProvider provideCheck
-        * @param WebRequest $request
-        * @param Status $expect
-        */
-       public function testCheck( $request, $expect ) {
-               $this->assertEquals( $expect, self::$restrictionsForChecks->check( $request ) );
-       }
-
-       public function provideCheck() {
-               $ret = [];
-
-               $mockBuilder = $this->getMockBuilder( FauxRequest::class )
-                       ->setMethods( [ 'getIP' ] );
-
-               foreach ( self::provideCheckIP() as $checkIP ) {
-                       $ok = [];
-                       $request = $mockBuilder->getMock();
-
-                       $request->expects( $this->any() )->method( 'getIP' )
-                               ->will( $this->returnValue( $checkIP[0] ) );
-                       $ok['ip'] = $checkIP[1];
-
-                       /* If we ever add more restrictions, add nested for loops here:
-                        *  foreach ( self::provideCheckFoo() as $checkFoo ) {
-                        *      $request->expects( $this->any() )->method( 'getFoo' )
-                        *          ->will( $this->returnValue( $checkFoo[0] );
-                        *      $ok['foo'] = $checkFoo[1];
-                        *
-                        *      foreach ( self::provideCheckBar() as $checkBar ) {
-                        *          $request->expects( $this->any() )->method( 'getBar' )
-                        *              ->will( $this->returnValue( $checkBar[0] );
-                        *          $ok['bar'] = $checkBar[1];
-                        *
-                        *          // etc.
-                        *      }
-                        *  }
-                        */
-
-                       $status = Status::newGood();
-                       $status->setResult( $ok === array_filter( $ok ), $ok );
-                       $ret[] = [ $request, $status ];
-               }
-
-               return $ret;
-       }
-}
diff --git a/tests/phpunit/languages/SpecialPageAliasTest.php b/tests/phpunit/languages/SpecialPageAliasTest.php
deleted file mode 100644 (file)
index cce9d0e..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-
-/**
- * Verifies that special page aliases are valid, with no slashes.
- *
- * @group Language
- * @group SpecialPageAliases
- * @group SystemTest
- * @group medium
- * @todo This should be a structure test
- *
- * @author Katie Filbert < aude.wiki@gmail.com >
- */
-class SpecialPageAliasTest extends \MediaWikiUnitTestCase {
-
-       /**
-        * @coversNothing
-        * @dataProvider validSpecialPageAliasesProvider
-        */
-       public function testValidSpecialPageAliases( $code, $specialPageAliases ) {
-               foreach ( $specialPageAliases as $specialPage => $aliases ) {
-                       foreach ( $aliases as $alias ) {
-                               $msg = "$specialPage alias '$alias' in $code is valid with no slashes";
-                               $this->assertRegExp( '/^[^\/]*$/', $msg );
-                       }
-               }
-       }
-
-       public function validSpecialPageAliasesProvider() {
-               $codes = array_keys( Language::fetchLanguageNames( null, 'mwfile' ) );
-
-               $data = [];
-
-               foreach ( $codes as $code ) {
-                       $specialPageAliases = $this->getSpecialPageAliases( $code );
-
-                       if ( $specialPageAliases !== [] ) {
-                               $data[] = [ $code, $specialPageAliases ];
-                       }
-               }
-
-               return $data;
-       }
-
-       /**
-        * @param string $code
-        *
-        * @return array
-        */
-       protected function getSpecialPageAliases( $code ) {
-               $file = Language::getMessagesFileName( $code );
-
-               if ( is_readable( $file ) ) {
-                       include $file;
-
-                       if ( isset( $specialPageAliases ) && $specialPageAliases !== null ) {
-                               return $specialPageAliases;
-                       }
-               }
-
-               return [];
-       }
-
-}
index 3fa31fe..1366119 100644 (file)
@@ -30,7 +30,7 @@ class SpecialPageFatalTest extends MediaWikiTestCase {
                $user = User::newFromName( 'UTSysop' );
 
                try {
-                       $executor->executeSpecialPage( $page, '', null, null, $user );
+                       $executor->executeSpecialPage( $page, '', null, 'qqx', $user );
                } catch ( \PHPUnit\Framework\Error\Deprecated $deprecated ) {
                        // Allow deprecation,
                        // this test want to check fatals or other things breaking the extension
diff --git a/tests/phpunit/unit/includes/DerivativeRequestTest.php b/tests/phpunit/unit/includes/DerivativeRequestTest.php
new file mode 100644 (file)
index 0000000..cad39fd
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+
+/**
+ * @covers DerivativeRequest
+ */
+class DerivativeRequestTest extends MediaWikiUnitTestCase {
+
+       public function testSetIp() {
+               $original = new WebRequest();
+               $original->setIP( '1.2.3.4' );
+               $derivative = new DerivativeRequest( $original, [] );
+
+               $this->assertEquals( '1.2.3.4', $derivative->getIP() );
+
+               $derivative->setIP( '5.6.7.8' );
+
+               $this->assertEquals( '5.6.7.8', $derivative->getIP() );
+               $this->assertEquals( '1.2.3.4', $original->getIP() );
+       }
+
+}
diff --git a/tests/phpunit/unit/includes/MediaWikiVersionFetcherTest.php b/tests/phpunit/unit/includes/MediaWikiVersionFetcherTest.php
deleted file mode 100644 (file)
index dfdbfa7..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-/**
- * Note: this is not a unit test, as it touches the file system and reads an actual file.
- * If unit tests are added for MediaWikiVersionFetcher, this should be done in a distinct test case.
- *
- * @covers MediaWikiVersionFetcher
- *
- * @group ComposerHooks
- *
- * @author Jeroen De Dauw < jeroendedauw@gmail.com >
- */
-class MediaWikiVersionFetcherTest extends \MediaWikiUnitTestCase {
-
-       public function testReturnsResult() {
-               global $wgVersion;
-               $versionFetcher = new MediaWikiVersionFetcher();
-               $this->assertSame( $wgVersion, $versionFetcher->fetchVersion() );
-       }
-
-}
diff --git a/tests/phpunit/unit/includes/Revision/RevisionStoreFactoryTest.php b/tests/phpunit/unit/includes/Revision/RevisionStoreFactoryTest.php
deleted file mode 100644 (file)
index 8e8fbd7..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-<?php
-
-namespace MediaWiki\Tests\Revision;
-
-use ActorMigration;
-use CommentStore;
-use MediaWiki\Logger\Spi as LoggerSpi;
-use MediaWiki\Revision\RevisionStore;
-use MediaWiki\Revision\RevisionStoreFactory;
-use MediaWiki\Revision\SlotRoleRegistry;
-use MediaWiki\Storage\BlobStore;
-use MediaWiki\Storage\BlobStoreFactory;
-use MediaWiki\Storage\NameTableStore;
-use MediaWiki\Storage\NameTableStoreFactory;
-use MediaWiki\Storage\SqlBlobStore;
-use Psr\Log\LoggerInterface;
-use Psr\Log\NullLogger;
-use WANObjectCache;
-use Wikimedia\Rdbms\ILBFactory;
-use Wikimedia\Rdbms\ILoadBalancer;
-use Wikimedia\TestingAccessWrapper;
-
-class RevisionStoreFactoryTest extends \MediaWikiUnitTestCase {
-
-       /**
-        * @covers \MediaWiki\Revision\RevisionStoreFactory::__construct
-        */
-       public function testValidConstruction_doesntCauseErrors() {
-               new RevisionStoreFactory(
-                       $this->getMockLoadBalancerFactory(),
-                       $this->getMockBlobStoreFactory(),
-                       $this->getNameTableStoreFactory(),
-                       $this->getMockSlotRoleRegistry(),
-                       $this->getHashWANObjectCache(),
-                       $this->getMockCommentStore(),
-                       ActorMigration::newMigration(),
-                       MIGRATION_OLD,
-                       $this->getMockLoggerSpi(),
-                       true
-               );
-               $this->assertTrue( true );
-       }
-
-       public function provideWikiIds() {
-               yield [ true ];
-               yield [ false ];
-               yield [ 'somewiki' ];
-               yield [ 'somewiki', MIGRATION_OLD , false ];
-               yield [ 'somewiki', MIGRATION_NEW , true ];
-       }
-
-       /**
-        * @dataProvider provideWikiIds
-        * @covers \MediaWiki\Revision\RevisionStoreFactory::getRevisionStore
-        */
-       public function testGetRevisionStore(
-               $dbDomain,
-               $mcrMigrationStage = MIGRATION_OLD,
-               $contentHandlerUseDb = true
-       ) {
-               $lbFactory = $this->getMockLoadBalancerFactory();
-               $blobStoreFactory = $this->getMockBlobStoreFactory();
-               $nameTableStoreFactory = $this->getNameTableStoreFactory();
-               $slotRoleRegistry = $this->getMockSlotRoleRegistry();
-               $cache = $this->getHashWANObjectCache();
-               $commentStore = $this->getMockCommentStore();
-               $actorMigration = ActorMigration::newMigration();
-               $loggerProvider = $this->getMockLoggerSpi();
-
-               $factory = new RevisionStoreFactory(
-                       $lbFactory,
-                       $blobStoreFactory,
-                       $nameTableStoreFactory,
-                       $slotRoleRegistry,
-                       $cache,
-                       $commentStore,
-                       $actorMigration,
-                       $mcrMigrationStage,
-                       $loggerProvider,
-                       $contentHandlerUseDb
-               );
-
-               $store = $factory->getRevisionStore( $dbDomain );
-               $wrapper = TestingAccessWrapper::newFromObject( $store );
-
-               // ensure the correct object type is returned
-               $this->assertInstanceOf( RevisionStore::class, $store );
-
-               // ensure the RevisionStore is for the given wikiId
-               $this->assertSame( $dbDomain, $wrapper->dbDomain );
-
-               // ensure all other required services are correctly set
-               $this->assertSame( $cache, $wrapper->cache );
-               $this->assertSame( $commentStore, $wrapper->commentStore );
-               $this->assertSame( $mcrMigrationStage, $wrapper->mcrMigrationStage );
-               $this->assertSame( $actorMigration, $wrapper->actorMigration );
-               $this->assertSame( $contentHandlerUseDb, $store->getContentHandlerUseDB() );
-
-               $this->assertInstanceOf( ILoadBalancer::class, $wrapper->loadBalancer );
-               $this->assertInstanceOf( BlobStore::class, $wrapper->blobStore );
-               $this->assertInstanceOf( NameTableStore::class, $wrapper->contentModelStore );
-               $this->assertInstanceOf( NameTableStore::class, $wrapper->slotRoleStore );
-               $this->assertInstanceOf( LoggerInterface::class, $wrapper->logger );
-       }
-
-       /**
-        * @return \PHPUnit_Framework_MockObject_MockObject|ILoadBalancer
-        */
-       private function getMockLoadBalancer() {
-               return $this->getMockBuilder( ILoadBalancer::class )
-                       ->disableOriginalConstructor()->getMock();
-       }
-
-       /**
-        * @return \PHPUnit_Framework_MockObject_MockObject|ILBFactory
-        */
-       private function getMockLoadBalancerFactory() {
-               $mock = $this->getMockBuilder( ILBFactory::class )
-                       ->disableOriginalConstructor()->getMock();
-
-               $mock->method( 'getMainLB' )
-                       ->willReturnCallback( function () {
-                               return $this->getMockLoadBalancer();
-                       } );
-
-               return $mock;
-       }
-
-       /**
-        * @return \PHPUnit_Framework_MockObject_MockObject|SqlBlobStore
-        */
-       private function getMockSqlBlobStore() {
-               return $this->getMockBuilder( SqlBlobStore::class )
-                       ->disableOriginalConstructor()->getMock();
-       }
-
-       /**
-        * @return \PHPUnit_Framework_MockObject_MockObject|BlobStoreFactory
-        */
-       private function getMockBlobStoreFactory() {
-               $mock = $this->getMockBuilder( BlobStoreFactory::class )
-                       ->disableOriginalConstructor()->getMock();
-
-               $mock->method( 'newSqlBlobStore' )
-                       ->willReturnCallback( function () {
-                               return $this->getMockSqlBlobStore();
-                       } );
-
-               return $mock;
-       }
-
-       /**
-        * @return SlotRoleRegistry
-        */
-       private function getMockSlotRoleRegistry() {
-               return $this->createMock( SlotRoleRegistry::class );
-       }
-
-       /**
-        * @return NameTableStoreFactory
-        */
-       private function getNameTableStoreFactory() {
-               return new NameTableStoreFactory(
-                       $this->getMockLoadBalancerFactory(),
-                       $this->getHashWANObjectCache(),
-                       new NullLogger() );
-       }
-
-       /**
-        * @return \PHPUnit_Framework_MockObject_MockObject|CommentStore
-        */
-       private function getMockCommentStore() {
-               return $this->getMockBuilder( CommentStore::class )
-                       ->disableOriginalConstructor()->getMock();
-       }
-
-       private function getHashWANObjectCache() {
-               return new WANObjectCache( [ 'cache' => new \HashBagOStuff() ] );
-       }
-
-       /**
-        * @return \PHPUnit_Framework_MockObject_MockObject|LoggerSpi
-        */
-       private function getMockLoggerSpi() {
-               $mock = $this->getMock( LoggerSpi::class );
-
-               $mock->method( 'getLogger' )
-                       ->willReturn( new NullLogger() );
-
-               return $mock;
-       }
-
-}
diff --git a/tests/phpunit/unit/includes/SanitizerValidateEmailTest.php b/tests/phpunit/unit/includes/SanitizerValidateEmailTest.php
new file mode 100644 (file)
index 0000000..2619472
--- /dev/null
@@ -0,0 +1,103 @@
+<?php
+
+/**
+ * @covers Sanitizer::validateEmail
+ * @todo all test methods in this class should be refactored and...
+ *    use a single test method and a single data provider...
+ */
+class SanitizerValidateEmailTest extends MediaWikiUnitTestCase {
+
+       private function checkEmail( $addr, $expected = true, $msg = '' ) {
+               if ( $msg == '' ) {
+                       $msg = "Testing $addr";
+               }
+
+               $this->assertEquals(
+                       $expected,
+                       Sanitizer::validateEmail( $addr ),
+                       $msg
+               );
+       }
+
+       private function valid( $addr, $msg = '' ) {
+               $this->checkEmail( $addr, true, $msg );
+       }
+
+       private function invalid( $addr, $msg = '' ) {
+               $this->checkEmail( $addr, false, $msg );
+       }
+
+       public function testEmailWellKnownUserAtHostDotTldAreValid() {
+               $this->valid( 'user@example.com' );
+               $this->valid( 'user@example.museum' );
+       }
+
+       public function testEmailWithUpperCaseCharactersAreValid() {
+               $this->valid( 'USER@example.com' );
+               $this->valid( 'user@EXAMPLE.COM' );
+               $this->valid( 'user@Example.com' );
+               $this->valid( 'USER@eXAMPLE.com' );
+       }
+
+       public function testEmailWithAPlusInUserName() {
+               $this->valid( 'user+sub@example.com' );
+               $this->valid( 'user+@example.com' );
+       }
+
+       public function testEmailDoesNotNeedATopLevelDomain() {
+               $this->valid( "user@localhost" );
+               $this->valid( "FooBar@localdomain" );
+               $this->valid( "nobody@mycompany" );
+       }
+
+       public function testEmailWithWhiteSpacesBeforeOrAfterAreInvalids() {
+               $this->invalid( " user@host.com" );
+               $this->invalid( "user@host.com " );
+               $this->invalid( "\tuser@host.com" );
+               $this->invalid( "user@host.com\t" );
+       }
+
+       public function testEmailWithWhiteSpacesAreInvalids() {
+               $this->invalid( "User user@host" );
+               $this->invalid( "first last@mycompany" );
+               $this->invalid( "firstlast@my company" );
+       }
+
+       /**
+        * T28948 : comma were matched by an incorrect regexp range
+        */
+       public function testEmailWithCommasAreInvalids() {
+               $this->invalid( "user,foo@example.org" );
+               $this->invalid( "userfoo@ex,ample.org" );
+       }
+
+       public function testEmailWithHyphens() {
+               $this->valid( "user-foo@example.org" );
+               $this->valid( "userfoo@ex-ample.org" );
+       }
+
+       public function testEmailDomainCanNotBeginWithDot() {
+               $this->invalid( "user@." );
+               $this->invalid( "user@.localdomain" );
+               $this->invalid( "user@localdomain." );
+               $this->valid( "user.@localdomain" );
+               $this->valid( ".@localdomain" );
+               $this->invalid( ".@a............" );
+       }
+
+       public function testEmailWithFunnyCharacters() {
+               $this->valid( "\$user!ex{this}@123.com" );
+       }
+
+       public function testEmailTopLevelDomainCanBeNumerical() {
+               $this->valid( "user@example.1234" );
+       }
+
+       public function testEmailWithoutAtSignIsInvalid() {
+               $this->invalid( 'useràexample.com' );
+       }
+
+       public function testEmailWithOneCharacterDomainIsValid() {
+               $this->valid( 'user@a' );
+       }
+}
diff --git a/tests/phpunit/unit/includes/XmlJsTest.php b/tests/phpunit/unit/includes/XmlJsTest.php
new file mode 100644 (file)
index 0000000..82f8531
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+
+/**
+ * @group Xml
+ */
+class XmlJsTest extends MediaWikiUnitTestCase {
+
+       /**
+        * @covers XmlJsCode::__construct
+        * @dataProvider provideConstruction
+        */
+       public function testConstruction( $value ) {
+               $obj = new XmlJsCode( $value );
+               $this->assertEquals( $value, $obj->value );
+       }
+
+       public static function provideConstruction() {
+               return [
+                       [ null ],
+                       [ '' ],
+               ];
+       }
+
+}
diff --git a/tests/phpunit/unit/includes/composer/ComposerVersionNormalizerTest.php b/tests/phpunit/unit/includes/composer/ComposerVersionNormalizerTest.php
new file mode 100644 (file)
index 0000000..614b468
--- /dev/null
@@ -0,0 +1,160 @@
+<?php
+
+/**
+ * @covers ComposerVersionNormalizer
+ *
+ * @group ComposerHooks
+ *
+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
+ */
+class ComposerVersionNormalizerTest extends MediaWikiUnitTestCase {
+
+       /**
+        * @dataProvider nonStringProvider
+        */
+       public function testGivenNonString_normalizeThrowsInvalidArgumentException( $nonString ) {
+               $normalizer = new ComposerVersionNormalizer();
+
+               $this->setExpectedException( InvalidArgumentException::class );
+               $normalizer->normalizeSuffix( $nonString );
+       }
+
+       public function nonStringProvider() {
+               return [
+                       [ null ],
+                       [ 42 ],
+                       [ [] ],
+                       [ new stdClass() ],
+                       [ true ],
+               ];
+       }
+
+       /**
+        * @dataProvider simpleVersionProvider
+        */
+       public function testGivenSimpleVersion_normalizeSuffixReturnsAsIs( $simpleVersion ) {
+               $this->assertRemainsUnchanged( $simpleVersion );
+       }
+
+       protected function assertRemainsUnchanged( $version ) {
+               $normalizer = new ComposerVersionNormalizer();
+
+               $this->assertEquals(
+                       $version,
+                       $normalizer->normalizeSuffix( $version )
+               );
+       }
+
+       public function simpleVersionProvider() {
+               return [
+                       [ '1.22.0' ],
+                       [ '1.19.2' ],
+                       [ '1.19.2.0' ],
+                       [ '1.9' ],
+                       [ '123.321.456.654' ],
+               ];
+       }
+
+       /**
+        * @dataProvider complexVersionProvider
+        */
+       public function testGivenComplexVersionWithoutDash_normalizeSuffixAddsDash(
+               $withoutDash, $withDash
+       ) {
+               $normalizer = new ComposerVersionNormalizer();
+
+               $this->assertEquals(
+                       $withDash,
+                       $normalizer->normalizeSuffix( $withoutDash )
+               );
+       }
+
+       public function complexVersionProvider() {
+               return [
+                       [ '1.22.0alpha', '1.22.0-alpha' ],
+                       [ '1.22.0RC', '1.22.0-RC' ],
+                       [ '1.19beta', '1.19-beta' ],
+                       [ '1.9RC4', '1.9-RC4' ],
+                       [ '1.9.1.2RC4', '1.9.1.2-RC4' ],
+                       [ '1.9.1.2RC', '1.9.1.2-RC' ],
+                       [ '123.321.456.654RC9001', '123.321.456.654-RC9001' ],
+               ];
+       }
+
+       /**
+        * @dataProvider complexVersionProvider
+        */
+       public function testGivenComplexVersionWithDash_normalizeSuffixReturnsAsIs(
+               $withoutDash, $withDash
+       ) {
+               $this->assertRemainsUnchanged( $withDash );
+       }
+
+       /**
+        * @dataProvider fourLevelVersionsProvider
+        */
+       public function testGivenFourLevels_levelCountNormalizationDoesNothing( $version ) {
+               $normalizer = new ComposerVersionNormalizer();
+
+               $this->assertEquals(
+                       $version,
+                       $normalizer->normalizeLevelCount( $version )
+               );
+       }
+
+       public function fourLevelVersionsProvider() {
+               return [
+                       [ '1.22.0.0' ],
+                       [ '1.19.2.4' ],
+                       [ '1.19.2.0' ],
+                       [ '1.9.0.1' ],
+                       [ '123.321.456.654' ],
+                       [ '123.321.456.654RC4' ],
+                       [ '123.321.456.654-RC4' ],
+               ];
+       }
+
+       /**
+        * @dataProvider levelNormalizationProvider
+        */
+       public function testGivenFewerLevels_levelCountNormalizationEnsuresFourLevels(
+               $expected, $version
+       ) {
+               $normalizer = new ComposerVersionNormalizer();
+
+               $this->assertEquals(
+                       $expected,
+                       $normalizer->normalizeLevelCount( $version )
+               );
+       }
+
+       public function levelNormalizationProvider() {
+               return [
+                       [ '1.22.0.0', '1.22' ],
+                       [ '1.22.0.0', '1.22.0' ],
+                       [ '1.19.2.0', '1.19.2' ],
+                       [ '12345.0.0.0', '12345' ],
+                       [ '12345.0.0.0-RC4', '12345-RC4' ],
+                       [ '12345.0.0.0-alpha', '12345-alpha' ],
+               ];
+       }
+
+       /**
+        * @dataProvider invalidVersionProvider
+        */
+       public function testGivenInvalidVersion_normalizeSuffixReturnsAsIs( $invalidVersion ) {
+               $this->assertRemainsUnchanged( $invalidVersion );
+       }
+
+       public function invalidVersionProvider() {
+               return [
+                       [ '1.221-a' ],
+                       [ '1.221-' ],
+                       [ '1.22rc4a' ],
+                       [ 'a1.22rc' ],
+                       [ '.1.22rc' ],
+                       [ 'a' ],
+                       [ 'alpha42' ],
+               ];
+       }
+}
diff --git a/tests/phpunit/unit/includes/config/ConfigFactoryTest.php b/tests/phpunit/unit/includes/config/ConfigFactoryTest.php
deleted file mode 100644 (file)
index a136018..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-<?php
-
-use MediaWiki\MediaWikiServices;
-
-class ConfigFactoryTest extends \MediaWikiUnitTestCase {
-
-       /**
-        * @covers ConfigFactory::register
-        */
-       public function testRegister() {
-               $factory = new ConfigFactory();
-               $factory->register( 'unittest', 'GlobalVarConfig::newInstance' );
-               $this->assertInstanceOf( GlobalVarConfig::class, $factory->makeConfig( 'unittest' ) );
-       }
-
-       /**
-        * @covers ConfigFactory::register
-        */
-       public function testRegisterInvalid() {
-               $factory = new ConfigFactory();
-               $this->setExpectedException( InvalidArgumentException::class );
-               $factory->register( 'invalid', 'Invalid callback' );
-       }
-
-       /**
-        * @covers ConfigFactory::register
-        */
-       public function testRegisterInvalidInstance() {
-               $factory = new ConfigFactory();
-               $this->setExpectedException( InvalidArgumentException::class );
-               $factory->register( 'invalidInstance', new stdClass );
-       }
-
-       /**
-        * @covers ConfigFactory::register
-        */
-       public function testRegisterInstance() {
-               $config = GlobalVarConfig::newInstance();
-               $factory = new ConfigFactory();
-               $factory->register( 'unittest', $config );
-               $this->assertSame( $config, $factory->makeConfig( 'unittest' ) );
-       }
-
-       /**
-        * @covers ConfigFactory::register
-        */
-       public function testRegisterAgain() {
-               $factory = new ConfigFactory();
-               $factory->register( 'unittest', 'GlobalVarConfig::newInstance' );
-               $config1 = $factory->makeConfig( 'unittest' );
-
-               $factory->register( 'unittest', 'GlobalVarConfig::newInstance' );
-               $config2 = $factory->makeConfig( 'unittest' );
-
-               $this->assertNotSame( $config1, $config2 );
-       }
-
-       /**
-        * @covers ConfigFactory::salvage
-        */
-       public function testSalvage() {
-               $oldFactory = new ConfigFactory();
-               $oldFactory->register( 'foo', 'GlobalVarConfig::newInstance' );
-               $oldFactory->register( 'bar', 'GlobalVarConfig::newInstance' );
-               $oldFactory->register( 'quux', 'GlobalVarConfig::newInstance' );
-
-               // instantiate two of the three defined configurations
-               $foo = $oldFactory->makeConfig( 'foo' );
-               $bar = $oldFactory->makeConfig( 'bar' );
-               $quux = $oldFactory->makeConfig( 'quux' );
-
-               // define new config instance
-               $newFactory = new ConfigFactory();
-               $newFactory->register( 'foo', 'GlobalVarConfig::newInstance' );
-               $newFactory->register( 'bar', function () {
-                       return new HashConfig();
-               } );
-
-               // "foo" and "quux" are defined in the old and the new factory.
-               // The old factory has instances for "foo" and "bar", but not "quux".
-               $newFactory->salvage( $oldFactory );
-
-               $newFoo = $newFactory->makeConfig( 'foo' );
-               $this->assertSame( $foo, $newFoo, 'existing instance should be salvaged' );
-
-               $newBar = $newFactory->makeConfig( 'bar' );
-               $this->assertNotSame( $bar, $newBar, 'don\'t salvage if callbacks differ' );
-
-               // the new factory doesn't have quux defined, so the quux instance should not be salvaged
-               $this->setExpectedException( ConfigException::class );
-               $newFactory->makeConfig( 'quux' );
-       }
-
-       /**
-        * @covers ConfigFactory::getConfigNames
-        */
-       public function testGetConfigNames() {
-               $factory = new ConfigFactory();
-               $factory->register( 'foo', 'GlobalVarConfig::newInstance' );
-               $factory->register( 'bar', new HashConfig() );
-
-               $this->assertEquals( [ 'foo', 'bar' ], $factory->getConfigNames() );
-       }
-
-       /**
-        * @covers ConfigFactory::makeConfig
-        */
-       public function testMakeConfigWithCallback() {
-               $factory = new ConfigFactory();
-               $factory->register( 'unittest', 'GlobalVarConfig::newInstance' );
-
-               $conf = $factory->makeConfig( 'unittest' );
-               $this->assertInstanceOf( Config::class, $conf );
-               $this->assertSame( $conf, $factory->makeConfig( 'unittest' ) );
-       }
-
-       /**
-        * @covers ConfigFactory::makeConfig
-        */
-       public function testMakeConfigWithObject() {
-               $factory = new ConfigFactory();
-               $conf = new HashConfig();
-               $factory->register( 'test', $conf );
-               $this->assertSame( $conf, $factory->makeConfig( 'test' ) );
-       }
-
-       /**
-        * @covers ConfigFactory::makeConfig
-        */
-       public function testMakeConfigFallback() {
-               $factory = new ConfigFactory();
-               $factory->register( '*', 'GlobalVarConfig::newInstance' );
-               $conf = $factory->makeConfig( 'unittest' );
-               $this->assertInstanceOf( Config::class, $conf );
-       }
-
-       /**
-        * @covers ConfigFactory::makeConfig
-        */
-       public function testMakeConfigWithNoBuilders() {
-               $factory = new ConfigFactory();
-               $this->setExpectedException( ConfigException::class );
-               $factory->makeConfig( 'nobuilderregistered' );
-       }
-
-       /**
-        * @covers ConfigFactory::makeConfig
-        */
-       public function testMakeConfigWithInvalidCallback() {
-               $factory = new ConfigFactory();
-               $factory->register( 'unittest', function () {
-                       return true; // Not a Config object
-               } );
-               $this->setExpectedException( UnexpectedValueException::class );
-               $factory->makeConfig( 'unittest' );
-       }
-
-       /**
-        * @covers ConfigFactory::getDefaultInstance
-        */
-       public function testGetDefaultInstance() {
-               // NOTE: the global config factory returned here has been overwritten
-               // for operation in test mode. It may not reflect LocalSettings.
-               $factory = MediaWikiServices::getInstance()->getConfigFactory();
-               $this->assertInstanceOf( Config::class, $factory->makeConfig( 'main' ) );
-       }
-
-}
diff --git a/tests/phpunit/unit/includes/config/EtcdConfigTest.php b/tests/phpunit/unit/includes/config/EtcdConfigTest.php
new file mode 100644 (file)
index 0000000..95bb0ec
--- /dev/null
@@ -0,0 +1,618 @@
+<?php
+
+use Wikimedia\TestingAccessWrapper;
+
+class EtcdConfigTest extends MediaWikiUnitTestCase {
+
+       private function createConfigMock( array $options = [] ) {
+               return $this->getMockBuilder( EtcdConfig::class )
+                       ->setConstructorArgs( [ $options + [
+                               'host' => 'etcd-tcp.example.net',
+                               'directory' => '/',
+                               'timeout' => 0.1,
+                       ] ] )
+                       ->setMethods( [ 'fetchAllFromEtcd' ] )
+                       ->getMock();
+       }
+
+       private static function createEtcdResponse( array $response ) {
+               $baseResponse = [
+                       'config' => null,
+                       'error' => null,
+                       'retry' => false,
+                       'modifiedIndex' => 0,
+               ];
+               return array_merge( $baseResponse, $response );
+       }
+
+       private function createSimpleConfigMock( array $config, $index = 0 ) {
+               $mock = $this->createConfigMock();
+               $mock->expects( $this->once() )->method( 'fetchAllFromEtcd' )
+                       ->willReturn( self::createEtcdResponse( [
+                               'config' => $config,
+                               'modifiedIndex' => $index,
+                       ] ) );
+               return $mock;
+       }
+
+       /**
+        * @covers EtcdConfig::has
+        */
+       public function testHasKnown() {
+               $config = $this->createSimpleConfigMock( [
+                       'known' => 'value'
+               ] );
+               $this->assertSame( true, $config->has( 'known' ) );
+       }
+
+       /**
+        * @covers EtcdConfig::__construct
+        * @covers EtcdConfig::get
+        */
+       public function testGetKnown() {
+               $config = $this->createSimpleConfigMock( [
+                       'known' => 'value'
+               ] );
+               $this->assertSame( 'value', $config->get( 'known' ) );
+       }
+
+       /**
+        * @covers EtcdConfig::has
+        */
+       public function testHasUnknown() {
+               $config = $this->createSimpleConfigMock( [
+                       'known' => 'value'
+               ] );
+               $this->assertSame( false, $config->has( 'unknown' ) );
+       }
+
+       /**
+        * @covers EtcdConfig::get
+        */
+       public function testGetUnknown() {
+               $config = $this->createSimpleConfigMock( [
+                       'known' => 'value'
+               ] );
+               $this->setExpectedException( ConfigException::class );
+               $config->get( 'unknown' );
+       }
+
+       /**
+        * @covers EtcdConfig::getModifiedIndex
+        */
+       public function testGetModifiedIndex() {
+               $config = $this->createSimpleConfigMock(
+                       [ 'some' => 'value' ],
+                       123
+               );
+               $this->assertSame( 123, $config->getModifiedIndex() );
+       }
+
+       /**
+        * @covers EtcdConfig::__construct
+        */
+       public function testConstructCacheObj() {
+               $cache = $this->getMockBuilder( HashBagOStuff::class )
+                       ->setMethods( [ 'get' ] )
+                       ->getMock();
+               $cache->expects( $this->once() )->method( 'get' )
+                       ->willReturn( [
+                               'config' => [ 'known' => 'from-cache' ],
+                               'expires' => INF,
+                               'modifiedIndex' => 123
+                       ] );
+               $config = $this->createConfigMock( [ 'cache' => $cache ] );
+
+               $this->assertSame( 'from-cache', $config->get( 'known' ) );
+       }
+
+       /**
+        * @covers EtcdConfig::__construct
+        */
+       public function testConstructCacheSpec() {
+               $config = $this->createConfigMock( [ 'cache' => [
+                       'class' => HashBagOStuff::class
+               ] ] );
+               $config->expects( $this->once() )->method( 'fetchAllFromEtcd' )
+                       ->willReturn( self::createEtcdResponse(
+                               [ 'config' => [ 'known' => 'from-fetch' ], ] ) );
+
+               $this->assertSame( 'from-fetch', $config->get( 'known' ) );
+       }
+
+       /**
+        * Test matrix
+        *
+        * - [x] Cache miss
+        *       Result: Fetched value
+        *       > cache miss | gets lock | backend succeeds
+        *
+        * - [x] Cache miss with backend error
+        *       Result: ConfigException
+        *       > cache miss | gets lock | backend error (no retry)
+        *
+        * - [x] Cache hit after retry
+        *       Result: Cached value (populated by process holding lock)
+        *       > cache miss | no lock | cache retry
+        *
+        * - [x] Cache hit
+        *       Result: Cached value
+        *       > cache hit
+        *
+        * - [x] Process cache hit
+        *       Result: Cached value
+        *       > process cache hit
+        *
+        * - [x] Cache expired
+        *       Result: Fetched value
+        *       > cache expired | gets lock | backend succeeds
+        *
+        * - [x] Cache expired with backend failure
+        *       Result: Cached value (stale)
+        *       > cache expired | gets lock | backend fails (allows retry)
+        *
+        * - [x] Cache expired and no lock
+        *       Result: Cached value (stale)
+        *       > cache expired | no lock
+        *
+        * Other notable scenarios:
+        *
+        * - [ ] Cache miss with backend retry
+        *       Result: Fetched value
+        *       > cache expired | gets lock | backend failure (allows retry)
+        */
+
+       /**
+        * @covers EtcdConfig::load
+        */
+       public function testLoadCacheMiss() {
+               // Create cache mock
+               $cache = $this->getMockBuilder( HashBagOStuff::class )
+                       ->setMethods( [ 'get', 'lock' ] )
+                       ->getMock();
+               // .. misses cache
+               $cache->expects( $this->once() )->method( 'get' )
+                       ->willReturn( false );
+               // .. gets lock
+               $cache->expects( $this->once() )->method( 'lock' )
+                       ->willReturn( true );
+
+               // Create config mock
+               $mock = $this->createConfigMock( [
+                       'cache' => $cache,
+               ] );
+               $mock->expects( $this->once() )->method( 'fetchAllFromEtcd' )
+                       ->willReturn(
+                               self::createEtcdResponse( [ 'config' => [ 'known' => 'from-fetch' ] ] ) );
+
+               $this->assertSame( 'from-fetch', $mock->get( 'known' ) );
+       }
+
+       /**
+        * @covers EtcdConfig::load
+        */
+       public function testLoadCacheMissBackendError() {
+               // Create cache mock
+               $cache = $this->getMockBuilder( HashBagOStuff::class )
+                       ->setMethods( [ 'get', 'lock' ] )
+                       ->getMock();
+               // .. misses cache
+               $cache->expects( $this->once() )->method( 'get' )
+                       ->willReturn( false );
+               // .. gets lock
+               $cache->expects( $this->once() )->method( 'lock' )
+                       ->willReturn( true );
+
+               // Create config mock
+               $mock = $this->createConfigMock( [
+                       'cache' => $cache,
+               ] );
+               $mock->expects( $this->once() )->method( 'fetchAllFromEtcd' )
+                       ->willReturn( self::createEtcdResponse( [ 'error' => 'Fake error', ] ) );
+
+               $this->setExpectedException( ConfigException::class );
+               $mock->get( 'key' );
+       }
+
+       /**
+        * @covers EtcdConfig::load
+        */
+       public function testLoadCacheMissWithoutLock() {
+               // Create cache mock
+               $cache = $this->getMockBuilder( HashBagOStuff::class )
+                       ->setMethods( [ 'get', 'lock' ] )
+                       ->getMock();
+               $cache->expects( $this->exactly( 2 ) )->method( 'get' )
+                       ->will( $this->onConsecutiveCalls(
+                               // .. misses cache first time
+                               false,
+                               // .. hits cache on retry
+                               [
+                                       'config' => [ 'known' => 'from-cache' ],
+                                       'expires' => INF,
+                                       'modifiedIndex' => 123
+                               ]
+                       ) );
+               // .. misses lock
+               $cache->expects( $this->once() )->method( 'lock' )
+                       ->willReturn( false );
+
+               // Create config mock
+               $mock = $this->createConfigMock( [
+                       'cache' => $cache,
+               ] );
+               $mock->expects( $this->never() )->method( 'fetchAllFromEtcd' );
+
+               $this->assertSame( 'from-cache', $mock->get( 'known' ) );
+       }
+
+       /**
+        * @covers EtcdConfig::load
+        */
+       public function testLoadCacheHit() {
+               // Create cache mock
+               $cache = $this->getMockBuilder( HashBagOStuff::class )
+                       ->setMethods( [ 'get', 'lock' ] )
+                       ->getMock();
+               $cache->expects( $this->once() )->method( 'get' )
+                       // .. hits cache
+                       ->willReturn( [
+                               'config' => [ 'known' => 'from-cache' ],
+                               'expires' => INF,
+                               'modifiedIndex' => 0,
+                       ] );
+               $cache->expects( $this->never() )->method( 'lock' );
+
+               // Create config mock
+               $mock = $this->createConfigMock( [
+                       'cache' => $cache,
+               ] );
+               $mock->expects( $this->never() )->method( 'fetchAllFromEtcd' );
+
+               $this->assertSame( 'from-cache', $mock->get( 'known' ) );
+       }
+
+       /**
+        * @covers EtcdConfig::load
+        */
+       public function testLoadProcessCacheHit() {
+               // Create cache mock
+               $cache = $this->getMockBuilder( HashBagOStuff::class )
+                       ->setMethods( [ 'get', 'lock' ] )
+                       ->getMock();
+               $cache->expects( $this->once() )->method( 'get' )
+                       // .. hits cache
+                       ->willReturn( [
+                               'config' => [ 'known' => 'from-cache' ],
+                               'expires' => INF,
+                               'modifiedIndex' => 0,
+                       ] );
+               $cache->expects( $this->never() )->method( 'lock' );
+
+               // Create config mock
+               $mock = $this->createConfigMock( [
+                       'cache' => $cache,
+               ] );
+               $mock->expects( $this->never() )->method( 'fetchAllFromEtcd' );
+
+               $this->assertSame( 'from-cache', $mock->get( 'known' ), 'Cache hit' );
+               $this->assertSame( 'from-cache', $mock->get( 'known' ), 'Process cache hit' );
+       }
+
+       /**
+        * @covers EtcdConfig::load
+        */
+       public function testLoadCacheExpiredLockFetchSucceeded() {
+               // Create cache mock
+               $cache = $this->getMockBuilder( HashBagOStuff::class )
+                       ->setMethods( [ 'get', 'lock' ] )
+                       ->getMock();
+               $cache->expects( $this->once() )->method( 'get' )->willReturn(
+                       // .. stale cache
+                       [
+                               'config' => [ 'known' => 'from-cache-expired' ],
+                               'expires' => -INF,
+                               'modifiedIndex' => 0,
+                       ]
+               );
+               // .. gets lock
+               $cache->expects( $this->once() )->method( 'lock' )
+                       ->willReturn( true );
+
+               // Create config mock
+               $mock = $this->createConfigMock( [
+                       'cache' => $cache,
+               ] );
+               $mock->expects( $this->once() )->method( 'fetchAllFromEtcd' )
+                       ->willReturn( self::createEtcdResponse( [ 'config' => [ 'known' => 'from-fetch' ] ] ) );
+
+               $this->assertSame( 'from-fetch', $mock->get( 'known' ) );
+       }
+
+       /**
+        * @covers EtcdConfig::load
+        */
+       public function testLoadCacheExpiredLockFetchFails() {
+               // Create cache mock
+               $cache = $this->getMockBuilder( HashBagOStuff::class )
+                       ->setMethods( [ 'get', 'lock' ] )
+                       ->getMock();
+               $cache->expects( $this->once() )->method( 'get' )->willReturn(
+                       // .. stale cache
+                       [
+                               'config' => [ 'known' => 'from-cache-expired' ],
+                               'expires' => -INF,
+                               'modifiedIndex' => 0,
+                       ]
+               );
+               // .. gets lock
+               $cache->expects( $this->once() )->method( 'lock' )
+                       ->willReturn( true );
+
+               // Create config mock
+               $mock = $this->createConfigMock( [
+                       'cache' => $cache,
+               ] );
+               $mock->expects( $this->once() )->method( 'fetchAllFromEtcd' )
+                       ->willReturn( self::createEtcdResponse( [ 'error' => 'Fake failure', 'retry' => true ] ) );
+
+               $this->assertSame( 'from-cache-expired', $mock->get( 'known' ) );
+       }
+
+       /**
+        * @covers EtcdConfig::load
+        */
+       public function testLoadCacheExpiredNoLock() {
+               // Create cache mock
+               $cache = $this->getMockBuilder( HashBagOStuff::class )
+                       ->setMethods( [ 'get', 'lock' ] )
+                       ->getMock();
+               $cache->expects( $this->once() )->method( 'get' )
+                       // .. hits cache (expired value)
+                       ->willReturn( [
+                               'config' => [ 'known' => 'from-cache-expired' ],
+                               'expires' => -INF,
+                               'modifiedIndex' => 0,
+                       ] );
+               // .. misses lock
+               $cache->expects( $this->once() )->method( 'lock' )
+                       ->willReturn( false );
+
+               // Create config mock
+               $mock = $this->createConfigMock( [
+                       'cache' => $cache,
+               ] );
+               $mock->expects( $this->never() )->method( 'fetchAllFromEtcd' );
+
+               $this->assertSame( 'from-cache-expired', $mock->get( 'known' ) );
+       }
+
+       public static function provideFetchFromServer() {
+               return [
+                       '200 OK - Success' => [
+                               'http' => [
+                                       'code' => 200,
+                                       'reason' => 'OK',
+                                       'headers' => [],
+                                       'body' => json_encode( [ 'node' => [ 'nodes' => [
+                                               [
+                                                       'key' => '/example/foo',
+                                                       'value' => json_encode( [ 'val' => true ] ),
+                                                       'modifiedIndex' => 123
+                                               ],
+                                       ] ] ] ),
+                                       'error' => '',
+                               ],
+                               'expect' => self::createEtcdResponse( [
+                                       'config' => [ 'foo' => true ], // data
+                                       'modifiedIndex' => 123
+                               ] ),
+                       ],
+                       '200 OK - Empty dir' => [
+                               'http' => [
+                                       'code' => 200,
+                                       'reason' => 'OK',
+                                       'headers' => [],
+                                       'body' => json_encode( [ 'node' => [ 'nodes' => [
+                                               [
+                                                       'key' => '/example/foo',
+                                                       'value' => json_encode( [ 'val' => true ] ),
+                                                       'modifiedIndex' => 123
+                                               ],
+                                               [
+                                                       'key' => '/example/sub',
+                                                       'dir' => true,
+                                                       'modifiedIndex' => 234,
+                                                       'nodes' => [],
+                                               ],
+                                               [
+                                                       'key' => '/example/bar',
+                                                       'value' => json_encode( [ 'val' => false ] ),
+                                                       'modifiedIndex' => 125
+                                               ],
+                                       ] ] ] ),
+                                       'error' => '',
+                               ],
+                               'expect' => self::createEtcdResponse( [
+                                       'config' => [ 'foo' => true, 'bar' => false ], // data
+                                       'modifiedIndex' => 125 // largest modified index
+                               ] ),
+                       ],
+                       '200 OK - Recursive' => [
+                               'http' => [
+                                       'code' => 200,
+                                       'reason' => 'OK',
+                                       'headers' => [],
+                                       'body' => json_encode( [ 'node' => [ 'nodes' => [
+                                               [
+                                                       'key' => '/example/a',
+                                                       'dir' => true,
+                                                       'modifiedIndex' => 124,
+                                                       'nodes' => [
+                                                               [
+                                                                       'key' => 'b',
+                                                                       'value' => json_encode( [ 'val' => true ] ),
+                                                                       'modifiedIndex' => 123,
+
+                                                               ],
+                                                               [
+                                                                       'key' => 'c',
+                                                                       'value' => json_encode( [ 'val' => false ] ),
+                                                                       'modifiedIndex' => 123,
+                                                               ],
+                                                       ],
+                                               ],
+                                       ] ] ] ),
+                                       'error' => '',
+                               ],
+                               'expect' => self::createEtcdResponse( [
+                                       'config' => [ 'a/b' => true, 'a/c' => false ], // data
+                                       'modifiedIndex' => 123 // largest modified index
+                               ] ),
+                       ],
+                       '200 OK - Missing nodes at second level' => [
+                               'http' => [
+                                       'code' => 200,
+                                       'reason' => 'OK',
+                                       'headers' => [],
+                                       'body' => json_encode( [ 'node' => [ 'nodes' => [
+                                               [
+                                                       'key' => '/example/a',
+                                                       'dir' => true,
+                                                       'modifiedIndex' => 0,
+                                               ],
+                                       ] ] ] ),
+                                       'error' => '',
+                               ],
+                               'expect' => self::createEtcdResponse( [
+                                       'error' => "Unexpected JSON response in dir 'a'; missing 'nodes' list.",
+                               ] ),
+                       ],
+                       '200 OK - Directory with non-array "nodes" key' => [
+                               'http' => [
+                                       'code' => 200,
+                                       'reason' => 'OK',
+                                       'headers' => [],
+                                       'body' => json_encode( [ 'node' => [ 'nodes' => [
+                                               [
+                                                       'key' => '/example/a',
+                                                       'dir' => true,
+                                                       'nodes' => 'not an array'
+                                               ],
+                                       ] ] ] ),
+                                       'error' => '',
+                               ],
+                               'expect' => self::createEtcdResponse( [
+                                       'error' => "Unexpected JSON response in dir 'a'; 'nodes' is not an array.",
+                               ] ),
+                       ],
+                       '200 OK - Correctly encoded garbage response' => [
+                               'http' => [
+                                       'code' => 200,
+                                       'reason' => 'OK',
+                                       'headers' => [],
+                                       'body' => json_encode( [ 'foo' => 'bar' ] ),
+                                       'error' => '',
+                               ],
+                               'expect' => self::createEtcdResponse( [
+                                       'error' => "Unexpected JSON response: Missing or invalid node at top level.",
+                               ] ),
+                       ],
+                       '200 OK - Bad value' => [
+                               'http' => [
+                                       'code' => 200,
+                                       'reason' => 'OK',
+                                       'headers' => [],
+                                       'body' => json_encode( [ 'node' => [ 'nodes' => [
+                                               [
+                                                       'key' => '/example/foo',
+                                                       'value' => ';"broken{value',
+                                                       'modifiedIndex' => 123,
+                                               ]
+                                       ] ] ] ),
+                                       'error' => '',
+                               ],
+                               'expect' => self::createEtcdResponse( [
+                                       'error' => "Failed to parse value for 'foo'.",
+                               ] ),
+                       ],
+                       '200 OK - Empty node list' => [
+                               'http' => [
+                                       'code' => 200,
+                                       'reason' => 'OK',
+                                       'headers' => [],
+                                       'body' => '{"node":{"nodes":[], "modifiedIndex": 12 }}',
+                                       'error' => '',
+                               ],
+                               'expect' => self::createEtcdResponse( [
+                                       'config' => [], // data
+                               ] ),
+                       ],
+                       '200 OK - Invalid JSON' => [
+                               'http' => [
+                                       'code' => 200,
+                                       'reason' => 'OK',
+                                       'headers' => [ 'content-length' => 0 ],
+                                       'body' => '',
+                                       'error' => '(curl error: no status set)',
+                               ],
+                               'expect' => self::createEtcdResponse( [
+                                       'error' => "Error unserializing JSON response.",
+                               ] ),
+                       ],
+                       '404 Not Found' => [
+                               'http' => [
+                                       'code' => 404,
+                                       'reason' => 'Not Found',
+                                       'headers' => [ 'content-length' => 0 ],
+                                       'body' => '',
+                                       'error' => '',
+                               ],
+                               'expect' => self::createEtcdResponse( [
+                                       'error' => 'HTTP 404 (Not Found)',
+                               ] ),
+                       ],
+                       '400 Bad Request - custom error' => [
+                               'http' => [
+                                       'code' => 400,
+                                       'reason' => 'Bad Request',
+                                       'headers' => [ 'content-length' => 0 ],
+                                       'body' => '',
+                                       'error' => 'No good reason',
+                               ],
+                               'expect' => self::createEtcdResponse( [
+                                       'error' => 'No good reason',
+                                       'retry' => true, // retry
+                               ] ),
+                       ],
+               ];
+       }
+
+       /**
+        * @covers EtcdConfig::fetchAllFromEtcdServer
+        * @covers EtcdConfig::unserialize
+        * @covers EtcdConfig::parseResponse
+        * @covers EtcdConfig::parseDirectory
+        * @covers EtcdConfigParseError
+        * @dataProvider provideFetchFromServer
+        */
+       public function testFetchFromServer( array $httpResponse, array $expected ) {
+               $http = $this->getMockBuilder( MultiHttpClient::class )
+                       ->disableOriginalConstructor()
+                       ->getMock();
+               $http->expects( $this->once() )->method( 'run' )
+                       ->willReturn( array_values( $httpResponse ) );
+
+               $conf = $this->getMockBuilder( EtcdConfig::class )
+                       ->disableOriginalConstructor()
+                       ->getMock();
+               // Access for protected member and method
+               $conf = TestingAccessWrapper::newFromObject( $conf );
+               $conf->http = $http;
+
+               $this->assertSame(
+                       $expected,
+                       $conf->fetchAllFromEtcdServer( 'etcd-tcp.example.net' )
+               );
+       }
+}
diff --git a/tests/phpunit/unit/includes/db/DatabaseOracleTest.php b/tests/phpunit/unit/includes/db/DatabaseOracleTest.php
new file mode 100644 (file)
index 0000000..ff1c3ca
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+
+class DatabaseOracleTest extends MediaWikiUnitTestCase {
+
+       /**
+        * @return PHPUnit_Framework_MockObject_MockObject|DatabaseOracle
+        */
+       private function getMockDb() {
+               return $this->getMockBuilder( DatabaseOracle::class )
+                       ->disableOriginalConstructor()
+                       ->setMethods( null )
+                       ->getMock();
+       }
+
+       public function provideBuildSubstring() {
+               yield [ 'someField', 1, 2, 'SUBSTR(someField,1,2)' ];
+               yield [ 'someField', 1, null, 'SUBSTR(someField,1)' ];
+       }
+
+       /**
+        * @covers DatabaseOracle::buildSubstring
+        * @dataProvider provideBuildSubstring
+        */
+       public function testBuildSubstring( $input, $start, $length, $expected ) {
+               $mockDb = $this->getMockDb();
+               $output = $mockDb->buildSubstring( $input, $start, $length );
+               $this->assertSame( $expected, $output );
+       }
+
+       public function provideBuildSubstring_invalidParams() {
+               yield [ -1, 1 ];
+               yield [ 1, -1 ];
+               yield [ 1, 'foo' ];
+               yield [ 'foo', 1 ];
+               yield [ null, 1 ];
+               yield [ 0, 1 ];
+       }
+
+       /**
+        * @covers DatabaseOracle::buildSubstring
+        * @dataProvider provideBuildSubstring_invalidParams
+        */
+       public function testBuildSubstring_invalidParams( $start, $length ) {
+               $mockDb = $this->getMockDb();
+               $this->setExpectedException( InvalidArgumentException::class );
+               $mockDb->buildSubstring( 'foo', $start, $length );
+       }
+
+}
diff --git a/tests/phpunit/unit/includes/debug/logger/monolog/LogstashFormatterTest.php b/tests/phpunit/unit/includes/debug/logger/monolog/LogstashFormatterTest.php
new file mode 100644 (file)
index 0000000..a2ed7f2
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+
+namespace MediaWiki\Logger\Monolog;
+
+class LogstashFormatterTest extends \MediaWikiUnitTestCase {
+       /**
+        * @dataProvider provideV1
+        * @covers MediaWiki\Logger\Monolog\LogstashFormatter::formatV1
+        * @param array $record The input record.
+        * @param array $expected Associative array of expected keys and their values.
+        * @param array $notExpected List of keys that should not exist.
+        */
+       public function testV1( array $record, array $expected, array $notExpected ) {
+               $formatter = new LogstashFormatter( 'app', 'system', null, null, LogstashFormatter::V1 );
+               $formatted = json_decode( $formatter->format( $record ), true );
+               foreach ( $expected as $key => $value ) {
+                       $this->assertArrayHasKey( $key, $formatted );
+                       $this->assertSame( $value, $formatted[$key] );
+               }
+               foreach ( $notExpected as $key ) {
+                       $this->assertArrayNotHasKey( $key, $formatted );
+               }
+       }
+
+       public function provideV1() {
+               return [
+                       [
+                               [ 'extra' => [ 'foo' => 1 ], 'context' => [ 'bar' => 2 ] ],
+                               [ 'foo' => 1, 'bar' => 2 ],
+                               [ 'logstash_formatter_key_conflict' ],
+                       ],
+                       [
+                               [ 'extra' => [ 'url' => 1 ], 'context' => [ 'url' => 2 ] ],
+                               [ 'url' => 1, 'c_url' => 2, 'logstash_formatter_key_conflict' => [ 'url' ] ],
+                               [],
+                       ],
+                       [
+                               [ 'channel' => 'x', 'context' => [ 'channel' => 'y' ] ],
+                               [ 'channel' => 'x', 'c_channel' => 'y',
+                                       'logstash_formatter_key_conflict' => [ 'channel' ] ],
+                               [],
+                       ],
+               ];
+       }
+
+       /**
+        * @covers MediaWiki\Logger\Monolog\LogstashFormatter::formatV1
+        */
+       public function testV1WithPrefix() {
+               $formatter = new LogstashFormatter( 'app', 'system', null, 'ctx_', LogstashFormatter::V1 );
+               $record = [ 'extra' => [ 'url' => 1 ], 'context' => [ 'url' => 2 ] ];
+               $formatted = json_decode( $formatter->format( $record ), true );
+               $this->assertArrayHasKey( 'url', $formatted );
+               $this->assertSame( 1, $formatted['url'] );
+               $this->assertArrayHasKey( 'ctx_url', $formatted );
+               $this->assertSame( 2, $formatted['ctx_url'] );
+               $this->assertArrayNotHasKey( 'c_url', $formatted );
+       }
+}
diff --git a/tests/phpunit/unit/includes/deferred/MWCallableUpdateTest.php b/tests/phpunit/unit/includes/deferred/MWCallableUpdateTest.php
new file mode 100644 (file)
index 0000000..20ffddb
--- /dev/null
@@ -0,0 +1,80 @@
+<?php
+
+/**
+ * @covers MWCallableUpdate
+ */
+class MWCallableUpdateTest extends MediaWikiUnitTestCase {
+
+       public function testDoUpdate() {
+               $ran = 0;
+               $update = new MWCallableUpdate( function () use ( &$ran ) {
+                       $ran++;
+               } );
+               $this->assertSame( 0, $ran );
+               $update->doUpdate();
+               $this->assertSame( 1, $ran );
+       }
+
+       public function testCancel() {
+               // Prepare update and DB
+               $db = new DatabaseTestHelper( __METHOD__ );
+               $db->begin( __METHOD__ );
+               $ran = 0;
+               $update = new MWCallableUpdate( function () use ( &$ran ) {
+                       $ran++;
+               }, __METHOD__, $db );
+
+               // Emulate rollback
+               $db->rollback( __METHOD__ );
+
+               $update->doUpdate();
+
+               // Ensure it was cancelled
+               $this->assertSame( 0, $ran );
+       }
+
+       public function testCancelSome() {
+               // Prepare update and DB
+               $db1 = new DatabaseTestHelper( __METHOD__ );
+               $db1->begin( __METHOD__ );
+               $db2 = new DatabaseTestHelper( __METHOD__ );
+               $db2->begin( __METHOD__ );
+               $ran = 0;
+               $update = new MWCallableUpdate( function () use ( &$ran ) {
+                       $ran++;
+               }, __METHOD__, [ $db1, $db2 ] );
+
+               // Emulate rollback
+               $db1->rollback( __METHOD__ );
+
+               $update->doUpdate();
+
+               // Prevents: "Notice: DB transaction writes or callbacks still pending"
+               $db2->rollback( __METHOD__ );
+
+               // Ensure it was cancelled
+               $this->assertSame( 0, $ran );
+       }
+
+       public function testCancelAll() {
+               // Prepare update and DB
+               $db1 = new DatabaseTestHelper( __METHOD__ );
+               $db1->begin( __METHOD__ );
+               $db2 = new DatabaseTestHelper( __METHOD__ );
+               $db2->begin( __METHOD__ );
+               $ran = 0;
+               $update = new MWCallableUpdate( function () use ( &$ran ) {
+                       $ran++;
+               }, __METHOD__, [ $db1, $db2 ] );
+
+               // Emulate rollbacks
+               $db1->rollback( __METHOD__ );
+               $db2->rollback( __METHOD__ );
+
+               $update->doUpdate();
+
+               // Ensure it was cancelled
+               $this->assertSame( 0, $ran );
+       }
+
+}
diff --git a/tests/phpunit/unit/includes/deferred/TransactionRoundDefiningUpdateTest.php b/tests/phpunit/unit/includes/deferred/TransactionRoundDefiningUpdateTest.php
new file mode 100644 (file)
index 0000000..c16c397
--- /dev/null
@@ -0,0 +1,17 @@
+<?php
+
+/**
+ * @covers TransactionRoundDefiningUpdate
+ */
+class TransactionRoundDefiningUpdateTest extends MediaWikiUnitTestCase {
+
+       public function testDoUpdate() {
+               $ran = 0;
+               $update = new TransactionRoundDefiningUpdate( function () use ( &$ran ) {
+                       $ran++;
+               } );
+               $this->assertSame( 0, $ran );
+               $update->doUpdate();
+               $this->assertSame( 1, $ran );
+       }
+}
diff --git a/tests/phpunit/unit/includes/libs/mime/MSCompoundFileReaderTest.php b/tests/phpunit/unit/includes/libs/mime/MSCompoundFileReaderTest.php
new file mode 100644 (file)
index 0000000..4509a61
--- /dev/null
@@ -0,0 +1,60 @@
+<?php
+/*
+ * Copyright 2019 Wikimedia Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed
+ * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+
+/**
+ * @group Media
+ * @covers MSCompoundFileReader
+ */
+class MSCompoundFileReaderTest extends PHPUnit\Framework\TestCase {
+       public static function provideValid() {
+               return [
+                       [ 'calc.xls', 'application/vnd.ms-excel' ],
+                       [ 'excel2016-compat97.xls', 'application/vnd.ms-excel' ],
+                       [ 'gnumeric.xls', 'application/vnd.ms-excel' ],
+                       [ 'impress.ppt', 'application/vnd.ms-powerpoint' ],
+                       [ 'powerpoint2016-compat97.ppt', 'application/vnd.ms-powerpoint' ],
+                       [ 'word2016-compat97.doc', 'application/msword' ],
+                       [ 'writer.doc', 'application/msword' ],
+               ];
+       }
+
+       /** @dataProvider provideValid */
+       public function testReadFile( $fileName, $expectedMime ) {
+               global $IP;
+
+               $info = MSCompoundFileReader::readFile( "$IP/tests/phpunit/data/MSCompoundFileReader/$fileName" );
+               $this->assertTrue( $info['valid'] );
+               $this->assertSame( $expectedMime, $info['mime'] );
+       }
+
+       public static function provideInvalid() {
+               return [
+                       [ 'dir-beyond-end.xls', 'ERROR_READ_PAST_END' ],
+                       [ 'fat-loop.xls', 'ERROR_INVALID_FORMAT' ],
+                       [ 'invalid-signature.xls', 'ERROR_INVALID_SIGNATURE' ],
+               ];
+       }
+
+       /** @dataProvider provideInvalid */
+       public function testReadFileInvalid( $fileName, $expectedError ) {
+               global $IP;
+
+               $info = MSCompoundFileReader::readFile( "$IP/tests/phpunit/data/MSCompoundFileReader/$fileName" );
+               $this->assertFalse( $info['valid'] );
+               $this->assertSame( constant( MSCompoundFileReader::class . '::' . $expectedError ),
+                       $info['errorCode'] );
+       }
+}
diff --git a/tests/phpunit/unit/includes/media/SVGMetadataExtractorTest.php b/tests/phpunit/unit/includes/media/SVGMetadataExtractorTest.php
deleted file mode 100644 (file)
index 30d1008..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-<?php
-
-/**
- * @group Media
- * @covers SVGMetadataExtractor
- */
-class SVGMetadataExtractorTest extends \MediaWikiUnitTestCase {
-
-       /**
-        * @dataProvider provideSvgFiles
-        */
-       public function testGetMetadata( $infile, $expected ) {
-               $this->assertMetadata( $infile, $expected );
-       }
-
-       /**
-        * @dataProvider provideSvgFilesWithXMLMetadata
-        */
-       public function testGetXMLMetadata( $infile, $expected ) {
-               $r = new XMLReader();
-               $this->assertMetadata( $infile, $expected );
-       }
-
-       /**
-        * @dataProvider provideSvgUnits
-        */
-       public function testScaleSVGUnit( $inUnit, $expected ) {
-               $this->assertEquals(
-                       $expected,
-                       SVGReader::scaleSVGUnit( $inUnit ),
-                       'SVG unit conversion and scaling failure'
-               );
-       }
-
-       function assertMetadata( $infile, $expected ) {
-               try {
-                       $data = SVGMetadataExtractor::getMetadata( $infile );
-                       $this->assertEquals( $expected, $data, 'SVG metadata extraction test' );
-               } catch ( MWException $e ) {
-                       if ( $expected === false ) {
-                               $this->assertTrue( true, 'SVG metadata extracted test (expected failure)' );
-                       } else {
-                               throw $e;
-                       }
-               }
-       }
-
-       public static function provideSvgFiles() {
-               $base = __DIR__ . '/../../../data/media';
-
-               return [
-                       [
-                               "$base/Wikimedia-logo.svg",
-                               [
-                                       'width' => 1024,
-                                       'height' => 1024,
-                                       'originalWidth' => '1024',
-                                       'originalHeight' => '1024',
-                                       'translations' => [],
-                               ]
-                       ],
-                       [
-                               "$base/QA_icon.svg",
-                               [
-                                       'width' => 60,
-                                       'height' => 60,
-                                       'originalWidth' => '60',
-                                       'originalHeight' => '60',
-                                       'translations' => [],
-                               ]
-                       ],
-                       [
-                               "$base/Gtk-media-play-ltr.svg",
-                               [
-                                       'width' => 60,
-                                       'height' => 60,
-                                       'originalWidth' => '60.0000000',
-                                       'originalHeight' => '60.0000000',
-                                       'translations' => [],
-                               ]
-                       ],
-                       [
-                               "$base/Toll_Texas_1.svg",
-                               // This file triggered T33719, needs entity expansion in the xmlns checks
-                               [
-                                       'width' => 385,
-                                       'height' => 385,
-                                       'originalWidth' => '385',
-                                       'originalHeight' => '385.0004883',
-                                       'translations' => [],
-                               ]
-                       ],
-                       [
-                               "$base/Tux.svg",
-                               [
-                                       'width' => 512,
-                                       'height' => 594,
-                                       'originalWidth' => '100%',
-                                       'originalHeight' => '100%',
-                                       'title' => 'Tux',
-                                       'translations' => [],
-                                       'description' => 'For more information see: http://commons.wikimedia.org/wiki/Image:Tux.svg',
-                               ]
-                       ],
-                       [
-                               "$base/Speech_bubbles.svg",
-                               [
-                                       'width' => 627,
-                                       'height' => 461,
-                                       'originalWidth' => '17.7cm',
-                                       'originalHeight' => '13cm',
-                                       'translations' => [
-                                               'de' => SVGReader::LANG_FULL_MATCH,
-                                               'fr' => SVGReader::LANG_FULL_MATCH,
-                                               'nl' => SVGReader::LANG_FULL_MATCH,
-                                               'tlh-ca' => SVGReader::LANG_FULL_MATCH,
-                                               'tlh' => SVGReader::LANG_PREFIX_MATCH
-                                       ],
-                               ]
-                       ],
-                       [
-                               "$base/Soccer_ball_animated.svg",
-                               [
-                                       'width' => 150,
-                                       'height' => 150,
-                                       'originalWidth' => '150',
-                                       'originalHeight' => '150',
-                                       'animated' => true,
-                                       'translations' => []
-                               ],
-                       ],
-                       [
-                               "$base/comma_separated_viewbox.svg",
-                               [
-                                       'width' => 512,
-                                       'height' => 594,
-                                       'originalWidth' => '100%',
-                                       'originalHeight' => '100%',
-                                       'translations' => []
-                               ],
-                       ],
-               ];
-       }
-
-       public static function provideSvgFilesWithXMLMetadata() {
-               $base = __DIR__ . '/../../../data/media';
-               // phpcs:disable Generic.Files.LineLength
-               $metadata = '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
-      <ns4:Work xmlns:ns4="http://creativecommons.org/ns#" rdf:about="">
-        <ns5:format xmlns:ns5="http://purl.org/dc/elements/1.1/">image/svg+xml</ns5:format>
-        <ns5:type xmlns:ns5="http://purl.org/dc/elements/1.1/" rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
-      </ns4:Work>
-    </rdf:RDF>';
-               // phpcs:enable
-
-               $metadata = str_replace( "\r", '', $metadata ); // Windows compat
-               return [
-                       [
-                               "$base/US_states_by_total_state_tax_revenue.svg",
-                               [
-                                       'height' => 593,
-                                       'metadata' => $metadata,
-                                       'width' => 959,
-                                       'originalWidth' => '958.69',
-                                       'originalHeight' => '592.78998',
-                                       'translations' => [],
-                               ]
-                       ],
-               ];
-       }
-
-       public static function provideSvgUnits() {
-               return [
-                       [ '1' , 1 ],
-                       [ '1.1' , 1.1 ],
-                       [ '0.1' , 0.1 ],
-                       [ '.1' , 0.1 ],
-                       [ '1e2' , 100 ],
-                       [ '1E2' , 100 ],
-                       [ '+1' , 1 ],
-                       [ '-1' , -1 ],
-                       [ '-1.1' , -1.1 ],
-                       [ '1e+2' , 100 ],
-                       [ '1e-2' , 0.01 ],
-                       [ '10px' , 10 ],
-                       [ '10pt' , 10 * 1.25 ],
-                       [ '10pc' , 10 * 15 ],
-                       [ '10mm' , 10 * 3.543307 ],
-                       [ '10cm' , 10 * 35.43307 ],
-                       [ '10in' , 10 * 90 ],
-                       [ '10em' , 10 * 16 ],
-                       [ '10ex' , 10 * 12 ],
-                       [ '10%' , 51.2 ],
-                       [ '10 px' , 10 ],
-                       // Invalid values
-                       [ '1e1.1', 10 ],
-                       [ '10bp', 10 ],
-                       [ 'p10', null ],
-               ];
-       }
-}
diff --git a/tests/phpunit/unit/includes/objectcache/RedisBagOStuffTest.php b/tests/phpunit/unit/includes/objectcache/RedisBagOStuffTest.php
new file mode 100644 (file)
index 0000000..e35e373
--- /dev/null
@@ -0,0 +1,108 @@
+<?php
+
+use Wikimedia\TestingAccessWrapper;
+
+/**
+ * @group BagOStuff
+ */
+class RedisBagOStuffTest extends MediaWikiUnitTestCase {
+
+       /** @var RedisBagOStuff */
+       private $cache;
+
+       protected function setUp() {
+               parent::setUp();
+               $cache = $this->getMockBuilder( RedisBagOStuff::class )
+                       ->disableOriginalConstructor()
+                       ->getMock();
+               $this->cache = TestingAccessWrapper::newFromObject( $cache );
+       }
+
+       /**
+        * @covers RedisBagOStuff::unserialize
+        * @dataProvider unserializeProvider
+        */
+       public function testUnserialize( $expected, $input, $message ) {
+               $actual = $this->cache->unserialize( $input );
+               $this->assertSame( $expected, $actual, $message );
+       }
+
+       public function unserializeProvider() {
+               return [
+                       [
+                               -1,
+                               '-1',
+                               'String representation of \'-1\'',
+                       ],
+                       [
+                               0,
+                               '0',
+                               'String representation of \'0\'',
+                       ],
+                       [
+                               1,
+                               '1',
+                               'String representation of \'1\'',
+                       ],
+                       [
+                               -1.0,
+                               'd:-1;',
+                               'Serialized negative double',
+                       ],
+                       [
+                               'foo',
+                               's:3:"foo";',
+                               'Serialized string',
+                       ]
+               ];
+       }
+
+       /**
+        * @covers RedisBagOStuff::serialize
+        * @dataProvider serializeProvider
+        */
+       public function testSerialize( $expected, $input, $message ) {
+               $actual = $this->cache->serialize( $input );
+               $this->assertSame( $expected, $actual, $message );
+       }
+
+       public function serializeProvider() {
+               return [
+                       [
+                               -1,
+                               -1,
+                               '-1 as integer',
+                       ],
+                       [
+                               0,
+                               0,
+                               '0 as integer',
+                       ],
+                       [
+                               1,
+                               1,
+                               '1 as integer',
+                       ],
+                       [
+                               'd:-1;',
+                               -1.0,
+                               'Negative double',
+                       ],
+                       [
+                               's:3:"2.1";',
+                               '2.1',
+                               'Decimal string',
+                       ],
+                       [
+                               's:1:"1";',
+                               '1',
+                               'String representation of 1',
+                       ],
+                       [
+                               's:3:"foo";',
+                               'foo',
+                               'String',
+                       ],
+               ];
+       }
+}
index 71e4fff..0436e19 100644 (file)
@@ -274,30 +274,6 @@ class SanitizerUnitTest extends MediaWikiUnitTestCase {
                ];
        }
 
-       /**
-        * Test escapeIdReferenceList for consistency with escapeIdForAttribute
-        *
-        * @dataProvider provideEscapeIdReferenceList
-        * @covers Sanitizer::escapeIdReferenceList
-        */
-       public function testEscapeIdReferenceList( $referenceList, $id1, $id2 ) {
-               $this->assertEquals(
-                       Sanitizer::escapeIdReferenceList( $referenceList ),
-                       Sanitizer::escapeIdForAttribute( $id1 )
-                               . ' '
-                               . Sanitizer::escapeIdForAttribute( $id2 )
-               );
-       }
-
-       public static function provideEscapeIdReferenceList() {
-               /** [ <reference list>, <individual id 1>, <individual id 2> ] */
-               return [
-                       [ 'foo bar', 'foo', 'bar' ],
-                       [ '#1 #2', '#1', '#2' ],
-                       [ '+1 +2', '+1', '+2' ],
-               ];
-       }
-
        /**
         * @dataProvider provideIsReservedDataAttribute
         * @covers Sanitizer::isReservedDataAttribute
diff --git a/tests/phpunit/unit/includes/registration/VersionCheckerTest.php b/tests/phpunit/unit/includes/registration/VersionCheckerTest.php
new file mode 100644 (file)
index 0000000..8b6a963
--- /dev/null
@@ -0,0 +1,476 @@
+<?php
+
+/**
+ * @covers VersionChecker
+ */
+class VersionCheckerTest extends MediaWikiUnitTestCase {
+
+       /**
+        * @dataProvider provideMediaWikiCheck
+        */
+       public function testMediaWikiCheck( $coreVersion, $constraint, $expected ) {
+               $checker = new VersionChecker( $coreVersion, '7.0.0', [] );
+               $this->assertEquals( $expected, !(bool)$checker->checkArray( [
+                       'FakeExtension' => [
+                               'MediaWiki' => $constraint,
+                       ],
+               ] ) );
+       }
+
+       public static function provideMediaWikiCheck() {
+               return [
+                       // [ $wgVersion, constraint, expected ]
+                       [ '1.25alpha', '>= 1.26', false ],
+                       [ '1.25.0', '>= 1.26', false ],
+                       [ '1.26alpha', '>= 1.26', true ],
+                       [ '1.26alpha', '>= 1.26.0', true ],
+                       [ '1.26alpha', '>= 1.26.0-stable', false ],
+                       [ '1.26.0', '>= 1.26.0-stable', true ],
+                       [ '1.26.1', '>= 1.26.0-stable', true ],
+                       [ '1.27.1', '>= 1.26.0-stable', true ],
+                       [ '1.26alpha', '>= 1.26.1', false ],
+                       [ '1.26alpha', '>= 1.26alpha', true ],
+                       [ '1.26alpha', '>= 1.25', true ],
+                       [ '1.26.0-alpha.14', '>= 1.26.0-alpha.15', false ],
+                       [ '1.26.0-alpha.14', '>= 1.26.0-alpha.10', true ],
+                       [ '1.26.1', '>= 1.26.2, <=1.26.0', false ],
+                       [ '1.26.1', '^1.26.2', false ],
+                       // Accept anything for un-parsable version strings
+                       [ '1.26mwf14', '== 1.25alpha', true ],
+                       [ 'totallyinvalid', '== 1.0', true ],
+               ];
+       }
+
+       /**
+        * @dataProvider providePhpValidCheck
+        */
+       public function testPhpValidCheck( $phpVersion, $constraint, $expected ) {
+               $checker = new VersionChecker( '1.0.0', $phpVersion, [] );
+               $this->assertEquals( $expected, !(bool)$checker->checkArray( [
+                       'FakeExtension' => [
+                               'platform' => [
+                                       'php' => $constraint,
+                               ],
+                       ],
+               ] ) );
+       }
+
+       public static function providePhpValidCheck() {
+               return [
+                       // [ phpVersion, constraint, expected ]
+                       [ '7.0.23', '>= 7.0.0', true ],
+                       [ '7.0.23', '^7.1.0', false ],
+                       [ '7.0.23', '7.0.23', true ],
+               ];
+       }
+
+       /**
+        * @expectedException UnexpectedValueException
+        */
+       public function testPhpInvalidConstraint() {
+               $checker = new VersionChecker( '1.0.0', '7.0.0', [] );
+               $checker->checkArray( [
+                       'FakeExtension' => [
+                               'platform' => [
+                                       'php' => 'totallyinvalid',
+                               ],
+                       ],
+               ] );
+       }
+
+       /**
+        * @dataProvider providePhpInvalidVersion
+        * @expectedException UnexpectedValueException
+        */
+       public function testPhpInvalidVersion( $phpVersion ) {
+                $checker = new VersionChecker( '1.0.0', $phpVersion, [] );
+       }
+
+       public static function providePhpInvalidVersion() {
+               return [
+                       // [ phpVersion ]
+                       [ '7.abc' ],
+                       [ '5.a.x' ],
+               ];
+       }
+
+       /**
+        * @dataProvider provideType
+        */
+       public function testType( $given, $expected ) {
+               $checker = new VersionChecker(
+                       '1.0.0',
+                       '7.0.0',
+                       [ 'phpLoadedExtension' ],
+                       [
+                               'presentAbility' => true,
+                               'presentAbilityWithMessage' => true,
+                               'missingAbility' => false,
+                               'missingAbilityWithMessage' => false,
+                       ],
+                       [
+                               'presentAbilityWithMessage' => 'Present.',
+                               'missingAbilityWithMessage' => 'Missing.',
+                       ]
+               );
+               $checker->setLoadedExtensionsAndSkins( [
+                               'FakeDependency' => [
+                                       'version' => '1.0.0',
+                               ],
+                               'NoVersionGiven' => [],
+                       ] );
+               $this->assertEquals( $expected, $checker->checkArray( [
+                       'FakeExtension' => $given,
+               ] ) );
+       }
+
+       public static function provideType() {
+               return [
+                       // valid type
+                       [
+                               [
+                                       'extensions' => [
+                                               'FakeDependency' => '1.0.0',
+                                       ],
+                               ],
+                               [],
+                       ],
+                       [
+                               [
+                                       'MediaWiki' => '1.0.0',
+                               ],
+                               [],
+                       ],
+                       [
+                               [
+                                       'extensions' => [
+                                               'NoVersionGiven' => '*',
+                                       ],
+                               ],
+                               [],
+                       ],
+                       [
+                               [
+                                       'extensions' => [
+                                               'NoVersionGiven' => '1.0',
+                                       ],
+                               ],
+                               [
+                                       [
+                                               'incompatible' => 'FakeExtension',
+                                               'type' => 'incompatible-extensions',
+                                               'msg' => 'NoVersionGiven does not expose its version, but FakeExtension requires: 1.0.',
+                                       ],
+                               ],
+                       ],
+                       [
+                               [
+                                       'extensions' => [
+                                               'Missing' => '*',
+                                       ],
+                               ],
+                               [
+                                       [
+                                               'missing' => 'Missing',
+                                               'type' => 'missing-extensions',
+                                               'msg' => 'FakeExtension requires Missing to be installed.',
+                                       ],
+                               ],
+                       ],
+                       [
+                               [
+                                       'extensions' => [
+                                               'FakeDependency' => '2.0.0',
+                                       ],
+                               ],
+                               [
+                                       [
+                                               'incompatible' => 'FakeExtension',
+                                               'type' => 'incompatible-extensions',
+                                               // phpcs:ignore Generic.Files.LineLength.TooLong
+                                               'msg' => 'FakeExtension is not compatible with the current installed version of FakeDependency (1.0.0), it requires: 2.0.0.',
+                                       ],
+                               ],
+                       ],
+                       [
+                               [
+                                       'skins' => [
+                                               'FakeSkin' => '*',
+                                       ],
+                               ],
+                               [
+                                       [
+                                               'missing' => 'FakeSkin',
+                                               'type' => 'missing-skins',
+                                               'msg' => 'FakeExtension requires FakeSkin to be installed.',
+                                       ],
+                               ],
+                       ],
+                       [
+                               [
+                                       'platform' => [
+                                               'ext-phpLoadedExtension' => '*',
+                                       ],
+                               ],
+                               [],
+                       ],
+                       [
+                               [
+                                       'platform' => [
+                                               'ext-phpMissingExtension' => '*',
+                                       ],
+                               ],
+                               [
+                                       [
+                                               'missing' => 'phpMissingExtension',
+                                               'type' => 'missing-phpExtension',
+                                               // phpcs:ignore Generic.Files.LineLength.TooLong
+                                               'msg' => 'FakeExtension requires phpMissingExtension PHP extension to be installed.',
+                                       ],
+                               ],
+                       ],
+                       [
+                               [
+                                       'platform' => [
+                                               'ability-presentAbility' => true,
+                                       ],
+                               ],
+                               [],
+                       ],
+                       [
+                               [
+                                       'platform' => [
+                                               'ability-presentAbilityWithMessage' => true,
+                                       ],
+                               ],
+                               [],
+                       ],
+                       [
+                               [
+                                       'platform' => [
+                                               'ability-presentAbility' => false,
+                                       ],
+                               ],
+                               [],
+                       ],
+                       [
+                               [
+                                       'platform' => [
+                                               'ability-presentAbilityWithMessage' => false,
+                                       ],
+                               ],
+                               [],
+                       ],
+                       [
+                               [
+                                       'platform' => [
+                                               'ability-missingAbility' => true,
+                                       ],
+                               ],
+                               [
+                                       [
+                                               'missing' => 'missingAbility',
+                                               'type' => 'missing-ability',
+                                               'msg' => 'FakeExtension requires "missingAbility" ability',
+                                       ],
+                               ],
+                       ],
+                       [
+                               [
+                                       'platform' => [
+                                               'ability-missingAbilityWithMessage' => true,
+                                       ],
+                               ],
+                               [
+                                       [
+                                               'missing' => 'missingAbilityWithMessage',
+                                               'type' => 'missing-ability',
+                                               // phpcs:ignore Generic.Files.LineLength.TooLong
+                                               'msg' => 'FakeExtension requires "missingAbilityWithMessage" ability: Missing.',
+                                       ],
+                               ],
+                       ],
+                       [
+                               [
+                                       'platform' => [
+                                               'ability-missingAbility' => false,
+                                       ],
+                               ],
+                               [],
+                       ],
+                       [
+                               [
+                                       'platform' => [
+                                               'ability-missingAbilityWithMessage' => false,
+                                       ],
+                               ],
+                               [],
+                       ],
+               ];
+       }
+
+       /**
+        * Check, if a non-parsable version constraint does not throw an exception or
+        * returns any error message.
+        */
+       public function testInvalidConstraint() {
+               $checker = new VersionChecker( '1.0.0', '7.0.0', [] );
+               $checker->setLoadedExtensionsAndSkins( [
+                               'FakeDependency' => [
+                                       'version' => 'not really valid',
+                               ],
+                       ] );
+               $this->assertEquals( [
+                       [
+                               'type' => 'invalid-version',
+                               'msg' => "FakeDependency does not have a valid version string.",
+                       ],
+               ], $checker->checkArray( [
+                       'FakeExtension' => [
+                               'extensions' => [
+                                       'FakeDependency' => '1.24.3',
+                               ],
+                       ],
+               ] ) );
+
+               $checker = new VersionChecker( '1.0.0', '7.0.0', [] );
+               $checker->setLoadedExtensionsAndSkins( [
+                               'FakeDependency' => [
+                                       'version' => '1.24.3',
+                               ],
+                       ] );
+
+               $this->setExpectedException( UnexpectedValueException::class );
+               $checker->checkArray( [
+                       'FakeExtension' => [
+                               'FakeDependency' => 'not really valid',
+                       ],
+               ] );
+       }
+
+       public function provideInvalidDependency() {
+               return [
+                       [
+                               [
+                                       'FakeExtension' => [
+                                               'platform' => [
+                                                       'undefinedPlatformDependency' => '*',
+                                               ],
+                                       ],
+                               ],
+                               'undefinedPlatformDependency',
+                       ],
+                       [
+                               [
+                                       'FakeExtension' => [
+                                               'platform' => [
+                                                       'phpLoadedExtension' => '*',
+                                               ],
+                                       ],
+                               ],
+                               'phpLoadedExtension',
+                       ],
+                       [
+                               [
+                                       'FakeExtension' => [
+                                               'platform' => [
+                                                       'ability-invalidAbility' => true,
+                                               ],
+                                       ],
+                               ],
+                               'ability-invalidAbility',
+                       ],
+                       [
+                               [
+                                       'FakeExtension' => [
+                                               'platform' => [
+                                                       'presentAbility' => true,
+                                               ],
+                                       ],
+                               ],
+                               'presentAbility',
+                       ],
+                       [
+                               [
+                                       'FakeExtension' => [
+                                               'undefinedDependencyType' => '*',
+                                       ],
+                               ],
+                               'undefinedDependencyType',
+                       ],
+                       // T197478
+                       [
+                               [
+                                       'FakeExtension' => [
+                                               'skin' => [
+                                                       'FakeSkin' => '*',
+                                               ],
+                                       ],
+                               ],
+                               'skin',
+                       ],
+               ];
+       }
+
+       /**
+        * @dataProvider provideInvalidDependency
+        */
+       public function testInvalidDependency( $depencency, $type ) {
+               $checker = new VersionChecker(
+                       '1.0.0',
+                       '7.0.0',
+                       [ 'phpLoadedExtension' ],
+                       [
+                               'presentAbility' => true,
+                               'missingAbility' => false,
+                       ]
+               );
+               $this->setExpectedException(
+                       UnexpectedValueException::class,
+                       "Dependency type $type unknown in FakeExtension"
+               );
+               $checker->checkArray( $depencency );
+       }
+
+       public function testInvalidPhpExtensionConstraint() {
+               $checker = new VersionChecker( '1.0.0', '7.0.0', [ 'phpLoadedExtension' ] );
+               $this->setExpectedException(
+                       UnexpectedValueException::class,
+                       'Version constraints for PHP extensions are not supported in FakeExtension'
+               );
+               $checker->checkArray( [
+                       'FakeExtension' => [
+                               'platform' => [
+                                       'ext-phpLoadedExtension' => '1.0.0',
+                               ],
+                       ],
+               ] );
+       }
+
+       /**
+        * @dataProvider provideInvalidAbilityType
+        */
+       public function testInvalidAbilityType( $value ) {
+               $checker = new VersionChecker( '1.0.0', '7.0.0', [], [ 'presentAbility' => true ] );
+               $this->setExpectedException(
+                       UnexpectedValueException::class,
+                       'Only booleans are allowed to to indicate the presence of abilities in FakeExtension'
+               );
+               $checker->checkArray( [
+                       'FakeExtension' => [
+                               'platform' => [
+                                       'ability-presentAbility' => $value,
+                               ],
+                       ],
+               ] );
+       }
+
+       public function provideInvalidAbilityType() {
+               return [
+                       [ null ],
+                       [ 1 ],
+                       [ '1' ],
+               ];
+       }
+
+}
diff --git a/tests/phpunit/unit/includes/search/SearchSuggestionSetTest.php b/tests/phpunit/unit/includes/search/SearchSuggestionSetTest.php
new file mode 100644 (file)
index 0000000..fb0309d
--- /dev/null
@@ -0,0 +1,111 @@
+<?php
+
+/**
+ * Test for filter utilities.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+class SearchSuggestionSetTest extends \MediaWikiUnitTestCase {
+       /**
+        * Test that adding a new suggestion at the end
+        * will keep proper score ordering
+        * @covers SearchSuggestionSet::append
+        */
+       public function testAppend() {
+               $set = SearchSuggestionSet::emptySuggestionSet();
+               $this->assertEquals( 0, $set->getSize() );
+               $set->append( new SearchSuggestion( 3 ) );
+               $this->assertEquals( 3, $set->getWorstScore() );
+               $this->assertEquals( 3, $set->getBestScore() );
+
+               $suggestion = new SearchSuggestion( 4 );
+               $set->append( $suggestion );
+               $this->assertEquals( 2, $set->getWorstScore() );
+               $this->assertEquals( 3, $set->getBestScore() );
+               $this->assertEquals( 2, $suggestion->getScore() );
+
+               $suggestion = new SearchSuggestion( 2 );
+               $set->append( $suggestion );
+               $this->assertEquals( 1, $set->getWorstScore() );
+               $this->assertEquals( 3, $set->getBestScore() );
+               $this->assertEquals( 1, $suggestion->getScore() );
+
+               $scores = $set->map( function ( $s ) {
+                       return $s->getScore();
+               } );
+               $sorted = $scores;
+               asort( $sorted );
+               $this->assertEquals( $sorted, $scores );
+       }
+
+       /**
+        * Test that adding a new best suggestion will keep proper score
+        * ordering
+        * @covers SearchSuggestionSet::getWorstScore
+        * @covers SearchSuggestionSet::getBestScore
+        * @covers SearchSuggestionSet::prepend
+        */
+       public function testInsertBest() {
+               $set = SearchSuggestionSet::emptySuggestionSet();
+               $this->assertEquals( 0, $set->getSize() );
+               $set->prepend( new SearchSuggestion( 3 ) );
+               $this->assertEquals( 3, $set->getWorstScore() );
+               $this->assertEquals( 3, $set->getBestScore() );
+
+               $suggestion = new SearchSuggestion( 4 );
+               $set->prepend( $suggestion );
+               $this->assertEquals( 3, $set->getWorstScore() );
+               $this->assertEquals( 4, $set->getBestScore() );
+               $this->assertEquals( 4, $suggestion->getScore() );
+
+               $suggestion = new SearchSuggestion( 0 );
+               $set->prepend( $suggestion );
+               $this->assertEquals( 3, $set->getWorstScore() );
+               $this->assertEquals( 5, $set->getBestScore() );
+               $this->assertEquals( 5, $suggestion->getScore() );
+
+               $suggestion = new SearchSuggestion( 2 );
+               $set->prepend( $suggestion );
+               $this->assertEquals( 3, $set->getWorstScore() );
+               $this->assertEquals( 6, $set->getBestScore() );
+               $this->assertEquals( 6, $suggestion->getScore() );
+
+               $scores = $set->map( function ( $s ) {
+                       return $s->getScore();
+               } );
+               $sorted = $scores;
+               asort( $sorted );
+               $this->assertEquals( $sorted, $scores );
+       }
+
+       /**
+        * @covers SearchSuggestionSet::shrink
+        */
+       public function testShrink() {
+               $set = SearchSuggestionSet::emptySuggestionSet();
+               for ( $i = 0; $i < 100; $i++ ) {
+                       $set->append( new SearchSuggestion( 0 ) );
+               }
+               $set->shrink( 10 );
+               $this->assertEquals( 10, $set->getSize() );
+
+               $set->shrink( 0 );
+               $this->assertEquals( 0, $set->getSize() );
+       }
+
+       // TODO: test for fromTitles
+}
diff --git a/tests/phpunit/unit/includes/shell/CommandFactoryTest.php b/tests/phpunit/unit/includes/shell/CommandFactoryTest.php
new file mode 100644 (file)
index 0000000..e27fe34
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+
+use MediaWiki\Shell\Command;
+use MediaWiki\Shell\CommandFactory;
+use MediaWiki\Shell\FirejailCommand;
+use Psr\Log\NullLogger;
+use Wikimedia\TestingAccessWrapper;
+
+/**
+ * @group Shell
+ */
+class CommandFactoryTest extends MediaWikiUnitTestCase {
+
+       /**
+        * @covers MediaWiki\Shell\CommandFactory::create
+        */
+       public function testCreate() {
+               $logger = new NullLogger();
+               $cgroup = '/sys/fs/cgroup/memory/mygroup';
+               $limits = [
+                       'filesize' => 1000,
+                       'memory' => 1000,
+                       'time' => 30,
+                       'walltime' => 40,
+               ];
+
+               $factory = new CommandFactory( $limits, $cgroup, false );
+               $factory->setLogger( $logger );
+               $factory->logStderr();
+               $command = $factory->create();
+               $this->assertInstanceOf( Command::class, $command );
+
+               $wrapper = TestingAccessWrapper::newFromObject( $command );
+               $this->assertSame( $logger, $wrapper->logger );
+               $this->assertSame( $cgroup, $wrapper->cgroup );
+               $this->assertSame( $limits, $wrapper->limits );
+               $this->assertTrue( $wrapper->doLogStderr );
+       }
+
+       /**
+        * @covers MediaWiki\Shell\CommandFactory::create
+        */
+       public function testFirejailCreate() {
+               $factory = new CommandFactory( [], false, 'firejail' );
+               $factory->setLogger( new NullLogger() );
+               $this->assertInstanceOf( FirejailCommand::class, $factory->create() );
+       }
+}
diff --git a/tests/phpunit/unit/includes/site/CachingSiteStoreTest.php b/tests/phpunit/unit/includes/site/CachingSiteStoreTest.php
deleted file mode 100644 (file)
index 92ed1f5..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-<?php
-
-/**
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @since 1.25
- *
- * @ingroup Site
- * @ingroup Test
- *
- * @group Site
- * @group Database
- *
- * @author Jeroen De Dauw < jeroendedauw@gmail.com >
- */
-class CachingSiteStoreTest extends \MediaWikiUnitTestCase {
-
-       /**
-        * @covers CachingSiteStore::getSites
-        */
-       public function testGetSites() {
-               $testSites = TestSites::getSites();
-
-               $store = new CachingSiteStore(
-                       $this->getHashSiteStore( $testSites ),
-                       ObjectCache::getLocalClusterInstance()
-               );
-
-               $sites = $store->getSites();
-
-               $this->assertInstanceOf( SiteList::class, $sites );
-
-               /**
-                * @var Site $site
-                */
-               foreach ( $sites as $site ) {
-                       $this->assertInstanceOf( Site::class, $site );
-               }
-
-               foreach ( $testSites as $site ) {
-                       if ( $site->getGlobalId() !== null ) {
-                               $this->assertTrue( $sites->hasSite( $site->getGlobalId() ) );
-                       }
-               }
-       }
-
-       /**
-        * @covers CachingSiteStore::saveSites
-        */
-       public function testSaveSites() {
-               $store = new CachingSiteStore(
-                       new HashSiteStore(), ObjectCache::getLocalClusterInstance()
-               );
-
-               $sites = [];
-
-               $site = new Site();
-               $site->setGlobalId( 'ertrywuutr' );
-               $site->setLanguageCode( 'en' );
-               $sites[] = $site;
-
-               $site = new MediaWikiSite();
-               $site->setGlobalId( 'sdfhxujgkfpth' );
-               $site->setLanguageCode( 'nl' );
-               $sites[] = $site;
-
-               $this->assertTrue( $store->saveSites( $sites ) );
-
-               $site = $store->getSite( 'ertrywuutr' );
-               $this->assertInstanceOf( Site::class, $site );
-               $this->assertEquals( 'en', $site->getLanguageCode() );
-
-               $site = $store->getSite( 'sdfhxujgkfpth' );
-               $this->assertInstanceOf( Site::class, $site );
-               $this->assertEquals( 'nl', $site->getLanguageCode() );
-       }
-
-       /**
-        * @covers CachingSiteStore::reset
-        */
-       public function testReset() {
-               $dbSiteStore = $this->getMockBuilder( SiteStore::class )
-                       ->disableOriginalConstructor()
-                       ->getMock();
-
-               $dbSiteStore->expects( $this->any() )
-                       ->method( 'getSite' )
-                       ->will( $this->returnValue( $this->getTestSite() ) );
-
-               $dbSiteStore->expects( $this->any() )
-                       ->method( 'getSites' )
-                       ->will( $this->returnCallback( function () {
-                               $siteList = new SiteList();
-                               $siteList->setSite( $this->getTestSite() );
-
-                               return $siteList;
-                       } ) );
-
-               $store = new CachingSiteStore( $dbSiteStore, ObjectCache::getLocalClusterInstance() );
-
-               // initialize internal cache
-               $this->assertGreaterThan( 0, $store->getSites()->count(), 'count sites' );
-
-               $store->getSite( 'enwiki' )->setLanguageCode( 'en-ca' );
-
-               // sanity check: $store should have the new language code for 'enwiki'
-               $this->assertEquals( 'en-ca', $store->getSite( 'enwiki' )->getLanguageCode(), 'sanity check' );
-
-               // purge cache
-               $store->reset();
-
-               // the internal cache of $store should be updated, and now pulling
-               // the site from the 'fallback' DBSiteStore with the original language code.
-               $this->assertEquals( 'en', $store->getSite( 'enwiki' )->getLanguageCode(), 'reset' );
-       }
-
-       public function getTestSite() {
-               $enwiki = new MediaWikiSite();
-               $enwiki->setGlobalId( 'enwiki' );
-               $enwiki->setLanguageCode( 'en' );
-
-               return $enwiki;
-       }
-
-       /**
-        * @covers CachingSiteStore::clear
-        */
-       public function testClear() {
-               $store = new CachingSiteStore(
-                       new HashSiteStore(), ObjectCache::getLocalClusterInstance()
-               );
-               $this->assertTrue( $store->clear() );
-
-               $site = $store->getSite( 'enwiki' );
-               $this->assertNull( $site );
-
-               $sites = $store->getSites();
-               $this->assertEquals( 0, $sites->count() );
-       }
-
-       /**
-        * @param Site[] $sites
-        *
-        * @return SiteStore
-        */
-       private function getHashSiteStore( array $sites ) {
-               $siteStore = new HashSiteStore();
-               $siteStore->saveSites( $sites );
-
-               return $siteStore;
-       }
-
-}
diff --git a/tests/phpunit/unit/includes/site/HashSiteStoreTest.php b/tests/phpunit/unit/includes/site/HashSiteStoreTest.php
deleted file mode 100644 (file)
index 8b0d4e0..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-<?php
-
-/**
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @since 1.25
- *
- * @ingroup Site
- * @group Site
- *
- * @author Katie Filbert < aude.wiki@gmail.com >
- */
-class HashSiteStoreTest extends \MediaWikiUnitTestCase {
-
-       /**
-        * @covers HashSiteStore::getSites
-        */
-       public function testGetSites() {
-               $expectedSites = [];
-
-               foreach ( TestSites::getSites() as $testSite ) {
-                       $siteId = $testSite->getGlobalId();
-                       $expectedSites[$siteId] = $testSite;
-               }
-
-               $siteStore = new HashSiteStore( $expectedSites );
-
-               $this->assertEquals( new SiteList( $expectedSites ), $siteStore->getSites() );
-       }
-
-       /**
-        * @covers HashSiteStore::saveSite
-        * @covers HashSiteStore::getSite
-        */
-       public function testSaveSite() {
-               $store = new HashSiteStore();
-
-               $site = new Site();
-               $site->setGlobalId( 'dewiki' );
-
-               $this->assertCount( 0, $store->getSites(), '0 sites in store' );
-
-               $store->saveSite( $site );
-
-               $this->assertCount( 1, $store->getSites(), 'Store has 1 sites' );
-               $this->assertEquals( $site, $store->getSite( 'dewiki' ), 'Store has dewiki' );
-       }
-
-       /**
-        * @covers HashSiteStore::saveSites
-        */
-       public function testSaveSites() {
-               $store = new HashSiteStore();
-
-               $sites = [];
-
-               $site = new Site();
-               $site->setGlobalId( 'enwiki' );
-               $site->setLanguageCode( 'en' );
-               $sites[] = $site;
-
-               $site = new MediaWikiSite();
-               $site->setGlobalId( 'eswiki' );
-               $site->setLanguageCode( 'es' );
-               $sites[] = $site;
-
-               $this->assertCount( 0, $store->getSites(), '0 sites in store' );
-
-               $store->saveSites( $sites );
-
-               $this->assertCount( 2, $store->getSites(), 'Store has 2 sites' );
-               $this->assertTrue( $store->getSites()->hasSite( 'enwiki' ), 'Store has enwiki' );
-               $this->assertTrue( $store->getSites()->hasSite( 'eswiki' ), 'Store has eswiki' );
-       }
-
-       /**
-        * @covers HashSiteStore::clear
-        */
-       public function testClear() {
-               $store = new HashSiteStore();
-
-               $site = new Site();
-               $site->setGlobalId( 'arwiki' );
-               $store->saveSite( $site );
-
-               $this->assertCount( 1, $store->getSites(), '1 site in store' );
-
-               $store->clear();
-               $this->assertCount( 0, $store->getSites(), '0 sites in store' );
-       }
-}
diff --git a/tests/phpunit/unit/includes/site/SiteExporterTest.php b/tests/phpunit/unit/includes/site/SiteExporterTest.php
new file mode 100644 (file)
index 0000000..dcf51ac
--- /dev/null
@@ -0,0 +1,145 @@
+<?php
+
+/**
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ *
+ * @ingroup Site
+ * @ingroup Test
+ *
+ * @group Site
+ *
+ * @covers SiteExporter
+ *
+ * @author Daniel Kinzler
+ */
+class SiteExporterTest extends MediaWikiUnitTestCase {
+
+       public function testConstructor_InvalidArgument() {
+               $this->setExpectedException( InvalidArgumentException::class );
+
+               new SiteExporter( 'Foo' );
+       }
+
+       public function testExportSites() {
+               $foo = Site::newForType( Site::TYPE_UNKNOWN );
+               $foo->setGlobalId( 'Foo' );
+
+               $acme = Site::newForType( Site::TYPE_UNKNOWN );
+               $acme->setGlobalId( 'acme.com' );
+               $acme->setGroup( 'Test' );
+               $acme->addLocalId( Site::ID_INTERWIKI, 'acme' );
+               $acme->setPath( Site::PATH_LINK, 'http://acme.com/' );
+
+               $tmp = tmpfile();
+               $exporter = new SiteExporter( $tmp );
+
+               $exporter->exportSites( [ $foo, $acme ] );
+
+               fseek( $tmp, 0 );
+               $xml = fread( $tmp, 16 * 1024 );
+
+               $this->assertContains( '<sites ', $xml );
+               $this->assertContains( '<site>', $xml );
+               $this->assertContains( '<globalid>Foo</globalid>', $xml );
+               $this->assertContains( '</site>', $xml );
+               $this->assertContains( '<globalid>acme.com</globalid>', $xml );
+               $this->assertContains( '<group>Test</group>', $xml );
+               $this->assertContains( '<localid type="interwiki">acme</localid>', $xml );
+               $this->assertContains( '<path type="link">http://acme.com/</path>', $xml );
+               $this->assertContains( '</sites>', $xml );
+
+               // NOTE: HHVM (at least on wmf Jenkins) doesn't like file URLs.
+               $xsdFile = __DIR__ . '/../../../../../docs/sitelist-1.0.xsd';
+               $xsdData = file_get_contents( $xsdFile );
+
+               $document = new DOMDocument();
+               $document->loadXML( $xml, LIBXML_NONET );
+               $document->schemaValidateSource( $xsdData );
+       }
+
+       private function newSiteStore( SiteList $sites ) {
+               $store = $this->getMockBuilder( SiteStore::class )->getMock();
+
+               $store->expects( $this->once() )
+                       ->method( 'saveSites' )
+                       ->will( $this->returnCallback( function ( $moreSites ) use ( $sites ) {
+                               foreach ( $moreSites as $site ) {
+                                       $sites->setSite( $site );
+                               }
+                       } ) );
+
+               $store->expects( $this->any() )
+                       ->method( 'getSites' )
+                       ->will( $this->returnValue( new SiteList() ) );
+
+               return $store;
+       }
+
+       public function provideRoundTrip() {
+               $foo = Site::newForType( Site::TYPE_UNKNOWN );
+               $foo->setGlobalId( 'Foo' );
+
+               $acme = Site::newForType( Site::TYPE_UNKNOWN );
+               $acme->setGlobalId( 'acme.com' );
+               $acme->setGroup( 'Test' );
+               $acme->addLocalId( Site::ID_INTERWIKI, 'acme' );
+               $acme->setPath( Site::PATH_LINK, 'http://acme.com/' );
+
+               $dewiki = Site::newForType( Site::TYPE_MEDIAWIKI );
+               $dewiki->setGlobalId( 'dewiki' );
+               $dewiki->setGroup( 'wikipedia' );
+               $dewiki->setForward( true );
+               $dewiki->addLocalId( Site::ID_INTERWIKI, 'wikipedia' );
+               $dewiki->addLocalId( Site::ID_EQUIVALENT, 'de' );
+               $dewiki->setPath( Site::PATH_LINK, 'http://de.wikipedia.org/w/' );
+               $dewiki->setPath( MediaWikiSite::PATH_PAGE, 'http://de.wikipedia.org/wiki/' );
+               $dewiki->setSource( 'meta.wikimedia.org' );
+
+               return [
+                       'empty' => [
+                               new SiteList()
+                       ],
+
+                       'some' => [
+                               new SiteList( [ $foo, $acme, $dewiki ] ),
+                       ],
+               ];
+       }
+
+       /**
+        * @dataProvider provideRoundTrip()
+        */
+       public function testRoundTrip( SiteList $sites ) {
+               $tmp = tmpfile();
+               $exporter = new SiteExporter( $tmp );
+
+               $exporter->exportSites( $sites );
+
+               fseek( $tmp, 0 );
+               $xml = fread( $tmp, 16 * 1024 );
+
+               $actualSites = new SiteList();
+               $store = $this->newSiteStore( $actualSites );
+
+               $importer = new SiteImporter( $store );
+               $importer->importFromXML( $xml );
+
+               $this->assertEquals( $sites, $actualSites );
+       }
+
+}
diff --git a/tests/phpunit/unit/includes/site/SiteImporterTest.php b/tests/phpunit/unit/includes/site/SiteImporterTest.php
new file mode 100644 (file)
index 0000000..d4e4103
--- /dev/null
@@ -0,0 +1,197 @@
+<?php
+
+/**
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ *
+ * @ingroup Site
+ * @ingroup Test
+ *
+ * @group Site
+ *
+ * @covers SiteImporter
+ *
+ * @author Daniel Kinzler
+ */
+class SiteImporterTest extends MediaWikiUnitTestCase {
+
+       private function newSiteImporter( array $expectedSites, $errorCount ) {
+               $store = $this->getMockBuilder( SiteStore::class )->getMock();
+
+               $store->expects( $this->once() )
+                       ->method( 'saveSites' )
+                       ->will( $this->returnCallback( function ( $sites ) use ( $expectedSites ) {
+                               $this->assertSitesEqual( $expectedSites, $sites );
+                       } ) );
+
+               $store->expects( $this->any() )
+                       ->method( 'getSites' )
+                       ->will( $this->returnValue( new SiteList() ) );
+
+               $errorHandler = $this->getMockBuilder( Psr\Log\LoggerInterface::class )->getMock();
+               $errorHandler->expects( $this->exactly( $errorCount ) )
+                       ->method( 'error' );
+
+               $importer = new SiteImporter( $store );
+               $importer->setExceptionCallback( [ $errorHandler, 'error' ] );
+
+               return $importer;
+       }
+
+       public function assertSitesEqual( $expected, $actual, $message = '' ) {
+               $this->assertEquals(
+                       $this->getSerializedSiteList( $expected ),
+                       $this->getSerializedSiteList( $actual ),
+                       $message
+               );
+       }
+
+       public function provideImportFromXML() {
+               $foo = Site::newForType( Site::TYPE_UNKNOWN );
+               $foo->setGlobalId( 'Foo' );
+
+               $acme = Site::newForType( Site::TYPE_UNKNOWN );
+               $acme->setGlobalId( 'acme.com' );
+               $acme->setGroup( 'Test' );
+               $acme->addLocalId( Site::ID_INTERWIKI, 'acme' );
+               $acme->setPath( Site::PATH_LINK, 'http://acme.com/' );
+
+               $dewiki = Site::newForType( Site::TYPE_MEDIAWIKI );
+               $dewiki->setGlobalId( 'dewiki' );
+               $dewiki->setGroup( 'wikipedia' );
+               $dewiki->setForward( true );
+               $dewiki->addLocalId( Site::ID_INTERWIKI, 'wikipedia' );
+               $dewiki->addLocalId( Site::ID_EQUIVALENT, 'de' );
+               $dewiki->setPath( Site::PATH_LINK, 'http://de.wikipedia.org/w/' );
+               $dewiki->setPath( MediaWikiSite::PATH_PAGE, 'http://de.wikipedia.org/wiki/' );
+               $dewiki->setSource( 'meta.wikimedia.org' );
+
+               return [
+                       'empty' => [
+                               '<sites></sites>',
+                               [],
+                       ],
+                       'no sites' => [
+                               '<sites><Foo><globalid>Foo</globalid></Foo><Bar><quux>Bla</quux></Bar></sites>',
+                               [],
+                       ],
+                       'minimal' => [
+                               '<sites>' .
+                                       '<site><globalid>Foo</globalid></site>' .
+                               '</sites>',
+                               [ $foo ],
+                       ],
+                       'full' => [
+                               '<sites>' .
+                                       '<site><globalid>Foo</globalid></site>' .
+                                       '<site>' .
+                                               '<globalid>acme.com</globalid>' .
+                                               '<localid type="interwiki">acme</localid>' .
+                                               '<group>Test</group>' .
+                                               '<path type="link">http://acme.com/</path>' .
+                                       '</site>' .
+                                       '<site type="mediawiki">' .
+                                               '<source>meta.wikimedia.org</source>' .
+                                               '<globalid>dewiki</globalid>' .
+                                               '<localid type="interwiki">wikipedia</localid>' .
+                                               '<localid type="equivalent">de</localid>' .
+                                               '<group>wikipedia</group>' .
+                                               '<forward/>' .
+                                               '<path type="link">http://de.wikipedia.org/w/</path>' .
+                                               '<path type="page_path">http://de.wikipedia.org/wiki/</path>' .
+                                       '</site>' .
+                               '</sites>',
+                               [ $foo, $acme, $dewiki ],
+                       ],
+                       'skip' => [
+                               '<sites>' .
+                                       '<site><globalid>Foo</globalid></site>' .
+                                       '<site><barf>Foo</barf></site>' .
+                                       '<site>' .
+                                               '<globalid>acme.com</globalid>' .
+                                               '<localid type="interwiki">acme</localid>' .
+                                               '<silly>boop!</silly>' .
+                                               '<group>Test</group>' .
+                                               '<path type="link">http://acme.com/</path>' .
+                                       '</site>' .
+                               '</sites>',
+                               [ $foo, $acme ],
+                               1
+                       ],
+               ];
+       }
+
+       /**
+        * @dataProvider provideImportFromXML
+        */
+       public function testImportFromXML( $xml, array $expectedSites, $errorCount = 0 ) {
+               $importer = $this->newSiteImporter( $expectedSites, $errorCount );
+               $importer->importFromXML( $xml );
+       }
+
+       public function testImportFromXML_malformed() {
+               $this->setExpectedException( Exception::class );
+
+               $store = $this->getMockBuilder( SiteStore::class )->getMock();
+               $importer = new SiteImporter( $store );
+               $importer->importFromXML( 'THIS IS NOT XML' );
+       }
+
+       public function testImportFromFile() {
+               $foo = Site::newForType( Site::TYPE_UNKNOWN );
+               $foo->setGlobalId( 'Foo' );
+
+               $acme = Site::newForType( Site::TYPE_UNKNOWN );
+               $acme->setGlobalId( 'acme.com' );
+               $acme->setGroup( 'Test' );
+               $acme->addLocalId( Site::ID_INTERWIKI, 'acme' );
+               $acme->setPath( Site::PATH_LINK, 'http://acme.com/' );
+
+               $dewiki = Site::newForType( Site::TYPE_MEDIAWIKI );
+               $dewiki->setGlobalId( 'dewiki' );
+               $dewiki->setGroup( 'wikipedia' );
+               $dewiki->setForward( true );
+               $dewiki->addLocalId( Site::ID_INTERWIKI, 'wikipedia' );
+               $dewiki->addLocalId( Site::ID_EQUIVALENT, 'de' );
+               $dewiki->setPath( Site::PATH_LINK, 'http://de.wikipedia.org/w/' );
+               $dewiki->setPath( MediaWikiSite::PATH_PAGE, 'http://de.wikipedia.org/wiki/' );
+               $dewiki->setSource( 'meta.wikimedia.org' );
+
+               $importer = $this->newSiteImporter( [ $foo, $acme, $dewiki ], 0 );
+
+               $file = __DIR__ . '/SiteImporterTest.xml';
+               $importer->importFromFile( $file );
+       }
+
+       /**
+        * @param Site[] $sites
+        *
+        * @return array[]
+        */
+       private function getSerializedSiteList( $sites ) {
+               $serialized = [];
+
+               foreach ( $sites as $site ) {
+                       $key = $site->getGlobalId();
+                       $data = unserialize( $site->serialize() );
+
+                       $serialized[$key] = $data;
+               }
+
+               return $serialized;
+       }
+}
diff --git a/tests/phpunit/unit/includes/site/SiteImporterTest.xml b/tests/phpunit/unit/includes/site/SiteImporterTest.xml
new file mode 100644 (file)
index 0000000..720b1fa
--- /dev/null
@@ -0,0 +1,19 @@
+<sites version="1.0" xmlns="http://www.mediawiki.org/xml/sitelist-1.0/">
+       <site><globalid>Foo</globalid></site>
+       <site>
+               <globalid>acme.com</globalid>
+               <localid type="interwiki">acme</localid>
+               <group>Test</group>
+               <path type="link">http://acme.com/</path>
+       </site>
+       <site type="mediawiki">
+               <source>meta.wikimedia.org</source>
+               <globalid>dewiki</globalid>
+               <localid type="interwiki">wikipedia</localid>
+               <localid type="equivalent">de</localid>
+               <group>wikipedia</group>
+               <forward/>
+               <path type="link">http://de.wikipedia.org/w/</path>
+               <path type="page_path">http://de.wikipedia.org/wiki/</path>
+       </site>
+</sites>
diff --git a/tests/phpunit/unit/includes/tidy/RemexDriverTest.php b/tests/phpunit/unit/includes/tidy/RemexDriverTest.php
new file mode 100644 (file)
index 0000000..555aeae
--- /dev/null
@@ -0,0 +1,326 @@
+<?php
+
+class RemexDriverTest extends MediaWikiUnitTestCase {
+       private static $remexTidyTestData = [
+               [
+                       'Empty string',
+                       "",
+                       ""
+               ],
+               [
+                       'Simple p-wrap',
+                       "x",
+                       "<p>x</p>"
+               ],
+               [
+                       'No p-wrap of blank node',
+                       " ",
+                       " "
+               ],
+               [
+                       'p-wrap terminated by div',
+                       "x<div></div>",
+                       "<p>x</p><div></div>"
+               ],
+               [
+                       'p-wrap not terminated by span',
+                       "x<span></span>",
+                       "<p>x<span></span></p>"
+               ],
+               [
+                       'An element is non-blank and so gets p-wrapped',
+                       "<span></span>",
+                       "<p><span></span></p>"
+               ],
+               [
+                       'The blank flag is set after a block-level element',
+                       "<div></div> ",
+                       "<div></div> "
+               ],
+               [
+                       'Blank detection between two block-level elements',
+                       "<div></div> <div></div>",
+                       "<div></div> <div></div>"
+               ],
+               [
+                       'But p-wrapping of non-blank content works after an element',
+                       "<div></div>x",
+                       "<div></div><p>x</p>"
+               ],
+               [
+                       'p-wrapping between two block-level elements',
+                       "<div></div>x<div></div>",
+                       "<div></div><p>x</p><div></div>"
+               ],
+               [
+                       'p-wrap inside blockquote',
+                       "<blockquote>x</blockquote>",
+                       "<blockquote><p>x</p></blockquote>"
+               ],
+               [
+                       'A comment is blank for p-wrapping purposes',
+                       "<!-- x -->",
+                       "<!-- x -->"
+               ],
+               [
+                       'A comment is blank even when a p-wrap was opened by a text node',
+                       " <!-- x -->",
+                       " <!-- x -->"
+               ],
+               [
+                       'A comment does not open a p-wrap',
+                       "<!-- x -->x",
+                       "<!-- x --><p>x</p>"
+               ],
+               [
+                       'A comment does not close a p-wrap',
+                       "x<!-- x -->",
+                       "<p>x<!-- x --></p>"
+               ],
+               [
+                       'Empty li',
+                       "<ul><li></li></ul>",
+                       "<ul><li class=\"mw-empty-elt\"></li></ul>"
+               ],
+               [
+                       'li with element',
+                       "<ul><li><span></span></li></ul>",
+                       "<ul><li><span></span></li></ul>"
+               ],
+               [
+                       'li with text',
+                       "<ul><li>x</li></ul>",
+                       "<ul><li>x</li></ul>"
+               ],
+               [
+                       'Empty tr',
+                       "<table><tbody><tr></tr></tbody></table>",
+                       "<table><tbody><tr class=\"mw-empty-elt\"></tr></tbody></table>"
+               ],
+               [
+                       'Empty p',
+                       "<p>\n</p>",
+                       "<p class=\"mw-empty-elt\">\n</p>"
+               ],
+               [
+                       'No p-wrapping of an inline element which contains a block element (T150317)',
+                       "<small><div>x</div></small>",
+                       "<small><div>x</div></small>"
+               ],
+               [
+                       'p-wrapping of an inline element which contains an inline element',
+                       "<small><b>x</b></small>",
+                       "<p><small><b>x</b></small></p>"
+               ],
+               [
+                       'p-wrapping is enabled in a blockquote in an inline element',
+                       "<small><blockquote>x</blockquote></small>",
+                       "<small><blockquote><p>x</p></blockquote></small>"
+               ],
+               [
+                       'All bare text should be p-wrapped even when surrounded by block tags',
+                       "<small><blockquote>x</blockquote></small>y<div></div>z",
+                       "<small><blockquote><p>x</p></blockquote></small><p>y</p><div></div><p>z</p>"
+               ],
+               [
+                       'Split tag stack 1',
+                       "<small>x<div>y</div>z</small>",
+                       "<p><small>x</small></p><small><div>y</div></small><p><small>z</small></p>"
+               ],
+               [
+                       'Split tag stack 2',
+                       "<small><div>y</div>z</small>",
+                       "<small><div>y</div></small><p><small>z</small></p>"
+               ],
+               [
+                       'Split tag stack 3',
+                       "<small>x<div>y</div></small>",
+                       "<p><small>x</small></p><small><div>y</div></small>"
+               ],
+               [
+                       'Split tag stack 4 (modified to use splittable tag)',
+                       "a<code>b<i>c<div>d</div></i>e</code>",
+                       "<p>a<code>b<i>c</i></code></p><code><i><div>d</div></i></code><p><code>e</code></p>"
+               ],
+               [
+                       "Split tag stack regression check 1",
+                       "x<span><div>y</div></span>",
+                       "<p>x</p><span><div>y</div></span>"
+               ],
+               [
+                       "Split tag stack regression check 2 (modified to use splittable tag)",
+                       "a<code><i><div>d</div></i>e</code>",
+                       "<p>a</p><code><i><div>d</div></i></code><p><code>e</code></p>"
+               ],
+               // Simple tests from pwrap.js
+               [
+                       'Simple pwrap test 1',
+                       'a',
+                       '<p>a</p>'
+               ],
+               [
+                       '<span> is not a splittable tag, but gets p-wrapped in simple wrapping scenarios',
+                       '<span>a</span>',
+                       '<p><span>a</span></p>'
+               ],
+               [
+                       'Simple pwrap test 3',
+                       'x <div>a</div> <div>b</div> y',
+                       '<p>x </p><div>a</div> <div>b</div><p> y</p>'
+               ],
+               [
+                       'Simple pwrap test 4',
+                       'x<!--c--> <div>a</div> <div>b</div> <!--c-->y',
+                       '<p>x<!--c--> </p><div>a</div> <div>b</div> <!--c--><p>y</p>'
+               ],
+               // Complex tests from pwrap.js
+               [
+                       'Complex pwrap test 1',
+                       '<i>x<div>a</div>y</i>',
+                       '<p><i>x</i></p><i><div>a</div></i><p><i>y</i></p>'
+               ],
+               [
+                       'Complex pwrap test 2',
+                       'a<small>b</small><i>c<div>d</div>e</i>f',
+                       '<p>a<small>b</small><i>c</i></p><i><div>d</div></i><p><i>e</i>f</p>'
+               ],
+               [
+                       'Complex pwrap test 3',
+                       'a<small>b<i>c<div>d</div></i>e</small>',
+                       '<p>a<small>b<i>c</i></small></p><small><i><div>d</div></i></small><p><small>e</small></p>'
+               ],
+               [
+                       'Complex pwrap test 4',
+                       'x<small><div>y</div></small>',
+                       '<p>x</p><small><div>y</div></small>'
+               ],
+               [
+                       'Complex pwrap test 5',
+                       'a<small><i><div>d</div></i>e</small>',
+                       '<p>a</p><small><i><div>d</div></i></small><p><small>e</small></p>'
+               ],
+               // phpcs:disable Generic.Files.LineLength
+               [
+                       'Complex pwrap test 6',
+                       '<i>a<div>b</div>c<b>d<div>e</div>f</b>g</i>',
+                       // PHP 5 does not allow concatenation in initialisation of a class static variable
+                       '<p><i>a</i></p><i><div>b</div></i><p><i>c<b>d</b></i></p><i><b><div>e</div></b></i><p><i><b>f</b>g</i></p>'
+               ],
+               // phpcs:enable
+               /* FIXME the second <b> causes a stack split which clones the <i> even
+                * though no <p> is actually generated
+               [
+                       'Complex pwrap test 7',
+                       '<i><b><font><div>x</div></font></b><div>y</div><b><font><div>z</div></font></b></i>',
+                       '<i><b><font><div>x</div></font></b><div>y</div><b><font><div>z</div></font></b></i>'
+               ],
+                */
+               // New local tests
+               [
+                       'Blank text node after block end',
+                       '<small>x<div>y</div> <b>z</b></small>',
+                       '<p><small>x</small></p><small><div>y</div></small><p><small> <b>z</b></small></p>'
+               ],
+               [
+                       'Text node fostering (FIXME: wrap missing)',
+                       '<table>x</table>',
+                       'x<table></table>'
+               ],
+               [
+                       'Blockquote fostering',
+                       '<table><blockquote>x</blockquote></table>',
+                       '<blockquote><p>x</p></blockquote><table></table>'
+               ],
+               [
+                       'Block element fostering',
+                       '<table><div>x',
+                       '<div>x</div><table></table>'
+               ],
+               [
+                       'Formatting element fostering (FIXME: wrap missing)',
+                       '<table><b>x',
+                       '<b>x</b><table></table>'
+               ],
+               [
+                       'AAA clone of p-wrapped element (FIXME: empty b)',
+                       '<b>x<p>y</b>z</p>',
+                       '<p><b>x</b></p><b></b><p><b>y</b>z</p>',
+               ],
+               [
+                       'AAA with fostering (FIXME: wrap missing)',
+                       '<table><b>1<p>2</b>3</p>',
+                       '<b>1</b><p><b>2</b>3</p><table></table>'
+               ],
+               [
+                       'AAA causes reparent of p-wrapped text node (T178632)',
+                       '<i><blockquote>x</i></blockquote>',
+                       '<i></i><blockquote><p><i>x</i></p></blockquote>',
+               ],
+               [
+                       'p-wrap ended by reparenting (T200827)',
+                       '<i><blockquote><p></i>',
+                       '<i></i><blockquote><p><i></i></p><p><i></i></p></blockquote>',
+               ],
+               [
+                       'style tag isn\'t p-wrapped (T186965)',
+                       '<style>/* ... */</style>',
+                       '<style>/* ... */</style>',
+               ],
+               [
+                       'link tag isn\'t p-wrapped (T186965)',
+                       '<link rel="foo" href="bar" />',
+                       '<link rel="foo" href="bar" />',
+               ],
+               [
+                       'style tag doesn\'t split p-wrapping (T208901)',
+                       'foo <style>/* ... */</style> bar',
+                       '<p>foo <style>/* ... */</style> bar</p>',
+               ],
+               [
+                       'link tag doesn\'t split p-wrapping (T208901)',
+                       'foo <link rel="foo" href="bar" /> bar',
+                       '<p>foo <link rel="foo" href="bar" /> bar</p>',
+               ],
+       ];
+
+       public function provider() {
+               return self::$remexTidyTestData;
+       }
+
+       /**
+        * @dataProvider provider
+        * @covers MediaWiki\Tidy\RemexCompatFormatter
+        * @covers MediaWiki\Tidy\RemexCompatMunger
+        * @covers MediaWiki\Tidy\RemexDriver
+        * @covers MediaWiki\Tidy\RemexMungerData
+        */
+       public function testTidy( $desc, $input, $expected ) {
+               $r = new MediaWiki\Tidy\RemexDriver( [] );
+               $result = $r->tidy( $input );
+               $this->assertEquals( $expected, $result, $desc );
+       }
+
+       public function html5libProvider() {
+               $files = json_decode( file_get_contents( __DIR__ . '/html5lib-tests.json' ), true );
+               $tests = [];
+               foreach ( $files as $file => $fileTests ) {
+                       foreach ( $fileTests as $i => $test ) {
+                               $tests[] = [ "$file:$i", $test['data'] ];
+                       }
+               }
+               return $tests;
+       }
+
+       /**
+        * This is a quick and dirty test to make sure none of the html5lib tests
+        * generate exceptions. We don't really know what the expected output is.
+        *
+        * @dataProvider html5libProvider
+        * @coversNothing
+        */
+       public function testHtml5Lib( $desc, $input ) {
+               $r = new MediaWiki\Tidy\RemexDriver( [] );
+               $result = $r->tidy( $input );
+               $this->assertTrue( true, $desc );
+       }
+}
diff --git a/tests/phpunit/unit/includes/tidy/html5lib-tests.json b/tests/phpunit/unit/includes/tidy/html5lib-tests.json
new file mode 100644 (file)
index 0000000..2b1c3e8
--- /dev/null
@@ -0,0 +1,80692 @@
+{
+  "adoption01.dat": [
+    {
+      "data": "<a><p></a></p>",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag",
+        "(1,10): adoption-agency-1.3"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a"
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "a"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a></a><p><a></a></p></body></html>",
+        "noQuirksBodyHtml": "<a></a><p><a></a></p>"
+      }
+    },
+    {
+      "data": "<a>1<p>2</a>3</p>",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag",
+        "(1,12): adoption-agency-1.3"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "text": "1"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "a",
+                        "children": [
+                          {
+                            "text": "2"
+                          }
+                        ]
+                      },
+                      {
+                        "text": "3"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a>1</a><p><a>2</a>3</p></body></html>",
+        "noQuirksBodyHtml": "<a>1</a><p><a>2</a>3</p>"
+      }
+    },
+    {
+      "data": "<a>1<button>2</a>3</button>",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag",
+        "(1,17): adoption-agency-1.3"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "button": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "text": "1"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "button",
+                    "children": [
+                      {
+                        "tag": "a",
+                        "children": [
+                          {
+                            "text": "2"
+                          }
+                        ]
+                      },
+                      {
+                        "text": "3"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a>1</a><button><a>2</a>3</button></body></html>",
+        "noQuirksBodyHtml": "<a>1</a><button><a>2</a>3</button>"
+      }
+    },
+    {
+      "data": "<a>1<b>2</a>3</b>",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag",
+        "(1,12): adoption-agency-1.3"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "b": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "text": "1"
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": "2"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "text": "3"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a>1<b>2</b></a><b>3</b></body></html>",
+        "noQuirksBodyHtml": "<a>1<b>2</b></a><b>3</b>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "text": "1"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "a",
+                        "children": [
+                          {
+                            "text": "2"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "div",
+                        "children": [
+                          {
+                            "tag": "a",
+                            "children": [
+                              {
+                                "text": "3"
+                              }
+                            ]
+                          },
+                          {
+                            "text": "4"
+                          }
+                        ]
+                      },
+                      {
+                        "text": "5"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a>1</a><div><a>2</a><div><a>3</a>4</div>5</div></body></html>",
+        "noQuirksBodyHtml": "<a>1</a><div><a>2</a><div><a>3</a>4</div>5</div>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "p": true,
+            "table": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "text": "1"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "a",
+                        "children": [
+                          {
+                            "text": "2"
+                          }
+                        ]
+                      },
+                      {
+                        "text": "3"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a>1</a><p><a>2</a>3</p><table></table></body></html>",
+        "noQuirksBodyHtml": "<a>1</a><p><a>2</a>3</p><table></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "a": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "tag": "a"
+                          },
+                          {
+                            "tag": "p",
+                            "children": [
+                              {
+                                "tag": "a"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b><b><a></a><p><a></a></p></b></b></body></html>",
+        "noQuirksBodyHtml": "<b><b><a></a><p><a></a></p></b></b>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "a": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "a",
+                        "children": [
+                          {
+                            "tag": "b"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "tag": "p",
+                            "children": [
+                              {
+                                "tag": "a"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b><a><b></b></a><b><p><a></a></p></b></b></body></html>",
+        "noQuirksBodyHtml": "<b><a><b></b></a><b><p><a></a></p></b></b>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "b": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "tag": "b"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "tag": "p",
+                            "children": [
+                              {
+                                "tag": "a"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a><b><b></b></b></a><b><b><p><a></a></p></b></b></body></html>",
+        "noQuirksBodyHtml": "<a><b><b></b></b></a><b><b><p><a></a></p></b></b>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "s": true,
+            "b": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "1"
+                      },
+                      {
+                        "tag": "s",
+                        "attrs": [
+                          {
+                            "name": "id",
+                            "value": "A"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "text": "2"
+                          },
+                          {
+                            "tag": "b",
+                            "attrs": [
+                              {
+                                "name": "id",
+                                "value": "B"
+                              }
+                            ],
+                            "children": [
+                              {
+                                "text": "3"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "s",
+                    "attrs": [
+                      {
+                        "name": "id",
+                        "value": "A"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "tag": "b",
+                        "attrs": [
+                          {
+                            "name": "id",
+                            "value": "B"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "text": "4"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "b",
+                    "attrs": [
+                      {
+                        "name": "id",
+                        "value": "B"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "5"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><p>1<s id=\"A\">2<b id=\"B\">3</b></s></p><s id=\"A\"><b id=\"B\">4</b></s><b id=\"B\">5</b></body></html>",
+        "noQuirksBodyHtml": "<p>1<s id=\"A\">2<b id=\"B\">3</b></s></p><s id=\"A\"><b id=\"B\">4</b></s><b id=\"B\">5</b>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "text": "1"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "text": "3"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "text": "2"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a>1</a><a>3</a><table><tbody><tr><td>2</td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<a>1</a><a>3</a><table><tbody><tr><td>2</td></tr></tbody></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "AC"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "text": "B"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>AC<table><tbody><tr><td>B</td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "AC<table><tbody><tr><td>B</td></tr></tbody></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "svg svg": true,
+            "svg tr": true,
+            "svg input": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "tag": "svg",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "ns": "http://www.w3.org/2000/svg",
+                            "children": [
+                              {
+                                "tag": "input",
+                                "ns": "http://www.w3.org/2000/svg"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a><svg><tr><input></input></tr></svg></a></body></html>",
+        "noQuirksBodyHtml": "<a><svg><tr><input></input></tr></svg></a>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "a": true,
+            "b": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "a",
+                        "children": [
+                          {
+                            "tag": "b"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "tag": "div",
+                            "children": [
+                              {
+                                "tag": "a"
+                              },
+                              {
+                                "tag": "div",
+                                "children": [
+                                  {
+                                    "tag": "a"
+                                  },
+                                  {
+                                    "tag": "div",
+                                    "children": [
+                                      {
+                                        "tag": "a"
+                                      },
+                                      {
+                                        "tag": "div",
+                                        "children": [
+                                          {
+                                            "tag": "a"
+                                          },
+                                          {
+                                            "tag": "div",
+                                            "children": [
+                                              {
+                                                "tag": "a"
+                                              },
+                                              {
+                                                "tag": "div",
+                                                "children": [
+                                                  {
+                                                    "tag": "a"
+                                                  },
+                                                  {
+                                                    "tag": "div",
+                                                    "children": [
+                                                      {
+                                                        "tag": "a"
+                                                      },
+                                                      {
+                                                        "tag": "div",
+                                                        "children": [
+                                                          {
+                                                            "tag": "a",
+                                                            "children": [
+                                                              {
+                                                                "tag": "div",
+                                                                "children": [
+                                                                  {
+                                                                    "tag": "div"
+                                                                  }
+                                                                ]
+                                                              }
+                                                            ]
+                                                          }
+                                                        ]
+                                                      }
+                                                    ]
+                                                  }
+                                                ]
+                                              }
+                                            ]
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div><a><b></b></a><b><div><a></a><div><a></a><div><a></a><div><a></a><div><a></a><div><a></a><div><a></a><div><a><div><div></div></div></a></div></div></div></div></div></div></div></div></b></div></body></html>",
+        "noQuirksBodyHtml": "<div><a><b></b></a><b><div><a></a><div><a></a><div><a></a><div><a></a><div><a></a><div><a></a><div><a></a><div><a><div><div></div></div></a></div></div></div></div></div></div></div></div></b></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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "a": true,
+            "b": true,
+            "u": true,
+            "i": true,
+            "code": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "a",
+                        "children": [
+                          {
+                            "tag": "b",
+                            "children": [
+                              {
+                                "tag": "u",
+                                "children": [
+                                  {
+                                    "tag": "i",
+                                    "children": [
+                                      {
+                                        "tag": "code"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "u",
+                        "children": [
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "tag": "code",
+                                "children": [
+                                  {
+                                    "tag": "div",
+                                    "children": [
+                                      {
+                                        "tag": "a"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div><a><b><u><i><code></code></i></u></b></a><u><i><code><div><a></a></div></code></i></u></div></body></html>",
+        "noQuirksBodyHtml": "<div><a><b><u><i><code></code></i></u></b></a><u><i><code><div><a></a></div></code></i></u></div>"
+      }
+    },
+    {
+      "data": "<b><b><b><b>x</b></b></b></b>y",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "tag": "b",
+                            "children": [
+                              {
+                                "tag": "b",
+                                "children": [
+                                  {
+                                    "text": "x"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "text": "y"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b><b><b><b>x</b></b></b></b>y</body></html>",
+        "noQuirksBodyHtml": "<b><b><b><b>x</b></b></b></b>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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "b": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "tag": "b",
+                            "children": [
+                              {
+                                "tag": "b",
+                                "children": [
+                                  {
+                                    "tag": "b"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "tag": "b",
+                            "children": [
+                              {
+                                "tag": "b",
+                                "children": [
+                                  {
+                                    "text": "x"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><p><b><b><b><b></b></b></b></b></p><p><b><b><b>x</b></b></b></p></body></html>",
+        "noQuirksBodyHtml": "<p><b><b><b><b></b></b></b></b></p><p><b><b><b>x</b></b></b></p>"
+      }
+    },
+    {
+      "data": "<b><em><foo><foob><fooc><aside></b></em>",
+      "errors": [
+        "(1,35): adoption-agency-1.3",
+        "(1,40): adoption-agency-1.3",
+        "(1,40): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "div"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "b": true,
+            "em": true,
+            "foo": true,
+            "foob": true,
+            "fooc": true,
+            "aside": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "b",
+            "children": [
+              {
+                "tag": "em",
+                "children": [
+                  {
+                    "tag": "foo",
+                    "children": [
+                      {
+                        "tag": "foob",
+                        "children": [
+                          {
+                            "tag": "fooc"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          },
+          {
+            "tag": "aside",
+            "children": [
+              {
+                "tag": "b"
+              }
+            ]
+          }
+        ],
+        "html": "<b><em><foo><foob><fooc></fooc></foob></foo></em></b><aside><b></b></aside>",
+        "noQuirksBodyHtml": "<b><em><foo><foob><fooc></fooc></foob></foo></em></b><aside><b></b></aside>"
+      }
+    }
+  ],
+  "adoption02.dat": [
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "i": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "text": "1"
+                      },
+                      {
+                        "tag": "i",
+                        "children": [
+                          {
+                            "text": "2"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "i",
+                    "children": [
+                      {
+                        "tag": "p",
+                        "children": [
+                          {
+                            "tag": "b",
+                            "children": [
+                              {
+                                "text": "3"
+                              }
+                            ]
+                          },
+                          {
+                            "text": "4"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b>1<i>2</i></b><i><p><b>3</b>4</p></i></body></html>",
+        "noQuirksBodyHtml": "<b>1<i>2</i></b><i><p><b>3</b>4</p></i>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "div": true,
+            "style": true,
+            "address": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a"
+                  },
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "a",
+                        "children": [
+                          {
+                            "tag": "style"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "address",
+                        "children": [
+                          {
+                            "tag": "a"
+                          },
+                          {
+                            "tag": "a"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a></a><div><a><style></style></a><address><a></a><a></a></address></div></body></html>",
+        "noQuirksBodyHtml": "<a></a><div><a><style></style></a><address><a></a><a></a></address></div>"
+      }
+    }
+  ],
+  "comments01.dat": [
+    {
+      "data": "FOO<!-- BAR -->BAZ",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "comment": " BAR "
+                  },
+                  {
+                    "text": "BAZ"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<!-- BAR -->BAZ</body></html>",
+        "noQuirksBodyHtml": "FOO<!-- BAR -->BAZ"
+      }
+    },
+    {
+      "data": "FOO<!-- BAR --!>BAZ",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,15): unexpected-bang-after-double-dash-in-comment"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "comment": " BAR "
+                  },
+                  {
+                    "text": "BAZ"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<!-- BAR -->BAZ</body></html>",
+        "noQuirksBodyHtml": "FOO<!-- BAR -->BAZ"
+      }
+    },
+    {
+      "data": "FOO<!-- BAR --   >BAZ",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,15): unexpected-char-in-comment",
+        "(1,21): eof-in-comment"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "comment": " BAR --   >BAZ"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<!-- BAR --   >BAZ--></body></html>",
+        "noQuirksBodyHtml": "FOO<!-- BAR --   >BAZ-->"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "comment": " BAR -- <QUX> -- MUX "
+                  },
+                  {
+                    "text": "BAZ"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<!-- BAR -- <QUX> -- MUX -->BAZ</body></html>",
+        "noQuirksBodyHtml": "FOO<!-- BAR -- <QUX> -- MUX -->BAZ"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "comment": " BAR -- <QUX> -- MUX "
+                  },
+                  {
+                    "text": "BAZ"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<!-- BAR -- <QUX> -- MUX -->BAZ</body></html>",
+        "noQuirksBodyHtml": "FOO<!-- BAR -- <QUX> -- MUX -->BAZ"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "comment": " BAR -- <QUX> -- MUX -- >BAZ"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<!-- BAR -- <QUX> -- MUX -- >BAZ--></body></html>",
+        "noQuirksBodyHtml": "FOO<!-- BAR -- <QUX> -- MUX -- >BAZ-->"
+      }
+    },
+    {
+      "data": "FOO<!---->BAZ",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "comment": ""
+                  },
+                  {
+                    "text": "BAZ"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<!---->BAZ</body></html>",
+        "noQuirksBodyHtml": "FOO<!---->BAZ"
+      }
+    },
+    {
+      "data": "FOO<!--->BAZ",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,9): incorrect-comment"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "comment": ""
+                  },
+                  {
+                    "text": "BAZ"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<!---->BAZ</body></html>",
+        "noQuirksBodyHtml": "FOO<!---->BAZ"
+      }
+    },
+    {
+      "data": "FOO<!-->BAZ",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,8): incorrect-comment"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "comment": ""
+                  },
+                  {
+                    "text": "BAZ"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<!---->BAZ</body></html>",
+        "noQuirksBodyHtml": "FOO<!---->BAZ"
+      }
+    },
+    {
+      "data": "<?xml version=\"1.0\">Hi",
+      "errors": [
+        "(1,1): expected-tag-name-but-got-question-mark",
+        "(1,22): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "comment": "?xml version=\"1.0\""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hi"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!--?xml version=\"1.0\"--><html><head></head><body>Hi</body></html>",
+        "noQuirksBodyHtml": "<!--?xml version=\"1.0\"-->Hi"
+      }
+    },
+    {
+      "data": "<?xml version=\"1.0\">",
+      "errors": [
+        "(1,1): expected-tag-name-but-got-question-mark",
+        "(1,20): expected-doctype-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "comment": "?xml version=\"1.0\""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!--?xml version=\"1.0\"--><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!--?xml version=\"1.0\"-->"
+      }
+    },
+    {
+      "data": "<?xml version",
+      "errors": [
+        "(1,1): expected-tag-name-but-got-question-mark",
+        "(1,13): expected-doctype-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "comment": "?xml version"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!--?xml version--><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!--?xml version-->"
+      }
+    },
+    {
+      "data": "FOO<!----->BAZ",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,10): unexpected-dash-after-double-dash-in-comment"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "comment": "-"
+                  },
+                  {
+                    "text": "BAZ"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<!----->BAZ</body></html>",
+        "noQuirksBodyHtml": "FOO<!----->BAZ"
+      }
+    },
+    {
+      "data": "<html><!-- comment --><title>Comment before head</title>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "title": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "comment": " comment "
+              },
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "Comment before head"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><!-- comment --><head><title>Comment before head</title></head><body></body></html>",
+        "noQuirksBodyHtml": "<!-- comment --><title>Comment before head</title>"
+      }
+    }
+  ],
+  "doctype01.dat": [
+    {
+      "data": "<!DOCTYPE html>Hello",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!dOctYpE HtMl>Hello",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPEhtml>Hello",
+      "errors": [
+        "(1,9): need-space-after-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE>Hello",
+      "errors": [
+        "(1,9): need-space-after-doctype",
+        "(1,10): expected-doctype-name-but-got-right-bracket",
+        "(1,10): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": ""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE ><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE >Hello",
+      "errors": [
+        "(1,11): expected-doctype-name-but-got-right-bracket",
+        "(1,11): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": ""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE ><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE potato>Hello",
+      "errors": [
+        "(1,17): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "potato"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE potato >Hello",
+      "errors": [
+        "(1,18): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "potato"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE potato taco>Hello",
+      "errors": [
+        "(1,17): expected-space-or-right-bracket-in-doctype",
+        "(1,22): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "potato"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE potato taco \"ddd>Hello",
+      "errors": [
+        "(1,17): expected-space-or-right-bracket-in-doctype",
+        "(1,27): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "potato"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE potato sYstEM>Hello",
+      "errors": [
+        "(1,24): unexpected-char-in-doctype",
+        "(1,24): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "potato"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE potato sYstEM    >Hello",
+      "errors": [
+        "(1,28): unexpected-char-in-doctype",
+        "(1,28): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "potato"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE   potato       sYstEM  ggg>Hello",
+      "errors": [
+        "(1,34): unexpected-char-in-doctype",
+        "(1,37): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "potato"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE potato SYSTEM taco  >Hello",
+      "errors": [
+        "(1,25): unexpected-char-in-doctype",
+        "(1,31): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "potato"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE potato SYSTEM 'taco\"'>Hello",
+      "errors": [
+        "(1,32): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "potato \"\" \"taco\"\""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE potato SYSTEM \"taco\">Hello",
+      "errors": [
+        "(1,31): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "potato \"\" \"taco\""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE potato SYSTEM \"tai'co\">Hello",
+      "errors": [
+        "(1,33): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "potato \"\" \"tai'co\""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE potato SYSTEMtaco \"ddd\">Hello",
+      "errors": [
+        "(1,24): unexpected-char-in-doctype",
+        "(1,34): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "potato"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE potato grass SYSTEM taco>Hello",
+      "errors": [
+        "(1,17): expected-space-or-right-bracket-in-doctype",
+        "(1,35): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "potato"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE potato pUbLIc>Hello",
+      "errors": [
+        "(1,24): unexpected-end-of-doctype",
+        "(1,24): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "potato"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE potato pUbLIc >Hello",
+      "errors": [
+        "(1,25): unexpected-end-of-doctype",
+        "(1,25): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "potato"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE potato pUbLIcgoof>Hello",
+      "errors": [
+        "(1,24): unexpected-char-in-doctype",
+        "(1,28): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "potato"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE potato PUBLIC goof>Hello",
+      "errors": [
+        "(1,25): unexpected-char-in-doctype",
+        "(1,29): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "potato"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE potato PUBLIC \"go'of\">Hello",
+      "errors": [
+        "(1,32): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "potato \"go'of\" \"\""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE potato PUBLIC 'go'of'>Hello",
+      "errors": [
+        "(1,29): unexpected-char-in-doctype",
+        "(1,32): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "potato \"go\" \"\""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE potato PUBLIC 'go:hh   of' >Hello",
+      "errors": [
+        "(1,38): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "potato \"go:hh   of\" \"\""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE potato PUBLIC \"W3C-//dfdf\" SYSTEM ggg>Hello",
+      "errors": [
+        "(1,38): unexpected-char-in-doctype",
+        "(1,48): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "potato \"W3C-//dfdf\" \"\""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE potato><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\n   \"http://www.w3.org/TR/html4/strict.dtd\">Hello",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE ...>Hello",
+      "errors": [
+        "(1,14): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "..."
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Hello"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE ...><html><head></head><body>Hello</body></html>",
+        "noQuirksBodyHtml": "Hello"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">",
+      "errors": [
+        "(2,58): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\"\n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">",
+      "errors": [
+        "(2,54): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<!DOCTYPE root-element [SYSTEM OR PUBLIC FPI] \"uri\" [ \n<!-- internal declarations -->\n]>",
+      "errors": [
+        "(1,23): expected-space-or-right-bracket-in-doctype",
+        "(2,30): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "doctype": "root-element"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "]>",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE root-element><html><head></head><body>]&gt;</body></html>",
+        "noQuirksBodyHtml": "\n]&gt;"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html PUBLIC\n  \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\n    \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">",
+      "errors": [
+        "(3,53): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<!DOCTYPE HTML SYSTEM \"http://www.w3.org/DTD/HTML4-strict.dtd\"><body><b>Mine!</b></body>",
+      "errors": [
+        "(1,63): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html \"\" \"http://www.w3.org/DTD/HTML4-strict.dtd\""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "text": "Mine!"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><b>Mine!</b></body></html>",
+        "noQuirksBodyHtml": "<b>Mine!</b>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    }
+  ],
+  "domjs-unsafe.dat": [
+    {
+      "data": "<svg><![CDATA[foo\nbar]]>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(2,6): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "foo\nbar"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>foo\nbar</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>foo\nbar</svg>"
+      }
+    },
+    {
+      "data": "<svg><![CDATA[foo\rbar]]>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(2,6): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "foo\nbar"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>foo\nbar</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>foo\nbar</svg>"
+      }
+    },
+    {
+      "data": "<svg><![CDATA[foo\r\nbar]]>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(2,6): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "foo\nbar"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>foo\nbar</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>foo\nbar</svg>"
+      }
+    },
+    {
+      "data": "<script>a='\u0000'</script>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,12): invalid-codepoint"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "a='�'",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script>a='�'</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script>a='�'</script>"
+      }
+    },
+    {
+      "data": "<script type=\"data\"><!--\u0000</script>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag",
+        "(1,25): invalid-codepoint"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "data"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "<!--�",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script type=\"data\"><!--�</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"data\"><!--�</script>"
+      }
+    },
+    {
+      "data": "<script type=\"data\"><!--foo\u0000</script>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag",
+        "(1,28): invalid-codepoint"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "data"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "<!--foo�",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script type=\"data\"><!--foo�</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"data\"><!--foo�</script>"
+      }
+    },
+    {
+      "data": "<script type=\"data\"><!-- foo-\u0000</script>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag",
+        "(1,30): invalid-codepoint"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "data"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "<!-- foo-�",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script type=\"data\"><!-- foo-�</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"data\"><!-- foo-�</script>"
+      }
+    },
+    {
+      "data": "<script type=\"data\"><!-- foo--\u0000</script>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag",
+        "(1,31): invalid-codepoint"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "data"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "<!-- foo--�",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script type=\"data\"><!-- foo--�</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"data\"><!-- foo--�</script>"
+      }
+    },
+    {
+      "data": "<script type=\"data\"><!-- foo-",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag",
+        "(1,29): expected-script-data-but-got-eof",
+        "(1,29): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "data"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "<!-- foo-",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script type=\"data\"><!-- foo-</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"data\"><!-- foo-</script>"
+      }
+    },
+    {
+      "data": "<script type=\"data\"><!-- foo-<</script>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "data"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "<!-- foo-<",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script type=\"data\"><!-- foo-<</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"data\"><!-- foo-<</script>"
+      }
+    },
+    {
+      "data": "<script type=\"data\"><!-- foo-<S",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag",
+        "(1,31): expected-script-data-but-got-eof",
+        "(1,31): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "data"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "<!-- foo-<S",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script type=\"data\"><!-- foo-<S</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"data\"><!-- foo-<S</script>"
+      }
+    },
+    {
+      "data": "<script type=\"data\"><!-- foo-</SCRIPT>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "data"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "<!-- foo-",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script type=\"data\"><!-- foo-</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"data\"><!-- foo-</script>"
+      }
+    },
+    {
+      "data": "<script type=\"data\"><!--<p></script>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "data"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "<!--<p>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script type=\"data\"><!--<p></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"data\"><!--<p></script>"
+      }
+    },
+    {
+      "data": "<script type=\"data\"><!--<script></script></script>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "data"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "<!--<script></script>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script type=\"data\"><!--<script></script></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"data\"><!--<script></script></script>"
+      }
+    },
+    {
+      "data": "<script type=\"data\"><!--<script>\u0000</script></script>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag",
+        "(1,33): invalid-codepoint"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "data"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "<!--<script>�</script>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script type=\"data\"><!--<script>�</script></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"data\"><!--<script>�</script></script>"
+      }
+    },
+    {
+      "data": "<script type=\"data\"><!--<script>-\u0000</script></script>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag",
+        "(1,34): invalid-codepoint"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "data"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "<!--<script>-�</script>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script type=\"data\"><!--<script>-�</script></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"data\"><!--<script>-�</script></script>"
+      }
+    },
+    {
+      "data": "<script type=\"data\"><!--<script>--\u0000</script></script>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag",
+        "(1,35): invalid-codepoint"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "data"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "<!--<script>--�</script>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script type=\"data\"><!--<script>--�</script></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"data\"><!--<script>--�</script></script>"
+      }
+    },
+    {
+      "data": "<script type=\"data\"><!--<script>---</script></script>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "data"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "<!--<script>---</script>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script type=\"data\"><!--<script>---</script></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"data\"><!--<script>---</script></script>"
+      }
+    },
+    {
+      "data": "<script type=\"data\"><!--<script></scrip></SCRIPT></script>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "data"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "<!--<script></scrip></SCRIPT>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script type=\"data\"><!--<script></scrip></SCRIPT></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"data\"><!--<script></scrip></SCRIPT></script>"
+      }
+    },
+    {
+      "data": "<script type=\"data\"><!--<script></scrip </SCRIPT></script>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "data"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "<!--<script></scrip </SCRIPT>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script type=\"data\"><!--<script></scrip </SCRIPT></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"data\"><!--<script></scrip </SCRIPT></script>"
+      }
+    },
+    {
+      "data": "<script type=\"data\"><!--<script></scrip/</SCRIPT></script>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "data"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "<!--<script></scrip/</SCRIPT>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script type=\"data\"><!--<script></scrip/</SCRIPT></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"data\"><!--<script></scrip/</SCRIPT></script>"
+      }
+    },
+    {
+      "data": "<script type=\"data\"></scrip/></script>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "data"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "</scrip/>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script type=\"data\"></scrip/></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"data\"></scrip/></script>"
+      }
+    },
+    {
+      "data": "<script type=\"data\"></scrip ></script>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "data"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "</scrip >",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script type=\"data\"></scrip ></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"data\"></scrip ></script>"
+      }
+    },
+    {
+      "data": "<script type=\"data\"><!--</scrip></script>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "data"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "<!--</scrip>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script type=\"data\"><!--</scrip></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"data\"><!--</scrip></script>"
+      }
+    },
+    {
+      "data": "<script type=\"data\"><!--</scrip </script>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "data"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "<!--</scrip ",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script type=\"data\"><!--</scrip </script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"data\"><!--</scrip </script>"
+      }
+    },
+    {
+      "data": "<script type=\"data\"><!--</scrip/</script>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "data"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "<!--</scrip/",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script type=\"data\"><!--</scrip/</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"data\"><!--</scrip/</script>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><!DOCTYPE html>",
+      "errors": [
+        "(1,30): unexpected-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<html><!DOCTYPE html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,21): unexpected-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<html><head><!DOCTYPE html></head>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,27): unexpected-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<html><head></head><!DOCTYPE html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,34): unexpected-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<body></body><!DOCTYPE html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,28): unexpected-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<table><!DOCTYPE html></table>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,22): unexpected-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table></table></body></html>",
+        "noQuirksBodyHtml": "<table></table>"
+      }
+    },
+    {
+      "data": "<select><!DOCTYPE html></select>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,23): unexpected-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><select></select></body></html>",
+        "noQuirksBodyHtml": "<select></select>"
+      }
+    },
+    {
+      "data": "<table><colgroup><!DOCTYPE html></colgroup></table>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,32): unexpected-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "colgroup": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "colgroup"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><colgroup></colgroup></table></body></html>",
+        "noQuirksBodyHtml": "<table><colgroup></colgroup></table>"
+      }
+    },
+    {
+      "data": "<table><colgroup><!--test--></colgroup></table>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "colgroup": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "colgroup",
+                        "children": [
+                          {
+                            "comment": "test"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><colgroup><!--test--></colgroup></table></body></html>",
+        "noQuirksBodyHtml": "<table><colgroup><!--test--></colgroup></table>"
+      }
+    },
+    {
+      "data": "<table><colgroup><html></colgroup></table>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,23): non-html-root"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "colgroup": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "colgroup"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><colgroup></colgroup></table></body></html>",
+        "noQuirksBodyHtml": "<table><colgroup></colgroup></table>"
+      }
+    },
+    {
+      "data": "<table><colgroup> foo</colgroup></table>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,32): foster-parenting-character-in-table",
+        "(1,32): foster-parenting-character-in-table",
+        "(1,32): foster-parenting-character-in-table",
+        "(1,32): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "colgroup": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "foo"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "colgroup",
+                        "children": [
+                          {
+                            "text": " "
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>foo<table><colgroup> </colgroup></table></body></html>",
+        "noQuirksBodyHtml": "foo<table><colgroup> </colgroup></table>"
+      }
+    },
+    {
+      "data": "<select><!--test--></select>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "comment": "test"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><select><!--test--></select></body></html>",
+        "noQuirksBodyHtml": "<select><!--test--></select>"
+      }
+    },
+    {
+      "data": "<select><html></select>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,14): non-html-root"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><select></select></body></html>",
+        "noQuirksBodyHtml": "<select></select>"
+      }
+    },
+    {
+      "data": "<frameset><html></frameset>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag",
+        "(1,16): non-html-root"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<frameset></frameset><html>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag",
+        "(1,27): non-html-root"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<frameset></frameset><!DOCTYPE html>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag",
+        "(1,36): unexpected-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<html><body></body></html><!DOCTYPE html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,41): unexpected-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<svg><!DOCTYPE html></svg>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,20): unexpected-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg></svg></body></html>",
+        "noQuirksBodyHtml": "<svg></svg>"
+      }
+    },
+    {
+      "data": "<svg><font></font></svg>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg font": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "font",
+                        "ns": "http://www.w3.org/2000/svg"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg><font></font></svg></body></html>",
+        "noQuirksBodyHtml": "<svg><font></font></svg>"
+      }
+    },
+    {
+      "data": "<svg><font id=foo></font></svg>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg font": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "font",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "attrs": [
+                          {
+                            "name": "id",
+                            "value": "foo"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg><font id=\"foo\"></font></svg></body></html>",
+        "noQuirksBodyHtml": "<svg><font id=\"foo\"></font></svg>"
+      }
+    },
+    {
+      "data": "<svg><font size=4></font></svg>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,18): unexpected-html-element-in-foreign-content",
+        "(1,31): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "font": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg"
+                  },
+                  {
+                    "tag": "font",
+                    "attrs": [
+                      {
+                        "name": "size",
+                        "value": "4"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg></svg><font size=\"4\"></font></body></html>",
+        "noQuirksBodyHtml": "<svg><font size=\"4\"></font></svg>"
+      }
+    },
+    {
+      "data": "<svg><font color=red></font></svg>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,21): unexpected-html-element-in-foreign-content",
+        "(1,34): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "font": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg"
+                  },
+                  {
+                    "tag": "font",
+                    "attrs": [
+                      {
+                        "name": "color",
+                        "value": "red"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg></svg><font color=\"red\"></font></body></html>",
+        "noQuirksBodyHtml": "<svg><font color=\"red\"></font></svg>"
+      }
+    },
+    {
+      "data": "<svg><font font=sans></font></svg>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg font": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "font",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "attrs": [
+                          {
+                            "name": "font",
+                            "value": "sans"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg><font font=\"sans\"></font></svg></body></html>",
+        "noQuirksBodyHtml": "<svg><font font=\"sans\"></font></svg>"
+      }
+    }
+  ],
+  "entities01.dat": [
+    {
+      "data": "FOO&gt;BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO>BAR",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO&gt;BAR</body></html>",
+        "noQuirksBodyHtml": "FOO&gt;BAR"
+      }
+    },
+    {
+      "data": "FOO&gtBAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,6): named-entity-without-semicolon"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO>BAR",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO&gt;BAR</body></html>",
+        "noQuirksBodyHtml": "FOO&gt;BAR"
+      }
+    },
+    {
+      "data": "FOO&gt BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,6): named-entity-without-semicolon"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO> BAR",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO&gt; BAR</body></html>",
+        "noQuirksBodyHtml": "FOO&gt; BAR"
+      }
+    },
+    {
+      "data": "FOO&gt;;;BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO>;;BAR",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO&gt;;;BAR</body></html>",
+        "noQuirksBodyHtml": "FOO&gt;;;BAR"
+      }
+    },
+    {
+      "data": "I'm &notit; I tell you",
+      "errors": [
+        "(1,4): expected-doctype-but-got-chars",
+        "(1,9): named-entity-without-semicolon"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "I'm ¬it; I tell you"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>I'm ¬it; I tell you</body></html>",
+        "noQuirksBodyHtml": "I'm ¬it; I tell you"
+      }
+    },
+    {
+      "data": "I'm &notin; I tell you",
+      "errors": [
+        "(1,4): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "I'm ∉ I tell you"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>I'm ∉ I tell you</body></html>",
+        "noQuirksBodyHtml": "I'm ∉ I tell you"
+      }
+    },
+    {
+      "data": "FOO& BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO& BAR",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO&amp; BAR</body></html>",
+        "noQuirksBodyHtml": "FOO&amp; BAR"
+      }
+    },
+    {
+      "data": "FOO&<BAR>",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,9): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "bar": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO&",
+                    "escaped": true
+                  },
+                  {
+                    "tag": "bar"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO&amp;<bar></bar></body></html>",
+        "noQuirksBodyHtml": "FOO&amp;<bar></bar>"
+      }
+    },
+    {
+      "data": "FOO&&&&gt;BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO&&&>BAR",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO&amp;&amp;&amp;&gt;BAR</body></html>",
+        "noQuirksBodyHtml": "FOO&amp;&amp;&amp;&gt;BAR"
+      }
+    },
+    {
+      "data": "FOO&#41;BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO)BAR"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO)BAR</body></html>",
+        "noQuirksBodyHtml": "FOO)BAR"
+      }
+    },
+    {
+      "data": "FOO&#x41;BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOOABAR"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOOABAR</body></html>",
+        "noQuirksBodyHtml": "FOOABAR"
+      }
+    },
+    {
+      "data": "FOO&#X41;BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOOABAR"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOOABAR</body></html>",
+        "noQuirksBodyHtml": "FOOABAR"
+      }
+    },
+    {
+      "data": "FOO&#BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,5): expected-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO&#BAR",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO&amp;#BAR</body></html>",
+        "noQuirksBodyHtml": "FOO&amp;#BAR"
+      }
+    },
+    {
+      "data": "FOO&#ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,5): expected-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO&#ZOO",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO&amp;#ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO&amp;#ZOO"
+      }
+    },
+    {
+      "data": "FOO&#xBAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,7): expected-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOOºR"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOOºR</body></html>",
+        "noQuirksBodyHtml": "FOOºR"
+      }
+    },
+    {
+      "data": "FOO&#xZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,6): expected-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO&#xZOO",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO&amp;#xZOO</body></html>",
+        "noQuirksBodyHtml": "FOO&amp;#xZOO"
+      }
+    },
+    {
+      "data": "FOO&#XZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,6): expected-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO&#XZOO",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO&amp;#XZOO</body></html>",
+        "noQuirksBodyHtml": "FOO&amp;#XZOO"
+      }
+    },
+    {
+      "data": "FOO&#41BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,7): numeric-entity-without-semicolon"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO)BAR"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO)BAR</body></html>",
+        "noQuirksBodyHtml": "FOO)BAR"
+      }
+    },
+    {
+      "data": "FOO&#x41BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,10): numeric-entity-without-semicolon"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO䆺R"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO䆺R</body></html>",
+        "noQuirksBodyHtml": "FOO䆺R"
+      }
+    },
+    {
+      "data": "FOO&#x41ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,8): numeric-entity-without-semicolon"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOOAZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOOAZOO</body></html>",
+        "noQuirksBodyHtml": "FOOAZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0000;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO�ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO�ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO�ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0078;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOOxZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOOxZOO</body></html>",
+        "noQuirksBodyHtml": "FOOxZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0079;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOOyZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOOyZOO</body></html>",
+        "noQuirksBodyHtml": "FOOyZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0080;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO€ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO€ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO€ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0081;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO\81ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO\81ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO\81ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0082;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO‚ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO‚ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO‚ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0083;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOOƒZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOOƒZOO</body></html>",
+        "noQuirksBodyHtml": "FOOƒZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0084;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO„ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO„ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO„ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0085;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO…ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO…ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO…ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0086;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO†ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO†ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO†ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0087;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO‡ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO‡ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO‡ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0088;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOOˆZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOOˆZOO</body></html>",
+        "noQuirksBodyHtml": "FOOˆZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0089;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO‰ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO‰ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO‰ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x008A;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOOŠZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOOŠZOO</body></html>",
+        "noQuirksBodyHtml": "FOOŠZOO"
+      }
+    },
+    {
+      "data": "FOO&#x008B;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO‹ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO‹ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO‹ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x008C;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOOŒZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOOŒZOO</body></html>",
+        "noQuirksBodyHtml": "FOOŒZOO"
+      }
+    },
+    {
+      "data": "FOO&#x008D;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO\8dZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO\8dZOO</body></html>",
+        "noQuirksBodyHtml": "FOO\8dZOO"
+      }
+    },
+    {
+      "data": "FOO&#x008E;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOOŽZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOOŽZOO</body></html>",
+        "noQuirksBodyHtml": "FOOŽZOO"
+      }
+    },
+    {
+      "data": "FOO&#x008F;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO\8fZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO\8fZOO</body></html>",
+        "noQuirksBodyHtml": "FOO\8fZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0090;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO\90ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO\90ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO\90ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0091;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO‘ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO‘ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO‘ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0092;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO’ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO’ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO’ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0093;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO“ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO“ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO“ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0094;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO”ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO”ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO”ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0095;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO•ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO•ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO•ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0096;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO–ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO–ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO–ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0097;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO—ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO—ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO—ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0098;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO˜ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO˜ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO˜ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x0099;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO™ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO™ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO™ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x009A;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOOšZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOOšZOO</body></html>",
+        "noQuirksBodyHtml": "FOOšZOO"
+      }
+    },
+    {
+      "data": "FOO&#x009B;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO›ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO›ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO›ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x009C;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOOœZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOOœZOO</body></html>",
+        "noQuirksBodyHtml": "FOOœZOO"
+      }
+    },
+    {
+      "data": "FOO&#x009D;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO\9dZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO\9dZOO</body></html>",
+        "noQuirksBodyHtml": "FOO\9dZOO"
+      }
+    },
+    {
+      "data": "FOO&#x009E;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOOžZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOOžZOO</body></html>",
+        "noQuirksBodyHtml": "FOOžZOO"
+      }
+    },
+    {
+      "data": "FOO&#x009F;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOOŸZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOOŸZOO</body></html>",
+        "noQuirksBodyHtml": "FOOŸZOO"
+      }
+    },
+    {
+      "data": "FOO&#x00A0;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO ZOO",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO&nbsp;ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO&nbsp;ZOO"
+      }
+    },
+    {
+      "data": "FOO&#xD7FF;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO퟿ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO퟿ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO퟿ZOO"
+      }
+    },
+    {
+      "data": "FOO&#xD800;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO�ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO�ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO�ZOO"
+      }
+    },
+    {
+      "data": "FOO&#xD801;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO�ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO�ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO�ZOO"
+      }
+    },
+    {
+      "data": "FOO&#xDFFE;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO�ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO�ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO�ZOO"
+      }
+    },
+    {
+      "data": "FOO&#xDFFF;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO�ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO�ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO�ZOO"
+      }
+    },
+    {
+      "data": "FOO&#xE000;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOOZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOOZOO</body></html>",
+        "noQuirksBodyHtml": "FOOZOO"
+      }
+    },
+    {
+      "data": "FOO&#x10FFFE;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,13): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO􏿾ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO􏿾ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO􏿾ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x1087D4;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO􈟔ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO􈟔ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO􈟔ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x10FFFF;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,13): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO􏿿ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO􏿿ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO􏿿ZOO"
+      }
+    },
+    {
+      "data": "FOO&#x110000;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,13): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO�ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO�ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO�ZOO"
+      }
+    },
+    {
+      "data": "FOO&#xFFFFFF;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,13): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO�ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO�ZOO</body></html>",
+        "noQuirksBodyHtml": "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO�"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO�</body></html>",
+        "noQuirksBodyHtml": "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO�"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO�</body></html>",
+        "noQuirksBodyHtml": "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO�"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO�</body></html>",
+        "noQuirksBodyHtml": "FOO�"
+      }
+    },
+    {
+      "data": "FOO&#11111111111ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,16): numeric-entity-without-semicolon",
+        "(1,16): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO�ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO�ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO�ZOO"
+      }
+    },
+    {
+      "data": "FOO&#1111111111ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,15): numeric-entity-without-semicolon",
+        "(1,15): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO�ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO�ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO�ZOO"
+      }
+    },
+    {
+      "data": "FOO&#111111111111ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,17): numeric-entity-without-semicolon",
+        "(1,17): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO�ZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO�ZOO</body></html>",
+        "noQuirksBodyHtml": "FOO�ZOO"
+      }
+    }
+  ],
+  "entities02.dat": [
+    {
+      "data": "<div bar=\"ZZ&gt;YY\"></div>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "bar",
+                        "value": "ZZ>YY"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div bar=\"ZZ>YY\"></div></body></html>",
+        "noQuirksBodyHtml": "<div bar=\"ZZ>YY\"></div>"
+      }
+    },
+    {
+      "data": "<div bar=\"ZZ&\"></div>",
+      "errors": [
+        "(1,15): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "bar",
+                        "value": "ZZ&",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div bar=\"ZZ&amp;\"></div></body></html>",
+        "noQuirksBodyHtml": "<div bar=\"ZZ&amp;\"></div>"
+      }
+    },
+    {
+      "data": "<div bar='ZZ&'></div>",
+      "errors": [
+        "(1,15): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "bar",
+                        "value": "ZZ&",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div bar=\"ZZ&amp;\"></div></body></html>",
+        "noQuirksBodyHtml": "<div bar=\"ZZ&amp;\"></div>"
+      }
+    },
+    {
+      "data": "<div bar=ZZ&></div>",
+      "errors": [
+        "(1,13): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "bar",
+                        "value": "ZZ&",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div bar=\"ZZ&amp;\"></div></body></html>",
+        "noQuirksBodyHtml": "<div bar=\"ZZ&amp;\"></div>"
+      }
+    },
+    {
+      "data": "<div bar=\"ZZ&gt=YY\"></div>",
+      "errors": [
+        "(1,15): named-entity-without-semicolon",
+        "(1,20): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "bar",
+                        "value": "ZZ&gt=YY",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div bar=\"ZZ&amp;gt=YY\"></div></body></html>",
+        "noQuirksBodyHtml": "<div bar=\"ZZ&amp;gt=YY\"></div>"
+      }
+    },
+    {
+      "data": "<div bar=\"ZZ&gt0YY\"></div>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "bar",
+                        "value": "ZZ&gt0YY",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div bar=\"ZZ&amp;gt0YY\"></div></body></html>",
+        "noQuirksBodyHtml": "<div bar=\"ZZ&amp;gt0YY\"></div>"
+      }
+    },
+    {
+      "data": "<div bar=\"ZZ&gt9YY\"></div>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "bar",
+                        "value": "ZZ&gt9YY",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div bar=\"ZZ&amp;gt9YY\"></div></body></html>",
+        "noQuirksBodyHtml": "<div bar=\"ZZ&amp;gt9YY\"></div>"
+      }
+    },
+    {
+      "data": "<div bar=\"ZZ&gtaYY\"></div>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "bar",
+                        "value": "ZZ&gtaYY",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div bar=\"ZZ&amp;gtaYY\"></div></body></html>",
+        "noQuirksBodyHtml": "<div bar=\"ZZ&amp;gtaYY\"></div>"
+      }
+    },
+    {
+      "data": "<div bar=\"ZZ&gtZYY\"></div>",
+      "errors": [
+        "(1,20): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "bar",
+                        "value": "ZZ&gtZYY",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div bar=\"ZZ&amp;gtZYY\"></div></body></html>",
+        "noQuirksBodyHtml": "<div bar=\"ZZ&amp;gtZYY\"></div>"
+      }
+    },
+    {
+      "data": "<div bar=\"ZZ&gt YY\"></div>",
+      "errors": [
+        "(1,15): named-entity-without-semicolon",
+        "(1,20): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "bar",
+                        "value": "ZZ> YY"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div bar=\"ZZ> YY\"></div></body></html>",
+        "noQuirksBodyHtml": "<div bar=\"ZZ> YY\"></div>"
+      }
+    },
+    {
+      "data": "<div bar=\"ZZ&gt\"></div>",
+      "errors": [
+        "(1,15): named-entity-without-semicolon",
+        "(1,17): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "bar",
+                        "value": "ZZ>"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div bar=\"ZZ>\"></div></body></html>",
+        "noQuirksBodyHtml": "<div bar=\"ZZ>\"></div>"
+      }
+    },
+    {
+      "data": "<div bar='ZZ&gt'></div>",
+      "errors": [
+        "(1,15): named-entity-without-semicolon",
+        "(1,17): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "bar",
+                        "value": "ZZ>"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div bar=\"ZZ>\"></div></body></html>",
+        "noQuirksBodyHtml": "<div bar=\"ZZ>\"></div>"
+      }
+    },
+    {
+      "data": "<div bar=ZZ&gt></div>",
+      "errors": [
+        "(1,14): named-entity-without-semicolon",
+        "(1,15): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "bar",
+                        "value": "ZZ>"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div bar=\"ZZ>\"></div></body></html>",
+        "noQuirksBodyHtml": "<div bar=\"ZZ>\"></div>"
+      }
+    },
+    {
+      "data": "<div bar=\"ZZ&pound_id=23\"></div>",
+      "errors": [
+        "(1,18): named-entity-without-semicolon",
+        "(1,26): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "bar",
+                        "value": "ZZ£_id=23"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div bar=\"ZZ£_id=23\"></div></body></html>",
+        "noQuirksBodyHtml": "<div bar=\"ZZ£_id=23\"></div>"
+      }
+    },
+    {
+      "data": "<div bar=\"ZZ&prod_id=23\"></div>",
+      "errors": [
+        "(1,25): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "bar",
+                        "value": "ZZ&prod_id=23",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div bar=\"ZZ&amp;prod_id=23\"></div></body></html>",
+        "noQuirksBodyHtml": "<div bar=\"ZZ&amp;prod_id=23\"></div>"
+      }
+    },
+    {
+      "data": "<div bar=\"ZZ&pound;_id=23\"></div>",
+      "errors": [
+        "(1,27): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "bar",
+                        "value": "ZZ£_id=23"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div bar=\"ZZ£_id=23\"></div></body></html>",
+        "noQuirksBodyHtml": "<div bar=\"ZZ£_id=23\"></div>"
+      }
+    },
+    {
+      "data": "<div bar=\"ZZ&prod;_id=23\"></div>",
+      "errors": [
+        "(1,26): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "bar",
+                        "value": "ZZ∏_id=23"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div bar=\"ZZ∏_id=23\"></div></body></html>",
+        "noQuirksBodyHtml": "<div bar=\"ZZ∏_id=23\"></div>"
+      }
+    },
+    {
+      "data": "<div bar=\"ZZ&pound=23\"></div>",
+      "errors": [
+        "(1,18): named-entity-without-semicolon",
+        "(1,23): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "bar",
+                        "value": "ZZ&pound=23",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div bar=\"ZZ&amp;pound=23\"></div></body></html>",
+        "noQuirksBodyHtml": "<div bar=\"ZZ&amp;pound=23\"></div>"
+      }
+    },
+    {
+      "data": "<div bar=\"ZZ&prod=23\"></div>",
+      "errors": [
+        "(1,22): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "bar",
+                        "value": "ZZ&prod=23",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div bar=\"ZZ&amp;prod=23\"></div></body></html>",
+        "noQuirksBodyHtml": "<div bar=\"ZZ&amp;prod=23\"></div>"
+      }
+    },
+    {
+      "data": "<div>ZZ&pound_id=23</div>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,13): named-entity-without-semicolon"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": "ZZ£_id=23"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div>ZZ£_id=23</div></body></html>",
+        "noQuirksBodyHtml": "<div>ZZ£_id=23</div>"
+      }
+    },
+    {
+      "data": "<div>ZZ&prod_id=23</div>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": "ZZ&prod_id=23",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div>ZZ&amp;prod_id=23</div></body></html>",
+        "noQuirksBodyHtml": "<div>ZZ&amp;prod_id=23</div>"
+      }
+    },
+    {
+      "data": "<div>ZZ&pound;_id=23</div>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": "ZZ£_id=23"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div>ZZ£_id=23</div></body></html>",
+        "noQuirksBodyHtml": "<div>ZZ£_id=23</div>"
+      }
+    },
+    {
+      "data": "<div>ZZ&prod;_id=23</div>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": "ZZ∏_id=23"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div>ZZ∏_id=23</div></body></html>",
+        "noQuirksBodyHtml": "<div>ZZ∏_id=23</div>"
+      }
+    },
+    {
+      "data": "<div>ZZ&pound=23</div>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,13): named-entity-without-semicolon"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": "ZZ£=23"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div>ZZ£=23</div></body></html>",
+        "noQuirksBodyHtml": "<div>ZZ£=23</div>"
+      }
+    },
+    {
+      "data": "<div>ZZ&prod=23</div>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": "ZZ&prod=23",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div>ZZ&amp;prod=23</div></body></html>",
+        "noQuirksBodyHtml": "<div>ZZ&amp;prod=23</div>"
+      }
+    },
+    {
+      "data": "<div>ZZ&AElig=</div>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": "ZZÆ="
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div>ZZÆ=</div></body></html>",
+        "noQuirksBodyHtml": "<div>ZZÆ=</div>"
+      }
+    }
+  ],
+  "foreign-fragment.dat": [
+    {
+      "data": "<nobr>X",
+      "errors": [
+        "6: HTML start tag “nobr” in a foreign namespace context.",
+        "7: End of file seen and there were open elements.",
+        "6: Unclosed element “nobr”."
+      ],
+      "fragment": {
+        "name": "path",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "svg nobr": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "nobr",
+            "ns": "http://www.w3.org/2000/svg",
+            "children": [
+              {
+                "text": "X"
+              }
+            ]
+          }
+        ],
+        "html": "<nobr>X</nobr>",
+        "noQuirksBodyHtml": "<nobr>X</nobr>"
+      }
+    },
+    {
+      "data": "<font color></font>X",
+      "errors": [
+        "12: HTML start tag “font” in a foreign namespace context."
+      ],
+      "fragment": {
+        "name": "path",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "svg font": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "font",
+            "ns": "http://www.w3.org/2000/svg",
+            "attrs": [
+              {
+                "name": "color",
+                "value": ""
+              }
+            ]
+          },
+          {
+            "text": "X"
+          }
+        ],
+        "html": "<font color=\"\"></font>X",
+        "noQuirksBodyHtml": "<font color=\"\"></font>X"
+      }
+    },
+    {
+      "data": "<font></font>X",
+      "errors": [],
+      "fragment": {
+        "name": "path",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "svg font": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "font",
+            "ns": "http://www.w3.org/2000/svg"
+          },
+          {
+            "text": "X"
+          }
+        ],
+        "html": "<font></font>X",
+        "noQuirksBodyHtml": "<font></font>X"
+      }
+    },
+    {
+      "data": "<g></path>X",
+      "errors": [
+        "10: End tag “path” did not match the name of the current open element (“g”).",
+        "11: End of file seen and there were open elements.",
+        "3: Unclosed element “g”."
+      ],
+      "fragment": {
+        "name": "path",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "svg g": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "g",
+            "ns": "http://www.w3.org/2000/svg",
+            "children": [
+              {
+                "text": "X"
+              }
+            ]
+          }
+        ],
+        "html": "<g>X</g>",
+        "noQuirksBodyHtml": "<g>X</g>"
+      }
+    },
+    {
+      "data": "</path>X",
+      "errors": [
+        "5: Stray end tag “path”."
+      ],
+      "fragment": {
+        "name": "path",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {}
+        },
+        "tree": [
+          {
+            "text": "X"
+          }
+        ],
+        "html": "X",
+        "noQuirksBodyHtml": "X"
+      }
+    },
+    {
+      "data": "</foreignObject>X",
+      "errors": [
+        "5: Stray end tag “foreignobject”."
+      ],
+      "fragment": {
+        "name": "foreignObject",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {}
+        },
+        "tree": [
+          {
+            "text": "X"
+          }
+        ],
+        "html": "X",
+        "noQuirksBodyHtml": "X"
+      }
+    },
+    {
+      "data": "</desc>X",
+      "errors": [
+        "5: Stray end tag “desc”."
+      ],
+      "fragment": {
+        "name": "desc",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {}
+        },
+        "tree": [
+          {
+            "text": "X"
+          }
+        ],
+        "html": "X",
+        "noQuirksBodyHtml": "X"
+      }
+    },
+    {
+      "data": "</title>X",
+      "errors": [
+        "5: Stray end tag “title”."
+      ],
+      "fragment": {
+        "name": "title",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {}
+        },
+        "tree": [
+          {
+            "text": "X"
+          }
+        ],
+        "html": "X",
+        "noQuirksBodyHtml": "X"
+      }
+    },
+    {
+      "data": "</svg>X",
+      "errors": [
+        "5: Stray end tag “svg”."
+      ],
+      "fragment": {
+        "name": "svg",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {}
+        },
+        "tree": [
+          {
+            "text": "X"
+          }
+        ],
+        "html": "X",
+        "noQuirksBodyHtml": "X"
+      }
+    },
+    {
+      "data": "</mfenced>X",
+      "errors": [
+        "5: Stray end tag “mfenced”."
+      ],
+      "fragment": {
+        "name": "mfenced",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {}
+        },
+        "tree": [
+          {
+            "text": "X"
+          }
+        ],
+        "html": "X",
+        "noQuirksBodyHtml": "X"
+      }
+    },
+    {
+      "data": "</malignmark>X",
+      "errors": [
+        "5: Stray end tag “malignmark”."
+      ],
+      "fragment": {
+        "name": "malignmark",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {}
+        },
+        "tree": [
+          {
+            "text": "X"
+          }
+        ],
+        "html": "X",
+        "noQuirksBodyHtml": "X"
+      }
+    },
+    {
+      "data": "</math>X",
+      "errors": [
+        "5: Stray end tag “math”."
+      ],
+      "fragment": {
+        "name": "math",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {}
+        },
+        "tree": [
+          {
+            "text": "X"
+          }
+        ],
+        "html": "X",
+        "noQuirksBodyHtml": "X"
+      }
+    },
+    {
+      "data": "</annotation-xml>X",
+      "errors": [
+        "5: Stray end tag “annotation-xml”."
+      ],
+      "fragment": {
+        "name": "annotation-xml",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {}
+        },
+        "tree": [
+          {
+            "text": "X"
+          }
+        ],
+        "html": "X",
+        "noQuirksBodyHtml": "X"
+      }
+    },
+    {
+      "data": "</mtext>X",
+      "errors": [
+        "5: Stray end tag “mtext”."
+      ],
+      "fragment": {
+        "name": "mtext",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {}
+        },
+        "tree": [
+          {
+            "text": "X"
+          }
+        ],
+        "html": "X",
+        "noQuirksBodyHtml": "X"
+      }
+    },
+    {
+      "data": "</mi>X",
+      "errors": [
+        "5: Stray end tag “mi”."
+      ],
+      "fragment": {
+        "name": "mi",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {}
+        },
+        "tree": [
+          {
+            "text": "X"
+          }
+        ],
+        "html": "X",
+        "noQuirksBodyHtml": "X"
+      }
+    },
+    {
+      "data": "</mo>X",
+      "errors": [
+        "5: Stray end tag “mo”."
+      ],
+      "fragment": {
+        "name": "mo",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {}
+        },
+        "tree": [
+          {
+            "text": "X"
+          }
+        ],
+        "html": "X",
+        "noQuirksBodyHtml": "X"
+      }
+    },
+    {
+      "data": "</mn>X",
+      "errors": [
+        "5: Stray end tag “mn”."
+      ],
+      "fragment": {
+        "name": "mn",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {}
+        },
+        "tree": [
+          {
+            "text": "X"
+          }
+        ],
+        "html": "X",
+        "noQuirksBodyHtml": "X"
+      }
+    },
+    {
+      "data": "</ms>X",
+      "errors": [
+        "5: Stray end tag “ms”."
+      ],
+      "fragment": {
+        "name": "ms",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {}
+        },
+        "tree": [
+          {
+            "text": "X"
+          }
+        ],
+        "html": "X",
+        "noQuirksBodyHtml": "X"
+      }
+    },
+    {
+      "data": "<b></b><mglyph/><i></i><malignmark/><u></u><ms/>X",
+      "errors": [
+        "51: Self-closing syntax (“/>”) used on a non-void HTML element. Ignoring the slash and treating as a start tag.",
+        "52: End of file seen and there were open elements.",
+        "51: Unclosed element “ms”."
+      ],
+      "fragment": {
+        "name": "ms",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "b": true,
+            "math mglyph": true,
+            "i": true,
+            "math malignmark": true,
+            "u": true,
+            "ms": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "b"
+          },
+          {
+            "tag": "mglyph",
+            "ns": "http://www.w3.org/1998/Math/MathML"
+          },
+          {
+            "tag": "i"
+          },
+          {
+            "tag": "malignmark",
+            "ns": "http://www.w3.org/1998/Math/MathML"
+          },
+          {
+            "tag": "u"
+          },
+          {
+            "tag": "ms",
+            "children": [
+              {
+                "text": "X"
+              }
+            ]
+          }
+        ],
+        "html": "<b></b><mglyph></mglyph><i></i><malignmark></malignmark><u></u><ms>X</ms>",
+        "noQuirksBodyHtml": "<b></b><mglyph><i></i><malignmark><u></u><ms>X</ms></malignmark></mglyph>"
+      }
+    },
+    {
+      "data": "<malignmark></malignmark>",
+      "errors": [],
+      "fragment": {
+        "name": "ms",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "math malignmark": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "malignmark",
+            "ns": "http://www.w3.org/1998/Math/MathML"
+          }
+        ],
+        "html": "<malignmark></malignmark>",
+        "noQuirksBodyHtml": "<malignmark></malignmark>"
+      }
+    },
+    {
+      "data": "<div></div>",
+      "errors": [],
+      "fragment": {
+        "name": "ms",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "div"
+          }
+        ],
+        "html": "<div></div>",
+        "noQuirksBodyHtml": "<div></div>"
+      }
+    },
+    {
+      "data": "<figure></figure>",
+      "errors": [],
+      "fragment": {
+        "name": "ms",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "figure": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "figure"
+          }
+        ],
+        "html": "<figure></figure>",
+        "noQuirksBodyHtml": "<figure></figure>"
+      }
+    },
+    {
+      "data": "<b></b><mglyph/><i></i><malignmark/><u></u><mn/>X",
+      "errors": [
+        "51: Self-closing syntax (“/>”) used on a non-void HTML element. Ignoring the slash and treating as a start tag.",
+        "52: End of file seen and there were open elements.",
+        "51: Unclosed element “mn”."
+      ],
+      "fragment": {
+        "name": "mn",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "b": true,
+            "math mglyph": true,
+            "i": true,
+            "math malignmark": true,
+            "u": true,
+            "mn": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "b"
+          },
+          {
+            "tag": "mglyph",
+            "ns": "http://www.w3.org/1998/Math/MathML"
+          },
+          {
+            "tag": "i"
+          },
+          {
+            "tag": "malignmark",
+            "ns": "http://www.w3.org/1998/Math/MathML"
+          },
+          {
+            "tag": "u"
+          },
+          {
+            "tag": "mn",
+            "children": [
+              {
+                "text": "X"
+              }
+            ]
+          }
+        ],
+        "html": "<b></b><mglyph></mglyph><i></i><malignmark></malignmark><u></u><mn>X</mn>",
+        "noQuirksBodyHtml": "<b></b><mglyph><i></i><malignmark><u></u><mn>X</mn></malignmark></mglyph>"
+      }
+    },
+    {
+      "data": "<malignmark></malignmark>",
+      "errors": [],
+      "fragment": {
+        "name": "mn",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "math malignmark": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "malignmark",
+            "ns": "http://www.w3.org/1998/Math/MathML"
+          }
+        ],
+        "html": "<malignmark></malignmark>",
+        "noQuirksBodyHtml": "<malignmark></malignmark>"
+      }
+    },
+    {
+      "data": "<div></div>",
+      "errors": [],
+      "fragment": {
+        "name": "mn",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "div"
+          }
+        ],
+        "html": "<div></div>",
+        "noQuirksBodyHtml": "<div></div>"
+      }
+    },
+    {
+      "data": "<figure></figure>",
+      "errors": [],
+      "fragment": {
+        "name": "mn",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "figure": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "figure"
+          }
+        ],
+        "html": "<figure></figure>",
+        "noQuirksBodyHtml": "<figure></figure>"
+      }
+    },
+    {
+      "data": "<b></b><mglyph/><i></i><malignmark/><u></u><mo/>X",
+      "errors": [
+        "51: Self-closing syntax (“/>”) used on a non-void HTML element. Ignoring the slash and treating as a start tag.",
+        "52: End of file seen and there were open elements.",
+        "51: Unclosed element “mo”."
+      ],
+      "fragment": {
+        "name": "mo",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "b": true,
+            "math mglyph": true,
+            "i": true,
+            "math malignmark": true,
+            "u": true,
+            "mo": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "b"
+          },
+          {
+            "tag": "mglyph",
+            "ns": "http://www.w3.org/1998/Math/MathML"
+          },
+          {
+            "tag": "i"
+          },
+          {
+            "tag": "malignmark",
+            "ns": "http://www.w3.org/1998/Math/MathML"
+          },
+          {
+            "tag": "u"
+          },
+          {
+            "tag": "mo",
+            "children": [
+              {
+                "text": "X"
+              }
+            ]
+          }
+        ],
+        "html": "<b></b><mglyph></mglyph><i></i><malignmark></malignmark><u></u><mo>X</mo>",
+        "noQuirksBodyHtml": "<b></b><mglyph><i></i><malignmark><u></u><mo>X</mo></malignmark></mglyph>"
+      }
+    },
+    {
+      "data": "<malignmark></malignmark>",
+      "errors": [],
+      "fragment": {
+        "name": "mo",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "math malignmark": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "malignmark",
+            "ns": "http://www.w3.org/1998/Math/MathML"
+          }
+        ],
+        "html": "<malignmark></malignmark>",
+        "noQuirksBodyHtml": "<malignmark></malignmark>"
+      }
+    },
+    {
+      "data": "<div></div>",
+      "errors": [],
+      "fragment": {
+        "name": "mo",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "div"
+          }
+        ],
+        "html": "<div></div>",
+        "noQuirksBodyHtml": "<div></div>"
+      }
+    },
+    {
+      "data": "<figure></figure>",
+      "errors": [],
+      "fragment": {
+        "name": "mo",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "figure": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "figure"
+          }
+        ],
+        "html": "<figure></figure>",
+        "noQuirksBodyHtml": "<figure></figure>"
+      }
+    },
+    {
+      "data": "<b></b><mglyph/><i></i><malignmark/><u></u><mi/>X",
+      "errors": [
+        "51: Self-closing syntax (“/>”) used on a non-void HTML element. Ignoring the slash and treating as a start tag.",
+        "52: End of file seen and there were open elements.",
+        "51: Unclosed element “mi”."
+      ],
+      "fragment": {
+        "name": "mi",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "b": true,
+            "math mglyph": true,
+            "i": true,
+            "math malignmark": true,
+            "u": true,
+            "mi": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "b"
+          },
+          {
+            "tag": "mglyph",
+            "ns": "http://www.w3.org/1998/Math/MathML"
+          },
+          {
+            "tag": "i"
+          },
+          {
+            "tag": "malignmark",
+            "ns": "http://www.w3.org/1998/Math/MathML"
+          },
+          {
+            "tag": "u"
+          },
+          {
+            "tag": "mi",
+            "children": [
+              {
+                "text": "X"
+              }
+            ]
+          }
+        ],
+        "html": "<b></b><mglyph></mglyph><i></i><malignmark></malignmark><u></u><mi>X</mi>",
+        "noQuirksBodyHtml": "<b></b><mglyph><i></i><malignmark><u></u><mi>X</mi></malignmark></mglyph>"
+      }
+    },
+    {
+      "data": "<malignmark></malignmark>",
+      "errors": [],
+      "fragment": {
+        "name": "mi",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "math malignmark": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "malignmark",
+            "ns": "http://www.w3.org/1998/Math/MathML"
+          }
+        ],
+        "html": "<malignmark></malignmark>",
+        "noQuirksBodyHtml": "<malignmark></malignmark>"
+      }
+    },
+    {
+      "data": "<div></div>",
+      "errors": [],
+      "fragment": {
+        "name": "mi",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "div"
+          }
+        ],
+        "html": "<div></div>",
+        "noQuirksBodyHtml": "<div></div>"
+      }
+    },
+    {
+      "data": "<figure></figure>",
+      "errors": [],
+      "fragment": {
+        "name": "mi",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "figure": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "figure"
+          }
+        ],
+        "html": "<figure></figure>",
+        "noQuirksBodyHtml": "<figure></figure>"
+      }
+    },
+    {
+      "data": "<b></b><mglyph/><i></i><malignmark/><u></u><mtext/>X",
+      "errors": [
+        "51: Self-closing syntax (“/>”) used on a non-void HTML element. Ignoring the slash and treating as a start tag.",
+        "52: End of file seen and there were open elements.",
+        "51: Unclosed element “mtext”."
+      ],
+      "fragment": {
+        "name": "mtext",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "b": true,
+            "math mglyph": true,
+            "i": true,
+            "math malignmark": true,
+            "u": true,
+            "mtext": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "b"
+          },
+          {
+            "tag": "mglyph",
+            "ns": "http://www.w3.org/1998/Math/MathML"
+          },
+          {
+            "tag": "i"
+          },
+          {
+            "tag": "malignmark",
+            "ns": "http://www.w3.org/1998/Math/MathML"
+          },
+          {
+            "tag": "u"
+          },
+          {
+            "tag": "mtext",
+            "children": [
+              {
+                "text": "X"
+              }
+            ]
+          }
+        ],
+        "html": "<b></b><mglyph></mglyph><i></i><malignmark></malignmark><u></u><mtext>X</mtext>",
+        "noQuirksBodyHtml": "<b></b><mglyph><i></i><malignmark><u></u><mtext>X</mtext></malignmark></mglyph>"
+      }
+    },
+    {
+      "data": "<malignmark></malignmark>",
+      "errors": [],
+      "fragment": {
+        "name": "mtext",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "math malignmark": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "malignmark",
+            "ns": "http://www.w3.org/1998/Math/MathML"
+          }
+        ],
+        "html": "<malignmark></malignmark>",
+        "noQuirksBodyHtml": "<malignmark></malignmark>"
+      }
+    },
+    {
+      "data": "<div></div>",
+      "errors": [],
+      "fragment": {
+        "name": "mtext",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "div"
+          }
+        ],
+        "html": "<div></div>",
+        "noQuirksBodyHtml": "<div></div>"
+      }
+    },
+    {
+      "data": "<figure></figure>",
+      "errors": [],
+      "fragment": {
+        "name": "mtext",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "figure": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "figure"
+          }
+        ],
+        "html": "<figure></figure>",
+        "noQuirksBodyHtml": "<figure></figure>"
+      }
+    },
+    {
+      "data": "<div></div>",
+      "errors": [
+        "5: HTML start tag “div” in a foreign namespace context."
+      ],
+      "fragment": {
+        "name": "annotation-xml",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "math div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "div",
+            "ns": "http://www.w3.org/1998/Math/MathML"
+          }
+        ],
+        "html": "<div></div>",
+        "noQuirksBodyHtml": "<div></div>"
+      }
+    },
+    {
+      "data": "<figure></figure>",
+      "errors": [],
+      "fragment": {
+        "name": "annotation-xml",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "math figure": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "figure",
+            "ns": "http://www.w3.org/1998/Math/MathML"
+          }
+        ],
+        "html": "<figure></figure>",
+        "noQuirksBodyHtml": "<figure></figure>"
+      }
+    },
+    {
+      "data": "<div></div>",
+      "errors": [
+        "5: HTML start tag “div” in a foreign namespace context."
+      ],
+      "fragment": {
+        "name": "math",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "math div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "div",
+            "ns": "http://www.w3.org/1998/Math/MathML"
+          }
+        ],
+        "html": "<div></div>",
+        "noQuirksBodyHtml": "<div></div>"
+      }
+    },
+    {
+      "data": "<figure></figure>",
+      "errors": [],
+      "fragment": {
+        "name": "math",
+        "ns": "http://www.w3.org/1998/Math/MathML"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "math figure": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "figure",
+            "ns": "http://www.w3.org/1998/Math/MathML"
+          }
+        ],
+        "html": "<figure></figure>",
+        "noQuirksBodyHtml": "<figure></figure>"
+      }
+    },
+    {
+      "data": "<div></div>",
+      "errors": [],
+      "fragment": {
+        "name": "foreignObject",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "div"
+          }
+        ],
+        "html": "<div></div>",
+        "noQuirksBodyHtml": "<div></div>"
+      }
+    },
+    {
+      "data": "<figure></figure>",
+      "errors": [],
+      "fragment": {
+        "name": "foreignObject",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "figure": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "figure"
+          }
+        ],
+        "html": "<figure></figure>",
+        "noQuirksBodyHtml": "<figure></figure>"
+      }
+    },
+    {
+      "data": "<div></div>",
+      "errors": [],
+      "fragment": {
+        "name": "title",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "div"
+          }
+        ],
+        "html": "<div></div>",
+        "noQuirksBodyHtml": "<div></div>"
+      }
+    },
+    {
+      "data": "<figure></figure>",
+      "errors": [],
+      "fragment": {
+        "name": "title",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "figure": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "figure"
+          }
+        ],
+        "html": "<figure></figure>",
+        "noQuirksBodyHtml": "<figure></figure>"
+      }
+    },
+    {
+      "data": "<figure></figure>",
+      "errors": [],
+      "fragment": {
+        "name": "desc",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "figure": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "figure"
+          }
+        ],
+        "html": "<figure></figure>",
+        "noQuirksBodyHtml": "<figure></figure>"
+      }
+    },
+    {
+      "data": "<div><h1>X</h1></div>",
+      "errors": [
+        "5: HTML start tag “div” in a foreign namespace context.",
+        "9: HTML start tag “h1” in a foreign namespace context."
+      ],
+      "fragment": {
+        "name": "svg",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "svg div": true,
+            "svg h1": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "div",
+            "ns": "http://www.w3.org/2000/svg",
+            "children": [
+              {
+                "tag": "h1",
+                "ns": "http://www.w3.org/2000/svg",
+                "children": [
+                  {
+                    "text": "X"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<div><h1>X</h1></div>",
+        "noQuirksBodyHtml": "<div><h1>X</h1></div>"
+      }
+    },
+    {
+      "data": "<div></div>",
+      "errors": [
+        "5: HTML start tag “div” in a foreign namespace context."
+      ],
+      "fragment": {
+        "name": "svg",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "svg div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "div",
+            "ns": "http://www.w3.org/2000/svg"
+          }
+        ],
+        "html": "<div></div>",
+        "noQuirksBodyHtml": "<div></div>"
+      }
+    },
+    {
+      "data": "<div></div>",
+      "errors": [],
+      "fragment": {
+        "name": "desc",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "div"
+          }
+        ],
+        "html": "<div></div>",
+        "noQuirksBodyHtml": "<div></div>"
+      }
+    },
+    {
+      "data": "<figure></figure>",
+      "errors": [],
+      "fragment": {
+        "name": "desc",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "figure": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "figure"
+          }
+        ],
+        "html": "<figure></figure>",
+        "noQuirksBodyHtml": "<figure></figure>"
+      }
+    },
+    {
+      "data": "<plaintext><foo>",
+      "errors": [
+        "(1,16): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "desc",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "plaintext": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "plaintext",
+            "children": [
+              {
+                "text": "<foo>",
+                "no_escape": true
+              }
+            ]
+          }
+        ],
+        "html": "<plaintext><foo></plaintext>",
+        "noQuirksBodyHtml": "<plaintext><foo></plaintext>"
+      }
+    },
+    {
+      "data": "<frameset>X",
+      "errors": [
+        "6: Stray start tag “frameset”."
+      ],
+      "fragment": {
+        "name": "desc",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {}
+        },
+        "tree": [
+          {
+            "text": "X"
+          }
+        ],
+        "html": "X",
+        "noQuirksBodyHtml": "X"
+      }
+    },
+    {
+      "data": "<head>X",
+      "errors": [
+        "6: Stray start tag “head”."
+      ],
+      "fragment": {
+        "name": "desc",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {}
+        },
+        "tree": [
+          {
+            "text": "X"
+          }
+        ],
+        "html": "X",
+        "noQuirksBodyHtml": "X"
+      }
+    },
+    {
+      "data": "<body>X",
+      "errors": [
+        "6: Stray start tag “body”."
+      ],
+      "fragment": {
+        "name": "desc",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {}
+        },
+        "tree": [
+          {
+            "text": "X"
+          }
+        ],
+        "html": "X",
+        "noQuirksBodyHtml": "X"
+      }
+    },
+    {
+      "data": "<html>X",
+      "errors": [
+        "6: Stray start tag “html”."
+      ],
+      "fragment": {
+        "name": "desc",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {}
+        },
+        "tree": [
+          {
+            "text": "X"
+          }
+        ],
+        "html": "X",
+        "noQuirksBodyHtml": "X"
+      }
+    },
+    {
+      "data": "<html class=\"foo\">X",
+      "errors": [
+        "6: Stray start tag “html”."
+      ],
+      "fragment": {
+        "name": "desc",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {}
+        },
+        "tree": [
+          {
+            "text": "X"
+          }
+        ],
+        "html": "X",
+        "noQuirksBodyHtml": "X"
+      }
+    },
+    {
+      "data": "<body class=\"foo\">X",
+      "errors": [
+        "6: Stray start tag “body”."
+      ],
+      "fragment": {
+        "name": "desc",
+        "ns": "http://www.w3.org/2000/svg"
+      },
+      "document": {
+        "props": {
+          "tags": {}
+        },
+        "tree": [
+          {
+            "text": "X"
+          }
+        ],
+        "html": "X",
+        "noQuirksBodyHtml": "X"
+      }
+    }
+  ],
+  "html5test-com.dat": [
+    {
+      "data": "<div<div>",
+      "errors": [
+        "(1,9): expected-doctype-but-got-start-tag",
+        "(1,9): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div<div": true
+          },
+          "tagWithLt": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div<div"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div<div></div<div></body></html>",
+        "noQuirksBodyHtml": "<div<div></div<div>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          },
+          "attrWithFunnyChar": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "foo<bar",
+                        "value": ""
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div foo<bar=\"\"></div></body></html>",
+        "noQuirksBodyHtml": "<div foo<bar=\"\"></div>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "foo",
+                        "value": "`bar`"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div foo=\"`bar`\"></div></body></html>",
+        "noQuirksBodyHtml": "<div foo=\"`bar`\"></div>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          },
+          "attrWithFunnyChar": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "\\\"foo",
+                        "value": ""
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div \\\"foo=\"\"></div></body></html>",
+        "noQuirksBodyHtml": "<div \\\"foo=\"\"></div>"
+      }
+    },
+    {
+      "data": "<a href='\\nbar'></a>",
+      "errors": [
+        "(1,16): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "attrs": [
+                      {
+                        "name": "href",
+                        "value": "\\nbar"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a href=\"\\nbar\"></a></body></html>",
+        "noQuirksBodyHtml": "<a href=\"\\nbar\"></a>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "&lang;&rang;",
+      "errors": [
+        "(1,6): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "⟨⟩"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>⟨⟩</body></html>",
+        "noQuirksBodyHtml": "⟨⟩"
+      }
+    },
+    {
+      "data": "&apos;",
+      "errors": [
+        "(1,6): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "'"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>'</body></html>",
+        "noQuirksBodyHtml": "'"
+      }
+    },
+    {
+      "data": "&ImaginaryI;",
+      "errors": [
+        "(1,12): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "ⅈ"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>ⅈ</body></html>",
+        "noQuirksBodyHtml": "ⅈ"
+      }
+    },
+    {
+      "data": "&Kopf;",
+      "errors": [
+        "(1,6): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "𝕂"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>𝕂</body></html>",
+        "noQuirksBodyHtml": "𝕂"
+      }
+    },
+    {
+      "data": "&notinva;",
+      "errors": [
+        "(1,9): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "∉"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>∉</body></html>",
+        "noQuirksBodyHtml": "∉"
+      }
+    },
+    {
+      "data": "<?import namespace=\"foo\" implementation=\"#bar\">",
+      "errors": [
+        "(1,1): expected-tag-name-but-got-question-mark",
+        "(1,47): expected-doctype-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "comment": "?import namespace=\"foo\" implementation=\"#bar\""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!--?import namespace=\"foo\" implementation=\"#bar\"--><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!--?import namespace=\"foo\" implementation=\"#bar\"-->"
+      }
+    },
+    {
+      "data": "<!--foo--bar-->",
+      "errors": [
+        "(1,10): unexpected-char-in-comment",
+        "(1,15): expected-doctype-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "comment": "foo--bar"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!--foo--bar--><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!--foo--bar-->"
+      }
+    },
+    {
+      "data": "<![CDATA[x]]>",
+      "errors": [
+        "(1,2): expected-dashes-or-doctype",
+        "(1,13): expected-doctype-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "comment": "[CDATA[x]]"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!--[CDATA[x]]--><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!--[CDATA[x]]-->"
+      }
+    },
+    {
+      "data": "<textarea><!--</textarea>--></textarea>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag",
+        "(1,39): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "textarea": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "textarea",
+                    "children": [
+                      {
+                        "text": "<!--",
+                        "escaped": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><textarea>&lt;!--</textarea>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<textarea>&lt;!--</textarea>--&gt;"
+      }
+    },
+    {
+      "data": "<textarea><!--</textarea>-->",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "textarea": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "textarea",
+                    "children": [
+                      {
+                        "text": "<!--",
+                        "escaped": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><textarea>&lt;!--</textarea>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<textarea>&lt;!--</textarea>--&gt;"
+      }
+    },
+    {
+      "data": "<style><!--</style>--></style>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,30): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": "<!--",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><style><!--</style></head><body>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<style><!--</style>--&gt;"
+      }
+    },
+    {
+      "data": "<style><!--</style>-->",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": "<!--",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><style><!--</style></head><body>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<style><!--</style>--&gt;"
+      }
+    },
+    {
+      "data": "<ul><li>A </li> <li>B</li></ul>",
+      "errors": [
+        "(1,4): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ul": true,
+            "li": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ul",
+                    "children": [
+                      {
+                        "tag": "li",
+                        "children": [
+                          {
+                            "text": "A "
+                          }
+                        ]
+                      },
+                      {
+                        "text": " "
+                      },
+                      {
+                        "tag": "li",
+                        "children": [
+                          {
+                            "text": "B"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ul><li>A </li> <li>B</li></ul></body></html>",
+        "noQuirksBodyHtml": "<ul><li>A </li> <li>B</li></ul>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "input": true,
+            "div": true,
+            "table": true,
+            "form": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "input"
+                  },
+                  {
+                    "tag": "div"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "form"
+                      },
+                      {
+                        "tag": "input",
+                        "attrs": [
+                          {
+                            "name": "type",
+                            "value": "hidden"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><input><div></div><table><form></form><input type=\"hidden\"></table></body></html>",
+        "noQuirksBodyHtml": "<input><div></div><table><form></form><input type=\"hidden\"></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "i": true,
+            "b": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "i",
+                    "children": [
+                      {
+                        "text": "A"
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": "B"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "b"
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "tag": "i"
+                          },
+                          {
+                            "text": "C"
+                          }
+                        ]
+                      },
+                      {
+                        "text": "D"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><i>A<b>B</b></i><b></b><p><b><i></i>C</b>D</p></body></html>",
+        "noQuirksBodyHtml": "<i>A<b>B</b></i><b></b><p><b><i></i>C</b>D</p>"
+      }
+    },
+    {
+      "data": "<div></div>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div></div></body></html>",
+        "noQuirksBodyHtml": "<div></div>"
+      }
+    },
+    {
+      "data": "<svg></svg>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg></svg></body></html>",
+        "noQuirksBodyHtml": "<svg></svg>"
+      }
+    },
+    {
+      "data": "<math></math>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math></math></body></html>",
+        "noQuirksBodyHtml": "<math></math>"
+      }
+    }
+  ],
+  "inbody01.dat": [
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "button": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "button",
+                    "children": [
+                      {
+                        "text": "1"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><button>1</button></body></html>",
+        "noQuirksBodyHtml": "<button>1</button>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "foo": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "foo",
+                    "children": [
+                      {
+                        "text": "1"
+                      },
+                      {
+                        "tag": "p",
+                        "children": [
+                          {
+                            "text": "2"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><foo>1<p>2</p></foo></body></html>",
+        "noQuirksBodyHtml": "<foo>1<p>2</p></foo>"
+      }
+    },
+    {
+      "data": "<dd>1</foo>",
+      "errors": [
+        "(1,4): expected-doctype-but-got-start-tag",
+        "(1,11): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "dd": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "dd",
+                    "children": [
+                      {
+                        "text": "1"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><dd>1</dd></body></html>",
+        "noQuirksBodyHtml": "<dd>1</dd>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "foo": true,
+            "dd": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "foo",
+                    "children": [
+                      {
+                        "text": "1"
+                      },
+                      {
+                        "tag": "dd",
+                        "children": [
+                          {
+                            "text": "2"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><foo>1<dd>2</dd></foo></body></html>",
+        "noQuirksBodyHtml": "<foo>1<dd>2</dd></foo>"
+      }
+    }
+  ],
+  "isindex.dat": [
+    {
+      "data": "<isindex>",
+      "errors": [
+        "(1,9): expected-doctype-but-got-start-tag",
+        "(1,9): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "isindex": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "isindex"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><isindex></isindex></body></html>",
+        "noQuirksBodyHtml": "<isindex></isindex>"
+      }
+    },
+    {
+      "data": "<isindex name=\"A\" action=\"B\" prompt=\"C\" foo=\"D\">",
+      "errors": [
+        "(1,48): expected-doctype-but-got-start-tag",
+        "(1,48): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "isindex": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "isindex",
+                    "attrs": [
+                      {
+                        "name": "action",
+                        "value": "B"
+                      },
+                      {
+                        "name": "foo",
+                        "value": "D"
+                      },
+                      {
+                        "name": "name",
+                        "value": "A"
+                      },
+                      {
+                        "name": "prompt",
+                        "value": "C"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><isindex name=\"A\" action=\"B\" prompt=\"C\" foo=\"D\"></isindex></body></html>",
+        "noQuirksBodyHtml": "<isindex name=\"A\" action=\"B\" prompt=\"C\" foo=\"D\"></isindex>"
+      }
+    },
+    {
+      "data": "<form><isindex>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,15): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "form": true,
+            "isindex": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "form",
+                    "children": [
+                      {
+                        "tag": "isindex"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><form><isindex></isindex></form></body></html>",
+        "noQuirksBodyHtml": "<form><isindex></isindex></form>"
+      }
+    },
+    {
+      "data": "<!doctype html><isindex>x</isindex>x",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "isindex": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "isindex",
+                    "children": [
+                      {
+                        "text": "x"
+                      }
+                    ]
+                  },
+                  {
+                    "text": "x"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><isindex>x</isindex>x</body></html>",
+        "noQuirksBodyHtml": "<isindex>x</isindex>x"
+      }
+    }
+  ],
+  "main-element.dat": [
+    {
+      "data": "<!doctype html><p>foo<main>bar<p>baz",
+      "errors": [
+        "(1,36): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "main": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "foo"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "main",
+                    "children": [
+                      {
+                        "text": "bar"
+                      },
+                      {
+                        "tag": "p",
+                        "children": [
+                          {
+                            "text": "baz"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p>foo</p><main>bar<p>baz</p></main></body></html>",
+        "noQuirksBodyHtml": "<p>foo</p><main>bar<p>baz</p></main>"
+      }
+    },
+    {
+      "data": "<!doctype html><main><p>foo</main>bar",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "main": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "main",
+                    "children": [
+                      {
+                        "tag": "p",
+                        "children": [
+                          {
+                            "text": "foo"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "text": "bar"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><main><p>foo</p></main>bar</body></html>",
+        "noQuirksBodyHtml": "<main><p>foo</p></main>bar"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html>xxx<svg><x><g><a><main><b>",
+      "errors": [
+        " * (1,42) unexpected HTML-like start tag token in foreign content",
+        " * (1,42) unexpected end of file"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg x": true,
+            "svg g": true,
+            "svg a": true,
+            "svg main": true,
+            "b": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "xxx"
+                  },
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "x",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "tag": "g",
+                            "ns": "http://www.w3.org/2000/svg",
+                            "children": [
+                              {
+                                "tag": "a",
+                                "ns": "http://www.w3.org/2000/svg",
+                                "children": [
+                                  {
+                                    "tag": "main",
+                                    "ns": "http://www.w3.org/2000/svg"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "b"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>xxx<svg><x><g><a><main></main></a></g></x></svg><b></b></body></html>",
+        "noQuirksBodyHtml": "xxx<svg><x><g><a><main><b></b></main></a></g></x></svg>"
+      }
+    }
+  ],
+  "math.dat": [
+    {
+      "data": "<math><tr><td><mo><tr>",
+      "errors": [],
+      "fragment": {
+        "name": "td"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "math math": true,
+            "math tr": true,
+            "math td": true,
+            "math mo": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "math",
+            "ns": "http://www.w3.org/1998/Math/MathML",
+            "children": [
+              {
+                "tag": "tr",
+                "ns": "http://www.w3.org/1998/Math/MathML",
+                "children": [
+                  {
+                    "tag": "td",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mo",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<math><tr><td><mo></mo></td></tr></math>",
+        "noQuirksBodyHtml": "<math><tr><td><mo></mo></td></tr></math>"
+      }
+    },
+    {
+      "data": "<math><tr><td><mo><tr>",
+      "errors": [],
+      "fragment": {
+        "name": "tr"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "math math": true,
+            "math tr": true,
+            "math td": true,
+            "math mo": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "math",
+            "ns": "http://www.w3.org/1998/Math/MathML",
+            "children": [
+              {
+                "tag": "tr",
+                "ns": "http://www.w3.org/1998/Math/MathML",
+                "children": [
+                  {
+                    "tag": "td",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mo",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<math><tr><td><mo></mo></td></tr></math>",
+        "noQuirksBodyHtml": "<math><tr><td><mo></mo></td></tr></math>"
+      }
+    },
+    {
+      "data": "<math><thead><mo><tbody>",
+      "errors": [],
+      "fragment": {
+        "name": "thead"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "math math": true,
+            "math thead": true,
+            "math mo": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "math",
+            "ns": "http://www.w3.org/1998/Math/MathML",
+            "children": [
+              {
+                "tag": "thead",
+                "ns": "http://www.w3.org/1998/Math/MathML",
+                "children": [
+                  {
+                    "tag": "mo",
+                    "ns": "http://www.w3.org/1998/Math/MathML"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<math><thead><mo></mo></thead></math>",
+        "noQuirksBodyHtml": "<math><thead><mo></mo></thead></math>"
+      }
+    },
+    {
+      "data": "<math><tfoot><mo><tbody>",
+      "errors": [],
+      "fragment": {
+        "name": "tfoot"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "math math": true,
+            "math tfoot": true,
+            "math mo": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "math",
+            "ns": "http://www.w3.org/1998/Math/MathML",
+            "children": [
+              {
+                "tag": "tfoot",
+                "ns": "http://www.w3.org/1998/Math/MathML",
+                "children": [
+                  {
+                    "tag": "mo",
+                    "ns": "http://www.w3.org/1998/Math/MathML"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<math><tfoot><mo></mo></tfoot></math>",
+        "noQuirksBodyHtml": "<math><tfoot><mo></mo></tfoot></math>"
+      }
+    },
+    {
+      "data": "<math><tbody><mo><tfoot>",
+      "errors": [],
+      "fragment": {
+        "name": "tbody"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "math math": true,
+            "math tbody": true,
+            "math mo": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "math",
+            "ns": "http://www.w3.org/1998/Math/MathML",
+            "children": [
+              {
+                "tag": "tbody",
+                "ns": "http://www.w3.org/1998/Math/MathML",
+                "children": [
+                  {
+                    "tag": "mo",
+                    "ns": "http://www.w3.org/1998/Math/MathML"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<math><tbody><mo></mo></tbody></math>",
+        "noQuirksBodyHtml": "<math><tbody><mo></mo></tbody></math>"
+      }
+    },
+    {
+      "data": "<math><tbody><mo></table>",
+      "errors": [],
+      "fragment": {
+        "name": "tbody"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "math math": true,
+            "math tbody": true,
+            "math mo": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "math",
+            "ns": "http://www.w3.org/1998/Math/MathML",
+            "children": [
+              {
+                "tag": "tbody",
+                "ns": "http://www.w3.org/1998/Math/MathML",
+                "children": [
+                  {
+                    "tag": "mo",
+                    "ns": "http://www.w3.org/1998/Math/MathML"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<math><tbody><mo></mo></tbody></math>",
+        "noQuirksBodyHtml": "<math><tbody><mo></mo></tbody></math>"
+      }
+    },
+    {
+      "data": "<math><thead><mo></table>",
+      "errors": [],
+      "fragment": {
+        "name": "tbody"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "math math": true,
+            "math thead": true,
+            "math mo": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "math",
+            "ns": "http://www.w3.org/1998/Math/MathML",
+            "children": [
+              {
+                "tag": "thead",
+                "ns": "http://www.w3.org/1998/Math/MathML",
+                "children": [
+                  {
+                    "tag": "mo",
+                    "ns": "http://www.w3.org/1998/Math/MathML"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<math><thead><mo></mo></thead></math>",
+        "noQuirksBodyHtml": "<math><thead><mo></mo></thead></math>"
+      }
+    },
+    {
+      "data": "<math><tfoot><mo></table>",
+      "errors": [],
+      "fragment": {
+        "name": "tbody"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "math math": true,
+            "math tfoot": true,
+            "math mo": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "math",
+            "ns": "http://www.w3.org/1998/Math/MathML",
+            "children": [
+              {
+                "tag": "tfoot",
+                "ns": "http://www.w3.org/1998/Math/MathML",
+                "children": [
+                  {
+                    "tag": "mo",
+                    "ns": "http://www.w3.org/1998/Math/MathML"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<math><tfoot><mo></mo></tfoot></math>",
+        "noQuirksBodyHtml": "<math><tfoot><mo></mo></tfoot></math>"
+      }
+    }
+  ],
+  "menuitem-element.dat": [
+    {
+      "data": "<menuitem>",
+      "errors": [
+        "10: Start tag seen without seeing a doctype first. Expected “<!DOCTYPE html>”."
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "menuitem": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "menuitem"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><menuitem></menuitem></body></html>",
+        "noQuirksBodyHtml": "<menuitem></menuitem>"
+      }
+    },
+    {
+      "data": "</menuitem>",
+      "errors": [
+        "11: End tag seen without seeing a doctype first. Expected “<!DOCTYPE html>”.",
+        "11: Stray end tag “menuitem”."
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><menuitem>A",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "menuitem": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "menuitem",
+                    "children": [
+                      {
+                        "text": "A"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><menuitem>A</menuitem></body></html>",
+        "noQuirksBodyHtml": "<menuitem>A</menuitem>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><menuitem>A<menuitem>B",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "menuitem": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "menuitem",
+                    "children": [
+                      {
+                        "text": "A"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "menuitem",
+                    "children": [
+                      {
+                        "text": "B"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><menuitem>A</menuitem><menuitem>B</menuitem></body></html>",
+        "noQuirksBodyHtml": "<menuitem>A</menuitem><menuitem>B</menuitem>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><menuitem>A<menu>B</menu>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "menuitem": true,
+            "menu": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "menuitem",
+                    "children": [
+                      {
+                        "text": "A"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "menu",
+                    "children": [
+                      {
+                        "text": "B"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><menuitem>A</menuitem><menu>B</menu></body></html>",
+        "noQuirksBodyHtml": "<menuitem>A</menuitem><menu>B</menu>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><menuitem>A<hr>B",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "menuitem": true,
+            "hr": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "menuitem",
+                    "children": [
+                      {
+                        "text": "A"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "hr"
+                  },
+                  {
+                    "text": "B"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><menuitem>A</menuitem><hr>B</body></html>",
+        "noQuirksBodyHtml": "<menuitem>A</menuitem><hr>B"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><li><menuitem><li>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "li": true,
+            "menuitem": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "li",
+                    "children": [
+                      {
+                        "tag": "menuitem"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "li"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><li><menuitem></menuitem></li><li></li></body></html>",
+        "noQuirksBodyHtml": "<li><menuitem></menuitem></li><li></li>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><menuitem><p></menuitem>x",
+      "errors": [
+        "39: Stray end tag “menuitem”."
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "menuitem": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "menuitem",
+                    "children": [
+                      {
+                        "tag": "p",
+                        "children": [
+                          {
+                            "text": "x"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><menuitem><p>x</p></menuitem></body></html>",
+        "noQuirksBodyHtml": "<menuitem><p>x</p></menuitem>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><p><b></p><menuitem>",
+      "errors": [
+        "25: End tag “p” seen, but there were open elements.",
+        "21: Unclosed element “b”.",
+        "35: End of file seen and there were open elements."
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "b": true,
+            "menuitem": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "b"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "menuitem"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><b></b></p><b><menuitem></menuitem></b></body></html>",
+        "noQuirksBodyHtml": "<p><b></b></p><b><menuitem></menuitem></b>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><menuitem><asdf></menuitem>x",
+      "errors": [
+        "40: End tag “menuitem” seen, but there were open elements.",
+        "31: Unclosed element “asdf”."
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "menuitem": true,
+            "asdf": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "menuitem",
+                    "children": [
+                      {
+                        "tag": "asdf"
+                      }
+                    ]
+                  },
+                  {
+                    "text": "x"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><menuitem><asdf></asdf></menuitem>x</body></html>",
+        "noQuirksBodyHtml": "<menuitem><asdf></asdf></menuitem>x"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html></menuitem>",
+      "errors": [
+        "26: Stray end tag “menuitem”."
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><html></menuitem>",
+      "errors": [
+        "26: Stray end tag “menuitem”."
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><head></menuitem>",
+      "errors": [
+        "26: Stray end tag “menuitem”."
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><select><menuitem></select>",
+      "errors": [
+        "33: Stray start tag “menuitem”."
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select></select></body></html>",
+        "noQuirksBodyHtml": "<select></select>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><option><menuitem>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "option": true,
+            "menuitem": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "option",
+                    "children": [
+                      {
+                        "tag": "menuitem"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><option><menuitem></menuitem></option></body></html>",
+        "noQuirksBodyHtml": "<option><menuitem></menuitem></option>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><menuitem><option>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "menuitem": true,
+            "option": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "menuitem",
+                    "children": [
+                      {
+                        "tag": "option"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><menuitem><option></option></menuitem></body></html>",
+        "noQuirksBodyHtml": "<menuitem><option></option></menuitem>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><menuitem></body>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "menuitem": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "menuitem"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><menuitem></menuitem></body></html>",
+        "noQuirksBodyHtml": "<menuitem></menuitem>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><menuitem></html>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "menuitem": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "menuitem"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><menuitem></menuitem></body></html>",
+        "noQuirksBodyHtml": "<menuitem></menuitem>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><menuitem><p>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "menuitem": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "menuitem",
+                    "children": [
+                      {
+                        "tag": "p"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><menuitem><p></p></menuitem></body></html>",
+        "noQuirksBodyHtml": "<menuitem><p></p></menuitem>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><menuitem><li>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "menuitem": true,
+            "li": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "menuitem",
+                    "children": [
+                      {
+                        "tag": "li"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><menuitem><li></li></menuitem></body></html>",
+        "noQuirksBodyHtml": "<menuitem><li></li></menuitem>"
+      }
+    }
+  ],
+  "namespace-sensitivity.dat": [
+    {
+      "data": "<body><table><tr><td><svg><td><foreignObject><span></td>Foo",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "svg svg": true,
+            "svg td": true,
+            "svg foreignObject": true,
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Foo"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "svg",
+                                    "ns": "http://www.w3.org/2000/svg",
+                                    "children": [
+                                      {
+                                        "tag": "td",
+                                        "ns": "http://www.w3.org/2000/svg",
+                                        "children": [
+                                          {
+                                            "tag": "foreignObject",
+                                            "ns": "http://www.w3.org/2000/svg",
+                                            "children": [
+                                              {
+                                                "tag": "span"
+                                              }
+                                            ]
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>Foo<table><tbody><tr><td><svg><td><foreignObject><span></span></foreignObject></td></svg></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "Foo<table><tbody><tr><td><svg><td><foreignObject><span></span></foreignObject></td></svg></td></tr></tbody></table>"
+      }
+    }
+  ],
+  "noscript01.dat": [
+    {
+      "data": "<head><noscript><!doctype html><!--foo--></noscript>",
+      "errors": [
+        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.",
+        "Line: 1 Col: 31 Unexpected DOCTYPE. Ignored."
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "comment": "foo"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript><!--foo--></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><!--foo--></noscript>"
+      }
+    },
+    {
+      "data": "<head><noscript><html class=\"foo\"><!--foo--></noscript>",
+      "errors": [
+        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.",
+        "Line: 1 Col: 34 html needs to be the first start tag."
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "attrs": [
+              {
+                "name": "class",
+                "value": "foo"
+              }
+            ],
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "comment": "foo"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html class=\"foo\"><head><noscript><!--foo--></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><!--foo--></noscript>"
+      }
+    },
+    {
+      "data": "<head><noscript></noscript>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-tag"
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript"
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript></noscript>"
+      }
+    },
+    {
+      "data": "<head><noscript>   </noscript>",
+      "errors": [
+        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE."
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "text": "   ",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript>   </noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript>   </noscript>"
+      }
+    },
+    {
+      "data": "<head><noscript><!--foo--></noscript>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-tag"
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "comment": "foo"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript><!--foo--></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><!--foo--></noscript>"
+      }
+    },
+    {
+      "data": "<head><noscript><basefont><!--foo--></noscript>",
+      "errors": [
+        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE."
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "basefont": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "tag": "basefont"
+                      },
+                      {
+                        "comment": "foo"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript><basefont><!--foo--></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><basefont><!--foo--></noscript>"
+      }
+    },
+    {
+      "data": "<head><noscript><bgsound><!--foo--></noscript>",
+      "errors": [
+        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE."
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "bgsound": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "tag": "bgsound"
+                      },
+                      {
+                        "comment": "foo"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript><bgsound><!--foo--></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><bgsound><!--foo--></noscript>"
+      }
+    },
+    {
+      "data": "<head><noscript><link><!--foo--></noscript>",
+      "errors": [
+        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE."
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "link": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "tag": "link"
+                      },
+                      {
+                        "comment": "foo"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript><link><!--foo--></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><link><!--foo--></noscript>"
+      }
+    },
+    {
+      "data": "<head><noscript><meta><!--foo--></noscript>",
+      "errors": [
+        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE."
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "meta": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "tag": "meta"
+                      },
+                      {
+                        "comment": "foo"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript><meta><!--foo--></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><meta><!--foo--></noscript>"
+      }
+    },
+    {
+      "data": "<head><noscript><noframes>XXX</noscript></noframes></noscript>",
+      "errors": [
+        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE."
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "noframes": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "tag": "noframes",
+                        "children": [
+                          {
+                            "text": "XXX</noscript>",
+                            "no_escape": true
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript><noframes>XXX</noscript></noframes></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><noframes>XXX</noscript></noframes></noscript>"
+      }
+    },
+    {
+      "data": "<head><noscript><style>XXX</style></noscript>",
+      "errors": [
+        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE."
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "style": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "tag": "style",
+                        "children": [
+                          {
+                            "text": "XXX",
+                            "no_escape": true
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript><style>XXX</style></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><style>XXX</style></noscript>"
+      }
+    },
+    {
+      "data": "<head><noscript></br><!--foo--></noscript>",
+      "errors": [
+        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.",
+        "Line: 1 Col: 21 Element br not allowed in a inhead-noscript context",
+        "Line: 1 Col: 21 Unexpected end tag (br). Treated as br element.",
+        "Line: 1 Col: 42 Unexpected end tag (noscript). Ignored."
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true,
+            "br": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript"
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "br"
+                  },
+                  {
+                    "comment": "foo"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript></noscript></head><body><br><!--foo--></body></html>",
+        "noQuirksBodyHtml": "<noscript><br><!--foo--></noscript>"
+      }
+    },
+    {
+      "data": "<head><noscript><head class=\"foo\"><!--foo--></noscript>",
+      "errors": [
+        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.",
+        "Line: 1 Col: 34 Unexpected start tag (head)."
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "comment": "foo"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript><!--foo--></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><!--foo--></noscript>"
+      }
+    },
+    {
+      "data": "<head><noscript><noscript class=\"foo\"><!--foo--></noscript>",
+      "errors": [
+        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.",
+        "Line: 1 Col: 34 Unexpected start tag (noscript)."
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "comment": "foo"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript><!--foo--></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><noscript class=\"foo\"><!--foo--></noscript></noscript>"
+      }
+    },
+    {
+      "data": "<head><noscript></p><!--foo--></noscript>",
+      "errors": [
+        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.",
+        "Line: 1 Col: 20 Unexpected end tag (p). Ignored."
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "comment": "foo"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript><!--foo--></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><p></p><!--foo--></noscript>"
+      }
+    },
+    {
+      "data": "<head><noscript><p><!--foo--></noscript>",
+      "errors": [
+        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.",
+        "Line: 1 Col: 19 Element p not allowed in a inhead-noscript context",
+        "Line: 1 Col: 40 Unexpected end tag (noscript). Ignored."
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true,
+            "p": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript"
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "comment": "foo"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript></noscript></head><body><p><!--foo--></p></body></html>",
+        "noQuirksBodyHtml": "<noscript><p><!--foo--></p></noscript>"
+      }
+    },
+    {
+      "data": "<head><noscript>XXX<!--foo--></noscript></head>",
+      "errors": [
+        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE.",
+        "Line: 1 Col: 19 Unexpected non-space character. Expected inhead-noscript content",
+        "Line: 1 Col: 30 Unexpected end tag (noscript). Ignored.",
+        "Line: 1 Col: 37 Unexpected end tag (head). Ignored."
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript"
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "XXX"
+                  },
+                  {
+                    "comment": "foo"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript></noscript></head><body>XXX<!--foo--></body></html>",
+        "noQuirksBodyHtml": "<noscript>XXX<!--foo--></noscript>"
+      }
+    },
+    {
+      "data": "<head><noscript>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-tag",
+        "(1,6): eof-in-head-noscript"
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript"
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript></noscript>"
+      }
+    }
+  ],
+  "pending-spec-changes-plain-text-unsafe.dat": [
+    {
+      "data": "<body><table>\u0000filler\u0000text\u0000",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,14): invalid-codepoint",
+        "(1,14): invalid-codepoint-in-table-text",
+        "(1,21): invalid-codepoint",
+        "(1,21): invalid-codepoint-in-table-text",
+        "(1,26): invalid-codepoint",
+        "(1,26): invalid-codepoint-in-table-text",
+        "(1,26): foster-parenting-character-in-table",
+        "(1,26): foster-parenting-character-in-table",
+        "(1,26): foster-parenting-character-in-table",
+        "(1,26): foster-parenting-character-in-table",
+        "(1,26): foster-parenting-character-in-table",
+        "(1,26): foster-parenting-character-in-table",
+        "(1,26): foster-parenting-character-in-table",
+        "(1,26): foster-parenting-character-in-table",
+        "(1,26): foster-parenting-character-in-table",
+        "(1,26): foster-parenting-character-in-table",
+        "(1,26): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "fillertext"
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>fillertext<table></table></body></html>",
+        "noQuirksBodyHtml": "fillertext<table></table>"
+      }
+    }
+  ],
+  "pending-spec-changes.dat": [
+    {
+      "data": "<input type=\"hidden\"><frameset>",
+      "errors": [
+        "(1,21): expected-doctype-but-got-start-tag",
+        "(1,31): unexpected-start-tag",
+        "(1,31): eof-in-frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "<input type=\"hidden\">"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><table><caption><svg>foo</table>bar",
+      "errors": [
+        "(1,47): unexpected-end-tag",
+        "(1,47): end-table-tag-in-caption"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "caption": true,
+            "svg svg": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "caption",
+                        "children": [
+                          {
+                            "tag": "svg",
+                            "ns": "http://www.w3.org/2000/svg",
+                            "children": [
+                              {
+                                "text": "foo"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "text": "bar"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><caption><svg>foo</svg></caption></table>bar</body></html>",
+        "noQuirksBodyHtml": "<table><caption><svg>foo</svg></caption></table>bar"
+      }
+    },
+    {
+      "data": "<table><tr><td><svg><desc><td></desc><circle>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "svg svg": true,
+            "svg desc": true,
+            "circle": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "svg",
+                                    "ns": "http://www.w3.org/2000/svg",
+                                    "children": [
+                                      {
+                                        "tag": "desc",
+                                        "ns": "http://www.w3.org/2000/svg"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              },
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "circle"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><tr><td><svg><desc></desc></svg></td><td><circle></circle></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><svg><desc></desc></svg></td><td><circle></circle></td></tr></tbody></table>"
+      }
+    }
+  ],
+  "plain-text-unsafe.dat": [
+    {
+      "data": "FOO&#x000D;ZOO",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,11): illegal-codepoint-for-numeric-entity"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO\rZOO"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO\rZOO</body></html>",
+        "noQuirksBodyHtml": "FOO\rZOO"
+      }
+    },
+    {
+      "data": "<html>\u0000<frameset></frameset>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,7): invalid-codepoint",
+        "(1,7): invalid-codepoint-in-body",
+        "(1,17): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<html> \u0000 <frameset></frameset>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,8): invalid-codepoint",
+        "(1,8): invalid-codepoint-in-body",
+        "(1,19): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "  "
+      }
+    },
+    {
+      "data": "<html>a\u0000a<frameset></frameset>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,8): invalid-codepoint",
+        "(1,8): invalid-codepoint-in-body",
+        "(1,19): unexpected-start-tag",
+        "(1,30): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "aa"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>aa</body></html>",
+        "noQuirksBodyHtml": "aa"
+      }
+    },
+    {
+      "data": "<html>\u0000\u0000<frameset></frameset>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,7): invalid-codepoint",
+        "(1,7): invalid-codepoint-in-body",
+        "(1,8): invalid-codepoint",
+        "(1,8): invalid-codepoint-in-body",
+        "(1,18): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<html>\u0000\n <frameset></frameset>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,7): invalid-codepoint",
+        "(1,7): invalid-codepoint-in-body",
+        "(2,11): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "\n "
+      }
+    },
+    {
+      "data": "<html><select>\u0000",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,15): invalid-codepoint",
+        "(1,15): invalid-codepoint-in-select",
+        "(1,15): eof-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><select></select></body></html>",
+        "noQuirksBodyHtml": "<select></select>"
+      }
+    },
+    {
+      "data": "\u0000",
+      "errors": [
+        "(1,1): invalid-codepoint",
+        "(1,1): expected-doctype-but-got-chars",
+        "(1,1): invalid-codepoint-in-body"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<body>\u0000",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,7): invalid-codepoint",
+        "(1,7): invalid-codepoint-in-body"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<plaintext>\u0000filler\u0000text\u0000",
+      "errors": [
+        "(1,11): expected-doctype-but-got-start-tag",
+        "(1,12): invalid-codepoint",
+        "(1,19): invalid-codepoint",
+        "(1,24): invalid-codepoint",
+        "(1,24): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "plaintext": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "plaintext",
+                    "children": [
+                      {
+                        "text": "�filler�text�",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><plaintext>�filler�text�</plaintext></body></html>",
+        "noQuirksBodyHtml": "<plaintext>�filler�text�</plaintext>"
+      }
+    },
+    {
+      "data": "<svg><![CDATA[\u0000filler\u0000text\u0000]]>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,30): invalid-codepoint",
+        "(1,30): invalid-codepoint",
+        "(1,30): invalid-codepoint",
+        "(1,30): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "�filler�text�"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>�filler�text�</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>�filler�text�</svg>"
+      }
+    },
+    {
+      "data": "<body><!\u0000>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,8): expected-dashes-or-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "comment": "�"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><!--�--></body></html>",
+        "noQuirksBodyHtml": "<!--�-->"
+      }
+    },
+    {
+      "data": "<body><!\u0000filler\u0000text>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,8): expected-dashes-or-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "comment": "�filler�text"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><!--�filler�text--></body></html>",
+        "noQuirksBodyHtml": "<!--�filler�text-->"
+      }
+    },
+    {
+      "data": "<body><svg><foreignObject>\u0000filler\u0000text",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,27): invalid-codepoint",
+        "(1,27): invalid-codepoint-in-body",
+        "(1,34): invalid-codepoint",
+        "(1,34): invalid-codepoint-in-body",
+        "(1,38): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg foreignObject": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "foreignObject",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "text": "fillertext"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg><foreignObject>fillertext</foreignObject></svg></body></html>",
+        "noQuirksBodyHtml": "<svg><foreignObject>fillertext</foreignObject></svg>"
+      }
+    },
+    {
+      "data": "<svg>\u0000filler\u0000text",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,6): invalid-codepoint",
+        "(1,6): invalid-codepoint-in-foreign-content",
+        "(1,13): invalid-codepoint",
+        "(1,13): invalid-codepoint-in-foreign-content",
+        "(1,17): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "�filler�text"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>�filler�text</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>�filler�text</svg>"
+      }
+    },
+    {
+      "data": "<svg>\u0000<frameset>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,6): invalid-codepoint",
+        "(1,6): invalid-codepoint-in-foreign-content",
+        "(1,16): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "�"
+                      },
+                      {
+                        "tag": "frameset",
+                        "ns": "http://www.w3.org/2000/svg"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>�<frameset></frameset></svg></body></html>",
+        "noQuirksBodyHtml": "<svg>�<frameset></frameset></svg>"
+      }
+    },
+    {
+      "data": "<svg>\u0000 <frameset>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,6): invalid-codepoint",
+        "(1,6): invalid-codepoint-in-foreign-content",
+        "(1,17): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "� "
+                      },
+                      {
+                        "tag": "frameset",
+                        "ns": "http://www.w3.org/2000/svg"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>� <frameset></frameset></svg></body></html>",
+        "noQuirksBodyHtml": "<svg>� <frameset></frameset></svg>"
+      }
+    },
+    {
+      "data": "<svg>\u0000a<frameset>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,6): invalid-codepoint",
+        "(1,6): invalid-codepoint-in-foreign-content",
+        "(1,17): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "�a"
+                      },
+                      {
+                        "tag": "frameset",
+                        "ns": "http://www.w3.org/2000/svg"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>�a<frameset></frameset></svg></body></html>",
+        "noQuirksBodyHtml": "<svg>�a<frameset></frameset></svg>"
+      }
+    },
+    {
+      "data": "<svg>\u0000</svg><frameset>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,6): invalid-codepoint",
+        "(1,6): invalid-codepoint-in-foreign-content",
+        "(1,22): unexpected-start-tag",
+        "(1,22): eof-in-frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "<svg>�</svg>"
+      }
+    },
+    {
+      "data": "<svg>\u0000 </svg><frameset>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,6): invalid-codepoint",
+        "(1,6): invalid-codepoint-in-foreign-content",
+        "(1,23): unexpected-start-tag",
+        "(1,23): eof-in-frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "<svg>� </svg>"
+      }
+    },
+    {
+      "data": "<svg>\u0000a</svg><frameset>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,6): invalid-codepoint",
+        "(1,6): invalid-codepoint-in-foreign-content",
+        "(1,23): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "�a"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>�a</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>�a</svg>"
+      }
+    },
+    {
+      "data": "<svg><path></path></svg><frameset>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,34): unexpected-start-tag",
+        "(1,34): eof-in-frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "<svg><path></path></svg>"
+      }
+    },
+    {
+      "data": "<svg><p><frameset>",
+      "errors": [
+        "(1, 5) expected-doctype-but-got-start-tag",
+        "(1, 8) unexpected-html-element-in-foreign-content",
+        "(1, 18) unexpected-start-tag",
+        "(1, 18) eof-in-frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "<svg><p><frameset></frameset></p></svg>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><pre>\r\n\r\nA</pre>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "pre": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "pre",
+                    "children": [
+                      {
+                        "text": "\nA"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><pre>\nA</pre></body></html>",
+        "noQuirksBodyHtml": "<pre>\nA</pre>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><pre>\r\rA</pre>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "pre": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "pre",
+                    "children": [
+                      {
+                        "text": "\nA"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><pre>\nA</pre></body></html>",
+        "noQuirksBodyHtml": "<pre>\nA</pre>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><pre>\rA</pre>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "pre": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "pre",
+                    "children": [
+                      {
+                        "text": "A"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><pre>A</pre></body></html>",
+        "noQuirksBodyHtml": "<pre>A</pre>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><table><tr><td><math><mtext>\u0000a",
+      "errors": [
+        "(1,44): invalid-codepoint",
+        "(1,44): invalid-codepoint-in-body",
+        "(1,45): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "math math": true,
+            "math mtext": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "math",
+                                    "ns": "http://www.w3.org/1998/Math/MathML",
+                                    "children": [
+                                      {
+                                        "tag": "mtext",
+                                        "ns": "http://www.w3.org/1998/Math/MathML",
+                                        "children": [
+                                          {
+                                            "text": "a"
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><math><mtext>a</mtext></math></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><math><mtext>a</mtext></math></td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><table><tr><td><svg><foreignObject>\u0000a",
+      "errors": [
+        "(1,51): invalid-codepoint",
+        "(1,51): invalid-codepoint-in-body",
+        "(1,52): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "svg svg": true,
+            "svg foreignObject": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "svg",
+                                    "ns": "http://www.w3.org/2000/svg",
+                                    "children": [
+                                      {
+                                        "tag": "foreignObject",
+                                        "ns": "http://www.w3.org/2000/svg",
+                                        "children": [
+                                          {
+                                            "text": "a"
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><svg><foreignObject>a</foreignObject></svg></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><svg><foreignObject>a</foreignObject></svg></td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><math><mi>a\u0000b",
+      "errors": [
+        "(1,27): invalid-codepoint",
+        "(1,27): invalid-codepoint-in-body",
+        "(1,28): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mi": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "text": "ab"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math><mi>ab</mi></math></body></html>",
+        "noQuirksBodyHtml": "<math><mi>ab</mi></math>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><math><mo>a\u0000b",
+      "errors": [
+        "(1,27): invalid-codepoint",
+        "(1,27): invalid-codepoint-in-body",
+        "(1,28): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mo": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mo",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "text": "ab"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math><mo>ab</mo></math></body></html>",
+        "noQuirksBodyHtml": "<math><mo>ab</mo></math>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><math><mn>a\u0000b",
+      "errors": [
+        "(1,27): invalid-codepoint",
+        "(1,27): invalid-codepoint-in-body",
+        "(1,28): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mn": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mn",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "text": "ab"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math><mn>ab</mn></math></body></html>",
+        "noQuirksBodyHtml": "<math><mn>ab</mn></math>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><math><ms>a\u0000b",
+      "errors": [
+        "(1,27): invalid-codepoint",
+        "(1,27): invalid-codepoint-in-body",
+        "(1,28): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math ms": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "ms",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "text": "ab"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math><ms>ab</ms></math></body></html>",
+        "noQuirksBodyHtml": "<math><ms>ab</ms></math>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><math><mtext>a\u0000b",
+      "errors": [
+        "(1,30): invalid-codepoint",
+        "(1,30): invalid-codepoint-in-body",
+        "(1,31): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mtext": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mtext",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "text": "ab"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math><mtext>ab</mtext></math></body></html>",
+        "noQuirksBodyHtml": "<math><mtext>ab</mtext></math>"
+      }
+    }
+  ],
+  "ruby.dat": [
+    {
+      "data": "<html><ruby>a<rb>b<rb></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rb": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rb",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "rb"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rb>b</rb><rb></rb></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rb>b</rb><rb></rb></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rb>b<rt></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rb": true,
+            "rt": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rb",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "rt"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rb>b</rb><rt></rt></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rb>b</rb><rt></rt></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rb>b<rtc></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rb": true,
+            "rtc": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rb",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "rtc"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rb>b</rb><rtc></rtc></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rb>b</rb><rtc></rtc></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rb>b<rp></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rb": true,
+            "rp": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rb",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "rp"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rb>b</rb><rp></rp></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rb>b</rb><rp></rp></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rb>b<span></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,31): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rb": true,
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rb",
+                        "children": [
+                          {
+                            "text": "b"
+                          },
+                          {
+                            "tag": "span"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rb>b<span></span></rb></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rb>b<span></span></rb></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rt>b<rb></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rt": true,
+            "rb": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rt",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "rb"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rt>b</rt><rb></rb></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rt>b</rt><rb></rb></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rt>b<rt></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rt": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rt",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "rt"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rt>b</rt><rt></rt></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rt>b</rt><rt></rt></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rt>b<rtc></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rt": true,
+            "rtc": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rt",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "rtc"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rt>b</rt><rtc></rtc></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rt>b</rt><rtc></rtc></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rt>b<rp></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rt": true,
+            "rp": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rt",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "rp"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rt>b</rt><rp></rp></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rt>b</rt><rp></rp></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rt>b<span></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,31): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rt": true,
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rt",
+                        "children": [
+                          {
+                            "text": "b"
+                          },
+                          {
+                            "tag": "span"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rt>b<span></span></rt></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rt>b<span></span></rt></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rtc>b<rb></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rtc": true,
+            "rb": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rtc",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "rb"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rtc>b</rtc><rb></rb></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rtc>b</rtc><rb></rb></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rtc>b<rt>c<rt>d</ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rtc": true,
+            "rt": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rtc",
+                        "children": [
+                          {
+                            "text": "b"
+                          },
+                          {
+                            "tag": "rt",
+                            "children": [
+                              {
+                                "text": "c"
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "rt",
+                            "children": [
+                              {
+                                "text": "d"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rtc>b<rt>c</rt><rt>d</rt></rtc></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rtc>b<rt>c</rt><rt>d</rt></rtc></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rtc>b<rtc></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rtc": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rtc",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "rtc"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rtc>b</rtc><rtc></rtc></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rtc>b</rtc><rtc></rtc></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rtc>b<rp></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rtc": true,
+            "rp": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rtc",
+                        "children": [
+                          {
+                            "text": "b"
+                          },
+                          {
+                            "tag": "rp"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rtc>b<rp></rp></rtc></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rtc>b<rp></rp></rtc></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rtc>b<span></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rtc": true,
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rtc",
+                        "children": [
+                          {
+                            "text": "b"
+                          },
+                          {
+                            "tag": "span"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rtc>b<span></span></rtc></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rtc>b<span></span></rtc></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rp>b<rb></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rp": true,
+            "rb": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rp",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "rb"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rp>b</rp><rb></rb></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rp>b</rp><rb></rb></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rp>b<rt></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rp": true,
+            "rt": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rp",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "rt"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rp>b</rp><rt></rt></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rp>b</rp><rt></rt></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rp>b<rtc></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rp": true,
+            "rtc": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rp",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "rtc"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rp>b</rp><rtc></rtc></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rp>b</rp><rtc></rtc></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rp>b<rp></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rp": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rp",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "rp"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rp>b</rp><rp></rp></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rp>b</rp><rp></rp></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rp>b<span></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,31): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rp": true,
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rp",
+                        "children": [
+                          {
+                            "text": "b"
+                          },
+                          {
+                            "tag": "span"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rp>b<span></span></rp></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rp>b<span></span></rp></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby><rtc><ruby>a<rb>b<rt></ruby></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rtc": true,
+            "rb": true,
+            "rt": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "tag": "rtc",
+                        "children": [
+                          {
+                            "tag": "ruby",
+                            "children": [
+                              {
+                                "text": "a"
+                              },
+                              {
+                                "tag": "rb",
+                                "children": [
+                                  {
+                                    "text": "b"
+                                  }
+                                ]
+                              },
+                              {
+                                "tag": "rt"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby><rtc><ruby>a<rb>b</rb><rt></rt></ruby></rtc></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby><rtc><ruby>a<rb>b</rb><rt></rt></ruby></rtc></ruby>"
+      }
+    }
+  ],
+  "scriptdata01.dat": [
+    {
+      "data": "FOO<script>'Hello'</script>BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "'Hello'",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "BAR"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script>'Hello'</script>BAR</body></html>",
+        "noQuirksBodyHtml": "FOO<script>'Hello'</script>BAR"
+      }
+    },
+    {
+      "data": "FOO<script></script>BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script"
+                  },
+                  {
+                    "text": "BAR"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script></script>BAR</body></html>",
+        "noQuirksBodyHtml": "FOO<script></script>BAR"
+      }
+    },
+    {
+      "data": "FOO<script></script >BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script"
+                  },
+                  {
+                    "text": "BAR"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script></script>BAR</body></html>",
+        "noQuirksBodyHtml": "FOO<script></script>BAR"
+      }
+    },
+    {
+      "data": "FOO<script></script/>BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,21): self-closing-flag-on-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script"
+                  },
+                  {
+                    "text": "BAR"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script></script>BAR</body></html>",
+        "noQuirksBodyHtml": "FOO<script></script>BAR"
+      }
+    },
+    {
+      "data": "FOO<script></script/ >BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,20): unexpected-character-after-solidus-in-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script"
+                  },
+                  {
+                    "text": "BAR"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script></script>BAR</body></html>",
+        "noQuirksBodyHtml": "FOO<script></script>BAR"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "text/plain"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "</scriptx>BAR",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script type=\"text/plain\"></scriptx>BAR</script></body></html>",
+        "noQuirksBodyHtml": "FOO<script type=\"text/plain\"></scriptx>BAR</script>"
+      }
+    },
+    {
+      "data": "FOO<script></script foo=\">\" dd>BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars",
+        "(1,31): attributes-in-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script"
+                  },
+                  {
+                    "text": "BAR"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script></script>BAR</body></html>",
+        "noQuirksBodyHtml": "FOO<script></script>BAR"
+      }
+    },
+    {
+      "data": "FOO<script>'<'</script>BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "'<'",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "BAR"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script>'<'</script>BAR</body></html>",
+        "noQuirksBodyHtml": "FOO<script>'<'</script>BAR"
+      }
+    },
+    {
+      "data": "FOO<script>'<!'</script>BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "'<!'",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "BAR"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script>'<!'</script>BAR</body></html>",
+        "noQuirksBodyHtml": "FOO<script>'<!'</script>BAR"
+      }
+    },
+    {
+      "data": "FOO<script>'<!-'</script>BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "'<!-'",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "BAR"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script>'<!-'</script>BAR</body></html>",
+        "noQuirksBodyHtml": "FOO<script>'<!-'</script>BAR"
+      }
+    },
+    {
+      "data": "FOO<script>'<!--'</script>BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "'<!--'",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "BAR"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script>'<!--'</script>BAR</body></html>",
+        "noQuirksBodyHtml": "FOO<script>'<!--'</script>BAR"
+      }
+    },
+    {
+      "data": "FOO<script>'<!---'</script>BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "'<!---'",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "BAR"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script>'<!---'</script>BAR</body></html>",
+        "noQuirksBodyHtml": "FOO<script>'<!---'</script>BAR"
+      }
+    },
+    {
+      "data": "FOO<script>'<!-->'</script>BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "'<!-->'",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "BAR"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script>'<!-->'</script>BAR</body></html>",
+        "noQuirksBodyHtml": "FOO<script>'<!-->'</script>BAR"
+      }
+    },
+    {
+      "data": "FOO<script>'<!-->'</script>BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "'<!-->'",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "BAR"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script>'<!-->'</script>BAR</body></html>",
+        "noQuirksBodyHtml": "FOO<script>'<!-->'</script>BAR"
+      }
+    },
+    {
+      "data": "FOO<script>'<!-- potato'</script>BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "'<!-- potato'",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "BAR"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script>'<!-- potato'</script>BAR</body></html>",
+        "noQuirksBodyHtml": "FOO<script>'<!-- potato'</script>BAR"
+      }
+    },
+    {
+      "data": "FOO<script>'<!-- <sCrIpt'</script>BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "'<!-- <sCrIpt'",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "BAR"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script>'<!-- <sCrIpt'</script>BAR</body></html>",
+        "noQuirksBodyHtml": "FOO<script>'<!-- <sCrIpt'</script>BAR"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "text/plain"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "'<!-- <sCrIpt>'</script>BAR",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script type=\"text/plain\">'<!-- <sCrIpt>'</script>BAR</script></body></html>",
+        "noQuirksBodyHtml": "FOO<script type=\"text/plain\">'<!-- <sCrIpt>'</script>BAR</script>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "text/plain"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "'<!-- <sCrIpt> -'</script>BAR",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script type=\"text/plain\">'<!-- <sCrIpt> -'</script>BAR</script></body></html>",
+        "noQuirksBodyHtml": "FOO<script type=\"text/plain\">'<!-- <sCrIpt> -'</script>BAR</script>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "text/plain"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "'<!-- <sCrIpt> --'</script>BAR",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script type=\"text/plain\">'<!-- <sCrIpt> --'</script>BAR</script></body></html>",
+        "noQuirksBodyHtml": "FOO<script type=\"text/plain\">'<!-- <sCrIpt> --'</script>BAR</script>"
+      }
+    },
+    {
+      "data": "FOO<script>'<!-- <sCrIpt> -->'</script>BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "'<!-- <sCrIpt> -->'",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "BAR"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script>'<!-- <sCrIpt> -->'</script>BAR</body></html>",
+        "noQuirksBodyHtml": "FOO<script>'<!-- <sCrIpt> -->'</script>BAR"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "text/plain"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "'<!-- <sCrIpt> --!>'</script>BAR",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script type=\"text/plain\">'<!-- <sCrIpt> --!>'</script>BAR</script></body></html>",
+        "noQuirksBodyHtml": "FOO<script type=\"text/plain\">'<!-- <sCrIpt> --!>'</script>BAR</script>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "text/plain"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "'<!-- <sCrIpt> -- >'</script>BAR",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script type=\"text/plain\">'<!-- <sCrIpt> -- >'</script>BAR</script></body></html>",
+        "noQuirksBodyHtml": "FOO<script type=\"text/plain\">'<!-- <sCrIpt> -- >'</script>BAR</script>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "text/plain"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "'<!-- <sCrIpt '</script>BAR",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script type=\"text/plain\">'<!-- <sCrIpt '</script>BAR</script></body></html>",
+        "noQuirksBodyHtml": "FOO<script type=\"text/plain\">'<!-- <sCrIpt '</script>BAR</script>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "text/plain"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "'<!-- <sCrIpt/'</script>BAR",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script type=\"text/plain\">'<!-- <sCrIpt/'</script>BAR</script></body></html>",
+        "noQuirksBodyHtml": "FOO<script type=\"text/plain\">'<!-- <sCrIpt/'</script>BAR</script>"
+      }
+    },
+    {
+      "data": "FOO<script type=\"text/plain\">'<!-- <sCrIpt\\'</script>BAR",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "text/plain"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "'<!-- <sCrIpt\\'",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "BAR"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script type=\"text/plain\">'<!-- <sCrIpt\\'</script>BAR</body></html>",
+        "noQuirksBodyHtml": "FOO<script type=\"text/plain\">'<!-- <sCrIpt\\'</script>BAR"
+      }
+    },
+    {
+      "data": "FOO<script type=\"text/plain\">'<!-- <sCrIpt/'</script>BAR</script>QUX",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "text/plain"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "'<!-- <sCrIpt/'</script>BAR",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "QUX"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script type=\"text/plain\">'<!-- <sCrIpt/'</script>BAR</script>QUX</body></html>",
+        "noQuirksBodyHtml": "FOO<script type=\"text/plain\">'<!-- <sCrIpt/'</script>BAR</script>QUX"
+      }
+    },
+    {
+      "data": "FOO<script><!--<script>-></script>--></script>QUX",
+      "errors": [
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "FOO"
+                  },
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script>-></script>-->",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "QUX"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>FOO<script><!--<script>-></script>--></script>QUX</body></html>",
+        "noQuirksBodyHtml": "FOO<script><!--<script>-></script>--></script>QUX"
+      }
+    }
+  ],
+  "tables01.dat": [
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "th": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "th"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><tr><th></th></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><th></th></tr></tbody></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><tr><td></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td></td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<table><col foo='bar'>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,22): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "colgroup": true,
+            "col": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "colgroup",
+                        "children": [
+                          {
+                            "tag": "col",
+                            "attrs": [
+                              {
+                                "name": "foo",
+                                "value": "bar"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><colgroup><col foo=\"bar\"></colgroup></table></body></html>",
+        "noQuirksBodyHtml": "<table><colgroup><col foo=\"bar\"></colgroup></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "colgroup": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "foo"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "colgroup"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>foo<table><colgroup></colgroup></table></body></html>",
+        "noQuirksBodyHtml": "foo<table><colgroup></colgroup></table>"
+      }
+    },
+    {
+      "data": "<table></table><p>foo",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table"
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "foo"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table></table><p>foo</p></body></html>",
+        "noQuirksBodyHtml": "<table></table><p>foo</p>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><tr><td></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td></td></tr></tbody></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "option": true,
+            "table": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "option",
+                        "children": [
+                          {
+                            "text": "3"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><select><option>3</option></select><table></table></body></html>",
+        "noQuirksBodyHtml": "<select><option>3</option></select><table></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "table": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select"
+                  },
+                  {
+                    "tag": "table"
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><select></select><table></table><table></table></body></html>",
+        "noQuirksBodyHtml": "<select></select><table></table><table></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "table": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select"
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><select></select><table></table></body></html>",
+        "noQuirksBodyHtml": "<select></select><table></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "option": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "option",
+                        "children": [
+                          {
+                            "text": "A"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "text": "B"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><select><option>A</option></select><table><tbody><tr><td>B</td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<select><option>A</option></select><table><tbody><tr><td>B</td></tr></tbody></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "text": "foo"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><tr><td>foo</td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td>foo</td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<table><td>A</table>B",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,11): unexpected-cell-in-table-body"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "text": "A"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "text": "B"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><tr><td>A</td></tr></tbody></table>B</body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td>A</td></tr></tbody></table>B"
+      }
+    },
+    {
+      "data": "<table><tr><caption>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,20): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "caption": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "caption"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><tr></tr></tbody><caption></caption></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr></tr></tbody><caption></caption></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "text": "foo"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><tr><td>foo</td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td>foo</td></tr></tbody></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td"
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><tr><td></td></tr><tr></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td></td></tr><tr></tr></tbody></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "button": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "button"
+                                  }
+                                ]
+                              },
+                              {
+                                "tag": "td"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><tr><td><button></button></td><td></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><button></button></td><td></td></tr></tbody></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "svg svg": true,
+            "svg desc": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "svg",
+                                    "ns": "http://www.w3.org/2000/svg",
+                                    "children": [
+                                      {
+                                        "tag": "desc",
+                                        "ns": "http://www.w3.org/2000/svg"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              },
+                              {
+                                "tag": "td"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><tr><td><svg><desc></desc></svg></td><td></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><svg><desc></desc></svg></td><td></td></tr></tbody></table>"
+      }
+    }
+  ],
+  "template.dat": [
+    {
+      "data": "<body><template>Hello</template>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "text": "Hello"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template>Hello</template></body></html>",
+        "noQuirksBodyHtml": "<template>Hello</template>"
+      }
+    },
+    {
+      "data": "<template>Hello</template>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "text": "Hello"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template>Hello</template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template>Hello</template>"
+      }
+    },
+    {
+      "data": "<template></template><div></div>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "body": true,
+            "div": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template></template></head><body><div></div></body></html>",
+        "noQuirksBodyHtml": "<template></template><div></div>"
+      }
+    },
+    {
+      "data": "<html><template>Hello</template>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "text": "Hello"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template>Hello</template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template>Hello</template>"
+      }
+    },
+    {
+      "data": "<head><template><div></div></template></head>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "div": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "div"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><div></div></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><div></div></template>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "template": true,
+            "span": true,
+            "b": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "template",
+                        "children": [
+                          {
+                            "content": true,
+                            "children": [
+                              {
+                                "tag": "div",
+                                "children": [
+                                  {
+                                    "tag": "span"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "b"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div><template><div><span></span></div></template><b></b></div></body></html>",
+        "noQuirksBodyHtml": "<div><template><div><span></span></div></template><b></b></div>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "template": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "template",
+                        "children": [
+                          {
+                            "content": true,
+                            "children": [
+                              {
+                                "text": "Hello"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div><template>Hello</template></div></body></html>",
+        "noQuirksBodyHtml": "<div><template>Hello</template></div>"
+      }
+    },
+    {
+      "data": "<div></template></div>",
+      "errors": [
+        " * (1,6) missing DOCTYPE",
+        " * (1,17) unexpected template end tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div></div></body></html>",
+        "noQuirksBodyHtml": "<div></div>"
+      }
+    },
+    {
+      "data": "<table><template></template></table>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "template": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "template",
+                        "children": [
+                          {
+                            "content": true
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><template></template></table></body></html>",
+        "noQuirksBodyHtml": "<table><template></template></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "template": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "template",
+                        "children": [
+                          {
+                            "content": true
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><template></template></table></body></html>",
+        "noQuirksBodyHtml": "<table><template></template></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "template": true,
+            "table": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "template",
+                        "children": [
+                          {
+                            "content": true
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div><template></template></div><table></table></body></html>",
+        "noQuirksBodyHtml": "<div><template></template></div><table></table>"
+      }
+    },
+    {
+      "data": "<table><template></template><div></div>",
+      "errors": [
+        "no doctype",
+        "bad div in table",
+        "bad /div in table",
+        "eof in table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "table": true,
+            "template": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "template",
+                        "children": [
+                          {
+                            "content": true
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div></div><table><template></template></table></body></html>",
+        "noQuirksBodyHtml": "<div></div><table><template></template></table>"
+      }
+    },
+    {
+      "data": "<table>   <template></template></table>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "template": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "text": "   "
+                      },
+                      {
+                        "tag": "template",
+                        "children": [
+                          {
+                            "content": true
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table>   <template></template></table></body></html>",
+        "noQuirksBodyHtml": "<table>   <template></template></table>"
+      }
+    },
+    {
+      "data": "<table><tbody><template></template></tbody>",
+      "errors": [
+        "no doctype",
+        "eof in table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "template": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><template></template></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><template></template></tbody></table>"
+      }
+    },
+    {
+      "data": "<table><tbody><template></tbody></template>",
+      "errors": [
+        "no doctype",
+        "bad /tbody",
+        "eof in table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "template": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><template></template></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><template></template></tbody></table>"
+      }
+    },
+    {
+      "data": "<table><tbody><template></template></tbody></table>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "template": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><template></template></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><template></template></tbody></table>"
+      }
+    },
+    {
+      "data": "<table><thead><template></template></thead>",
+      "errors": [
+        "no doctype",
+        "eof in table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "thead": true,
+            "template": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "thead",
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><thead><template></template></thead></table></body></html>",
+        "noQuirksBodyHtml": "<table><thead><template></template></thead></table>"
+      }
+    },
+    {
+      "data": "<table><tfoot><template></template></tfoot>",
+      "errors": [
+        "no doctype",
+        "eof in table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tfoot": true,
+            "template": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tfoot",
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tfoot><template></template></tfoot></table></body></html>",
+        "noQuirksBodyHtml": "<table><tfoot><template></template></tfoot></table>"
+      }
+    },
+    {
+      "data": "<select><template></template></select>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "template": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "template",
+                        "children": [
+                          {
+                            "content": true
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><select><template></template></select></body></html>",
+        "noQuirksBodyHtml": "<select><template></template></select>"
+      }
+    },
+    {
+      "data": "<select><template><option></option></template></select>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "template": true,
+            "option": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "template",
+                        "children": [
+                          {
+                            "content": true,
+                            "children": [
+                              {
+                                "tag": "option"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><select><template><option></option></template></select></body></html>",
+        "noQuirksBodyHtml": "<select><template><option></option></template></select>"
+      }
+    },
+    {
+      "data": "<template><option></option></select><option></option></template>",
+      "errors": [
+        "no doctype",
+        "bad /select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "option": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "option"
+                          },
+                          {
+                            "tag": "option"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><option></option><option></option></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><option></option><option></option></template>"
+      }
+    },
+    {
+      "data": "<select><template></template><option></select>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "template": true,
+            "option": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "template",
+                        "children": [
+                          {
+                            "content": true
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "option"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><select><template></template><option></option></select></body></html>",
+        "noQuirksBodyHtml": "<select><template></template><option></option></select>"
+      }
+    },
+    {
+      "data": "<select><option><template></template></select>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "option": true,
+            "template": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "option",
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><select><option><template></template></option></select></body></html>",
+        "noQuirksBodyHtml": "<select><option><template></template></option></select>"
+      }
+    },
+    {
+      "data": "<select><template>",
+      "errors": [
+        "no doctype",
+        "eof in template",
+        "eof in select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "template": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "template",
+                        "children": [
+                          {
+                            "content": true
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><select><template></template></select></body></html>",
+        "noQuirksBodyHtml": "<select><template></template></select>"
+      }
+    },
+    {
+      "data": "<select><option></option><template>",
+      "errors": [
+        "no doctype",
+        "eof in template",
+        "eof in select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "option": true,
+            "template": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "option"
+                      },
+                      {
+                        "tag": "template",
+                        "children": [
+                          {
+                            "content": true
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><select><option></option><template></template></select></body></html>",
+        "noQuirksBodyHtml": "<select><option></option><template></template></select>"
+      }
+    },
+    {
+      "data": "<select><option></option><template><option>",
+      "errors": [
+        "no doctype",
+        "eof in template",
+        "eof in select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "option": true,
+            "template": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "option"
+                      },
+                      {
+                        "tag": "template",
+                        "children": [
+                          {
+                            "content": true,
+                            "children": [
+                              {
+                                "tag": "option"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><select><option></option><template><option></option></template></select></body></html>",
+        "noQuirksBodyHtml": "<select><option></option><template><option></option></template></select>"
+      }
+    },
+    {
+      "data": "<table><thead><template><td></template></table>",
+      "errors": [
+        " * (1,8) missing DOCTYPE"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "thead": true,
+            "template": true,
+            "td": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "thead",
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true,
+                                "children": [
+                                  {
+                                    "tag": "td"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><thead><template><td></td></template></thead></table></body></html>",
+        "noQuirksBodyHtml": "<table><thead><template><td></td></template></thead></table>"
+      }
+    },
+    {
+      "data": "<table><template><thead></template></table>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "template": true,
+            "thead": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "template",
+                        "children": [
+                          {
+                            "content": true,
+                            "children": [
+                              {
+                                "tag": "thead"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><template><thead></thead></template></table></body></html>",
+        "noQuirksBodyHtml": "<table><template><thead></thead></template></table>"
+      }
+    },
+    {
+      "data": "<body><table><template><td></tr><div></template></table>",
+      "errors": [
+        "no doctype",
+        "bad </tr>",
+        "missing </div>"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "template": true,
+            "td": true,
+            "div": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "template",
+                        "children": [
+                          {
+                            "content": true,
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "div"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><template><td><div></div></td></template></table></body></html>",
+        "noQuirksBodyHtml": "<table><template><td><div></div></td></template></table>"
+      }
+    },
+    {
+      "data": "<table><template><thead></template></thead></table>",
+      "errors": [
+        "no doctype",
+        "bad /thead after /template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "template": true,
+            "thead": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "template",
+                        "children": [
+                          {
+                            "content": true,
+                            "children": [
+                              {
+                                "tag": "thead"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><template><thead></thead></template></table></body></html>",
+        "noQuirksBodyHtml": "<table><template><thead></thead></template></table>"
+      }
+    },
+    {
+      "data": "<table><thead><template><tr></template></table>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "thead": true,
+            "template": true,
+            "tr": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "thead",
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true,
+                                "children": [
+                                  {
+                                    "tag": "tr"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><thead><template><tr></tr></template></thead></table></body></html>",
+        "noQuirksBodyHtml": "<table><thead><template><tr></tr></template></thead></table>"
+      }
+    },
+    {
+      "data": "<table><template><tr></template></table>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "template": true,
+            "tr": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "template",
+                        "children": [
+                          {
+                            "content": true,
+                            "children": [
+                              {
+                                "tag": "tr"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><template><tr></tr></template></table></body></html>",
+        "noQuirksBodyHtml": "<table><template><tr></tr></template></table>"
+      }
+    },
+    {
+      "data": "<table><tr><template><td>",
+      "errors": [
+        "no doctype",
+        "eof in template",
+        "eof in table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "template": true,
+            "td": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "template",
+                                "children": [
+                                  {
+                                    "content": true,
+                                    "children": [
+                                      {
+                                        "tag": "td"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><tr><template><td></td></template></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><template><td></td></template></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<table><template><tr><template><td></template></tr></template></table>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "template": true,
+            "tr": true,
+            "td": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "template",
+                        "children": [
+                          {
+                            "content": true,
+                            "children": [
+                              {
+                                "tag": "tr",
+                                "children": [
+                                  {
+                                    "tag": "template",
+                                    "children": [
+                                      {
+                                        "content": true,
+                                        "children": [
+                                          {
+                                            "tag": "td"
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><template><tr><template><td></td></template></tr></template></table></body></html>",
+        "noQuirksBodyHtml": "<table><template><tr><template><td></td></template></tr></template></table>"
+      }
+    },
+    {
+      "data": "<table><template><tr><template><td></td></template></tr></template></table>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "template": true,
+            "tr": true,
+            "td": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "template",
+                        "children": [
+                          {
+                            "content": true,
+                            "children": [
+                              {
+                                "tag": "tr",
+                                "children": [
+                                  {
+                                    "tag": "template",
+                                    "children": [
+                                      {
+                                        "content": true,
+                                        "children": [
+                                          {
+                                            "tag": "td"
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><template><tr><template><td></td></template></tr></template></table></body></html>",
+        "noQuirksBodyHtml": "<table><template><tr><template><td></td></template></tr></template></table>"
+      }
+    },
+    {
+      "data": "<table><template><td></template>",
+      "errors": [
+        "no doctype",
+        "eof in table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "template": true,
+            "td": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "template",
+                        "children": [
+                          {
+                            "content": true,
+                            "children": [
+                              {
+                                "tag": "td"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><template><td></td></template></table></body></html>",
+        "noQuirksBodyHtml": "<table><template><td></td></template></table>"
+      }
+    },
+    {
+      "data": "<body><template><td></td></template>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "td": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "td"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><td></td></template></body></html>",
+        "noQuirksBodyHtml": "<template><td></td></template>"
+      }
+    },
+    {
+      "data": "<body><template><template><tr></tr></template><td></td></template>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "tr": true,
+            "td": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true,
+                                "children": [
+                                  {
+                                    "tag": "tr"
+                                  }
+                                ]
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "td"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><template><tr></tr></template><td></td></template></body></html>",
+        "noQuirksBodyHtml": "<template><template><tr></tr></template><td></td></template>"
+      }
+    },
+    {
+      "data": "<table><colgroup><template><col>",
+      "errors": [
+        "no doctype",
+        "eof in template",
+        "eof in table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "colgroup": true,
+            "template": true,
+            "col": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "colgroup",
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true,
+                                "children": [
+                                  {
+                                    "tag": "col"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><colgroup><template><col></template></colgroup></table></body></html>",
+        "noQuirksBodyHtml": "<table><colgroup><template><col></template></colgroup></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true,
+            "frame": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset",
+                "children": [
+                  {
+                    "tag": "frame"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset><frame></frameset></html>",
+        "noQuirksBodyHtml": "<template></template>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template></template>"
+      }
+    },
+    {
+      "data": "<template><div><frameset><span></span></div><span></span></template>",
+      "errors": [
+        "no doctype",
+        "bad frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "div": true,
+            "span": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "div",
+                            "children": [
+                              {
+                                "tag": "span"
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "span"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><div><span></span></div><span></span></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><div><span></span></div><span></span></template>"
+      }
+    },
+    {
+      "data": "<body><template><div><frameset><span></span></div><span></span></template></body>",
+      "errors": [
+        "no doctype",
+        "bad frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "div": true,
+            "span": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "div",
+                            "children": [
+                              {
+                                "tag": "span"
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "span"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><div><span></span></div><span></span></template></body></html>",
+        "noQuirksBodyHtml": "<template><div><span></span></div><span></span></template>"
+      }
+    },
+    {
+      "data": "<body><template><script>var i = 1;</script><td></td></template>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "script": true,
+            "td": true
+          },
+          "template": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "script",
+                            "children": [
+                              {
+                                "text": "var i = 1;",
+                                "no_escape": true
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "td"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><script>var i = 1;</script><td></td></template></body></html>",
+        "noQuirksBodyHtml": "<template><script>var i = 1;</script><td></td></template>"
+      }
+    },
+    {
+      "data": "<body><template><tr><div></div></tr></template>",
+      "errors": [
+        "no doctype",
+        "foster-parented div",
+        "foster-parented /div"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "tr": true,
+            "div": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "tr"
+                          },
+                          {
+                            "tag": "div"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><tr></tr><div></div></template></body></html>",
+        "noQuirksBodyHtml": "<template><tr></tr><div></div></template>"
+      }
+    },
+    {
+      "data": "<body><template><tr></tr><td></td></template>",
+      "errors": [
+        "no doctype",
+        "unexpected <td>"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "tr": true,
+            "td": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "tr"
+                          },
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><tr></tr><tr><td></td></tr></template></body></html>",
+        "noQuirksBodyHtml": "<template><tr></tr><tr><td></td></tr></template>"
+      }
+    },
+    {
+      "data": "<body><template><td></td></tr><td></td></template>",
+      "errors": [
+        "no doctype",
+        "bad </tr>"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "td": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "td"
+                          },
+                          {
+                            "tag": "td"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><td></td><td></td></template></body></html>",
+        "noQuirksBodyHtml": "<template><td></td><td></td></template>"
+      }
+    },
+    {
+      "data": "<body><template><td></td><tbody><td></td></template>",
+      "errors": [
+        "no doctype",
+        "bad <tbody>"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "td": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "td"
+                          },
+                          {
+                            "tag": "td"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><td></td><td></td></template></body></html>",
+        "noQuirksBodyHtml": "<template><td></td><td></td></template>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "td": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "td"
+                          },
+                          {
+                            "tag": "td"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><td></td><td></td></template></body></html>",
+        "noQuirksBodyHtml": "<template><td></td><td></td></template>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "td": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "td"
+                          },
+                          {
+                            "tag": "td"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><td></td><td></td></template></body></html>",
+        "noQuirksBodyHtml": "<template><td></td><td></td></template>"
+      }
+    },
+    {
+      "data": "<body><template><td></td></table><td></td></template>",
+      "errors": [
+        "no doctype",
+        "bad </table>"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "td": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "td"
+                          },
+                          {
+                            "tag": "td"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><td></td><td></td></template></body></html>",
+        "noQuirksBodyHtml": "<template><td></td><td></td></template>"
+      }
+    },
+    {
+      "data": "<body><template><tr></tr><tbody><tr></tr></template>",
+      "errors": [
+        "no doctype",
+        "bad <tbody>"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "tr": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "tr"
+                          },
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><tr></tr><tr></tr></template></body></html>",
+        "noQuirksBodyHtml": "<template><tr></tr><tr></tr></template>"
+      }
+    },
+    {
+      "data": "<body><template><tr></tr><caption><tr></tr></template>",
+      "errors": [
+        "no doctype",
+        "bad <caption>"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "tr": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "tr"
+                          },
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><tr></tr><tr></tr></template></body></html>",
+        "noQuirksBodyHtml": "<template><tr></tr><tr></tr></template>"
+      }
+    },
+    {
+      "data": "<body><template><tr></tr></table><tr></tr></template>",
+      "errors": [
+        "no doctype",
+        "bad </table>"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "tr": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "tr"
+                          },
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><tr></tr><tr></tr></template></body></html>",
+        "noQuirksBodyHtml": "<template><tr></tr><tr></tr></template>"
+      }
+    },
+    {
+      "data": "<body><template><thead></thead><caption></caption><tbody></tbody></template>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "thead": true,
+            "caption": true,
+            "tbody": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "thead"
+                          },
+                          {
+                            "tag": "caption"
+                          },
+                          {
+                            "tag": "tbody"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><thead></thead><caption></caption><tbody></tbody></template></body></html>",
+        "noQuirksBodyHtml": "<template><thead></thead><caption></caption><tbody></tbody></template>"
+      }
+    },
+    {
+      "data": "<body><template><thead></thead></table><tbody></tbody></template></body>",
+      "errors": [
+        "no doctype",
+        "bad </table>"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "thead": true,
+            "tbody": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "thead"
+                          },
+                          {
+                            "tag": "tbody"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><thead></thead><tbody></tbody></template></body></html>",
+        "noQuirksBodyHtml": "<template><thead></thead><tbody></tbody></template>"
+      }
+    },
+    {
+      "data": "<body><template><div><tr></tr></div></template>",
+      "errors": [
+        "no doctype",
+        "bad tr",
+        "bad /tr"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "div": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "div"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><div></div></template></body></html>",
+        "noQuirksBodyHtml": "<template><div></div></template>"
+      }
+    },
+    {
+      "data": "<body><template><em>Hello</em></template>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "em": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "em",
+                            "children": [
+                              {
+                                "text": "Hello"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><em>Hello</em></template></body></html>",
+        "noQuirksBodyHtml": "<template><em>Hello</em></template>"
+      }
+    },
+    {
+      "data": "<body><template><!--comment--></template>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true
+          },
+          "template": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "comment": "comment"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><!--comment--></template></body></html>",
+        "noQuirksBodyHtml": "<template><!--comment--></template>"
+      }
+    },
+    {
+      "data": "<body><template><style></style><td></td></template>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "style": true,
+            "td": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "style"
+                          },
+                          {
+                            "tag": "td"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><style></style><td></td></template></body></html>",
+        "noQuirksBodyHtml": "<template><style></style><td></td></template>"
+      }
+    },
+    {
+      "data": "<body><template><meta><td></td></template>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "meta": true,
+            "td": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "meta"
+                          },
+                          {
+                            "tag": "td"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><meta><td></td></template></body></html>",
+        "noQuirksBodyHtml": "<template><meta><td></td></template>"
+      }
+    },
+    {
+      "data": "<body><template><link><td></td></template>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "link": true,
+            "td": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "link"
+                          },
+                          {
+                            "tag": "td"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><link><td></td></template></body></html>",
+        "noQuirksBodyHtml": "<template><link><td></td></template>"
+      }
+    },
+    {
+      "data": "<body><template><template><tr></tr></template><td></td></template>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "tr": true,
+            "td": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true,
+                                "children": [
+                                  {
+                                    "tag": "tr"
+                                  }
+                                ]
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "td"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><template><tr></tr></template><td></td></template></body></html>",
+        "noQuirksBodyHtml": "<template><template><tr></tr></template><td></td></template>"
+      }
+    },
+    {
+      "data": "<body><table><colgroup><template><col></col></template></colgroup></table></body>",
+      "errors": [
+        "no doctype",
+        "bad /col"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "colgroup": true,
+            "template": true,
+            "col": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "colgroup",
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true,
+                                "children": [
+                                  {
+                                    "tag": "col"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><colgroup><template><col></template></colgroup></table></body></html>",
+        "noQuirksBodyHtml": "<table><colgroup><template><col></template></colgroup></table>"
+      }
+    },
+    {
+      "data": "<body a=b><template><div></div><body c=d><div></div></body></template></body>",
+      "errors": [
+        "no doctype",
+        "bad <body>",
+        "bad </body>"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "div": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "attrs": [
+                  {
+                    "name": "a",
+                    "value": "b"
+                  }
+                ],
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "div"
+                          },
+                          {
+                            "tag": "div"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body a=\"b\"><template><div></div><div></div></template></body></html>",
+        "noQuirksBodyHtml": "<template><div></div><div></div></template>"
+      }
+    },
+    {
+      "data": "<html a=b><template><div><html b=c><span></template>",
+      "errors": [
+        "no doctype",
+        "bad <html>",
+        "missing end tags in template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "div": true,
+            "span": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "attrs": [
+              {
+                "name": "a",
+                "value": "b"
+              }
+            ],
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "div",
+                            "children": [
+                              {
+                                "tag": "span"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html a=\"b\"><head><template><div><span></span></div></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><div><span></span></div></template>"
+      }
+    },
+    {
+      "data": "<html a=b><template><col></col><html b=c><col></col></template>",
+      "errors": [
+        "no doctype",
+        "bad /col",
+        "bad html",
+        "bad /col"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "col": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "attrs": [
+              {
+                "name": "a",
+                "value": "b"
+              }
+            ],
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "col"
+                          },
+                          {
+                            "tag": "col"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html a=\"b\"><head><template><col><col></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><col><col></template>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "attrs": [
+              {
+                "name": "a",
+                "value": "b"
+              }
+            ],
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html a=\"b\"><head><template></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template></template>"
+      }
+    },
+    {
+      "data": "<body><template><tr></tr><template></template><td></td></template>",
+      "errors": [
+        "no doctype",
+        "unexpected <td>"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "tr": true,
+            "td": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "tr"
+                          },
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><tr></tr><template></template><tr><td></td></tr></template></body></html>",
+        "noQuirksBodyHtml": "<template><tr></tr><template></template><tr><td></td></tr></template>"
+      }
+    },
+    {
+      "data": "<body><template><thead></thead><template><tr></tr></template><tr></tr><tfoot></tfoot></template>",
+      "errors": [
+        "no doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "thead": true,
+            "tr": true,
+            "tbody": true,
+            "tfoot": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "thead"
+                          },
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true,
+                                "children": [
+                                  {
+                                    "tag": "tr"
+                                  }
+                                ]
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "tbody",
+                            "children": [
+                              {
+                                "tag": "tr"
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "tfoot"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><thead></thead><template><tr></tr></template><tbody><tr></tr></tbody><tfoot></tfoot></template></body></html>",
+        "noQuirksBodyHtml": "<template><thead></thead><template><tr></tr></template><tbody><tr></tr></tbody><tfoot></tfoot></template>"
+      }
+    },
+    {
+      "data": "<body><template><template><b><template></template></template>text</template>",
+      "errors": [
+        "no doctype",
+        "missing </b>"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "b": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true,
+                                "children": [
+                                  {
+                                    "tag": "b",
+                                    "children": [
+                                      {
+                                        "tag": "template",
+                                        "children": [
+                                          {
+                                            "content": true
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          },
+                          {
+                            "text": "text"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><template><b><template></template></b></template>text</template></body></html>",
+        "noQuirksBodyHtml": "<template><template><b><template></template></b></template>text</template>"
+      }
+    },
+    {
+      "data": "<body><template><col><colgroup>",
+      "errors": [
+        "no doctype",
+        "bad colgroup",
+        "eof in template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "col": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "col"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><col></template></body></html>",
+        "noQuirksBodyHtml": "<template><col></template>"
+      }
+    },
+    {
+      "data": "<body><template><col></colgroup>",
+      "errors": [
+        "no doctype",
+        "bogus /colgroup",
+        "eof in template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "col": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "col"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><col></template></body></html>",
+        "noQuirksBodyHtml": "<template><col></template>"
+      }
+    },
+    {
+      "data": "<body><template><col><colgroup></template></body>",
+      "errors": [
+        "no doctype",
+        "bad colgroup"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "col": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "col"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><col></template></body></html>",
+        "noQuirksBodyHtml": "<template><col></template>"
+      }
+    },
+    {
+      "data": "<body><template><col><div>",
+      "errors": [
+        " * (1,7) missing DOCTYPE",
+        " * (1,27) unexpected token",
+        " * (1,27) unexpected end of file in template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "col": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "col"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><col></template></body></html>",
+        "noQuirksBodyHtml": "<template><col></template>"
+      }
+    },
+    {
+      "data": "<body><template><col></div>",
+      "errors": [
+        "no doctype",
+        "bad /div",
+        "eof in template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "col": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "col"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><col></template></body></html>",
+        "noQuirksBodyHtml": "<template><col></template>"
+      }
+    },
+    {
+      "data": "<body><template><col>Hello",
+      "errors": [
+        "no doctype",
+        "unexpected text",
+        "eof in template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "col": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "col"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><col></template></body></html>",
+        "noQuirksBodyHtml": "<template><col></template>"
+      }
+    },
+    {
+      "data": "<body><template><i><menu>Foo</i>",
+      "errors": [
+        "no doctype",
+        "mising /menu",
+        "eof in template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "i": true,
+            "menu": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "i"
+                          },
+                          {
+                            "tag": "menu",
+                            "children": [
+                              {
+                                "tag": "i",
+                                "children": [
+                                  {
+                                    "text": "Foo"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><i></i><menu><i>Foo</i></menu></template></body></html>",
+        "noQuirksBodyHtml": "<template><i></i><menu><i>Foo</i></menu></template>"
+      }
+    },
+    {
+      "data": "<body><template></div><div>Foo</div><template></template><tr></tr>",
+      "errors": [
+        "no doctype",
+        "bogus /div",
+        "bogus tr",
+        "bogus /tr",
+        "eof in template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true,
+            "div": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "div",
+                            "children": [
+                              {
+                                "text": "Foo"
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template><div>Foo</div><template></template></template></body></html>",
+        "noQuirksBodyHtml": "<template><div>Foo</div><template></template></template>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "template": true,
+            "tr": true,
+            "td": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "template",
+                        "children": [
+                          {
+                            "content": true,
+                            "children": [
+                              {
+                                "tag": "tr",
+                                "children": [
+                                  {
+                                    "tag": "td",
+                                    "children": [
+                                      {
+                                        "text": "Foo"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div><template><tr><td>Foo</td></tr></template></div></body></html>",
+        "noQuirksBodyHtml": "<div><template><tr><td>Foo</td></tr></template></div>"
+      }
+    },
+    {
+      "data": "<template></figcaption><sub><table></table>",
+      "errors": [
+        "no doctype",
+        "bad /figcaption",
+        "eof in template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "sub": true,
+            "table": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "sub",
+                            "children": [
+                              {
+                                "tag": "table"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><sub><table></table></sub></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><sub><table></table></sub></template>"
+      }
+    },
+    {
+      "data": "<template><template>",
+      "errors": [
+        "no doctype",
+        "eof in template",
+        "eof in template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><template></template></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><template></template></template>"
+      }
+    },
+    {
+      "data": "<template><div>",
+      "errors": [
+        "no doctype",
+        "eof in template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "div": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "div"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><div></div></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><div></div></template>"
+      }
+    },
+    {
+      "data": "<template><template><div>",
+      "errors": [
+        "no doctype",
+        "eof in template",
+        "eof in template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "div": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true,
+                                "children": [
+                                  {
+                                    "tag": "div"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><template><div></div></template></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><template><div></div></template></template>"
+      }
+    },
+    {
+      "data": "<template><template><table>",
+      "errors": [
+        "no doctype",
+        "eof in template",
+        "eof in template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "table": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true,
+                                "children": [
+                                  {
+                                    "tag": "table"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><template><table></table></template></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><template><table></table></template></template>"
+      }
+    },
+    {
+      "data": "<template><template><tbody>",
+      "errors": [
+        "no doctype",
+        "eof in template",
+        "eof in template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "tbody": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true,
+                                "children": [
+                                  {
+                                    "tag": "tbody"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><template><tbody></tbody></template></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><template><tbody></tbody></template></template>"
+      }
+    },
+    {
+      "data": "<template><template><tr>",
+      "errors": [
+        "no doctype",
+        "eof in template",
+        "eof in template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "tr": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true,
+                                "children": [
+                                  {
+                                    "tag": "tr"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><template><tr></tr></template></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><template><tr></tr></template></template>"
+      }
+    },
+    {
+      "data": "<template><template><td>",
+      "errors": [
+        "no doctype",
+        "eof in template",
+        "eof in template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "td": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true,
+                                "children": [
+                                  {
+                                    "tag": "td"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><template><td></td></template></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><template><td></td></template></template>"
+      }
+    },
+    {
+      "data": "<template><template><caption>",
+      "errors": [
+        "no doctype",
+        "eof in template",
+        "eof in template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "caption": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true,
+                                "children": [
+                                  {
+                                    "tag": "caption"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><template><caption></caption></template></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><template><caption></caption></template></template>"
+      }
+    },
+    {
+      "data": "<template><template><colgroup>",
+      "errors": [
+        "no doctype",
+        "eof in template",
+        "eof in template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "colgroup": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true,
+                                "children": [
+                                  {
+                                    "tag": "colgroup"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><template><colgroup></colgroup></template></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><template><colgroup></colgroup></template></template>"
+      }
+    },
+    {
+      "data": "<template><template><col>",
+      "errors": [
+        "no doctype",
+        "eof in template",
+        "eof in template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "col": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true,
+                                "children": [
+                                  {
+                                    "tag": "col"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><template><col></template></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><template><col></template></template>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "tbody": true,
+            "select": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true,
+                                "children": [
+                                  {
+                                    "tag": "tbody"
+                                  },
+                                  {
+                                    "tag": "select"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><template><tbody></tbody><select></select></template></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><template><tbody></tbody><select></select></template></template>"
+      }
+    },
+    {
+      "data": "<template><template><table>Foo",
+      "errors": [
+        "no doctype",
+        "foster-parenting text F",
+        "foster-parenting text o",
+        "foster-parenting text o",
+        "eof",
+        "eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "table": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true,
+                                "children": [
+                                  {
+                                    "text": "Foo"
+                                  },
+                                  {
+                                    "tag": "table"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><template>Foo<table></table></template></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><template>Foo<table></table></template></template>"
+      }
+    },
+    {
+      "data": "<template><template><frame>",
+      "errors": [
+        "no doctype",
+        "bad tag",
+        "eof",
+        "eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><template></template></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><template></template></template>"
+      }
+    },
+    {
+      "data": "<template><template><script>var i",
+      "errors": [
+        "no doctype",
+        "eof in script",
+        "eof in template",
+        "eof in template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "script": true,
+            "body": true
+          },
+          "template": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true,
+                                "children": [
+                                  {
+                                    "tag": "script",
+                                    "children": [
+                                      {
+                                        "text": "var i",
+                                        "no_escape": true
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><template><script>var i</script></template></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><template><script>var i</script></template></template>"
+      }
+    },
+    {
+      "data": "<template><template><style>var i",
+      "errors": [
+        "no doctype",
+        "eof in style",
+        "eof in template",
+        "eof in template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "style": true,
+            "body": true
+          },
+          "template": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true,
+                                "children": [
+                                  {
+                                    "tag": "style",
+                                    "children": [
+                                      {
+                                        "text": "var i",
+                                        "no_escape": true
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><template><style>var i</style></template></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><template><style>var i</style></template></template>"
+      }
+    },
+    {
+      "data": "<template><table></template><body><span>Foo",
+      "errors": [
+        "no doctype",
+        "missing /table",
+        "bad eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "table": true,
+            "body": true,
+            "span": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "table"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "span",
+                    "children": [
+                      {
+                        "text": "Foo"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><table></table></template></head><body><span>Foo</span></body></html>",
+        "noQuirksBodyHtml": "<template><table></table></template><span>Foo</span>"
+      }
+    },
+    {
+      "data": "<template><td></template><body><span>Foo",
+      "errors": [
+        "no doctype",
+        "bad eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "td": true,
+            "body": true,
+            "span": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "td"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "span",
+                    "children": [
+                      {
+                        "text": "Foo"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><td></td></template></head><body><span>Foo</span></body></html>",
+        "noQuirksBodyHtml": "<template><td></td></template><span>Foo</span>"
+      }
+    },
+    {
+      "data": "<template><object></template><body><span>Foo",
+      "errors": [
+        "no doctype",
+        "missing /object",
+        "bad eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "object": true,
+            "body": true,
+            "span": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "object"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "span",
+                    "children": [
+                      {
+                        "text": "Foo"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><object></object></template></head><body><span>Foo</span></body></html>",
+        "noQuirksBodyHtml": "<template><object></object></template><span>Foo</span>"
+      }
+    },
+    {
+      "data": "<template><svg><template>",
+      "errors": [
+        "no doctype",
+        "eof in template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "svg svg": true,
+            "svg template": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "svg",
+                            "ns": "http://www.w3.org/2000/svg",
+                            "children": [
+                              {
+                                "tag": "template",
+                                "ns": "http://www.w3.org/2000/svg"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><svg><template></template></svg></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><svg><template></template></svg></template>"
+      }
+    },
+    {
+      "data": "<template><svg><foo><template><foreignObject><div></template><div>",
+      "errors": [
+        "no doctype",
+        "ugly template closure",
+        "bad eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "svg svg": true,
+            "svg foo": true,
+            "svg template": true,
+            "svg foreignObject": true,
+            "div": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "svg",
+                            "ns": "http://www.w3.org/2000/svg",
+                            "children": [
+                              {
+                                "tag": "foo",
+                                "ns": "http://www.w3.org/2000/svg",
+                                "children": [
+                                  {
+                                    "tag": "template",
+                                    "ns": "http://www.w3.org/2000/svg",
+                                    "children": [
+                                      {
+                                        "tag": "foreignObject",
+                                        "ns": "http://www.w3.org/2000/svg",
+                                        "children": [
+                                          {
+                                            "tag": "div"
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><svg><foo><template><foreignObject><div></div></foreignObject></template></foo></svg></template></head><body><div></div></body></html>",
+        "noQuirksBodyHtml": "<template><svg><foo><template><foreignObject><div></div></foreignObject></template></foo></svg></template><div></div>"
+      }
+    },
+    {
+      "data": "<dummy><template><span></dummy>",
+      "errors": [
+        "no doctype",
+        "bad end tag </dummy>",
+        "eof in template",
+        "eof in dummy"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "dummy": true,
+            "template": true,
+            "span": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "dummy",
+                    "children": [
+                      {
+                        "tag": "template",
+                        "children": [
+                          {
+                            "content": true,
+                            "children": [
+                              {
+                                "tag": "span"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><dummy><template><span></span></template></dummy></body></html>",
+        "noQuirksBodyHtml": "<dummy><template><span></span></template></dummy>"
+      }
+    },
+    {
+      "data": "<body><table><tr><td><select><template>Foo</template><caption>A</table>",
+      "errors": [
+        "no doctype",
+        "(1,62): unexpected-caption-in-select-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "select": true,
+            "template": true,
+            "caption": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "select",
+                                    "children": [
+                                      {
+                                        "tag": "template",
+                                        "children": [
+                                          {
+                                            "content": true,
+                                            "children": [
+                                              {
+                                                "text": "Foo"
+                                              }
+                                            ]
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "caption",
+                        "children": [
+                          {
+                            "text": "A"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><tr><td><select><template>Foo</template></select></td></tr></tbody><caption>A</caption></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><select><template>Foo</template></select></td></tr></tbody><caption>A</caption></table>"
+      }
+    },
+    {
+      "data": "<body></body><template>",
+      "errors": [
+        "no doctype",
+        "(1,23): template-after-body",
+        "(1,24): eof-in-template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "template": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><template></template></body></html>",
+        "noQuirksBodyHtml": "<template></template>"
+      }
+    },
+    {
+      "data": "<head></head><template>",
+      "errors": [
+        "no doctype",
+        "(1,23): template-after-head",
+        "(1,24): eof-in-template"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template></template>"
+      }
+    },
+    {
+      "data": "<head></head><template>Foo</template>",
+      "errors": [
+        "no doctype",
+        "(1,23): template-after-head"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "text": "Foo"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template>Foo</template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template>Foo</template>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE HTML><dummy><table><template><table><template><table><script>",
+      "errors": [
+        "eof script",
+        "eof template",
+        "eof template",
+        "eof table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "dummy": true,
+            "table": true,
+            "template": true,
+            "script": true
+          },
+          "doctype": true,
+          "template": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "dummy",
+                    "children": [
+                      {
+                        "tag": "table",
+                        "children": [
+                          {
+                            "tag": "template",
+                            "children": [
+                              {
+                                "content": true,
+                                "children": [
+                                  {
+                                    "tag": "table",
+                                    "children": [
+                                      {
+                                        "tag": "template",
+                                        "children": [
+                                          {
+                                            "content": true,
+                                            "children": [
+                                              {
+                                                "tag": "table",
+                                                "children": [
+                                                  {
+                                                    "tag": "script"
+                                                  }
+                                                ]
+                                              }
+                                            ]
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><dummy><table><template><table><template><table><script></script></table></template></table></template></table></dummy></body></html>",
+        "noQuirksBodyHtml": "<dummy><table><template><table><template><table><script></script></table></template></table></template></table></dummy>"
+      }
+    },
+    {
+      "data": "<template><a><table><a>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "template": true,
+            "a": true,
+            "table": true,
+            "body": true
+          },
+          "template": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "template",
+                    "children": [
+                      {
+                        "content": true,
+                        "children": [
+                          {
+                            "tag": "a",
+                            "children": [
+                              {
+                                "tag": "a"
+                              },
+                              {
+                                "tag": "table"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><template><a><a></a><table></table></a></template></head><body></body></html>",
+        "noQuirksBodyHtml": "<template><a><a></a><table></table></a></template>"
+      }
+    }
+  ],
+  "tests1.dat": [
+    {
+      "data": "Test",
+      "errors": [
+        "(1,0): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Test"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>Test</body></html>",
+        "noQuirksBodyHtml": "Test"
+      }
+    },
+    {
+      "data": "<p>One<p>Two",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "One"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "Two"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><p>One</p><p>Two</p></body></html>",
+        "noQuirksBodyHtml": "<p>One</p><p>Two</p>"
+      }
+    },
+    {
+      "data": "Line1<br>Line2<br>Line3<br>Line4",
+      "errors": [
+        "(1,0): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "br": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Line1"
+                  },
+                  {
+                    "tag": "br"
+                  },
+                  {
+                    "text": "Line2"
+                  },
+                  {
+                    "tag": "br"
+                  },
+                  {
+                    "text": "Line3"
+                  },
+                  {
+                    "tag": "br"
+                  },
+                  {
+                    "text": "Line4"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>Line1<br>Line2<br>Line3<br>Line4</body></html>",
+        "noQuirksBodyHtml": "Line1<br>Line2<br>Line3<br>Line4"
+      }
+    },
+    {
+      "data": "<html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<head>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<body>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<html><head>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<html><head></head>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<html><head></head><body>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<html><head></head><body></body>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<html><head><body></body></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<html><head></body></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<html><head><body></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<html><body></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<body></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<head></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "</head>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "</body>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-end-tag element."
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "</html>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-end-tag element."
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<b><table><td><i></table>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "i": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "table",
+                        "children": [
+                          {
+                            "tag": "tbody",
+                            "children": [
+                              {
+                                "tag": "tr",
+                                "children": [
+                                  {
+                                    "tag": "td",
+                                    "children": [
+                                      {
+                                        "tag": "i"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b><table><tbody><tr><td><i></i></td></tr></tbody></table></b></body></html>",
+        "noQuirksBodyHtml": "<b><table><tbody><tr><td><i></i></td></tr></tbody></table></b>"
+      }
+    },
+    {
+      "data": "<b><table><td></b><i></table>X",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "i": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "table",
+                        "children": [
+                          {
+                            "tag": "tbody",
+                            "children": [
+                              {
+                                "tag": "tr",
+                                "children": [
+                                  {
+                                    "tag": "td",
+                                    "children": [
+                                      {
+                                        "tag": "i"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "text": "X"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b><table><tbody><tr><td><i></i></td></tr></tbody></table>X</b></body></html>",
+        "noQuirksBodyHtml": "<b><table><tbody><tr><td><i></i></td></tr></tbody></table>X</b>"
+      }
+    },
+    {
+      "data": "<h1>Hello<h2>World",
+      "errors": [
+        "(1,4): expected-doctype-but-got-start-tag",
+        "(1,13): unexpected-start-tag",
+        "(1,18): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "h1": true,
+            "h2": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "h1",
+                    "children": [
+                      {
+                        "text": "Hello"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "h2",
+                    "children": [
+                      {
+                        "text": "World"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><h1>Hello</h1><h2>World</h2></body></html>",
+        "noQuirksBodyHtml": "<h1>Hello</h1><h2>World</h2>"
+      }
+    },
+    {
+      "data": "<a><p>X<a>Y</a>Z</p></a>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a"
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "a",
+                        "children": [
+                          {
+                            "text": "X"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "a",
+                        "children": [
+                          {
+                            "text": "Y"
+                          }
+                        ]
+                      },
+                      {
+                        "text": "Z"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a></a><p><a>X</a><a>Y</a>Z</p></body></html>",
+        "noQuirksBodyHtml": "<a></a><p><a>X</a><a>Y</a>Z</p>"
+      }
+    },
+    {
+      "data": "<b><button>foo</b>bar",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag",
+        "(1,18): adoption-agency-1.3",
+        "(1,21): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "button": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b"
+                  },
+                  {
+                    "tag": "button",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": "foo"
+                          }
+                        ]
+                      },
+                      {
+                        "text": "bar"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b></b><button><b>foo</b>bar</button></body></html>",
+        "noQuirksBodyHtml": "<b></b><button><b>foo</b>bar</button>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><span><button>foo</span>bar",
+      "errors": [
+        "(1,39): unexpected-end-tag",
+        "(1,42): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "span": true,
+            "button": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "span",
+                    "children": [
+                      {
+                        "tag": "button",
+                        "children": [
+                          {
+                            "text": "foobar"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><span><button>foobar</button></span></body></html>",
+        "noQuirksBodyHtml": "<span><button>foobar</button></span>"
+      }
+    },
+    {
+      "data": "<p><b><div><marquee></p></b></div>X",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "b": true,
+            "div": true,
+            "marquee": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "b"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "tag": "marquee",
+                            "children": [
+                              {
+                                "tag": "p"
+                              },
+                              {
+                                "text": "X"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><p><b></b></p><div><b><marquee><p></p>X</marquee></b></div></body></html>",
+        "noQuirksBodyHtml": "<p><b></b></p><div><b><marquee><p></p>X</marquee></b></div>"
+      }
+    },
+    {
+      "data": "<script><div></script></div><title><p></title><p><p>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,28): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "title": true,
+            "body": true,
+            "p": true
+          },
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<div>",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "<p>",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p"
+                  },
+                  {
+                    "tag": "p"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><div></script><title>&lt;p&gt;</title></head><body><p></p><p></p></body></html>",
+        "noQuirksBodyHtml": "<script><div></script><title>&lt;p&gt;</title><p></p><p></p>"
+      }
+    },
+    {
+      "data": "<!--><div>--<!-->",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "comment": ""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": "--"
+                      },
+                      {
+                        "comment": ""
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!----><html><head></head><body><div>--<!----></div></body></html>",
+        "noQuirksBodyHtml": "<!----><div>--<!----></div>"
+      }
+    },
+    {
+      "data": "<p><hr></p>",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag",
+        "(1,11): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "hr": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p"
+                  },
+                  {
+                    "tag": "hr"
+                  },
+                  {
+                    "tag": "p"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><p></p><hr><p></p></body></html>",
+        "noQuirksBodyHtml": "<p></p><hr><p></p>"
+      }
+    },
+    {
+      "data": "<select><b><option><select><option></b></select>X",
+      "errors": [
+        "(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"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "option": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "option"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "option",
+                    "children": [
+                      {
+                        "text": "X"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><select><option></option></select><option>X</option></body></html>",
+        "noQuirksBodyHtml": "<select><option></option></select><option>X</option>"
+      }
+    },
+    {
+      "data": "<a><table><td><a><table></table><a></tr><a></table><b>X</b>C<a>Y",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "b": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "tag": "a"
+                      },
+                      {
+                        "tag": "table",
+                        "children": [
+                          {
+                            "tag": "tbody",
+                            "children": [
+                              {
+                                "tag": "tr",
+                                "children": [
+                                  {
+                                    "tag": "td",
+                                    "children": [
+                                      {
+                                        "tag": "a",
+                                        "children": [
+                                          {
+                                            "tag": "table"
+                                          }
+                                        ]
+                                      },
+                                      {
+                                        "tag": "a"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": "X"
+                          }
+                        ]
+                      },
+                      {
+                        "text": "C"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "text": "Y"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a><a></a><table><tbody><tr><td><a><table></table></a><a></a></td></tr></tbody></table></a><a><b>X</b>C</a><a>Y</a></body></html>",
+        "noQuirksBodyHtml": "<a><a></a><table><tbody><tr><td><a><table></table></a><a></a></td></tr></tbody></table></a><a><b>X</b>C</a><a>Y</a>"
+      }
+    },
+    {
+      "data": "<a X>0<b>1<a Y>2",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "b": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "attrs": [
+                      {
+                        "name": "x",
+                        "value": ""
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "0"
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": "1"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "a",
+                        "attrs": [
+                          {
+                            "name": "y",
+                            "value": ""
+                          }
+                        ],
+                        "children": [
+                          {
+                            "text": "2"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a x=\"\">0<b>1</b></a><b><a y=\"\">2</a></b></body></html>",
+        "noQuirksBodyHtml": "<a x=\"\">0<b>1</b></a><b><a y=\"\">2</a></b>"
+      }
+    },
+    {
+      "data": "<!-----><font><div>hello<table>excite!<b>me!<th><i>please!</tr><!--X-->",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "font": true,
+            "div": true,
+            "b": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "th": true,
+            "i": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "comment": "-"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "font",
+                    "children": [
+                      {
+                        "tag": "div",
+                        "children": [
+                          {
+                            "text": "helloexcite!"
+                          },
+                          {
+                            "tag": "b",
+                            "children": [
+                              {
+                                "text": "me!"
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "table",
+                            "children": [
+                              {
+                                "tag": "tbody",
+                                "children": [
+                                  {
+                                    "tag": "tr",
+                                    "children": [
+                                      {
+                                        "tag": "th",
+                                        "children": [
+                                          {
+                                            "tag": "i",
+                                            "children": [
+                                              {
+                                                "text": "please!"
+                                              }
+                                            ]
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  },
+                                  {
+                                    "comment": "X"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!-----><html><head></head><body><font><div>helloexcite!<b>me!</b><table><tbody><tr><th><i>please!</i></th></tr><!--X--></tbody></table></div></font></body></html>",
+        "noQuirksBodyHtml": "<!-----><font><div>helloexcite!<b>me!</b><table><tbody><tr><th><i>please!</i></th></tr><!--X--></tbody></table></div></font>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><li>hello<li>world<ul>how<li>do</ul>you</body><!--do-->",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "li": true,
+            "ul": true
+          },
+          "doctype": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "li",
+                    "children": [
+                      {
+                        "text": "hello"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "li",
+                    "children": [
+                      {
+                        "text": "world"
+                      },
+                      {
+                        "tag": "ul",
+                        "children": [
+                          {
+                            "text": "how"
+                          },
+                          {
+                            "tag": "li",
+                            "children": [
+                              {
+                                "text": "do"
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "text": "you"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "comment": "do"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><li>hello</li><li>world<ul>how<li>do</li></ul>you</li></body><!--do--></html>",
+        "noQuirksBodyHtml": "<li>hello</li><li>world<ul>how<li>do</li></ul>you<!--do--></li>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html>A<option>B<optgroup>C<select>D</option>E",
+      "errors": [
+        "(1,54): unexpected-end-tag-in-select",
+        "(1,55): eof-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "option": true,
+            "optgroup": true,
+            "select": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "A"
+                  },
+                  {
+                    "tag": "option",
+                    "children": [
+                      {
+                        "text": "B"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "optgroup",
+                    "children": [
+                      {
+                        "text": "C"
+                      },
+                      {
+                        "tag": "select",
+                        "children": [
+                          {
+                            "text": "DE"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>A<option>B</option><optgroup>C<select>DE</select></optgroup></body></html>",
+        "noQuirksBodyHtml": "A<option>B</option><optgroup>C<select>DE</select></optgroup>"
+      }
+    },
+    {
+      "data": "<",
+      "errors": [
+        "(1,1): expected-tag-name",
+        "(1,1): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "<",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>&lt;</body></html>",
+        "noQuirksBodyHtml": "&lt;"
+      }
+    },
+    {
+      "data": "<#",
+      "errors": [
+        "(1,1): expected-tag-name",
+        "(1,1): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "<#",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>&lt;#</body></html>",
+        "noQuirksBodyHtml": "&lt;#"
+      }
+    },
+    {
+      "data": "</",
+      "errors": [
+        "(1,2): expected-closing-tag-but-got-eof",
+        "(1,2): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "</",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>&lt;/</body></html>",
+        "noQuirksBodyHtml": "&lt;/"
+      }
+    },
+    {
+      "data": "</#",
+      "errors": [
+        "(1,2): expected-closing-tag-but-got-char",
+        "(1,3): expected-doctype-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "comment": "#"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!--#--><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!--#-->"
+      }
+    },
+    {
+      "data": "<?",
+      "errors": [
+        "(1,1): expected-tag-name-but-got-question-mark",
+        "(1,2): expected-doctype-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "comment": "?"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!--?--><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!--?-->"
+      }
+    },
+    {
+      "data": "<?#",
+      "errors": [
+        "(1,1): expected-tag-name-but-got-question-mark",
+        "(1,3): expected-doctype-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "comment": "?#"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!--?#--><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!--?#-->"
+      }
+    },
+    {
+      "data": "<!",
+      "errors": [
+        "(1,2): expected-dashes-or-doctype",
+        "(1,2): expected-doctype-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "comment": ""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!----><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!---->"
+      }
+    },
+    {
+      "data": "<!#",
+      "errors": [
+        "(1,2): expected-dashes-or-doctype",
+        "(1,3): expected-doctype-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "comment": "#"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!--#--><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!--#-->"
+      }
+    },
+    {
+      "data": "<?COMMENT?>",
+      "errors": [
+        "(1,1): expected-tag-name-but-got-question-mark",
+        "(1,11): expected-doctype-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "comment": "?COMMENT?"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!--?COMMENT?--><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!--?COMMENT?-->"
+      }
+    },
+    {
+      "data": "<!COMMENT>",
+      "errors": [
+        "(1,2): expected-dashes-or-doctype",
+        "(1,10): expected-doctype-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "comment": "COMMENT"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!--COMMENT--><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!--COMMENT-->"
+      }
+    },
+    {
+      "data": "</ COMMENT >",
+      "errors": [
+        "(1,2): expected-closing-tag-but-got-char",
+        "(1,12): expected-doctype-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "comment": " COMMENT "
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!-- COMMENT --><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!-- COMMENT -->"
+      }
+    },
+    {
+      "data": "<?COM--MENT?>",
+      "errors": [
+        "(1,1): expected-tag-name-but-got-question-mark",
+        "(1,13): expected-doctype-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "comment": "?COM--MENT?"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!--?COM--MENT?--><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!--?COM--MENT?-->"
+      }
+    },
+    {
+      "data": "<!COM--MENT>",
+      "errors": [
+        "(1,2): expected-dashes-or-doctype",
+        "(1,12): expected-doctype-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "comment": "COM--MENT"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!--COM--MENT--><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!--COM--MENT-->"
+      }
+    },
+    {
+      "data": "</ COM--MENT >",
+      "errors": [
+        "(1,2): expected-closing-tag-but-got-char",
+        "(1,14): expected-doctype-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "comment": " COM--MENT "
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!-- COM--MENT --><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!-- COM--MENT -->"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><style> EOF",
+      "errors": [
+        "(1,26): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": " EOF",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><style> EOF</style></head><body></body></html>",
+        "noQuirksBodyHtml": "<style> EOF</style>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><script> <!-- </script> --> </script> EOF",
+      "errors": [
+        "(1,52): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": " <!-- ",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": " "
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "-->  EOF",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script> <!-- </script> </head><body>--&gt;  EOF</body></html>",
+        "noQuirksBodyHtml": "<script> <!-- </script> --&gt;  EOF"
+      }
+    },
+    {
+      "data": "<b><p></b>TEST",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag",
+        "(1,10): adoption-agency-1.3"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b"
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "b"
+                      },
+                      {
+                        "text": "TEST"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b></b><p><b></b>TEST</p></body></html>",
+        "noQuirksBodyHtml": "<b></b><p><b></b>TEST</p>"
+      }
+    },
+    {
+      "data": "<p id=a><b><p id=b></b>TEST",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,19): unexpected-end-tag",
+        "(1,23): adoption-agency-1.2"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "b": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "attrs": [
+                      {
+                        "name": "id",
+                        "value": "a"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "tag": "b"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "attrs": [
+                      {
+                        "name": "id",
+                        "value": "b"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "TEST"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><p id=\"a\"><b></b></p><p id=\"b\">TEST</p></body></html>",
+        "noQuirksBodyHtml": "<p id=\"a\"><b></b></p><p id=\"b\">TEST</p>"
+      }
+    },
+    {
+      "data": "<b id=a><p><b id=b></p></b>TEST",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "attrs": [
+                      {
+                        "name": "id",
+                        "value": "a"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "tag": "p",
+                        "children": [
+                          {
+                            "tag": "b",
+                            "attrs": [
+                              {
+                                "name": "id",
+                                "value": "b"
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "text": "TEST"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b id=\"a\"><p><b id=\"b\"></b></p>TEST</b></body></html>",
+        "noQuirksBodyHtml": "<b id=\"a\"><p><b id=\"b\"></b></p>TEST</b>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><title>U-test</title><body><div><p>Test<u></p></div></body>",
+      "errors": [
+        "(1,61): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "title": true,
+            "body": true,
+            "div": true,
+            "p": true,
+            "u": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "U-test"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "p",
+                        "children": [
+                          {
+                            "text": "Test"
+                          },
+                          {
+                            "tag": "u"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><title>U-test</title></head><body><div><p>Test<u></u></p></div></body></html>",
+        "noQuirksBodyHtml": "<title>U-test</title><div><p>Test<u></u></p></div>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><font><table></font></table></font>",
+      "errors": [
+        "(1,35): unexpected-end-tag-implies-table-voodoo",
+        "(1,35): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "font": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "font",
+                    "children": [
+                      {
+                        "tag": "table"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><font><table></table></font></body></html>",
+        "noQuirksBodyHtml": "<font><table></table></font>"
+      }
+    },
+    {
+      "data": "<font><p>hello<b>cruel</font>world",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "font": true,
+            "p": true,
+            "b": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "font"
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "font",
+                        "children": [
+                          {
+                            "text": "hello"
+                          },
+                          {
+                            "tag": "b",
+                            "children": [
+                              {
+                                "text": "cruel"
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": "world"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><font></font><p><font>hello<b>cruel</b></font><b>world</b></p></body></html>",
+        "noQuirksBodyHtml": "<font></font><p><font>hello<b>cruel</b></font><b>world</b></p>"
+      }
+    },
+    {
+      "data": "<b>Test</i>Test",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag",
+        "(1,11): unexpected-end-tag",
+        "(1,15): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "text": "TestTest"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b>TestTest</b></body></html>",
+        "noQuirksBodyHtml": "<b>TestTest</b>"
+      }
+    },
+    {
+      "data": "<b>A<cite>B<div>C",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag",
+        "(1,17): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "cite": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "text": "A"
+                      },
+                      {
+                        "tag": "cite",
+                        "children": [
+                          {
+                            "text": "B"
+                          },
+                          {
+                            "tag": "div",
+                            "children": [
+                              {
+                                "text": "C"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b>A<cite>B<div>C</div></cite></b></body></html>",
+        "noQuirksBodyHtml": "<b>A<cite>B<div>C</div></cite></b>"
+      }
+    },
+    {
+      "data": "<b>A<cite>B<div>C</cite>D",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag",
+        "(1,24): unexpected-end-tag",
+        "(1,25): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "cite": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "text": "A"
+                      },
+                      {
+                        "tag": "cite",
+                        "children": [
+                          {
+                            "text": "B"
+                          },
+                          {
+                            "tag": "div",
+                            "children": [
+                              {
+                                "text": "CD"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b>A<cite>B<div>CD</div></cite></b></body></html>",
+        "noQuirksBodyHtml": "<b>A<cite>B<div>CD</div></cite></b>"
+      }
+    },
+    {
+      "data": "<b>A<cite>B<div>C</b>D",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag",
+        "(1,21): adoption-agency-1.3",
+        "(1,22): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "cite": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "text": "A"
+                      },
+                      {
+                        "tag": "cite",
+                        "children": [
+                          {
+                            "text": "B"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": "C"
+                          }
+                        ]
+                      },
+                      {
+                        "text": "D"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b>A<cite>B</cite></b><div><b>C</b>D</div></body></html>",
+        "noQuirksBodyHtml": "<b>A<cite>B</cite></b><div><b>C</b>D</div>"
+      }
+    },
+    {
+      "data": "",
+      "errors": [
+        "(1,0): expected-doctype-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<DIV>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,5): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div></div></body></html>",
+        "noQuirksBodyHtml": "<div></div>"
+      }
+    },
+    {
+      "data": "<DIV> abc",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,9): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": " abc"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div> abc</div></body></html>",
+        "noQuirksBodyHtml": "<div> abc</div>"
+      }
+    },
+    {
+      "data": "<DIV> abc <B>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,13): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "b": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": " abc "
+                      },
+                      {
+                        "tag": "b"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div> abc <b></b></div></body></html>",
+        "noQuirksBodyHtml": "<div> abc <b></b></div>"
+      }
+    },
+    {
+      "data": "<DIV> abc <B> def",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,17): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "b": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": " abc "
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": " def"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div> abc <b> def</b></div></body></html>",
+        "noQuirksBodyHtml": "<div> abc <b> def</b></div>"
+      }
+    },
+    {
+      "data": "<DIV> abc <B> def <I>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,21): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "b": true,
+            "i": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": " abc "
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": " def "
+                          },
+                          {
+                            "tag": "i"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div> abc <b> def <i></i></b></div></body></html>",
+        "noQuirksBodyHtml": "<div> abc <b> def <i></i></b></div>"
+      }
+    },
+    {
+      "data": "<DIV> abc <B> def <I> ghi",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,25): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "b": true,
+            "i": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": " abc "
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": " def "
+                          },
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "text": " ghi"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div> abc <b> def <i> ghi</i></b></div></body></html>",
+        "noQuirksBodyHtml": "<div> abc <b> def <i> ghi</i></b></div>"
+      }
+    },
+    {
+      "data": "<DIV> abc <B> def <I> ghi <P>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,29): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "b": true,
+            "i": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": " abc "
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": " def "
+                          },
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "text": " ghi "
+                              },
+                              {
+                                "tag": "p"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div> abc <b> def <i> ghi <p></p></i></b></div></body></html>",
+        "noQuirksBodyHtml": "<div> abc <b> def <i> ghi <p></p></i></b></div>"
+      }
+    },
+    {
+      "data": "<DIV> abc <B> def <I> ghi <P> jkl",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,33): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "b": true,
+            "i": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": " abc "
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": " def "
+                          },
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "text": " ghi "
+                              },
+                              {
+                                "tag": "p",
+                                "children": [
+                                  {
+                                    "text": " jkl"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div> abc <b> def <i> ghi <p> jkl</p></i></b></div></body></html>",
+        "noQuirksBodyHtml": "<div> abc <b> def <i> ghi <p> jkl</p></i></b></div>"
+      }
+    },
+    {
+      "data": "<DIV> abc <B> def <I> ghi <P> jkl </B>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,38): adoption-agency-1.3",
+        "(1,38): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "b": true,
+            "i": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": " abc "
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": " def "
+                          },
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "text": " ghi "
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "i",
+                        "children": [
+                          {
+                            "tag": "p",
+                            "children": [
+                              {
+                                "tag": "b",
+                                "children": [
+                                  {
+                                    "text": " jkl "
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div> abc <b> def <i> ghi </i></b><i><p><b> jkl </b></p></i></div></body></html>",
+        "noQuirksBodyHtml": "<div> abc <b> def <i> ghi </i></b><i><p><b> jkl </b></p></i></div>"
+      }
+    },
+    {
+      "data": "<DIV> abc <B> def <I> ghi <P> jkl </B> mno",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,38): adoption-agency-1.3",
+        "(1,42): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "b": true,
+            "i": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": " abc "
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": " def "
+                          },
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "text": " ghi "
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "i",
+                        "children": [
+                          {
+                            "tag": "p",
+                            "children": [
+                              {
+                                "tag": "b",
+                                "children": [
+                                  {
+                                    "text": " jkl "
+                                  }
+                                ]
+                              },
+                              {
+                                "text": " mno"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div> abc <b> def <i> ghi </i></b><i><p><b> jkl </b> mno</p></i></div></body></html>",
+        "noQuirksBodyHtml": "<div> abc <b> def <i> ghi </i></b><i><p><b> jkl </b> mno</p></i></div>"
+      }
+    },
+    {
+      "data": "<DIV> abc <B> def <I> ghi <P> jkl </B> mno </I>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "b": true,
+            "i": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": " abc "
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": " def "
+                          },
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "text": " ghi "
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "i"
+                      },
+                      {
+                        "tag": "p",
+                        "children": [
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "tag": "b",
+                                "children": [
+                                  {
+                                    "text": " jkl "
+                                  }
+                                ]
+                              },
+                              {
+                                "text": " mno "
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div> abc <b> def <i> ghi </i></b><i></i><p><i><b> jkl </b> mno </i></p></div></body></html>",
+        "noQuirksBodyHtml": "<div> abc <b> def <i> ghi </i></b><i></i><p><i><b> jkl </b> mno </i></p></div>"
+      }
+    },
+    {
+      "data": "<DIV> abc <B> def <I> ghi <P> jkl </B> mno </I> pqr",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "b": true,
+            "i": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": " abc "
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": " def "
+                          },
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "text": " ghi "
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "i"
+                      },
+                      {
+                        "tag": "p",
+                        "children": [
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "tag": "b",
+                                "children": [
+                                  {
+                                    "text": " jkl "
+                                  }
+                                ]
+                              },
+                              {
+                                "text": " mno "
+                              }
+                            ]
+                          },
+                          {
+                            "text": " pqr"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div> abc <b> def <i> ghi </i></b><i></i><p><i><b> jkl </b> mno </i> pqr</p></div></body></html>",
+        "noQuirksBodyHtml": "<div> abc <b> def <i> ghi </i></b><i></i><p><i><b> jkl </b> mno </i> pqr</p></div>"
+      }
+    },
+    {
+      "data": "<DIV> abc <B> def <I> ghi <P> jkl </B> mno </I> pqr </P>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "b": true,
+            "i": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": " abc "
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": " def "
+                          },
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "text": " ghi "
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "i"
+                      },
+                      {
+                        "tag": "p",
+                        "children": [
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "tag": "b",
+                                "children": [
+                                  {
+                                    "text": " jkl "
+                                  }
+                                ]
+                              },
+                              {
+                                "text": " mno "
+                              }
+                            ]
+                          },
+                          {
+                            "text": " pqr "
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div> abc <b> def <i> ghi </i></b><i></i><p><i><b> jkl </b> mno </i> pqr </p></div></body></html>",
+        "noQuirksBodyHtml": "<div> abc <b> def <i> ghi </i></b><i></i><p><i><b> jkl </b> mno </i> pqr </p></div>"
+      }
+    },
+    {
+      "data": "<DIV> abc <B> def <I> ghi <P> jkl </B> mno </I> pqr </P> stu",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "b": true,
+            "i": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": " abc "
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": " def "
+                          },
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "text": " ghi "
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "i"
+                      },
+                      {
+                        "tag": "p",
+                        "children": [
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "tag": "b",
+                                "children": [
+                                  {
+                                    "text": " jkl "
+                                  }
+                                ]
+                              },
+                              {
+                                "text": " mno "
+                              }
+                            ]
+                          },
+                          {
+                            "text": " pqr "
+                          }
+                        ]
+                      },
+                      {
+                        "text": " stu"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div> abc <b> def <i> ghi </i></b><i></i><p><i><b> jkl </b> mno </i> pqr </p> stu</div></body></html>",
+        "noQuirksBodyHtml": "<div> abc <b> def <i> ghi </i></b><i></i><p><i><b> jkl </b> mno </i> pqr </p> stu</div>"
+      }
+    },
+    {
+      "data": "<test attribute---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->",
+      "errors": [
+        "(1,1040): expected-doctype-but-got-start-tag",
+        "(1,1040): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "test": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "test",
+                    "attrs": [
+                      {
+                        "name": "attribute----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------",
+                        "value": ""
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><test attribute----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------=\"\"></test></body></html>",
+        "noQuirksBodyHtml": "<test attribute----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------=\"\"></test>"
+      }
+    },
+    {
+      "data": "<a href=\"blah\">aba<table><a href=\"foo\">br<tr><td></td></tr>x</table>aoe",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "attrs": [
+                      {
+                        "name": "href",
+                        "value": "blah"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "aba"
+                      },
+                      {
+                        "tag": "a",
+                        "attrs": [
+                          {
+                            "name": "href",
+                            "value": "foo"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "text": "br"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "a",
+                        "attrs": [
+                          {
+                            "name": "href",
+                            "value": "foo"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "text": "x"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "table",
+                        "children": [
+                          {
+                            "tag": "tbody",
+                            "children": [
+                              {
+                                "tag": "tr",
+                                "children": [
+                                  {
+                                    "tag": "td"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "a",
+                    "attrs": [
+                      {
+                        "name": "href",
+                        "value": "foo"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "aoe"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a href=\"blah\">aba<a href=\"foo\">br</a><a href=\"foo\">x</a><table><tbody><tr><td></td></tr></tbody></table></a><a href=\"foo\">aoe</a></body></html>",
+        "noQuirksBodyHtml": "<a href=\"blah\">aba<a href=\"foo\">br</a><a href=\"foo\">x</a><table><tbody><tr><td></td></tr></tbody></table></a><a href=\"foo\">aoe</a>"
+      }
+    },
+    {
+      "data": "<a href=\"blah\">aba<table><tr><td><a href=\"foo\">br</td></tr>x</table>aoe",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "attrs": [
+                      {
+                        "name": "href",
+                        "value": "blah"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "abax"
+                      },
+                      {
+                        "tag": "table",
+                        "children": [
+                          {
+                            "tag": "tbody",
+                            "children": [
+                              {
+                                "tag": "tr",
+                                "children": [
+                                  {
+                                    "tag": "td",
+                                    "children": [
+                                      {
+                                        "tag": "a",
+                                        "attrs": [
+                                          {
+                                            "name": "href",
+                                            "value": "foo"
+                                          }
+                                        ],
+                                        "children": [
+                                          {
+                                            "text": "br"
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "text": "aoe"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a href=\"blah\">abax<table><tbody><tr><td><a href=\"foo\">br</a></td></tr></tbody></table>aoe</a></body></html>",
+        "noQuirksBodyHtml": "<a href=\"blah\">abax<table><tbody><tr><td><a href=\"foo\">br</a></td></tr></tbody></table>aoe</a>"
+      }
+    },
+    {
+      "data": "<table><a href=\"blah\">aba<tr><td><a href=\"foo\">br</td></tr>x</table>aoe",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "attrs": [
+                      {
+                        "name": "href",
+                        "value": "blah"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "aba"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "a",
+                    "attrs": [
+                      {
+                        "name": "href",
+                        "value": "blah"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "x"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "a",
+                                    "attrs": [
+                                      {
+                                        "name": "href",
+                                        "value": "foo"
+                                      }
+                                    ],
+                                    "children": [
+                                      {
+                                        "text": "br"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "a",
+                    "attrs": [
+                      {
+                        "name": "href",
+                        "value": "blah"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "aoe"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a href=\"blah\">aba</a><a href=\"blah\">x</a><table><tbody><tr><td><a href=\"foo\">br</a></td></tr></tbody></table><a href=\"blah\">aoe</a></body></html>",
+        "noQuirksBodyHtml": "<a href=\"blah\">aba</a><a href=\"blah\">x</a><table><tbody><tr><td><a href=\"foo\">br</a></td></tr></tbody></table><a href=\"blah\">aoe</a>"
+      }
+    },
+    {
+      "data": "<a href=a>aa<marquee>aa<a href=b>bb</marquee>aa",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag",
+        "(1,45): end-tag-too-early",
+        "(1,47): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "marquee": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "attrs": [
+                      {
+                        "name": "href",
+                        "value": "a"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "aa"
+                      },
+                      {
+                        "tag": "marquee",
+                        "children": [
+                          {
+                            "text": "aa"
+                          },
+                          {
+                            "tag": "a",
+                            "attrs": [
+                              {
+                                "name": "href",
+                                "value": "b"
+                              }
+                            ],
+                            "children": [
+                              {
+                                "text": "bb"
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "text": "aa"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a href=\"a\">aa<marquee>aa<a href=\"b\">bb</a></marquee>aa</a></body></html>",
+        "noQuirksBodyHtml": "<a href=\"a\">aa<marquee>aa<a href=\"b\">bb</a></marquee>aa</a>"
+      }
+    },
+    {
+      "data": "<wbr><strike><code></strike><code><strike></code>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "wbr": true,
+            "strike": true,
+            "code": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "wbr"
+                  },
+                  {
+                    "tag": "strike",
+                    "children": [
+                      {
+                        "tag": "code"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "code",
+                    "children": [
+                      {
+                        "tag": "code",
+                        "children": [
+                          {
+                            "tag": "strike"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><wbr><strike><code></code></strike><code><code><strike></strike></code></code></body></html>",
+        "noQuirksBodyHtml": "<wbr><strike><code></code></strike><code><code><strike></strike></code></code>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><spacer>foo",
+      "errors": [
+        "(1,26): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "spacer": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "spacer",
+                    "children": [
+                      {
+                        "text": "foo"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><spacer>foo</spacer></body></html>",
+        "noQuirksBodyHtml": "<spacer>foo</spacer>"
+      }
+    },
+    {
+      "data": "<title><meta></title><link><title><meta></title>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "title": true,
+            "link": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "<meta>",
+                        "escaped": true
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "link"
+                  },
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "<meta>",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><title>&lt;meta&gt;</title><link><title>&lt;meta&gt;</title></head><body></body></html>",
+        "noQuirksBodyHtml": "<title>&lt;meta&gt;</title><link><title>&lt;meta&gt;</title>"
+      }
+    },
+    {
+      "data": "<style><!--</style><meta><script>--><link></script>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "meta": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": "<!--",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "meta"
+                  },
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "--><link>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><style><!--</style><meta><script>--><link></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<style><!--</style><meta><script>--><link></script>"
+      }
+    },
+    {
+      "data": "<head><meta></head><link>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,25): unexpected-start-tag-out-of-my-head"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "meta": true,
+            "link": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "meta"
+                  },
+                  {
+                    "tag": "link"
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><meta><link></head><body></body></html>",
+        "noQuirksBodyHtml": "<meta><link>"
+      }
+    },
+    {
+      "data": "<table><tr><tr><td><td><span><th><span>X</table>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,33): unexpected-cell-end-tag",
+        "(1,48): unexpected-cell-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "span": true,
+            "th": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          },
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td"
+                              },
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "span"
+                                  }
+                                ]
+                              },
+                              {
+                                "tag": "th",
+                                "children": [
+                                  {
+                                    "tag": "span",
+                                    "children": [
+                                      {
+                                        "text": "X"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><tr></tr><tr><td></td><td><span></span></td><th><span>X</span></th></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr></tr><tr><td></td><td><span></span></td><th><span>X</span></th></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<body><body><base><link><meta><title><p></title><body><p></body>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,12): unexpected-start-tag",
+        "(1,54): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "base": true,
+            "link": true,
+            "meta": true,
+            "title": true,
+            "p": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "base"
+                  },
+                  {
+                    "tag": "link"
+                  },
+                  {
+                    "tag": "meta"
+                  },
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "<p>",
+                        "escaped": true
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><base><link><meta><title>&lt;p&gt;</title><p></p></body></html>",
+        "noQuirksBodyHtml": "<base><link><meta><title>&lt;p&gt;</title><p></p>"
+      }
+    },
+    {
+      "data": "<textarea><p></textarea>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "textarea": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "textarea",
+                    "children": [
+                      {
+                        "text": "<p>",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><textarea>&lt;p&gt;</textarea></body></html>",
+        "noQuirksBodyHtml": "<textarea>&lt;p&gt;</textarea>"
+      }
+    },
+    {
+      "data": "<p><image></p>",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag",
+        "(1,10): unexpected-start-tag-treated-as"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "img": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "img"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><p><img></p></body></html>",
+        "noQuirksBodyHtml": "<p><img></p>"
+      }
+    },
+    {
+      "data": "<a><table><a></table><p><a><div><a>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "table": true,
+            "p": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "tag": "a"
+                      },
+                      {
+                        "tag": "table"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "a"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "a"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a><a></a><table></table></a><p><a></a></p><div><a></a></div></body></html>",
+        "noQuirksBodyHtml": "<a><a></a><table></table></a><p><a></a></p><div><a></a></div>"
+      }
+    },
+    {
+      "data": "<head></p><meta><p>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,10): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "meta": true,
+            "body": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "meta"
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><meta></head><body><p></p></body></html>",
+        "noQuirksBodyHtml": "<p></p><meta><p></p>"
+      }
+    },
+    {
+      "data": "<head></html><meta><p>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,19): expected-eof-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "meta": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "meta"
+                  },
+                  {
+                    "tag": "p"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><meta><p></p></body></html>",
+        "noQuirksBodyHtml": "<meta><p></p>"
+      }
+    },
+    {
+      "data": "<b><table><td><i></table>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "i": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "table",
+                        "children": [
+                          {
+                            "tag": "tbody",
+                            "children": [
+                              {
+                                "tag": "tr",
+                                "children": [
+                                  {
+                                    "tag": "td",
+                                    "children": [
+                                      {
+                                        "tag": "i"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b><table><tbody><tr><td><i></i></td></tr></tbody></table></b></body></html>",
+        "noQuirksBodyHtml": "<b><table><tbody><tr><td><i></i></td></tr></tbody></table></b>"
+      }
+    },
+    {
+      "data": "<b><table><td></b><i></table>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "i": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "table",
+                        "children": [
+                          {
+                            "tag": "tbody",
+                            "children": [
+                              {
+                                "tag": "tr",
+                                "children": [
+                                  {
+                                    "tag": "td",
+                                    "children": [
+                                      {
+                                        "tag": "i"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b><table><tbody><tr><td><i></i></td></tr></tbody></table></b></body></html>",
+        "noQuirksBodyHtml": "<b><table><tbody><tr><td><i></i></td></tr></tbody></table></b>"
+      }
+    },
+    {
+      "data": "<h1><h2>",
+      "errors": [
+        "(1,4): expected-doctype-but-got-start-tag",
+        "(1,8): unexpected-start-tag",
+        "(1,8): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "h1": true,
+            "h2": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "h1"
+                  },
+                  {
+                    "tag": "h2"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><h1></h1><h2></h2></body></html>",
+        "noQuirksBodyHtml": "<h1></h1><h2></h2>"
+      }
+    },
+    {
+      "data": "<a><p><a></a></p></a>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a"
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "a"
+                      },
+                      {
+                        "tag": "a"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a></a><p><a></a><a></a></p></body></html>",
+        "noQuirksBodyHtml": "<a></a><p><a></a><a></a></p>"
+      }
+    },
+    {
+      "data": "<b><button></b></button></b>",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag",
+        "(1,15): adoption-agency-1.3",
+        "(1,28): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "button": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b"
+                  },
+                  {
+                    "tag": "button",
+                    "children": [
+                      {
+                        "tag": "b"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b></b><button><b></b></button></body></html>",
+        "noQuirksBodyHtml": "<b></b><button><b></b></button>"
+      }
+    },
+    {
+      "data": "<p><b><div><marquee></p></b></div>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "b": true,
+            "div": true,
+            "marquee": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "b"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "tag": "marquee",
+                            "children": [
+                              {
+                                "tag": "p"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><p><b></b></p><div><b><marquee><p></p></marquee></b></div></body></html>",
+        "noQuirksBodyHtml": "<p><b></b></p><div><b><marquee><p></p></marquee></b></div>"
+      }
+    },
+    {
+      "data": "<script></script></div><title></title><p><p>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,23): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "title": true,
+            "body": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script"
+                  },
+                  {
+                    "tag": "title"
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p"
+                  },
+                  {
+                    "tag": "p"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script></script><title></title></head><body><p></p><p></p></body></html>",
+        "noQuirksBodyHtml": "<script></script><title></title><p></p><p></p>"
+      }
+    },
+    {
+      "data": "<p><hr></p>",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag",
+        "(1,11): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "hr": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p"
+                  },
+                  {
+                    "tag": "hr"
+                  },
+                  {
+                    "tag": "p"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><p></p><hr><p></p></body></html>",
+        "noQuirksBodyHtml": "<p></p><hr><p></p>"
+      }
+    },
+    {
+      "data": "<select><b><option><select><option></b></select>",
+      "errors": [
+        "(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"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "option": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "option"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "option"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><select><option></option></select><option></option></body></html>",
+        "noQuirksBodyHtml": "<select><option></option></select><option></option>"
+      }
+    },
+    {
+      "data": "<html><head><title></title><body></body></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "title": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "title"
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><title></title></head><body></body></html>",
+        "noQuirksBodyHtml": "<title></title>"
+      }
+    },
+    {
+      "data": "<a><table><td><a><table></table><a></tr><a></table><a>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "tag": "a"
+                      },
+                      {
+                        "tag": "table",
+                        "children": [
+                          {
+                            "tag": "tbody",
+                            "children": [
+                              {
+                                "tag": "tr",
+                                "children": [
+                                  {
+                                    "tag": "td",
+                                    "children": [
+                                      {
+                                        "tag": "a",
+                                        "children": [
+                                          {
+                                            "tag": "table"
+                                          }
+                                        ]
+                                      },
+                                      {
+                                        "tag": "a"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "a"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a><a></a><table><tbody><tr><td><a><table></table></a><a></a></td></tr></tbody></table></a><a></a></body></html>",
+        "noQuirksBodyHtml": "<a><a></a><table><tbody><tr><td><a><table></table></a><a></a></td></tr></tbody></table></a><a></a>"
+      }
+    },
+    {
+      "data": "<ul><li></li><div><li></div><li><li><div><li><address><li><b><em></b><li></ul>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ul": true,
+            "li": true,
+            "div": true,
+            "address": true,
+            "b": true,
+            "em": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ul",
+                    "children": [
+                      {
+                        "tag": "li"
+                      },
+                      {
+                        "tag": "div",
+                        "children": [
+                          {
+                            "tag": "li"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "li"
+                      },
+                      {
+                        "tag": "li",
+                        "children": [
+                          {
+                            "tag": "div"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "li",
+                        "children": [
+                          {
+                            "tag": "address"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "li",
+                        "children": [
+                          {
+                            "tag": "b",
+                            "children": [
+                              {
+                                "tag": "em"
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "li"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ul><li></li><div><li></li></div><li></li><li><div></div></li><li><address></address></li><li><b><em></em></b></li><li></li></ul></body></html>",
+        "noQuirksBodyHtml": "<ul><li></li><div><li></li></div><li></li><li><div></div></li><li><address></address></li><li><b><em></em></b></li><li></li></ul>"
+      }
+    },
+    {
+      "data": "<ul><li><ul></li><li>a</li></ul></li></ul>",
+      "errors": [
+        "(1,4): expected-doctype-but-got-start-tag",
+        "(1,17): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ul": true,
+            "li": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ul",
+                    "children": [
+                      {
+                        "tag": "li",
+                        "children": [
+                          {
+                            "tag": "ul",
+                            "children": [
+                              {
+                                "tag": "li",
+                                "children": [
+                                  {
+                                    "text": "a"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ul><li><ul><li>a</li></ul></li></ul></body></html>",
+        "noQuirksBodyHtml": "<ul><li><ul><li>a</li></ul></li></ul>"
+      }
+    },
+    {
+      "data": "<frameset><frame><frameset><frame></frameset><noframes></noframes></frameset>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true,
+            "frame": true,
+            "noframes": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset",
+                "children": [
+                  {
+                    "tag": "frame"
+                  },
+                  {
+                    "tag": "frameset",
+                    "children": [
+                      {
+                        "tag": "frame"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "noframes"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset><frame><frameset><frame></frameset><noframes></noframes></frameset></html>",
+        "noQuirksBodyHtml": "<noframes></noframes>"
+      }
+    },
+    {
+      "data": "<h1><table><td><h3></table><h3></h1>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "h1": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "h3": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "h1",
+                    "children": [
+                      {
+                        "tag": "table",
+                        "children": [
+                          {
+                            "tag": "tbody",
+                            "children": [
+                              {
+                                "tag": "tr",
+                                "children": [
+                                  {
+                                    "tag": "td",
+                                    "children": [
+                                      {
+                                        "tag": "h3"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "h3"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><h1><table><tbody><tr><td><h3></h3></td></tr></tbody></table></h1><h3></h3></body></html>",
+        "noQuirksBodyHtml": "<h1><table><tbody><tr><td><h3></h3></td></tr></tbody></table></h1><h3></h3>"
+      }
+    },
+    {
+      "data": "<table><colgroup><col><colgroup><col><col><col><colgroup><col><col><thead><tr><td></table>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "colgroup": true,
+            "col": true,
+            "thead": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "colgroup",
+                        "children": [
+                          {
+                            "tag": "col"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "colgroup",
+                        "children": [
+                          {
+                            "tag": "col"
+                          },
+                          {
+                            "tag": "col"
+                          },
+                          {
+                            "tag": "col"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "colgroup",
+                        "children": [
+                          {
+                            "tag": "col"
+                          },
+                          {
+                            "tag": "col"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "thead",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><colgroup><col></colgroup><colgroup><col><col><col></colgroup><colgroup><col><col></colgroup><thead><tr><td></td></tr></thead></table></body></html>",
+        "noQuirksBodyHtml": "<table><colgroup><col></colgroup><colgroup><col><col><col></colgroup><colgroup><col><col></colgroup><thead><tr><td></td></tr></thead></table>"
+      }
+    },
+    {
+      "data": "<table><col><tbody><col><tr><col><td><col></table><col>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,37): unexpected-cell-in-table-body",
+        "(1,55): unexpected-start-tag-ignored"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "colgroup": true,
+            "col": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "colgroup",
+                        "children": [
+                          {
+                            "tag": "col"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "tbody"
+                      },
+                      {
+                        "tag": "colgroup",
+                        "children": [
+                          {
+                            "tag": "col"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "colgroup",
+                        "children": [
+                          {
+                            "tag": "col"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td"
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "colgroup",
+                        "children": [
+                          {
+                            "tag": "col"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><colgroup><col></colgroup><tbody></tbody><colgroup><col></colgroup><tbody><tr></tr></tbody><colgroup><col></colgroup><tbody><tr><td></td></tr></tbody><colgroup><col></colgroup></table></body></html>",
+        "noQuirksBodyHtml": "<table><colgroup><col></colgroup><tbody></tbody><colgroup><col></colgroup><tbody><tr></tr></tbody><colgroup><col></colgroup><tbody><tr><td></td></tr></tbody><colgroup><col></colgroup></table>"
+      }
+    },
+    {
+      "data": "<table><colgroup><tbody><colgroup><tr><colgroup><td><colgroup></table><colgroup>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,52): unexpected-cell-in-table-body",
+        "(1,80): unexpected-start-tag-ignored"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "colgroup": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "colgroup"
+                      },
+                      {
+                        "tag": "tbody"
+                      },
+                      {
+                        "tag": "colgroup"
+                      },
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "colgroup"
+                      },
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td"
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "colgroup"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><colgroup></colgroup><tbody></tbody><colgroup></colgroup><tbody><tr></tr></tbody><colgroup></colgroup><tbody><tr><td></td></tr></tbody><colgroup></colgroup></table></body></html>",
+        "noQuirksBodyHtml": "<table><colgroup></colgroup><tbody></tbody><colgroup></colgroup><tbody><tr></tr></tbody><colgroup></colgroup><tbody><tr><td></td></tr></tbody><colgroup></colgroup></table>"
+      }
+    },
+    {
+      "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": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "br": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "br"
+                  },
+                  {
+                    "tag": "p"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><br><p></p></body></html>",
+        "noQuirksBodyHtml": "<br><p></p>"
+      }
+    },
+    {
+      "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": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "br": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "br"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><br><table><tbody><tr></tr></tbody></table><p></p></body></html>",
+        "noQuirksBodyHtml": "<br><table><tbody><tr></tr></tbody></table><p></p>"
+      }
+    },
+    {
+      "data": "<frameset>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag",
+        "(1,10): eof-in-frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": ""
+      }
+    }
+  ],
+  "tests10.dat": [
+    {
+      "data": "<!DOCTYPE html><svg></svg>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg></svg></body></html>",
+        "noQuirksBodyHtml": "<svg></svg>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><svg></svg><![CDATA[a]]>",
+      "errors": [
+        "(1,28) expected-dashes-or-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "doctype": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg"
+                  },
+                  {
+                    "comment": "[CDATA[a]]"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg></svg><!--[CDATA[a]]--></body></html>",
+        "noQuirksBodyHtml": "<svg></svg><!--[CDATA[a]]-->"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><svg></svg>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg></svg></body></html>",
+        "noQuirksBodyHtml": "<svg></svg>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><select><svg></svg></select>",
+      "errors": [
+        "(1,34) unexpected-start-tag-in-select",
+        "(1,40) unexpected-end-tag-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select></select></body></html>",
+        "noQuirksBodyHtml": "<select></select>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><select><option><svg></svg></option></select>",
+      "errors": [
+        "(1,42) unexpected-start-tag-in-select",
+        "(1,48) unexpected-end-tag-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "option": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "option"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select><option></option></select></body></html>",
+        "noQuirksBodyHtml": "<select><option></option></select>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><svg></svg></table>",
+      "errors": [
+        "(1,33) foster-parenting-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg"
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg></svg><table></table></body></html>",
+        "noQuirksBodyHtml": "<svg></svg><table></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><svg><g>foo</g></svg></table>",
+      "errors": [
+        "(1,33) foster-parenting-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg g": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "g",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "text": "foo"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg><g>foo</g></svg><table></table></body></html>",
+        "noQuirksBodyHtml": "<svg><g>foo</g></svg><table></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><svg><g>foo</g><g>bar</g></svg></table>",
+      "errors": [
+        "(1,33) foster-parenting-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg g": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "g",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "text": "foo"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "g",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "text": "bar"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg><g>foo</g><g>bar</g></svg><table></table></body></html>",
+        "noQuirksBodyHtml": "<svg><g>foo</g><g>bar</g></svg><table></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><tbody><svg><g>foo</g><g>bar</g></svg></tbody></table>",
+      "errors": [
+        "(1,40) foster-parenting-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg g": true,
+            "table": true,
+            "tbody": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "g",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "text": "foo"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "g",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "text": "bar"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg><g>foo</g><g>bar</g></svg><table><tbody></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<svg><g>foo</g><g>bar</g></svg><table><tbody></tbody></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><tbody><tr><svg><g>foo</g><g>bar</g></svg></tr></tbody></table>",
+      "errors": [
+        "(1,44) foster-parenting-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg g": true,
+            "table": true,
+            "tbody": true,
+            "tr": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "g",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "text": "foo"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "g",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "text": "bar"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg><g>foo</g><g>bar</g></svg><table><tbody><tr></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<svg><g>foo</g><g>bar</g></svg><table><tbody><tr></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><tbody><tr><td><svg><g>foo</g><g>bar</g></svg></td></tr></tbody></table>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "svg svg": true,
+            "svg g": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "svg",
+                                    "ns": "http://www.w3.org/2000/svg",
+                                    "children": [
+                                      {
+                                        "tag": "g",
+                                        "ns": "http://www.w3.org/2000/svg",
+                                        "children": [
+                                          {
+                                            "text": "foo"
+                                          }
+                                        ]
+                                      },
+                                      {
+                                        "tag": "g",
+                                        "ns": "http://www.w3.org/2000/svg",
+                                        "children": [
+                                          {
+                                            "text": "bar"
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><svg><g>foo</g><g>bar</g></svg></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><svg><g>foo</g><g>bar</g></svg></td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><tbody><tr><td><svg><g>foo</g><g>bar</g></svg><p>baz</td></tr></tbody></table>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "svg svg": true,
+            "svg g": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "svg",
+                                    "ns": "http://www.w3.org/2000/svg",
+                                    "children": [
+                                      {
+                                        "tag": "g",
+                                        "ns": "http://www.w3.org/2000/svg",
+                                        "children": [
+                                          {
+                                            "text": "foo"
+                                          }
+                                        ]
+                                      },
+                                      {
+                                        "tag": "g",
+                                        "ns": "http://www.w3.org/2000/svg",
+                                        "children": [
+                                          {
+                                            "text": "bar"
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  },
+                                  {
+                                    "tag": "p",
+                                    "children": [
+                                      {
+                                        "text": "baz"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><svg><g>foo</g><g>bar</g></svg><p>baz</p></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><svg><g>foo</g><g>bar</g></svg><p>baz</p></td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><caption><svg><g>foo</g><g>bar</g></svg><p>baz</caption></table>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "caption": true,
+            "svg svg": true,
+            "svg g": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "caption",
+                        "children": [
+                          {
+                            "tag": "svg",
+                            "ns": "http://www.w3.org/2000/svg",
+                            "children": [
+                              {
+                                "tag": "g",
+                                "ns": "http://www.w3.org/2000/svg",
+                                "children": [
+                                  {
+                                    "text": "foo"
+                                  }
+                                ]
+                              },
+                              {
+                                "tag": "g",
+                                "ns": "http://www.w3.org/2000/svg",
+                                "children": [
+                                  {
+                                    "text": "bar"
+                                  }
+                                ]
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "p",
+                            "children": [
+                              {
+                                "text": "baz"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><caption><svg><g>foo</g><g>bar</g></svg><p>baz</p></caption></table></body></html>",
+        "noQuirksBodyHtml": "<table><caption><svg><g>foo</g><g>bar</g></svg><p>baz</p></caption></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><caption><svg><g>foo</g><g>bar</g><p>baz</table><p>quux",
+      "errors": [
+        "(1,65) unexpected-html-element-in-foreign-content"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "caption": true,
+            "svg svg": true,
+            "svg g": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "caption",
+                        "children": [
+                          {
+                            "tag": "svg",
+                            "ns": "http://www.w3.org/2000/svg",
+                            "children": [
+                              {
+                                "tag": "g",
+                                "ns": "http://www.w3.org/2000/svg",
+                                "children": [
+                                  {
+                                    "text": "foo"
+                                  }
+                                ]
+                              },
+                              {
+                                "tag": "g",
+                                "ns": "http://www.w3.org/2000/svg",
+                                "children": [
+                                  {
+                                    "text": "bar"
+                                  }
+                                ]
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "p",
+                            "children": [
+                              {
+                                "text": "baz"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "quux"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><caption><svg><g>foo</g><g>bar</g></svg><p>baz</p></caption></table><p>quux</p></body></html>",
+        "noQuirksBodyHtml": "<table><caption><svg><g>foo</g><g>bar</g><p>baz</p></svg></caption></table><p>quux</p>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><caption><svg><g>foo</g><g>bar</g>baz</table><p>quux",
+      "errors": [
+        "(1,73) unexpected-end-tag",
+        "(1,73) expected-one-end-tag-but-got-another"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "caption": true,
+            "svg svg": true,
+            "svg g": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "caption",
+                        "children": [
+                          {
+                            "tag": "svg",
+                            "ns": "http://www.w3.org/2000/svg",
+                            "children": [
+                              {
+                                "tag": "g",
+                                "ns": "http://www.w3.org/2000/svg",
+                                "children": [
+                                  {
+                                    "text": "foo"
+                                  }
+                                ]
+                              },
+                              {
+                                "tag": "g",
+                                "ns": "http://www.w3.org/2000/svg",
+                                "children": [
+                                  {
+                                    "text": "bar"
+                                  }
+                                ]
+                              },
+                              {
+                                "text": "baz"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "quux"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><caption><svg><g>foo</g><g>bar</g>baz</svg></caption></table><p>quux</p></body></html>",
+        "noQuirksBodyHtml": "<table><caption><svg><g>foo</g><g>bar</g>baz</svg></caption></table><p>quux</p>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><colgroup><svg><g>foo</g><g>bar</g><p>baz</table><p>quux",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg g": true,
+            "p": true,
+            "table": true,
+            "colgroup": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "g",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "text": "foo"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "g",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "text": "bar"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "baz"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "colgroup"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "quux"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg><g>foo</g><g>bar</g></svg><p>baz</p><table><colgroup></colgroup></table><p>quux</p></body></html>",
+        "noQuirksBodyHtml": "<svg><g>foo</g><g>bar</g><p>baz</p></svg><table><colgroup></colgroup></table><p>quux</p>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><tr><td><select><svg><g>foo</g><g>bar</g><p>baz</table><p>quux",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "select": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "select",
+                                    "children": [
+                                      {
+                                        "text": "foobarbaz"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "quux"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><select>foobarbaz</select></td></tr></tbody></table><p>quux</p></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><select>foobarbaz</select></td></tr></tbody></table><p>quux</p>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><select><svg><g>foo</g><g>bar</g><p>baz</table><p>quux",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "table": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "text": "foobarbaz"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table"
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "quux"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select>foobarbaz</select><table></table><p>quux</p></body></html>",
+        "noQuirksBodyHtml": "<select>foobarbaz</select><table></table><p>quux</p>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body></body></html><svg><g>foo</g><g>bar</g><p>baz",
+      "errors": [
+        "(1,40) expected-eof-but-got-start-tag",
+        "(1,63) unexpected-html-element-in-foreign-content"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg g": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "g",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "text": "foo"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "g",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "text": "bar"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "baz"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg><g>foo</g><g>bar</g></svg><p>baz</p></body></html>",
+        "noQuirksBodyHtml": "<svg><g>foo</g><g>bar</g><p>baz</p></svg>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body></body><svg><g>foo</g><g>bar</g><p>baz",
+      "errors": [
+        "(1,33) unexpected-start-tag-after-body",
+        "(1,56) unexpected-html-element-in-foreign-content"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg g": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "g",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "text": "foo"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "g",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "text": "bar"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "baz"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg><g>foo</g><g>bar</g></svg><p>baz</p></body></html>",
+        "noQuirksBodyHtml": "<svg><g>foo</g><g>bar</g><p>baz</p></svg>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><frameset><svg><g></g><g></g><p><span>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "<svg><g></g><g></g><p><span></span></p></svg>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><frameset></frameset><svg><g></g><g></g><p><span>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "<svg><g></g><g></g><p><span></span></p></svg>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body xlink:href=foo><svg xlink:href=foo></svg>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "attrs": [
+                  {
+                    "name": "xlink:href",
+                    "value": "foo"
+                  }
+                ],
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "attrs": [
+                      {
+                        "name": "href",
+                        "ns": "http://www.w3.org/1999/xlink",
+                        "value": "foo"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body xlink:href=\"foo\"><svg xlink:href=\"foo\"></svg></body></html>",
+        "noQuirksBodyHtml": "<svg xlink:href=\"foo\"></svg>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body xlink:href=foo xml:lang=en><svg><g xml:lang=en xlink:href=foo></g></svg>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg g": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "attrs": [
+                  {
+                    "name": "xlink:href",
+                    "value": "foo"
+                  },
+                  {
+                    "name": "xml:lang",
+                    "value": "en"
+                  }
+                ],
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "g",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "attrs": [
+                          {
+                            "name": "href",
+                            "ns": "http://www.w3.org/1999/xlink",
+                            "value": "foo"
+                          },
+                          {
+                            "name": "lang",
+                            "ns": "http://www.w3.org/XML/1998/namespace",
+                            "value": "en"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body xlink:href=\"foo\" xml:lang=\"en\"><svg><g xml:lang=\"en\" xlink:href=\"foo\"></g></svg></body></html>",
+        "noQuirksBodyHtml": "<svg><g xml:lang=\"en\" xlink:href=\"foo\"></g></svg>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body xlink:href=foo xml:lang=en><svg><g xml:lang=en xlink:href=foo /></svg>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg g": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "attrs": [
+                  {
+                    "name": "xlink:href",
+                    "value": "foo"
+                  },
+                  {
+                    "name": "xml:lang",
+                    "value": "en"
+                  }
+                ],
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "g",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "attrs": [
+                          {
+                            "name": "href",
+                            "ns": "http://www.w3.org/1999/xlink",
+                            "value": "foo"
+                          },
+                          {
+                            "name": "lang",
+                            "ns": "http://www.w3.org/XML/1998/namespace",
+                            "value": "en"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body xlink:href=\"foo\" xml:lang=\"en\"><svg><g xml:lang=\"en\" xlink:href=\"foo\"></g></svg></body></html>",
+        "noQuirksBodyHtml": "<svg><g xml:lang=\"en\" xlink:href=\"foo\"></g></svg>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body xlink:href=foo xml:lang=en><svg><g xml:lang=en xlink:href=foo />bar</svg>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg g": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "attrs": [
+                  {
+                    "name": "xlink:href",
+                    "value": "foo"
+                  },
+                  {
+                    "name": "xml:lang",
+                    "value": "en"
+                  }
+                ],
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "g",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "attrs": [
+                          {
+                            "name": "href",
+                            "ns": "http://www.w3.org/1999/xlink",
+                            "value": "foo"
+                          },
+                          {
+                            "name": "lang",
+                            "ns": "http://www.w3.org/XML/1998/namespace",
+                            "value": "en"
+                          }
+                        ]
+                      },
+                      {
+                        "text": "bar"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body xlink:href=\"foo\" xml:lang=\"en\"><svg><g xml:lang=\"en\" xlink:href=\"foo\"></g>bar</svg></body></html>",
+        "noQuirksBodyHtml": "<svg><g xml:lang=\"en\" xlink:href=\"foo\"></g>bar</svg>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg></svg></body></html>",
+        "noQuirksBodyHtml": "<svg></svg>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "svg svg": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "svg",
+                        "ns": "http://www.w3.org/2000/svg"
+                      }
+                    ]
+                  },
+                  {
+                    "text": "a"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div><svg></svg></div>a</body></html>",
+        "noQuirksBodyHtml": "<div><svg></svg></div>a"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "svg svg": true,
+            "svg path": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "svg",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "tag": "path",
+                            "ns": "http://www.w3.org/2000/svg"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "text": "a"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div><svg><path></path></svg></div>a</body></html>",
+        "noQuirksBodyHtml": "<div><svg><path></path></svg></div>a"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "svg svg": true,
+            "svg path": true,
+            "path": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "svg",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "tag": "path",
+                            "ns": "http://www.w3.org/2000/svg"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "path"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div><svg><path></path></svg><path></path></div></body></html>",
+        "noQuirksBodyHtml": "<div><svg><path></path></svg><path></path></div>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "svg svg": true,
+            "svg path": true,
+            "svg foreignObject": true,
+            "math math": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "svg",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "tag": "path",
+                            "ns": "http://www.w3.org/2000/svg",
+                            "children": [
+                              {
+                                "tag": "foreignObject",
+                                "ns": "http://www.w3.org/2000/svg",
+                                "children": [
+                                  {
+                                    "tag": "math",
+                                    "ns": "http://www.w3.org/1998/Math/MathML",
+                                    "children": [
+                                      {
+                                        "text": "a"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div><svg><path><foreignObject><math>a</math></foreignObject></path></svg></div></body></html>",
+        "noQuirksBodyHtml": "<div><svg><path><foreignObject><math>a</math></foreignObject></path></svg></div>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "svg svg": true,
+            "svg path": true,
+            "svg foreignObject": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "svg",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "tag": "path",
+                            "ns": "http://www.w3.org/2000/svg",
+                            "children": [
+                              {
+                                "tag": "foreignObject",
+                                "ns": "http://www.w3.org/2000/svg",
+                                "children": [
+                                  {
+                                    "tag": "p",
+                                    "children": [
+                                      {
+                                        "text": "a"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div><svg><path><foreignObject><p>a</p></foreignObject></path></svg></div></body></html>",
+        "noQuirksBodyHtml": "<div><svg><path><foreignObject><p>a</p></foreignObject></path></svg></div>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><svg><desc><div><svg><ul>a",
+      "errors": [
+        "(1,40) unexpected-html-element-in-foreign-content",
+        "(1,41) expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg desc": true,
+            "div": true,
+            "ul": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "desc",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "tag": "div",
+                            "children": [
+                              {
+                                "tag": "svg",
+                                "ns": "http://www.w3.org/2000/svg"
+                              },
+                              {
+                                "tag": "ul",
+                                "children": [
+                                  {
+                                    "text": "a"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg><desc><div><svg></svg><ul>a</ul></div></desc></svg></body></html>",
+        "noQuirksBodyHtml": "<svg><desc><div><svg><ul>a</ul></svg></div></desc></svg>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><svg><desc><svg><ul>a",
+      "errors": [
+        "(1,35) unexpected-html-element-in-foreign-content",
+        "(1,36) expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg desc": true,
+            "ul": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "desc",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "tag": "svg",
+                            "ns": "http://www.w3.org/2000/svg"
+                          },
+                          {
+                            "tag": "ul",
+                            "children": [
+                              {
+                                "text": "a"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg><desc><svg></svg><ul>a</ul></desc></svg></body></html>",
+        "noQuirksBodyHtml": "<svg><desc><svg><ul>a</ul></svg></desc></svg>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><p><svg><desc><p>",
+      "errors": [
+        "(1,32) expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "svg svg": true,
+            "svg desc": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "svg",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "tag": "desc",
+                            "ns": "http://www.w3.org/2000/svg",
+                            "children": [
+                              {
+                                "tag": "p"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><svg><desc><p></p></desc></svg></p></body></html>",
+        "noQuirksBodyHtml": "<p><svg><desc><p></p></desc></svg></p>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><p><svg><title><p>",
+      "errors": [
+        "(1,33) expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "svg svg": true,
+            "svg title": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "svg",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "tag": "title",
+                            "ns": "http://www.w3.org/2000/svg",
+                            "children": [
+                              {
+                                "tag": "p"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><svg><title><p></p></title></svg></p></body></html>",
+        "noQuirksBodyHtml": "<p><svg><title><p></p></title></svg></p>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "svg svg": true,
+            "svg path": true,
+            "svg foreignObject": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "svg",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "tag": "path",
+                            "ns": "http://www.w3.org/2000/svg",
+                            "children": [
+                              {
+                                "tag": "foreignObject",
+                                "ns": "http://www.w3.org/2000/svg",
+                                "children": [
+                                  {
+                                    "tag": "p"
+                                  },
+                                  {
+                                    "tag": "p"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div><svg><path><foreignObject><p></p><p></p></foreignObject></path></svg></div></body></html>",
+        "noQuirksBodyHtml": "<div><svg><path><foreignObject><p></p><p></p></foreignObject></path></svg></div>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mi": true,
+            "div": true,
+            "object": true,
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "div",
+                            "children": [
+                              {
+                                "tag": "object",
+                                "children": [
+                                  {
+                                    "tag": "div",
+                                    "children": [
+                                      {
+                                        "tag": "span"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><mi><div><object><div><span></span></div></object></div></mi><mi></mi></math></body></html>",
+        "noQuirksBodyHtml": "<math><mi><div><object><div><span></span></div></object></div></mi><mi></mi></math>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mi": true,
+            "svg svg": true,
+            "svg foreignObject": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "svg",
+                            "ns": "http://www.w3.org/2000/svg",
+                            "children": [
+                              {
+                                "tag": "foreignObject",
+                                "ns": "http://www.w3.org/2000/svg",
+                                "children": [
+                                  {
+                                    "tag": "div",
+                                    "children": [
+                                      {
+                                        "tag": "div"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><mi><svg><foreignObject><div><div></div></div></foreignObject></svg></mi><mi></mi></math></body></html>",
+        "noQuirksBodyHtml": "<math><mi><svg><foreignObject><div><div></div></div></foreignObject></svg></mi><mi></mi></math>"
+      }
+    },
+    {
+      "data": "<svg><script></script><path>",
+      "errors": [
+        "(1,5) expected-doctype-but-got-start-tag",
+        "(1,28) expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg script": true,
+            "svg path": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "script",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "path",
+                        "ns": "http://www.w3.org/2000/svg"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg><script></script><path></path></svg></body></html>",
+        "noQuirksBodyHtml": "<svg><script></script><path></path></svg>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "table": true,
+            "tbody": true,
+            "tr": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg></svg><table><tbody><tr></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<svg></svg><table><tbody><tr></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<math><mi><mglyph>",
+      "errors": [
+        "(1,6) expected-doctype-but-got-start-tag",
+        "(1,18) expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mi": true,
+            "math mglyph": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "mglyph",
+                            "ns": "http://www.w3.org/1998/Math/MathML"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><mi><mglyph></mglyph></mi></math></body></html>",
+        "noQuirksBodyHtml": "<math><mi><mglyph></mglyph></mi></math>"
+      }
+    },
+    {
+      "data": "<math><mi><malignmark>",
+      "errors": [
+        "(1,6) expected-doctype-but-got-start-tag",
+        "(1,22) expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mi": true,
+            "math malignmark": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "malignmark",
+                            "ns": "http://www.w3.org/1998/Math/MathML"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><mi><malignmark></malignmark></mi></math></body></html>",
+        "noQuirksBodyHtml": "<math><mi><malignmark></malignmark></mi></math>"
+      }
+    },
+    {
+      "data": "<math><mo><mglyph>",
+      "errors": [
+        "(1,6) expected-doctype-but-got-start-tag",
+        "(1,18) expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mo": true,
+            "math mglyph": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mo",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "mglyph",
+                            "ns": "http://www.w3.org/1998/Math/MathML"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><mo><mglyph></mglyph></mo></math></body></html>",
+        "noQuirksBodyHtml": "<math><mo><mglyph></mglyph></mo></math>"
+      }
+    },
+    {
+      "data": "<math><mo><malignmark>",
+      "errors": [
+        "(1,6) expected-doctype-but-got-start-tag",
+        "(1,22) expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mo": true,
+            "math malignmark": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mo",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "malignmark",
+                            "ns": "http://www.w3.org/1998/Math/MathML"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><mo><malignmark></malignmark></mo></math></body></html>",
+        "noQuirksBodyHtml": "<math><mo><malignmark></malignmark></mo></math>"
+      }
+    },
+    {
+      "data": "<math><mn><mglyph>",
+      "errors": [
+        "(1,6) expected-doctype-but-got-start-tag",
+        "(1,18) expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mn": true,
+            "math mglyph": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mn",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "mglyph",
+                            "ns": "http://www.w3.org/1998/Math/MathML"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><mn><mglyph></mglyph></mn></math></body></html>",
+        "noQuirksBodyHtml": "<math><mn><mglyph></mglyph></mn></math>"
+      }
+    },
+    {
+      "data": "<math><mn><malignmark>",
+      "errors": [
+        "(1,6) expected-doctype-but-got-start-tag",
+        "(1,22) expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mn": true,
+            "math malignmark": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mn",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "malignmark",
+                            "ns": "http://www.w3.org/1998/Math/MathML"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><mn><malignmark></malignmark></mn></math></body></html>",
+        "noQuirksBodyHtml": "<math><mn><malignmark></malignmark></mn></math>"
+      }
+    },
+    {
+      "data": "<math><ms><mglyph>",
+      "errors": [
+        "(1,6) expected-doctype-but-got-start-tag",
+        "(1,18) expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math ms": true,
+            "math mglyph": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "ms",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "mglyph",
+                            "ns": "http://www.w3.org/1998/Math/MathML"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><ms><mglyph></mglyph></ms></math></body></html>",
+        "noQuirksBodyHtml": "<math><ms><mglyph></mglyph></ms></math>"
+      }
+    },
+    {
+      "data": "<math><ms><malignmark>",
+      "errors": [
+        "(1,6) expected-doctype-but-got-start-tag",
+        "(1,22) expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math ms": true,
+            "math malignmark": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "ms",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "malignmark",
+                            "ns": "http://www.w3.org/1998/Math/MathML"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><ms><malignmark></malignmark></ms></math></body></html>",
+        "noQuirksBodyHtml": "<math><ms><malignmark></malignmark></ms></math>"
+      }
+    },
+    {
+      "data": "<math><mtext><mglyph>",
+      "errors": [
+        "(1,6) expected-doctype-but-got-start-tag",
+        "(1,21) expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mtext": true,
+            "math mglyph": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mtext",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "mglyph",
+                            "ns": "http://www.w3.org/1998/Math/MathML"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><mtext><mglyph></mglyph></mtext></math></body></html>",
+        "noQuirksBodyHtml": "<math><mtext><mglyph></mglyph></mtext></math>"
+      }
+    },
+    {
+      "data": "<math><mtext><malignmark>",
+      "errors": [
+        "(1,6) expected-doctype-but-got-start-tag",
+        "(1,25) expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mtext": true,
+            "math malignmark": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mtext",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "malignmark",
+                            "ns": "http://www.w3.org/1998/Math/MathML"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><mtext><malignmark></malignmark></mtext></math></body></html>",
+        "noQuirksBodyHtml": "<math><mtext><malignmark></malignmark></mtext></math>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math annotation-xml": true,
+            "svg svg": true,
+            "math mi": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "annotation-xml",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "svg",
+                            "ns": "http://www.w3.org/2000/svg"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><annotation-xml><svg></svg></annotation-xml><mi></mi></math></body></html>",
+        "noQuirksBodyHtml": "<math><annotation-xml><svg></svg></annotation-xml><mi></mi></math>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math annotation-xml": true,
+            "svg svg": true,
+            "svg foreignObject": true,
+            "div": true,
+            "math mi": true,
+            "span": true,
+            "svg path": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "annotation-xml",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "svg",
+                            "ns": "http://www.w3.org/2000/svg",
+                            "children": [
+                              {
+                                "tag": "foreignObject",
+                                "ns": "http://www.w3.org/2000/svg",
+                                "children": [
+                                  {
+                                    "tag": "div",
+                                    "children": [
+                                      {
+                                        "tag": "math",
+                                        "ns": "http://www.w3.org/1998/Math/MathML",
+                                        "children": [
+                                          {
+                                            "tag": "mi",
+                                            "ns": "http://www.w3.org/1998/Math/MathML"
+                                          }
+                                        ]
+                                      },
+                                      {
+                                        "tag": "span"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              },
+                              {
+                                "tag": "path",
+                                "ns": "http://www.w3.org/2000/svg"
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><annotation-xml><svg><foreignObject><div><math><mi></mi></math><span></span></div></foreignObject><path></path></svg></annotation-xml><mi></mi></math></body></html>",
+        "noQuirksBodyHtml": "<math><annotation-xml><svg><foreignObject><div><math><mi></mi></math><span></span></div></foreignObject><path></path></svg></annotation-xml><mi></mi></math>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math annotation-xml": true,
+            "svg svg": true,
+            "svg foreignObject": true,
+            "math mi": true,
+            "math mo": true,
+            "span": true,
+            "svg path": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "annotation-xml",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "svg",
+                            "ns": "http://www.w3.org/2000/svg",
+                            "children": [
+                              {
+                                "tag": "foreignObject",
+                                "ns": "http://www.w3.org/2000/svg",
+                                "children": [
+                                  {
+                                    "tag": "math",
+                                    "ns": "http://www.w3.org/1998/Math/MathML",
+                                    "children": [
+                                      {
+                                        "tag": "mi",
+                                        "ns": "http://www.w3.org/1998/Math/MathML",
+                                        "children": [
+                                          {
+                                            "tag": "svg",
+                                            "ns": "http://www.w3.org/2000/svg"
+                                          }
+                                        ]
+                                      },
+                                      {
+                                        "tag": "mo",
+                                        "ns": "http://www.w3.org/1998/Math/MathML"
+                                      }
+                                    ]
+                                  },
+                                  {
+                                    "tag": "span"
+                                  }
+                                ]
+                              },
+                              {
+                                "tag": "path",
+                                "ns": "http://www.w3.org/2000/svg"
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><annotation-xml><svg><foreignObject><math><mi><svg></svg></mi><mo></mo></math><span></span></foreignObject><path></path></svg></annotation-xml><mi></mi></math></body></html>",
+        "noQuirksBodyHtml": "<math><annotation-xml><svg><foreignObject><math><mi><svg></svg></mi><mo></mo></math><span></span></foreignObject><path></path></svg></annotation-xml><mi></mi></math>"
+      }
+    }
+  ],
+  "tests11.dat": [
+    {
+      "data": "<!DOCTYPE html><body><svg attributeName='' attributeType='' baseFrequency='' baseProfile='' calcMode='' clipPathUnits='' diffuseConstant='' edgeMode='' filterUnits='' glyphRef='' gradientTransform='' gradientUnits='' kernelMatrix='' kernelUnitLength='' keyPoints='' keySplines='' keyTimes='' lengthAdjust='' limitingConeAngle='' markerHeight='' markerUnits='' markerWidth='' maskContentUnits='' maskUnits='' numOctaves='' pathLength='' patternContentUnits='' patternTransform='' patternUnits='' pointsAtX='' pointsAtY='' pointsAtZ='' preserveAlpha='' preserveAspectRatio='' primitiveUnits='' refX='' refY='' repeatCount='' repeatDur='' requiredExtensions='' requiredFeatures='' specularConstant='' specularExponent='' spreadMethod='' startOffset='' stdDeviation='' stitchTiles='' surfaceScale='' systemLanguage='' tableValues='' targetX='' targetY='' textLength='' viewBox='' viewTarget='' xChannelSelector='' yChannelSelector='' zoomAndPan=''></svg>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "attrs": [
+                      {
+                        "name": "attributeName",
+                        "value": ""
+                      },
+                      {
+                        "name": "attributeType",
+                        "value": ""
+                      },
+                      {
+                        "name": "baseFrequency",
+                        "value": ""
+                      },
+                      {
+                        "name": "baseProfile",
+                        "value": ""
+                      },
+                      {
+                        "name": "calcMode",
+                        "value": ""
+                      },
+                      {
+                        "name": "clipPathUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "diffuseConstant",
+                        "value": ""
+                      },
+                      {
+                        "name": "edgeMode",
+                        "value": ""
+                      },
+                      {
+                        "name": "filterUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "glyphRef",
+                        "value": ""
+                      },
+                      {
+                        "name": "gradientTransform",
+                        "value": ""
+                      },
+                      {
+                        "name": "gradientUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "kernelMatrix",
+                        "value": ""
+                      },
+                      {
+                        "name": "kernelUnitLength",
+                        "value": ""
+                      },
+                      {
+                        "name": "keyPoints",
+                        "value": ""
+                      },
+                      {
+                        "name": "keySplines",
+                        "value": ""
+                      },
+                      {
+                        "name": "keyTimes",
+                        "value": ""
+                      },
+                      {
+                        "name": "lengthAdjust",
+                        "value": ""
+                      },
+                      {
+                        "name": "limitingConeAngle",
+                        "value": ""
+                      },
+                      {
+                        "name": "markerHeight",
+                        "value": ""
+                      },
+                      {
+                        "name": "markerUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "markerWidth",
+                        "value": ""
+                      },
+                      {
+                        "name": "maskContentUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "maskUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "numOctaves",
+                        "value": ""
+                      },
+                      {
+                        "name": "pathLength",
+                        "value": ""
+                      },
+                      {
+                        "name": "patternContentUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "patternTransform",
+                        "value": ""
+                      },
+                      {
+                        "name": "patternUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "pointsAtX",
+                        "value": ""
+                      },
+                      {
+                        "name": "pointsAtY",
+                        "value": ""
+                      },
+                      {
+                        "name": "pointsAtZ",
+                        "value": ""
+                      },
+                      {
+                        "name": "preserveAlpha",
+                        "value": ""
+                      },
+                      {
+                        "name": "preserveAspectRatio",
+                        "value": ""
+                      },
+                      {
+                        "name": "primitiveUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "refX",
+                        "value": ""
+                      },
+                      {
+                        "name": "refY",
+                        "value": ""
+                      },
+                      {
+                        "name": "repeatCount",
+                        "value": ""
+                      },
+                      {
+                        "name": "repeatDur",
+                        "value": ""
+                      },
+                      {
+                        "name": "requiredExtensions",
+                        "value": ""
+                      },
+                      {
+                        "name": "requiredFeatures",
+                        "value": ""
+                      },
+                      {
+                        "name": "specularConstant",
+                        "value": ""
+                      },
+                      {
+                        "name": "specularExponent",
+                        "value": ""
+                      },
+                      {
+                        "name": "spreadMethod",
+                        "value": ""
+                      },
+                      {
+                        "name": "startOffset",
+                        "value": ""
+                      },
+                      {
+                        "name": "stdDeviation",
+                        "value": ""
+                      },
+                      {
+                        "name": "stitchTiles",
+                        "value": ""
+                      },
+                      {
+                        "name": "surfaceScale",
+                        "value": ""
+                      },
+                      {
+                        "name": "systemLanguage",
+                        "value": ""
+                      },
+                      {
+                        "name": "tableValues",
+                        "value": ""
+                      },
+                      {
+                        "name": "targetX",
+                        "value": ""
+                      },
+                      {
+                        "name": "targetY",
+                        "value": ""
+                      },
+                      {
+                        "name": "textLength",
+                        "value": ""
+                      },
+                      {
+                        "name": "viewBox",
+                        "value": ""
+                      },
+                      {
+                        "name": "viewTarget",
+                        "value": ""
+                      },
+                      {
+                        "name": "xChannelSelector",
+                        "value": ""
+                      },
+                      {
+                        "name": "yChannelSelector",
+                        "value": ""
+                      },
+                      {
+                        "name": "zoomAndPan",
+                        "value": ""
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg attributeName=\"\" attributeType=\"\" baseFrequency=\"\" baseProfile=\"\" calcMode=\"\" clipPathUnits=\"\" diffuseConstant=\"\" edgeMode=\"\" filterUnits=\"\" glyphRef=\"\" gradientTransform=\"\" gradientUnits=\"\" kernelMatrix=\"\" kernelUnitLength=\"\" keyPoints=\"\" keySplines=\"\" keyTimes=\"\" lengthAdjust=\"\" limitingConeAngle=\"\" markerHeight=\"\" markerUnits=\"\" markerWidth=\"\" maskContentUnits=\"\" maskUnits=\"\" numOctaves=\"\" pathLength=\"\" patternContentUnits=\"\" patternTransform=\"\" patternUnits=\"\" pointsAtX=\"\" pointsAtY=\"\" pointsAtZ=\"\" preserveAlpha=\"\" preserveAspectRatio=\"\" primitiveUnits=\"\" refX=\"\" refY=\"\" repeatCount=\"\" repeatDur=\"\" requiredExtensions=\"\" requiredFeatures=\"\" specularConstant=\"\" specularExponent=\"\" spreadMethod=\"\" startOffset=\"\" stdDeviation=\"\" stitchTiles=\"\" surfaceScale=\"\" systemLanguage=\"\" tableValues=\"\" targetX=\"\" targetY=\"\" textLength=\"\" viewBox=\"\" viewTarget=\"\" xChannelSelector=\"\" yChannelSelector=\"\" zoomAndPan=\"\"></svg></body></html>",
+        "noQuirksBodyHtml": "<svg attributeName=\"\" attributeType=\"\" baseFrequency=\"\" baseProfile=\"\" calcMode=\"\" clipPathUnits=\"\" diffuseConstant=\"\" edgeMode=\"\" filterUnits=\"\" glyphRef=\"\" gradientTransform=\"\" gradientUnits=\"\" kernelMatrix=\"\" kernelUnitLength=\"\" keyPoints=\"\" keySplines=\"\" keyTimes=\"\" lengthAdjust=\"\" limitingConeAngle=\"\" markerHeight=\"\" markerUnits=\"\" markerWidth=\"\" maskContentUnits=\"\" maskUnits=\"\" numOctaves=\"\" pathLength=\"\" patternContentUnits=\"\" patternTransform=\"\" patternUnits=\"\" pointsAtX=\"\" pointsAtY=\"\" pointsAtZ=\"\" preserveAlpha=\"\" preserveAspectRatio=\"\" primitiveUnits=\"\" refX=\"\" refY=\"\" repeatCount=\"\" repeatDur=\"\" requiredExtensions=\"\" requiredFeatures=\"\" specularConstant=\"\" specularExponent=\"\" spreadMethod=\"\" startOffset=\"\" stdDeviation=\"\" stitchTiles=\"\" surfaceScale=\"\" systemLanguage=\"\" tableValues=\"\" targetX=\"\" targetY=\"\" textLength=\"\" viewBox=\"\" viewTarget=\"\" xChannelSelector=\"\" yChannelSelector=\"\" zoomAndPan=\"\"></svg>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><BODY><SVG ATTRIBUTENAME='' ATTRIBUTETYPE='' BASEFREQUENCY='' BASEPROFILE='' CALCMODE='' CLIPPATHUNITS='' DIFFUSECONSTANT='' EDGEMODE='' FILTERUNITS='' GLYPHREF='' GRADIENTTRANSFORM='' GRADIENTUNITS='' KERNELMATRIX='' KERNELUNITLENGTH='' KEYPOINTS='' KEYSPLINES='' KEYTIMES='' LENGTHADJUST='' LIMITINGCONEANGLE='' MARKERHEIGHT='' MARKERUNITS='' MARKERWIDTH='' MASKCONTENTUNITS='' MASKUNITS='' NUMOCTAVES='' PATHLENGTH='' PATTERNCONTENTUNITS='' PATTERNTRANSFORM='' PATTERNUNITS='' POINTSATX='' POINTSATY='' POINTSATZ='' PRESERVEALPHA='' PRESERVEASPECTRATIO='' PRIMITIVEUNITS='' REFX='' REFY='' REPEATCOUNT='' REPEATDUR='' REQUIREDEXTENSIONS='' REQUIREDFEATURES='' SPECULARCONSTANT='' SPECULAREXPONENT='' SPREADMETHOD='' STARTOFFSET='' STDDEVIATION='' STITCHTILES='' SURFACESCALE='' SYSTEMLANGUAGE='' TABLEVALUES='' TARGETX='' TARGETY='' TEXTLENGTH='' VIEWBOX='' VIEWTARGET='' XCHANNELSELECTOR='' YCHANNELSELECTOR='' ZOOMANDPAN=''></SVG>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "attrs": [
+                      {
+                        "name": "attributeName",
+                        "value": ""
+                      },
+                      {
+                        "name": "attributeType",
+                        "value": ""
+                      },
+                      {
+                        "name": "baseFrequency",
+                        "value": ""
+                      },
+                      {
+                        "name": "baseProfile",
+                        "value": ""
+                      },
+                      {
+                        "name": "calcMode",
+                        "value": ""
+                      },
+                      {
+                        "name": "clipPathUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "diffuseConstant",
+                        "value": ""
+                      },
+                      {
+                        "name": "edgeMode",
+                        "value": ""
+                      },
+                      {
+                        "name": "filterUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "glyphRef",
+                        "value": ""
+                      },
+                      {
+                        "name": "gradientTransform",
+                        "value": ""
+                      },
+                      {
+                        "name": "gradientUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "kernelMatrix",
+                        "value": ""
+                      },
+                      {
+                        "name": "kernelUnitLength",
+                        "value": ""
+                      },
+                      {
+                        "name": "keyPoints",
+                        "value": ""
+                      },
+                      {
+                        "name": "keySplines",
+                        "value": ""
+                      },
+                      {
+                        "name": "keyTimes",
+                        "value": ""
+                      },
+                      {
+                        "name": "lengthAdjust",
+                        "value": ""
+                      },
+                      {
+                        "name": "limitingConeAngle",
+                        "value": ""
+                      },
+                      {
+                        "name": "markerHeight",
+                        "value": ""
+                      },
+                      {
+                        "name": "markerUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "markerWidth",
+                        "value": ""
+                      },
+                      {
+                        "name": "maskContentUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "maskUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "numOctaves",
+                        "value": ""
+                      },
+                      {
+                        "name": "pathLength",
+                        "value": ""
+                      },
+                      {
+                        "name": "patternContentUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "patternTransform",
+                        "value": ""
+                      },
+                      {
+                        "name": "patternUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "pointsAtX",
+                        "value": ""
+                      },
+                      {
+                        "name": "pointsAtY",
+                        "value": ""
+                      },
+                      {
+                        "name": "pointsAtZ",
+                        "value": ""
+                      },
+                      {
+                        "name": "preserveAlpha",
+                        "value": ""
+                      },
+                      {
+                        "name": "preserveAspectRatio",
+                        "value": ""
+                      },
+                      {
+                        "name": "primitiveUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "refX",
+                        "value": ""
+                      },
+                      {
+                        "name": "refY",
+                        "value": ""
+                      },
+                      {
+                        "name": "repeatCount",
+                        "value": ""
+                      },
+                      {
+                        "name": "repeatDur",
+                        "value": ""
+                      },
+                      {
+                        "name": "requiredExtensions",
+                        "value": ""
+                      },
+                      {
+                        "name": "requiredFeatures",
+                        "value": ""
+                      },
+                      {
+                        "name": "specularConstant",
+                        "value": ""
+                      },
+                      {
+                        "name": "specularExponent",
+                        "value": ""
+                      },
+                      {
+                        "name": "spreadMethod",
+                        "value": ""
+                      },
+                      {
+                        "name": "startOffset",
+                        "value": ""
+                      },
+                      {
+                        "name": "stdDeviation",
+                        "value": ""
+                      },
+                      {
+                        "name": "stitchTiles",
+                        "value": ""
+                      },
+                      {
+                        "name": "surfaceScale",
+                        "value": ""
+                      },
+                      {
+                        "name": "systemLanguage",
+                        "value": ""
+                      },
+                      {
+                        "name": "tableValues",
+                        "value": ""
+                      },
+                      {
+                        "name": "targetX",
+                        "value": ""
+                      },
+                      {
+                        "name": "targetY",
+                        "value": ""
+                      },
+                      {
+                        "name": "textLength",
+                        "value": ""
+                      },
+                      {
+                        "name": "viewBox",
+                        "value": ""
+                      },
+                      {
+                        "name": "viewTarget",
+                        "value": ""
+                      },
+                      {
+                        "name": "xChannelSelector",
+                        "value": ""
+                      },
+                      {
+                        "name": "yChannelSelector",
+                        "value": ""
+                      },
+                      {
+                        "name": "zoomAndPan",
+                        "value": ""
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg attributeName=\"\" attributeType=\"\" baseFrequency=\"\" baseProfile=\"\" calcMode=\"\" clipPathUnits=\"\" diffuseConstant=\"\" edgeMode=\"\" filterUnits=\"\" glyphRef=\"\" gradientTransform=\"\" gradientUnits=\"\" kernelMatrix=\"\" kernelUnitLength=\"\" keyPoints=\"\" keySplines=\"\" keyTimes=\"\" lengthAdjust=\"\" limitingConeAngle=\"\" markerHeight=\"\" markerUnits=\"\" markerWidth=\"\" maskContentUnits=\"\" maskUnits=\"\" numOctaves=\"\" pathLength=\"\" patternContentUnits=\"\" patternTransform=\"\" patternUnits=\"\" pointsAtX=\"\" pointsAtY=\"\" pointsAtZ=\"\" preserveAlpha=\"\" preserveAspectRatio=\"\" primitiveUnits=\"\" refX=\"\" refY=\"\" repeatCount=\"\" repeatDur=\"\" requiredExtensions=\"\" requiredFeatures=\"\" specularConstant=\"\" specularExponent=\"\" spreadMethod=\"\" startOffset=\"\" stdDeviation=\"\" stitchTiles=\"\" surfaceScale=\"\" systemLanguage=\"\" tableValues=\"\" targetX=\"\" targetY=\"\" textLength=\"\" viewBox=\"\" viewTarget=\"\" xChannelSelector=\"\" yChannelSelector=\"\" zoomAndPan=\"\"></svg></body></html>",
+        "noQuirksBodyHtml": "<svg attributeName=\"\" attributeType=\"\" baseFrequency=\"\" baseProfile=\"\" calcMode=\"\" clipPathUnits=\"\" diffuseConstant=\"\" edgeMode=\"\" filterUnits=\"\" glyphRef=\"\" gradientTransform=\"\" gradientUnits=\"\" kernelMatrix=\"\" kernelUnitLength=\"\" keyPoints=\"\" keySplines=\"\" keyTimes=\"\" lengthAdjust=\"\" limitingConeAngle=\"\" markerHeight=\"\" markerUnits=\"\" markerWidth=\"\" maskContentUnits=\"\" maskUnits=\"\" numOctaves=\"\" pathLength=\"\" patternContentUnits=\"\" patternTransform=\"\" patternUnits=\"\" pointsAtX=\"\" pointsAtY=\"\" pointsAtZ=\"\" preserveAlpha=\"\" preserveAspectRatio=\"\" primitiveUnits=\"\" refX=\"\" refY=\"\" repeatCount=\"\" repeatDur=\"\" requiredExtensions=\"\" requiredFeatures=\"\" specularConstant=\"\" specularExponent=\"\" spreadMethod=\"\" startOffset=\"\" stdDeviation=\"\" stitchTiles=\"\" surfaceScale=\"\" systemLanguage=\"\" tableValues=\"\" targetX=\"\" targetY=\"\" textLength=\"\" viewBox=\"\" viewTarget=\"\" xChannelSelector=\"\" yChannelSelector=\"\" zoomAndPan=\"\"></svg>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><svg attributename='' attributetype='' basefrequency='' baseprofile='' calcmode='' clippathunits='' diffuseconstant='' edgemode='' filterunits='' filterres='' glyphref='' gradienttransform='' gradientunits='' kernelmatrix='' kernelunitlength='' keypoints='' keysplines='' keytimes='' lengthadjust='' limitingconeangle='' markerheight='' markerunits='' markerwidth='' maskcontentunits='' maskunits='' numoctaves='' pathlength='' patterncontentunits='' patterntransform='' patternunits='' pointsatx='' pointsaty='' pointsatz='' preservealpha='' preserveaspectratio='' primitiveunits='' refx='' refy='' repeatcount='' repeatdur='' requiredextensions='' requiredfeatures='' specularconstant='' specularexponent='' spreadmethod='' startoffset='' stddeviation='' stitchtiles='' surfacescale='' systemlanguage='' tablevalues='' targetx='' targety='' textlength='' viewbox='' viewtarget='' xchannelselector='' ychannelselector='' zoomandpan=''></svg>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "attrs": [
+                      {
+                        "name": "attributeName",
+                        "value": ""
+                      },
+                      {
+                        "name": "attributeType",
+                        "value": ""
+                      },
+                      {
+                        "name": "baseFrequency",
+                        "value": ""
+                      },
+                      {
+                        "name": "baseProfile",
+                        "value": ""
+                      },
+                      {
+                        "name": "calcMode",
+                        "value": ""
+                      },
+                      {
+                        "name": "clipPathUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "diffuseConstant",
+                        "value": ""
+                      },
+                      {
+                        "name": "edgeMode",
+                        "value": ""
+                      },
+                      {
+                        "name": "filterUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "filterres",
+                        "value": ""
+                      },
+                      {
+                        "name": "glyphRef",
+                        "value": ""
+                      },
+                      {
+                        "name": "gradientTransform",
+                        "value": ""
+                      },
+                      {
+                        "name": "gradientUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "kernelMatrix",
+                        "value": ""
+                      },
+                      {
+                        "name": "kernelUnitLength",
+                        "value": ""
+                      },
+                      {
+                        "name": "keyPoints",
+                        "value": ""
+                      },
+                      {
+                        "name": "keySplines",
+                        "value": ""
+                      },
+                      {
+                        "name": "keyTimes",
+                        "value": ""
+                      },
+                      {
+                        "name": "lengthAdjust",
+                        "value": ""
+                      },
+                      {
+                        "name": "limitingConeAngle",
+                        "value": ""
+                      },
+                      {
+                        "name": "markerHeight",
+                        "value": ""
+                      },
+                      {
+                        "name": "markerUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "markerWidth",
+                        "value": ""
+                      },
+                      {
+                        "name": "maskContentUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "maskUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "numOctaves",
+                        "value": ""
+                      },
+                      {
+                        "name": "pathLength",
+                        "value": ""
+                      },
+                      {
+                        "name": "patternContentUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "patternTransform",
+                        "value": ""
+                      },
+                      {
+                        "name": "patternUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "pointsAtX",
+                        "value": ""
+                      },
+                      {
+                        "name": "pointsAtY",
+                        "value": ""
+                      },
+                      {
+                        "name": "pointsAtZ",
+                        "value": ""
+                      },
+                      {
+                        "name": "preserveAlpha",
+                        "value": ""
+                      },
+                      {
+                        "name": "preserveAspectRatio",
+                        "value": ""
+                      },
+                      {
+                        "name": "primitiveUnits",
+                        "value": ""
+                      },
+                      {
+                        "name": "refX",
+                        "value": ""
+                      },
+                      {
+                        "name": "refY",
+                        "value": ""
+                      },
+                      {
+                        "name": "repeatCount",
+                        "value": ""
+                      },
+                      {
+                        "name": "repeatDur",
+                        "value": ""
+                      },
+                      {
+                        "name": "requiredExtensions",
+                        "value": ""
+                      },
+                      {
+                        "name": "requiredFeatures",
+                        "value": ""
+                      },
+                      {
+                        "name": "specularConstant",
+                        "value": ""
+                      },
+                      {
+                        "name": "specularExponent",
+                        "value": ""
+                      },
+                      {
+                        "name": "spreadMethod",
+                        "value": ""
+                      },
+                      {
+                        "name": "startOffset",
+                        "value": ""
+                      },
+                      {
+                        "name": "stdDeviation",
+                        "value": ""
+                      },
+                      {
+                        "name": "stitchTiles",
+                        "value": ""
+                      },
+                      {
+                        "name": "surfaceScale",
+                        "value": ""
+                      },
+                      {
+                        "name": "systemLanguage",
+                        "value": ""
+                      },
+                      {
+                        "name": "tableValues",
+                        "value": ""
+                      },
+                      {
+                        "name": "targetX",
+                        "value": ""
+                      },
+                      {
+                        "name": "targetY",
+                        "value": ""
+                      },
+                      {
+                        "name": "textLength",
+                        "value": ""
+                      },
+                      {
+                        "name": "viewBox",
+                        "value": ""
+                      },
+                      {
+                        "name": "viewTarget",
+                        "value": ""
+                      },
+                      {
+                        "name": "xChannelSelector",
+                        "value": ""
+                      },
+                      {
+                        "name": "yChannelSelector",
+                        "value": ""
+                      },
+                      {
+                        "name": "zoomAndPan",
+                        "value": ""
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg attributeName=\"\" attributeType=\"\" baseFrequency=\"\" baseProfile=\"\" calcMode=\"\" clipPathUnits=\"\" diffuseConstant=\"\" edgeMode=\"\" filterUnits=\"\" filterres=\"\" glyphRef=\"\" gradientTransform=\"\" gradientUnits=\"\" kernelMatrix=\"\" kernelUnitLength=\"\" keyPoints=\"\" keySplines=\"\" keyTimes=\"\" lengthAdjust=\"\" limitingConeAngle=\"\" markerHeight=\"\" markerUnits=\"\" markerWidth=\"\" maskContentUnits=\"\" maskUnits=\"\" numOctaves=\"\" pathLength=\"\" patternContentUnits=\"\" patternTransform=\"\" patternUnits=\"\" pointsAtX=\"\" pointsAtY=\"\" pointsAtZ=\"\" preserveAlpha=\"\" preserveAspectRatio=\"\" primitiveUnits=\"\" refX=\"\" refY=\"\" repeatCount=\"\" repeatDur=\"\" requiredExtensions=\"\" requiredFeatures=\"\" specularConstant=\"\" specularExponent=\"\" spreadMethod=\"\" startOffset=\"\" stdDeviation=\"\" stitchTiles=\"\" surfaceScale=\"\" systemLanguage=\"\" tableValues=\"\" targetX=\"\" targetY=\"\" textLength=\"\" viewBox=\"\" viewTarget=\"\" xChannelSelector=\"\" yChannelSelector=\"\" zoomAndPan=\"\"></svg></body></html>",
+        "noQuirksBodyHtml": "<svg attributeName=\"\" attributeType=\"\" baseFrequency=\"\" baseProfile=\"\" calcMode=\"\" clipPathUnits=\"\" diffuseConstant=\"\" edgeMode=\"\" filterUnits=\"\" filterres=\"\" glyphRef=\"\" gradientTransform=\"\" gradientUnits=\"\" kernelMatrix=\"\" kernelUnitLength=\"\" keyPoints=\"\" keySplines=\"\" keyTimes=\"\" lengthAdjust=\"\" limitingConeAngle=\"\" markerHeight=\"\" markerUnits=\"\" markerWidth=\"\" maskContentUnits=\"\" maskUnits=\"\" numOctaves=\"\" pathLength=\"\" patternContentUnits=\"\" patternTransform=\"\" patternUnits=\"\" pointsAtX=\"\" pointsAtY=\"\" pointsAtZ=\"\" preserveAlpha=\"\" preserveAspectRatio=\"\" primitiveUnits=\"\" refX=\"\" refY=\"\" repeatCount=\"\" repeatDur=\"\" requiredExtensions=\"\" requiredFeatures=\"\" specularConstant=\"\" specularExponent=\"\" spreadMethod=\"\" startOffset=\"\" stdDeviation=\"\" stitchTiles=\"\" surfaceScale=\"\" systemLanguage=\"\" tableValues=\"\" targetX=\"\" targetY=\"\" textLength=\"\" viewBox=\"\" viewTarget=\"\" xChannelSelector=\"\" yChannelSelector=\"\" zoomAndPan=\"\"></svg>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><math attributeName='' attributeType='' baseFrequency='' baseProfile='' calcMode='' clipPathUnits='' diffuseConstant='' edgeMode='' filterUnits='' glyphRef='' gradientTransform='' gradientUnits='' kernelMatrix='' kernelUnitLength='' keyPoints='' keySplines='' keyTimes='' lengthAdjust='' limitingConeAngle='' markerHeight='' markerUnits='' markerWidth='' maskContentUnits='' maskUnits='' numOctaves='' pathLength='' patternContentUnits='' patternTransform='' patternUnits='' pointsAtX='' pointsAtY='' pointsAtZ='' preserveAlpha='' preserveAspectRatio='' primitiveUnits='' refX='' refY='' repeatCount='' repeatDur='' requiredExtensions='' requiredFeatures='' specularConstant='' specularExponent='' spreadMethod='' startOffset='' stdDeviation='' stitchTiles='' surfaceScale='' systemLanguage='' tableValues='' targetX='' targetY='' textLength='' viewBox='' viewTarget='' xChannelSelector='' yChannelSelector='' zoomAndPan=''></math>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "attrs": [
+                      {
+                        "name": "attributename",
+                        "value": ""
+                      },
+                      {
+                        "name": "attributetype",
+                        "value": ""
+                      },
+                      {
+                        "name": "basefrequency",
+                        "value": ""
+                      },
+                      {
+                        "name": "baseprofile",
+                        "value": ""
+                      },
+                      {
+                        "name": "calcmode",
+                        "value": ""
+                      },
+                      {
+                        "name": "clippathunits",
+                        "value": ""
+                      },
+                      {
+                        "name": "diffuseconstant",
+                        "value": ""
+                      },
+                      {
+                        "name": "edgemode",
+                        "value": ""
+                      },
+                      {
+                        "name": "filterunits",
+                        "value": ""
+                      },
+                      {
+                        "name": "glyphref",
+                        "value": ""
+                      },
+                      {
+                        "name": "gradienttransform",
+                        "value": ""
+                      },
+                      {
+                        "name": "gradientunits",
+                        "value": ""
+                      },
+                      {
+                        "name": "kernelmatrix",
+                        "value": ""
+                      },
+                      {
+                        "name": "kernelunitlength",
+                        "value": ""
+                      },
+                      {
+                        "name": "keypoints",
+                        "value": ""
+                      },
+                      {
+                        "name": "keysplines",
+                        "value": ""
+                      },
+                      {
+                        "name": "keytimes",
+                        "value": ""
+                      },
+                      {
+                        "name": "lengthadjust",
+                        "value": ""
+                      },
+                      {
+                        "name": "limitingconeangle",
+                        "value": ""
+                      },
+                      {
+                        "name": "markerheight",
+                        "value": ""
+                      },
+                      {
+                        "name": "markerunits",
+                        "value": ""
+                      },
+                      {
+                        "name": "markerwidth",
+                        "value": ""
+                      },
+                      {
+                        "name": "maskcontentunits",
+                        "value": ""
+                      },
+                      {
+                        "name": "maskunits",
+                        "value": ""
+                      },
+                      {
+                        "name": "numoctaves",
+                        "value": ""
+                      },
+                      {
+                        "name": "pathlength",
+                        "value": ""
+                      },
+                      {
+                        "name": "patterncontentunits",
+                        "value": ""
+                      },
+                      {
+                        "name": "patterntransform",
+                        "value": ""
+                      },
+                      {
+                        "name": "patternunits",
+                        "value": ""
+                      },
+                      {
+                        "name": "pointsatx",
+                        "value": ""
+                      },
+                      {
+                        "name": "pointsaty",
+                        "value": ""
+                      },
+                      {
+                        "name": "pointsatz",
+                        "value": ""
+                      },
+                      {
+                        "name": "preservealpha",
+                        "value": ""
+                      },
+                      {
+                        "name": "preserveaspectratio",
+                        "value": ""
+                      },
+                      {
+                        "name": "primitiveunits",
+                        "value": ""
+                      },
+                      {
+                        "name": "refx",
+                        "value": ""
+                      },
+                      {
+                        "name": "refy",
+                        "value": ""
+                      },
+                      {
+                        "name": "repeatcount",
+                        "value": ""
+                      },
+                      {
+                        "name": "repeatdur",
+                        "value": ""
+                      },
+                      {
+                        "name": "requiredextensions",
+                        "value": ""
+                      },
+                      {
+                        "name": "requiredfeatures",
+                        "value": ""
+                      },
+                      {
+                        "name": "specularconstant",
+                        "value": ""
+                      },
+                      {
+                        "name": "specularexponent",
+                        "value": ""
+                      },
+                      {
+                        "name": "spreadmethod",
+                        "value": ""
+                      },
+                      {
+                        "name": "startoffset",
+                        "value": ""
+                      },
+                      {
+                        "name": "stddeviation",
+                        "value": ""
+                      },
+                      {
+                        "name": "stitchtiles",
+                        "value": ""
+                      },
+                      {
+                        "name": "surfacescale",
+                        "value": ""
+                      },
+                      {
+                        "name": "systemlanguage",
+                        "value": ""
+                      },
+                      {
+                        "name": "tablevalues",
+                        "value": ""
+                      },
+                      {
+                        "name": "targetx",
+                        "value": ""
+                      },
+                      {
+                        "name": "targety",
+                        "value": ""
+                      },
+                      {
+                        "name": "textlength",
+                        "value": ""
+                      },
+                      {
+                        "name": "viewbox",
+                        "value": ""
+                      },
+                      {
+                        "name": "viewtarget",
+                        "value": ""
+                      },
+                      {
+                        "name": "xchannelselector",
+                        "value": ""
+                      },
+                      {
+                        "name": "ychannelselector",
+                        "value": ""
+                      },
+                      {
+                        "name": "zoomandpan",
+                        "value": ""
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math attributename=\"\" attributetype=\"\" basefrequency=\"\" baseprofile=\"\" calcmode=\"\" clippathunits=\"\" diffuseconstant=\"\" edgemode=\"\" filterunits=\"\" glyphref=\"\" gradienttransform=\"\" gradientunits=\"\" kernelmatrix=\"\" kernelunitlength=\"\" keypoints=\"\" keysplines=\"\" keytimes=\"\" lengthadjust=\"\" limitingconeangle=\"\" markerheight=\"\" markerunits=\"\" markerwidth=\"\" maskcontentunits=\"\" maskunits=\"\" numoctaves=\"\" pathlength=\"\" patterncontentunits=\"\" patterntransform=\"\" patternunits=\"\" pointsatx=\"\" pointsaty=\"\" pointsatz=\"\" preservealpha=\"\" preserveaspectratio=\"\" primitiveunits=\"\" refx=\"\" refy=\"\" repeatcount=\"\" repeatdur=\"\" requiredextensions=\"\" requiredfeatures=\"\" specularconstant=\"\" specularexponent=\"\" spreadmethod=\"\" startoffset=\"\" stddeviation=\"\" stitchtiles=\"\" surfacescale=\"\" systemlanguage=\"\" tablevalues=\"\" targetx=\"\" targety=\"\" textlength=\"\" viewbox=\"\" viewtarget=\"\" xchannelselector=\"\" ychannelselector=\"\" zoomandpan=\"\"></math></body></html>",
+        "noQuirksBodyHtml": "<math attributename=\"\" attributetype=\"\" basefrequency=\"\" baseprofile=\"\" calcmode=\"\" clippathunits=\"\" diffuseconstant=\"\" edgemode=\"\" filterunits=\"\" glyphref=\"\" gradienttransform=\"\" gradientunits=\"\" kernelmatrix=\"\" kernelunitlength=\"\" keypoints=\"\" keysplines=\"\" keytimes=\"\" lengthadjust=\"\" limitingconeangle=\"\" markerheight=\"\" markerunits=\"\" markerwidth=\"\" maskcontentunits=\"\" maskunits=\"\" numoctaves=\"\" pathlength=\"\" patterncontentunits=\"\" patterntransform=\"\" patternunits=\"\" pointsatx=\"\" pointsaty=\"\" pointsatz=\"\" preservealpha=\"\" preserveaspectratio=\"\" primitiveunits=\"\" refx=\"\" refy=\"\" repeatcount=\"\" repeatdur=\"\" requiredextensions=\"\" requiredfeatures=\"\" specularconstant=\"\" specularexponent=\"\" spreadmethod=\"\" startoffset=\"\" stddeviation=\"\" stitchtiles=\"\" surfacescale=\"\" systemlanguage=\"\" tablevalues=\"\" targetx=\"\" targety=\"\" textlength=\"\" viewbox=\"\" viewtarget=\"\" xchannelselector=\"\" ychannelselector=\"\" zoomandpan=\"\"></math>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><svg contentScriptType='' contentStyleType='' externalResourcesRequired='' filterRes=''></svg>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "attrs": [
+                      {
+                        "name": "contentscripttype",
+                        "value": ""
+                      },
+                      {
+                        "name": "contentstyletype",
+                        "value": ""
+                      },
+                      {
+                        "name": "externalresourcesrequired",
+                        "value": ""
+                      },
+                      {
+                        "name": "filterres",
+                        "value": ""
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg contentscripttype=\"\" contentstyletype=\"\" externalresourcesrequired=\"\" filterres=\"\"></svg></body></html>",
+        "noQuirksBodyHtml": "<svg contentScriptType=\"\" contentStyleType=\"\" externalResourcesRequired=\"\" filterres=\"\"></svg>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><svg CONTENTSCRIPTTYPE='' CONTENTSTYLETYPE='' EXTERNALRESOURCESREQUIRED='' FILTERRES=''></svg>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "attrs": [
+                      {
+                        "name": "contentscripttype",
+                        "value": ""
+                      },
+                      {
+                        "name": "contentstyletype",
+                        "value": ""
+                      },
+                      {
+                        "name": "externalresourcesrequired",
+                        "value": ""
+                      },
+                      {
+                        "name": "filterres",
+                        "value": ""
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg contentscripttype=\"\" contentstyletype=\"\" externalresourcesrequired=\"\" filterres=\"\"></svg></body></html>",
+        "noQuirksBodyHtml": "<svg contentScriptType=\"\" contentStyleType=\"\" externalResourcesRequired=\"\" filterres=\"\"></svg>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><svg contentscripttype='' contentstyletype='' externalresourcesrequired='' filterres=''></svg>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "attrs": [
+                      {
+                        "name": "contentscripttype",
+                        "value": ""
+                      },
+                      {
+                        "name": "contentstyletype",
+                        "value": ""
+                      },
+                      {
+                        "name": "externalresourcesrequired",
+                        "value": ""
+                      },
+                      {
+                        "name": "filterres",
+                        "value": ""
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg contentscripttype=\"\" contentstyletype=\"\" externalresourcesrequired=\"\" filterres=\"\"></svg></body></html>",
+        "noQuirksBodyHtml": "<svg contentScriptType=\"\" contentStyleType=\"\" externalResourcesRequired=\"\" filterres=\"\"></svg>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><math contentScriptType='' contentStyleType='' externalResourcesRequired='' filterRes=''></math>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "attrs": [
+                      {
+                        "name": "contentscripttype",
+                        "value": ""
+                      },
+                      {
+                        "name": "contentstyletype",
+                        "value": ""
+                      },
+                      {
+                        "name": "externalresourcesrequired",
+                        "value": ""
+                      },
+                      {
+                        "name": "filterres",
+                        "value": ""
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math contentscripttype=\"\" contentstyletype=\"\" externalresourcesrequired=\"\" filterres=\"\"></math></body></html>",
+        "noQuirksBodyHtml": "<math contentscripttype=\"\" contentstyletype=\"\" externalresourcesrequired=\"\" filterres=\"\"></math>"
+      }
+    },
+    {
+      "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>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg altGlyph": true,
+            "svg altGlyphDef": true,
+            "svg altGlyphItem": true,
+            "svg animateColor": true,
+            "svg animateMotion": true,
+            "svg animateTransform": true,
+            "svg clipPath": true,
+            "svg feBlend": true,
+            "svg feColorMatrix": true,
+            "svg feComponentTransfer": true,
+            "svg feComposite": true,
+            "svg feConvolveMatrix": true,
+            "svg feDiffuseLighting": true,
+            "svg feDisplacementMap": true,
+            "svg feDistantLight": true,
+            "svg feFlood": true,
+            "svg feFuncA": true,
+            "svg feFuncB": true,
+            "svg feFuncG": true,
+            "svg feFuncR": true,
+            "svg feGaussianBlur": true,
+            "svg feImage": true,
+            "svg feMerge": true,
+            "svg feMergeNode": true,
+            "svg feMorphology": true,
+            "svg feOffset": true,
+            "svg fePointLight": true,
+            "svg feSpecularLighting": true,
+            "svg feSpotLight": true,
+            "svg feTile": true,
+            "svg feTurbulence": true,
+            "svg foreignObject": true,
+            "svg glyphRef": true,
+            "svg linearGradient": true,
+            "svg radialGradient": true,
+            "svg textPath": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "altGlyph",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "altGlyphDef",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "altGlyphItem",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "animateColor",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "animateMotion",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "animateTransform",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "clipPath",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feBlend",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feColorMatrix",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feComponentTransfer",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feComposite",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feConvolveMatrix",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feDiffuseLighting",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feDisplacementMap",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feDistantLight",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feFlood",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feFuncA",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feFuncB",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feFuncG",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feFuncR",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feGaussianBlur",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feImage",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feMerge",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feMergeNode",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feMorphology",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feOffset",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "fePointLight",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feSpecularLighting",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feSpotLight",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feTile",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feTurbulence",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "foreignObject",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "glyphRef",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "linearGradient",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "radialGradient",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "textPath",
+                        "ns": "http://www.w3.org/2000/svg"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg><altGlyph></altGlyph><altGlyphDef></altGlyphDef><altGlyphItem></altGlyphItem><animateColor></animateColor><animateMotion></animateMotion><animateTransform></animateTransform><clipPath></clipPath><feBlend></feBlend><feColorMatrix></feColorMatrix><feComponentTransfer></feComponentTransfer><feComposite></feComposite><feConvolveMatrix></feConvolveMatrix><feDiffuseLighting></feDiffuseLighting><feDisplacementMap></feDisplacementMap><feDistantLight></feDistantLight><feFlood></feFlood><feFuncA></feFuncA><feFuncB></feFuncB><feFuncG></feFuncG><feFuncR></feFuncR><feGaussianBlur></feGaussianBlur><feImage></feImage><feMerge></feMerge><feMergeNode></feMergeNode><feMorphology></feMorphology><feOffset></feOffset><fePointLight></fePointLight><feSpecularLighting></feSpecularLighting><feSpotLight></feSpotLight><feTile></feTile><feTurbulence></feTurbulence><foreignObject></foreignObject><glyphRef></glyphRef><linearGradient></linearGradient><radialGradient></radialGradient><textPath></textPath></svg></body></html>",
+        "noQuirksBodyHtml": "<svg><altGlyph></altGlyph><altGlyphDef></altGlyphDef><altGlyphItem></altGlyphItem><animateColor></animateColor><animateMotion></animateMotion><animateTransform></animateTransform><clipPath></clipPath><feBlend></feBlend><feColorMatrix></feColorMatrix><feComponentTransfer></feComponentTransfer><feComposite></feComposite><feConvolveMatrix></feConvolveMatrix><feDiffuseLighting></feDiffuseLighting><feDisplacementMap></feDisplacementMap><feDistantLight></feDistantLight><feFlood></feFlood><feFuncA></feFuncA><feFuncB></feFuncB><feFuncG></feFuncG><feFuncR></feFuncR><feGaussianBlur></feGaussianBlur><feImage></feImage><feMerge></feMerge><feMergeNode></feMergeNode><feMorphology></feMorphology><feOffset></feOffset><fePointLight></fePointLight><feSpecularLighting></feSpecularLighting><feSpotLight></feSpotLight><feTile></feTile><feTurbulence></feTurbulence><foreignObject></foreignObject><glyphRef></glyphRef><linearGradient></linearGradient><radialGradient></radialGradient><textPath></textPath></svg>"
+      }
+    },
+    {
+      "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>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg altGlyph": true,
+            "svg altGlyphDef": true,
+            "svg altGlyphItem": true,
+            "svg animateColor": true,
+            "svg animateMotion": true,
+            "svg animateTransform": true,
+            "svg clipPath": true,
+            "svg feBlend": true,
+            "svg feColorMatrix": true,
+            "svg feComponentTransfer": true,
+            "svg feComposite": true,
+            "svg feConvolveMatrix": true,
+            "svg feDiffuseLighting": true,
+            "svg feDisplacementMap": true,
+            "svg feDistantLight": true,
+            "svg feFlood": true,
+            "svg feFuncA": true,
+            "svg feFuncB": true,
+            "svg feFuncG": true,
+            "svg feFuncR": true,
+            "svg feGaussianBlur": true,
+            "svg feImage": true,
+            "svg feMerge": true,
+            "svg feMergeNode": true,
+            "svg feMorphology": true,
+            "svg feOffset": true,
+            "svg fePointLight": true,
+            "svg feSpecularLighting": true,
+            "svg feSpotLight": true,
+            "svg feTile": true,
+            "svg feTurbulence": true,
+            "svg foreignObject": true,
+            "svg glyphRef": true,
+            "svg linearGradient": true,
+            "svg radialGradient": true,
+            "svg textPath": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "altGlyph",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "altGlyphDef",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "altGlyphItem",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "animateColor",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "animateMotion",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "animateTransform",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "clipPath",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feBlend",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feColorMatrix",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feComponentTransfer",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feComposite",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feConvolveMatrix",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feDiffuseLighting",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feDisplacementMap",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feDistantLight",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feFlood",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feFuncA",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feFuncB",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feFuncG",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feFuncR",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feGaussianBlur",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feImage",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feMerge",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feMergeNode",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feMorphology",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feOffset",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "fePointLight",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feSpecularLighting",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feSpotLight",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feTile",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feTurbulence",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "foreignObject",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "glyphRef",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "linearGradient",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "radialGradient",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "textPath",
+                        "ns": "http://www.w3.org/2000/svg"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg><altGlyph></altGlyph><altGlyphDef></altGlyphDef><altGlyphItem></altGlyphItem><animateColor></animateColor><animateMotion></animateMotion><animateTransform></animateTransform><clipPath></clipPath><feBlend></feBlend><feColorMatrix></feColorMatrix><feComponentTransfer></feComponentTransfer><feComposite></feComposite><feConvolveMatrix></feConvolveMatrix><feDiffuseLighting></feDiffuseLighting><feDisplacementMap></feDisplacementMap><feDistantLight></feDistantLight><feFlood></feFlood><feFuncA></feFuncA><feFuncB></feFuncB><feFuncG></feFuncG><feFuncR></feFuncR><feGaussianBlur></feGaussianBlur><feImage></feImage><feMerge></feMerge><feMergeNode></feMergeNode><feMorphology></feMorphology><feOffset></feOffset><fePointLight></fePointLight><feSpecularLighting></feSpecularLighting><feSpotLight></feSpotLight><feTile></feTile><feTurbulence></feTurbulence><foreignObject></foreignObject><glyphRef></glyphRef><linearGradient></linearGradient><radialGradient></radialGradient><textPath></textPath></svg></body></html>",
+        "noQuirksBodyHtml": "<svg><altGlyph></altGlyph><altGlyphDef></altGlyphDef><altGlyphItem></altGlyphItem><animateColor></animateColor><animateMotion></animateMotion><animateTransform></animateTransform><clipPath></clipPath><feBlend></feBlend><feColorMatrix></feColorMatrix><feComponentTransfer></feComponentTransfer><feComposite></feComposite><feConvolveMatrix></feConvolveMatrix><feDiffuseLighting></feDiffuseLighting><feDisplacementMap></feDisplacementMap><feDistantLight></feDistantLight><feFlood></feFlood><feFuncA></feFuncA><feFuncB></feFuncB><feFuncG></feFuncG><feFuncR></feFuncR><feGaussianBlur></feGaussianBlur><feImage></feImage><feMerge></feMerge><feMergeNode></feMergeNode><feMorphology></feMorphology><feOffset></feOffset><fePointLight></fePointLight><feSpecularLighting></feSpecularLighting><feSpotLight></feSpotLight><feTile></feTile><feTurbulence></feTurbulence><foreignObject></foreignObject><glyphRef></glyphRef><linearGradient></linearGradient><radialGradient></radialGradient><textPath></textPath></svg>"
+      }
+    },
+    {
+      "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>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg altGlyph": true,
+            "svg altGlyphDef": true,
+            "svg altGlyphItem": true,
+            "svg animateColor": true,
+            "svg animateMotion": true,
+            "svg animateTransform": true,
+            "svg clipPath": true,
+            "svg feBlend": true,
+            "svg feColorMatrix": true,
+            "svg feComponentTransfer": true,
+            "svg feComposite": true,
+            "svg feConvolveMatrix": true,
+            "svg feDiffuseLighting": true,
+            "svg feDisplacementMap": true,
+            "svg feDistantLight": true,
+            "svg feFlood": true,
+            "svg feFuncA": true,
+            "svg feFuncB": true,
+            "svg feFuncG": true,
+            "svg feFuncR": true,
+            "svg feGaussianBlur": true,
+            "svg feImage": true,
+            "svg feMerge": true,
+            "svg feMergeNode": true,
+            "svg feMorphology": true,
+            "svg feOffset": true,
+            "svg fePointLight": true,
+            "svg feSpecularLighting": true,
+            "svg feSpotLight": true,
+            "svg feTile": true,
+            "svg feTurbulence": true,
+            "svg foreignObject": true,
+            "svg glyphRef": true,
+            "svg linearGradient": true,
+            "svg radialGradient": true,
+            "svg textPath": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "altGlyph",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "altGlyphDef",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "altGlyphItem",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "animateColor",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "animateMotion",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "animateTransform",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "clipPath",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feBlend",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feColorMatrix",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feComponentTransfer",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feComposite",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feConvolveMatrix",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feDiffuseLighting",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feDisplacementMap",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feDistantLight",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feFlood",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feFuncA",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feFuncB",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feFuncG",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feFuncR",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feGaussianBlur",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feImage",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feMerge",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feMergeNode",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feMorphology",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feOffset",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "fePointLight",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feSpecularLighting",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feSpotLight",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feTile",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "feTurbulence",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "foreignObject",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "glyphRef",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "linearGradient",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "radialGradient",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "textPath",
+                        "ns": "http://www.w3.org/2000/svg"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg><altGlyph></altGlyph><altGlyphDef></altGlyphDef><altGlyphItem></altGlyphItem><animateColor></animateColor><animateMotion></animateMotion><animateTransform></animateTransform><clipPath></clipPath><feBlend></feBlend><feColorMatrix></feColorMatrix><feComponentTransfer></feComponentTransfer><feComposite></feComposite><feConvolveMatrix></feConvolveMatrix><feDiffuseLighting></feDiffuseLighting><feDisplacementMap></feDisplacementMap><feDistantLight></feDistantLight><feFlood></feFlood><feFuncA></feFuncA><feFuncB></feFuncB><feFuncG></feFuncG><feFuncR></feFuncR><feGaussianBlur></feGaussianBlur><feImage></feImage><feMerge></feMerge><feMergeNode></feMergeNode><feMorphology></feMorphology><feOffset></feOffset><fePointLight></fePointLight><feSpecularLighting></feSpecularLighting><feSpotLight></feSpotLight><feTile></feTile><feTurbulence></feTurbulence><foreignObject></foreignObject><glyphRef></glyphRef><linearGradient></linearGradient><radialGradient></radialGradient><textPath></textPath></svg></body></html>",
+        "noQuirksBodyHtml": "<svg><altGlyph></altGlyph><altGlyphDef></altGlyphDef><altGlyphItem></altGlyphItem><animateColor></animateColor><animateMotion></animateMotion><animateTransform></animateTransform><clipPath></clipPath><feBlend></feBlend><feColorMatrix></feColorMatrix><feComponentTransfer></feComponentTransfer><feComposite></feComposite><feConvolveMatrix></feConvolveMatrix><feDiffuseLighting></feDiffuseLighting><feDisplacementMap></feDisplacementMap><feDistantLight></feDistantLight><feFlood></feFlood><feFuncA></feFuncA><feFuncB></feFuncB><feFuncG></feFuncG><feFuncR></feFuncR><feGaussianBlur></feGaussianBlur><feImage></feImage><feMerge></feMerge><feMergeNode></feMergeNode><feMorphology></feMorphology><feOffset></feOffset><fePointLight></fePointLight><feSpecularLighting></feSpecularLighting><feSpotLight></feSpotLight><feTile></feTile><feTurbulence></feTurbulence><foreignObject></foreignObject><glyphRef></glyphRef><linearGradient></linearGradient><radialGradient></radialGradient><textPath></textPath></svg>"
+      }
+    },
+    {
+      "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>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math altglyph": true,
+            "math altglyphdef": true,
+            "math altglyphitem": true,
+            "math animatecolor": true,
+            "math animatemotion": true,
+            "math animatetransform": true,
+            "math clippath": true,
+            "math feblend": true,
+            "math fecolormatrix": true,
+            "math fecomponenttransfer": true,
+            "math fecomposite": true,
+            "math feconvolvematrix": true,
+            "math fediffuselighting": true,
+            "math fedisplacementmap": true,
+            "math fedistantlight": true,
+            "math feflood": true,
+            "math fefunca": true,
+            "math fefuncb": true,
+            "math fefuncg": true,
+            "math fefuncr": true,
+            "math fegaussianblur": true,
+            "math feimage": true,
+            "math femerge": true,
+            "math femergenode": true,
+            "math femorphology": true,
+            "math feoffset": true,
+            "math fepointlight": true,
+            "math fespecularlighting": true,
+            "math fespotlight": true,
+            "math fetile": true,
+            "math feturbulence": true,
+            "math foreignobject": true,
+            "math glyphref": true,
+            "math lineargradient": true,
+            "math radialgradient": true,
+            "math textpath": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "altglyph",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "altglyphdef",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "altglyphitem",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "animatecolor",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "animatemotion",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "animatetransform",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "clippath",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "feblend",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "fecolormatrix",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "fecomponenttransfer",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "fecomposite",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "feconvolvematrix",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "fediffuselighting",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "fedisplacementmap",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "fedistantlight",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "feflood",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "fefunca",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "fefuncb",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "fefuncg",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "fefuncr",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "fegaussianblur",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "feimage",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "femerge",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "femergenode",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "femorphology",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "feoffset",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "fepointlight",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "fespecularlighting",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "fespotlight",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "fetile",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "feturbulence",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "foreignobject",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "glyphref",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "lineargradient",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "radialgradient",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      },
+                      {
+                        "tag": "textpath",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math><altglyph></altglyph><altglyphdef></altglyphdef><altglyphitem></altglyphitem><animatecolor></animatecolor><animatemotion></animatemotion><animatetransform></animatetransform><clippath></clippath><feblend></feblend><fecolormatrix></fecolormatrix><fecomponenttransfer></fecomponenttransfer><fecomposite></fecomposite><feconvolvematrix></feconvolvematrix><fediffuselighting></fediffuselighting><fedisplacementmap></fedisplacementmap><fedistantlight></fedistantlight><feflood></feflood><fefunca></fefunca><fefuncb></fefuncb><fefuncg></fefuncg><fefuncr></fefuncr><fegaussianblur></fegaussianblur><feimage></feimage><femerge></femerge><femergenode></femergenode><femorphology></femorphology><feoffset></feoffset><fepointlight></fepointlight><fespecularlighting></fespecularlighting><fespotlight></fespotlight><fetile></fetile><feturbulence></feturbulence><foreignobject></foreignobject><glyphref></glyphref><lineargradient></lineargradient><radialgradient></radialgradient><textpath></textpath></math></body></html>",
+        "noQuirksBodyHtml": "<math><altglyph></altglyph><altglyphdef></altglyphdef><altglyphitem></altglyphitem><animatecolor></animatecolor><animatemotion></animatemotion><animatetransform></animatetransform><clippath></clippath><feblend></feblend><fecolormatrix></fecolormatrix><fecomponenttransfer></fecomponenttransfer><fecomposite></fecomposite><feconvolvematrix></feconvolvematrix><fediffuselighting></fediffuselighting><fedisplacementmap></fedisplacementmap><fedistantlight></fedistantlight><feflood></feflood><fefunca></fefunca><fefuncb></fefuncb><fefuncg></fefuncg><fefuncr></fefuncr><fegaussianblur></fegaussianblur><feimage></feimage><femerge></femerge><femergenode></femergenode><femorphology></femorphology><feoffset></feoffset><fepointlight></fepointlight><fespecularlighting></fespecularlighting><fespotlight></fespotlight><fetile></fetile><feturbulence></feturbulence><foreignobject></foreignobject><glyphref></glyphref><lineargradient></lineargradient><radialgradient></radialgradient><textpath></textpath></math>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><svg><solidColor /></svg>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg solidcolor": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "solidcolor",
+                        "ns": "http://www.w3.org/2000/svg"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg><solidcolor></solidcolor></svg></body></html>",
+        "noQuirksBodyHtml": "<svg><solidcolor></solidcolor></svg>"
+      }
+    }
+  ],
+  "tests12.dat": [
+    {
+      "data": "<!DOCTYPE html><body><p>foo<math><mtext><i>baz</i></mtext><annotation-xml><svg><desc><b>eggs</b></desc><g><foreignObject><P>spam<TABLE><tr><td><img></td></table></foreignObject></g><g>quux</g></svg></annotation-xml></math>bar",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "math math": true,
+            "math mtext": true,
+            "i": true,
+            "math annotation-xml": true,
+            "svg svg": true,
+            "svg desc": true,
+            "b": true,
+            "svg g": true,
+            "svg foreignObject": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "img": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "foo"
+                      },
+                      {
+                        "tag": "math",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "mtext",
+                            "ns": "http://www.w3.org/1998/Math/MathML",
+                            "children": [
+                              {
+                                "tag": "i",
+                                "children": [
+                                  {
+                                    "text": "baz"
+                                  }
+                                ]
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "annotation-xml",
+                            "ns": "http://www.w3.org/1998/Math/MathML",
+                            "children": [
+                              {
+                                "tag": "svg",
+                                "ns": "http://www.w3.org/2000/svg",
+                                "children": [
+                                  {
+                                    "tag": "desc",
+                                    "ns": "http://www.w3.org/2000/svg",
+                                    "children": [
+                                      {
+                                        "tag": "b",
+                                        "children": [
+                                          {
+                                            "text": "eggs"
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  },
+                                  {
+                                    "tag": "g",
+                                    "ns": "http://www.w3.org/2000/svg",
+                                    "children": [
+                                      {
+                                        "tag": "foreignObject",
+                                        "ns": "http://www.w3.org/2000/svg",
+                                        "children": [
+                                          {
+                                            "tag": "p",
+                                            "children": [
+                                              {
+                                                "text": "spam"
+                                              }
+                                            ]
+                                          },
+                                          {
+                                            "tag": "table",
+                                            "children": [
+                                              {
+                                                "tag": "tbody",
+                                                "children": [
+                                                  {
+                                                    "tag": "tr",
+                                                    "children": [
+                                                      {
+                                                        "tag": "td",
+                                                        "children": [
+                                                          {
+                                                            "tag": "img"
+                                                          }
+                                                        ]
+                                                      }
+                                                    ]
+                                                  }
+                                                ]
+                                              }
+                                            ]
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  },
+                                  {
+                                    "tag": "g",
+                                    "ns": "http://www.w3.org/2000/svg",
+                                    "children": [
+                                      {
+                                        "text": "quux"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "text": "bar"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p>foo<math><mtext><i>baz</i></mtext><annotation-xml><svg><desc><b>eggs</b></desc><g><foreignObject><p>spam</p><table><tbody><tr><td><img></td></tr></tbody></table></foreignObject></g><g>quux</g></svg></annotation-xml></math>bar</p></body></html>",
+        "noQuirksBodyHtml": "<p>foo<math><mtext><i>baz</i></mtext><annotation-xml><svg><desc><b>eggs</b></desc><g><foreignObject><p>spam</p><table><tbody><tr><td><img></td></tr></tbody></table></foreignObject></g><g>quux</g></svg></annotation-xml></math>bar</p>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body>foo<math><mtext><i>baz</i></mtext><annotation-xml><svg><desc><b>eggs</b></desc><g><foreignObject><P>spam<TABLE><tr><td><img></td></table></foreignObject></g><g>quux</g></svg></annotation-xml></math>bar",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mtext": true,
+            "i": true,
+            "math annotation-xml": true,
+            "svg svg": true,
+            "svg desc": true,
+            "b": true,
+            "svg g": true,
+            "svg foreignObject": true,
+            "p": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "img": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "foo"
+                  },
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mtext",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "text": "baz"
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "annotation-xml",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "svg",
+                            "ns": "http://www.w3.org/2000/svg",
+                            "children": [
+                              {
+                                "tag": "desc",
+                                "ns": "http://www.w3.org/2000/svg",
+                                "children": [
+                                  {
+                                    "tag": "b",
+                                    "children": [
+                                      {
+                                        "text": "eggs"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              },
+                              {
+                                "tag": "g",
+                                "ns": "http://www.w3.org/2000/svg",
+                                "children": [
+                                  {
+                                    "tag": "foreignObject",
+                                    "ns": "http://www.w3.org/2000/svg",
+                                    "children": [
+                                      {
+                                        "tag": "p",
+                                        "children": [
+                                          {
+                                            "text": "spam"
+                                          }
+                                        ]
+                                      },
+                                      {
+                                        "tag": "table",
+                                        "children": [
+                                          {
+                                            "tag": "tbody",
+                                            "children": [
+                                              {
+                                                "tag": "tr",
+                                                "children": [
+                                                  {
+                                                    "tag": "td",
+                                                    "children": [
+                                                      {
+                                                        "tag": "img"
+                                                      }
+                                                    ]
+                                                  }
+                                                ]
+                                              }
+                                            ]
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              },
+                              {
+                                "tag": "g",
+                                "ns": "http://www.w3.org/2000/svg",
+                                "children": [
+                                  {
+                                    "text": "quux"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "text": "bar"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>foo<math><mtext><i>baz</i></mtext><annotation-xml><svg><desc><b>eggs</b></desc><g><foreignObject><p>spam</p><table><tbody><tr><td><img></td></tr></tbody></table></foreignObject></g><g>quux</g></svg></annotation-xml></math>bar</body></html>",
+        "noQuirksBodyHtml": "foo<math><mtext><i>baz</i></mtext><annotation-xml><svg><desc><b>eggs</b></desc><g><foreignObject><p>spam</p><table><tbody><tr><td><img></td></tr></tbody></table></foreignObject></g><g>quux</g></svg></annotation-xml></math>bar"
+      }
+    }
+  ],
+  "tests14.dat": [
+    {
+      "data": "<!DOCTYPE html><html><body><xyz:abc></xyz:abc>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "xyz:abc": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "xyz:abc"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><xyz:abc></xyz:abc></body></html>",
+        "noQuirksBodyHtml": "<xyz:abc></xyz:abc>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><html><body><xyz:abc></xyz:abc><span></span>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "xyz:abc": true,
+            "span": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "xyz:abc"
+                  },
+                  {
+                    "tag": "span"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><xyz:abc></xyz:abc><span></span></body></html>",
+        "noQuirksBodyHtml": "<xyz:abc></xyz:abc><span></span>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><html><html abc:def=gh><xyz:abc></xyz:abc>",
+      "errors": [
+        "(1,38): non-html-root"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "xyz:abc": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "attrs": [
+              {
+                "name": "abc:def",
+                "value": "gh"
+              }
+            ],
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "xyz:abc"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html abc:def=\"gh\"><head></head><body><xyz:abc></xyz:abc></body></html>",
+        "noQuirksBodyHtml": "<xyz:abc></xyz:abc>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><html xml:lang=bar><html xml:lang=foo>",
+      "errors": [
+        "(1,53): non-html-root"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "attrs": [
+              {
+                "name": "xml:lang",
+                "value": "bar"
+              }
+            ],
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html xml:lang=\"bar\"><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><html 123=456>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "attrs": [
+              {
+                "name": "123",
+                "value": "456"
+              }
+            ],
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html 123=\"456\"><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><html 123=456><html 789=012>",
+      "errors": [
+        "(1,43): non-html-root"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "attrs": [
+              {
+                "name": "123",
+                "value": "456"
+              },
+              {
+                "name": "789",
+                "value": "012"
+              }
+            ],
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html 123=\"456\" 789=\"012\"><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><html><body 789=012>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "attrs": [
+                  {
+                    "name": "789",
+                    "value": "012"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body 789=\"012\"></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    }
+  ],
+  "tests15.dat": [
+    {
+      "data": "<!DOCTYPE html><p><b><i><u></p> <p>X",
+      "errors": [
+        "(1,31): unexpected-end-tag",
+        "(1,36): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "b": true,
+            "i": true,
+            "u": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "tag": "u"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "i",
+                        "children": [
+                          {
+                            "tag": "u",
+                            "children": [
+                              {
+                                "text": " "
+                              },
+                              {
+                                "tag": "p",
+                                "children": [
+                                  {
+                                    "text": "X"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><b><i><u></u></i></b></p><b><i><u> <p>X</p></u></i></b></body></html>",
+        "noQuirksBodyHtml": "<p><b><i><u></u></i></b></p><b><i><u> <p>X</p></u></i></b>"
+      }
+    },
+    {
+      "data": "<p><b><i><u></p>\n<p>X",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag",
+        "(1,16): unexpected-end-tag",
+        "(2,4): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "b": true,
+            "i": true,
+            "u": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "tag": "u"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "i",
+                        "children": [
+                          {
+                            "tag": "u",
+                            "children": [
+                              {
+                                "text": "\n"
+                              },
+                              {
+                                "tag": "p",
+                                "children": [
+                                  {
+                                    "text": "X"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><p><b><i><u></u></i></b></p><b><i><u>\n<p>X</p></u></i></b></body></html>",
+        "noQuirksBodyHtml": "<p><b><i><u></u></i></b></p><b><i><u>\n<p>X</p></u></i></b>"
+      }
+    },
+    {
+      "data": "<!doctype html></html> <head>",
+      "errors": [
+        "(1,29): expected-eof-but-got-start-tag",
+        "(1,29): unexpected-start-tag-ignored"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": " "
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body> </body></html>",
+        "noQuirksBodyHtml": " "
+      }
+    },
+    {
+      "data": "<!doctype html></body><meta>",
+      "errors": [
+        "(1,28): unexpected-start-tag-after-body"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "meta": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "meta"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><meta></body></html>",
+        "noQuirksBodyHtml": "<meta>"
+      }
+    },
+    {
+      "data": "<html></html><!-- foo -->",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          },
+          {
+            "comment": " foo "
+          }
+        ],
+        "html": "<html><head></head><body></body></html><!-- foo -->",
+        "noQuirksBodyHtml": "<!-- foo -->"
+      }
+    },
+    {
+      "data": "<!doctype html></body><title>X</title>",
+      "errors": [
+        "(1,29): unexpected-start-tag-after-body"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "title": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "X"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><title>X</title></body></html>",
+        "noQuirksBodyHtml": "<title>X</title>"
+      }
+    },
+    {
+      "data": "<!doctype html><table> X<meta></table>",
+      "errors": [
+        "(1,23): foster-parenting-character",
+        "(1,24): foster-parenting-character",
+        "(1,30): foster-parenting-start-character"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "meta": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": " X"
+                  },
+                  {
+                    "tag": "meta"
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body> X<meta><table></table></body></html>",
+        "noQuirksBodyHtml": " X<meta><table></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><table> x</table>",
+      "errors": [
+        "(1,23): foster-parenting-character",
+        "(1,24): foster-parenting-character"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": " x"
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body> x<table></table></body></html>",
+        "noQuirksBodyHtml": " x<table></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><table> x </table>",
+      "errors": [
+        "(1,23): foster-parenting-character",
+        "(1,24): foster-parenting-character",
+        "(1,25): foster-parenting-character"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": " x "
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body> x <table></table></body></html>",
+        "noQuirksBodyHtml": " x <table></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><table><tr> x</table>",
+      "errors": [
+        "(1,27): foster-parenting-character",
+        "(1,28): foster-parenting-character"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": " x"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body> x<table><tbody><tr></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": " x<table><tbody><tr></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><table>X<style> <tr>x </style> </table>",
+      "errors": [
+        "(1,23): foster-parenting-character"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "style": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "X"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "style",
+                        "children": [
+                          {
+                            "text": " <tr>x ",
+                            "no_escape": true
+                          }
+                        ]
+                      },
+                      {
+                        "text": " "
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>X<table><style> <tr>x </style> </table></body></html>",
+        "noQuirksBodyHtml": "X<table><style> <tr>x </style> </table>"
+      }
+    },
+    {
+      "data": "<!doctype html><div><table><a>foo</a> <tr><td>bar</td> </tr></table></div>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "a": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "a",
+                        "children": [
+                          {
+                            "text": "foo"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "table",
+                        "children": [
+                          {
+                            "text": " "
+                          },
+                          {
+                            "tag": "tbody",
+                            "children": [
+                              {
+                                "tag": "tr",
+                                "children": [
+                                  {
+                                    "tag": "td",
+                                    "children": [
+                                      {
+                                        "text": "bar"
+                                      }
+                                    ]
+                                  },
+                                  {
+                                    "text": " "
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><div><a>foo</a><table> <tbody><tr><td>bar</td> </tr></tbody></table></div></body></html>",
+        "noQuirksBodyHtml": "<div><a>foo</a><table> <tbody><tr><td>bar</td> </tr></tbody></table></div>"
+      }
+    },
+    {
+      "data": "<frame></frame></frame><frameset><frame><frameset><frame></frameset><noframes></frameset><noframes>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true,
+            "frame": true,
+            "noframes": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset",
+                "children": [
+                  {
+                    "tag": "frame"
+                  },
+                  {
+                    "tag": "frameset",
+                    "children": [
+                      {
+                        "tag": "frame"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "noframes",
+                    "children": [
+                      {
+                        "text": "</frameset><noframes>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset><frame><frameset><frame></frameset><noframes></frameset><noframes></noframes></frameset></html>",
+        "noQuirksBodyHtml": "<noframes></frameset><noframes></noframes>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><object></html>",
+      "errors": [
+        "(1,30): expected-body-in-scope",
+        "(1,30): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "object": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "object"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><object></object></body></html>",
+        "noQuirksBodyHtml": "<object></object>"
+      }
+    }
+  ],
+  "tests16.dat": [
+    {
+      "data": "<!doctype html><script>",
+      "errors": [
+        "(1,23): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script"
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script>a",
+      "errors": [
+        "(1,24): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "a",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script>a</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script>a</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><",
+      "errors": [
+        "(1,24): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script></",
+      "errors": [
+        "(1,25): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script></</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script></S",
+      "errors": [
+        "(1,26): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</S",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script></S</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></S</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script></SC",
+      "errors": [
+        "(1,27): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</SC",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script></SC</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></SC</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script></SCR",
+      "errors": [
+        "(1,28): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</SCR",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script></SCR</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></SCR</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script></SCRI",
+      "errors": [
+        "(1,29): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</SCRI",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script></SCRI</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></SCRI</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script></SCRIP",
+      "errors": [
+        "(1,30): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</SCRIP",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script></SCRIP</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></SCRIP</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script></SCRIPT",
+      "errors": [
+        "(1,31): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</SCRIPT",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script></SCRIPT</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></SCRIPT</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script></SCRIPT ",
+      "errors": [
+        "(1,32): expected-attribute-name-but-got-eof",
+        "(1,32): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script"
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script></s",
+      "errors": [
+        "(1,26): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</s",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script></s</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></s</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script></sc",
+      "errors": [
+        "(1,27): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</sc",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script></sc</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></sc</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script></scr",
+      "errors": [
+        "(1,28): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</scr",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script></scr</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></scr</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script></scri",
+      "errors": [
+        "(1,29): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</scri",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script></scri</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></scri</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script></scrip",
+      "errors": [
+        "(1,30): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</scrip",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script></scrip</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></scrip</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script></script",
+      "errors": [
+        "(1,31): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</script",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script></script</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></script</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script></script ",
+      "errors": [
+        "(1,32): expected-attribute-name-but-got-eof",
+        "(1,32): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script"
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!",
+      "errors": [
+        "(1,25): expected-script-data-but-got-eof",
+        "(1,25): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!a",
+      "errors": [
+        "(1,26): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!a",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!a</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!a</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!-",
+      "errors": [
+        "(1,26): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!-",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!-</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!-</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!-a",
+      "errors": [
+        "(1,27): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!-a",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!-a</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!-a</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--",
+      "errors": [
+        "(1,27): expected-named-closing-tag-but-got-eof",
+        "(1,27): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--a",
+      "errors": [
+        "(1,28): expected-named-closing-tag-but-got-eof",
+        "(1,28): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--a",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--a</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--a</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<",
+      "errors": [
+        "(1,28): expected-named-closing-tag-but-got-eof",
+        "(1,28): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<a",
+      "errors": [
+        "(1,29): expected-named-closing-tag-but-got-eof",
+        "(1,29): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<a",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<a</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<a</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--</",
+      "errors": [
+        "(1,29): expected-named-closing-tag-but-got-eof",
+        "(1,29): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--</",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--</</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--</</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--</script",
+      "errors": [
+        "(1,35): expected-named-closing-tag-but-got-eof",
+        "(1,35): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--</script",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--</script</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--</script</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--</script ",
+      "errors": [
+        "(1,36): expected-attribute-name-but-got-eof",
+        "(1,36): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<s",
+      "errors": [
+        "(1,29): expected-named-closing-tag-but-got-eof",
+        "(1,29): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<s",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<s</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<s</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script",
+      "errors": [
+        "(1,34): expected-named-closing-tag-but-got-eof",
+        "(1,34): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script ",
+      "errors": [
+        "(1,35): eof-in-script-in-script",
+        "(1,35): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script ",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script </script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script <",
+      "errors": [
+        "(1,36): eof-in-script-in-script",
+        "(1,36): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script <",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script <</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script <</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script <a",
+      "errors": [
+        "(1,37): eof-in-script-in-script",
+        "(1,37): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script <a",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script <a</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script <a</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script </",
+      "errors": [
+        "(1,37): eof-in-script-in-script",
+        "(1,37): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script </</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script </s",
+      "errors": [
+        "(1,38): eof-in-script-in-script",
+        "(1,38): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </s",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script </s</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </s</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script </script",
+      "errors": [
+        "(1,43): eof-in-script-in-script",
+        "(1,43): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </script",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script </script</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script </scripta",
+      "errors": [
+        "(1,44): eof-in-script-in-script",
+        "(1,44): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </scripta",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script </scripta</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </scripta</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script </script ",
+      "errors": [
+        "(1,44): expected-named-closing-tag-but-got-eof",
+        "(1,44): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </script ",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script </script </script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script </script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script </script>",
+      "errors": [
+        "(1,44): expected-named-closing-tag-but-got-eof",
+        "(1,44): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </script>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script </script></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script></script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script </script/",
+      "errors": [
+        "(1,44): expected-named-closing-tag-but-got-eof",
+        "(1,44): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </script/",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script </script/</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script/</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script </script <",
+      "errors": [
+        "(1,45): expected-named-closing-tag-but-got-eof",
+        "(1,45): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </script <",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script </script <</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script <</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script </script <a",
+      "errors": [
+        "(1,46): expected-named-closing-tag-but-got-eof",
+        "(1,46): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </script <a",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script </script <a</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script <a</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script </script </",
+      "errors": [
+        "(1,46): expected-named-closing-tag-but-got-eof",
+        "(1,46): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </script </",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script </script </</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script </</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script </script </script",
+      "errors": [
+        "(1,52): expected-named-closing-tag-but-got-eof",
+        "(1,52): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </script </script",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script </script </script</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script </script</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script </script </script ",
+      "errors": [
+        "(1,53): expected-attribute-name-but-got-eof",
+        "(1,53): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </script ",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script </script </script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script </script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script </script </script/",
+      "errors": [
+        "(1,53): unexpected-EOF-after-solidus-in-tag",
+        "(1,53): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </script ",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script </script </script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script </script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script </script </script>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </script ",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script </script </script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script </script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script -",
+      "errors": [
+        "(1,36): eof-in-script-in-script",
+        "(1,36): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script -",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script -</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script -</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script -a",
+      "errors": [
+        "(1,37): eof-in-script-in-script",
+        "(1,37): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script -a",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script -a</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script -a</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script -<",
+      "errors": [
+        "(1,37): eof-in-script-in-script",
+        "(1,37): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script -<",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script -<</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script -<</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script --",
+      "errors": [
+        "(1,37): eof-in-script-in-script",
+        "(1,37): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script --",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script --</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script --</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script --a",
+      "errors": [
+        "(1,38): eof-in-script-in-script",
+        "(1,38): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script --a",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script --a</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script --a</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script --<",
+      "errors": [
+        "(1,38): eof-in-script-in-script",
+        "(1,38): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script --<",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script --<</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script --<</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script -->",
+      "errors": [
+        "(1,38): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script -->",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script --></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script --></script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script --><",
+      "errors": [
+        "(1,39): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script --><",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script --><</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script --><</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script --></",
+      "errors": [
+        "(1,40): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script --></",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script --></</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script --></</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script --></script",
+      "errors": [
+        "(1,46): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script --></script",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script --></script</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script --></script</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script --></script ",
+      "errors": [
+        "(1,47): expected-attribute-name-but-got-eof",
+        "(1,47): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script -->",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script --></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script --></script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script --></script/",
+      "errors": [
+        "(1,47): unexpected-EOF-after-solidus-in-tag",
+        "(1,47): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script -->",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script --></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script --></script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script --></script>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script -->",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script --></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script --></script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script><\\/script>--></script>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script><\\/script>-->",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script><\\/script>--></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script><\\/script>--></script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script></scr'+'ipt>--></script>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script></scr'+'ipt>-->",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script></scr'+'ipt>--></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script></scr'+'ipt>--></script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script></script><script></script></script>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script></script><script></script>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script></script><script></script></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script></script><script></script></script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script></script><script></script>--><!--</script>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script></script><script></script>--><!--",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script></script><script></script>--><!--</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script></script><script></script>--><!--</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script></script><script></script>-- ></script>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script></script><script></script>-- >",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script></script><script></script>-- ></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script></script><script></script>-- ></script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script></script><script></script>- -></script>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script></script><script></script>- ->",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script></script><script></script>- -></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script></script><script></script>- -></script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script></script><script></script>- - ></script>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script></script><script></script>- - >",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script></script><script></script>- - ></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script></script><script></script>- - ></script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script></script><script></script>-></script>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script></script><script></script>->",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script></script><script></script>-></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script></script><script></script>-></script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script>--!></script>X",
+      "errors": [
+        "(1,49): expected-named-closing-tag-but-got-eof",
+        "(1,49): unexpected-EOF-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script>--!></script>X",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script>--!></script>X</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script>--!></script>X</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<scr'+'ipt></script>--></script>",
+      "errors": [
+        "(1,59): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<scr'+'ipt>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<scr'+'ipt></script></head><body>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<script><!--<scr'+'ipt></script>--&gt;"
+      }
+    },
+    {
+      "data": "<!doctype html><script><!--<script></scr'+'ipt></script>X",
+      "errors": [
+        "(1,57): expected-named-closing-tag-but-got-eof",
+        "(1,57): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script></scr'+'ipt></script>X",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script><!--<script></scr'+'ipt></script>X</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script></scr'+'ipt></script>X</script>"
+      }
+    },
+    {
+      "data": "<!doctype html><style><!--<style></style>--></style>",
+      "errors": [
+        "(1,52): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": "<!--<style>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><style><!--<style></style></head><body>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<style><!--<style></style>--&gt;"
+      }
+    },
+    {
+      "data": "<!doctype html><style><!--</style>X",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": "<!--",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "X"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><style><!--</style></head><body>X</body></html>",
+        "noQuirksBodyHtml": "<style><!--</style>X"
+      }
+    },
+    {
+      "data": "<!doctype html><style><!--...</style>...--></style>",
+      "errors": [
+        "(1,51): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": "<!--...",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "...-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><style><!--...</style></head><body>...--&gt;</body></html>",
+        "noQuirksBodyHtml": "<style><!--...</style>...--&gt;"
+      }
+    },
+    {
+      "data": "<!doctype html><style><!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style></style>X",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": "<!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "X"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><style><!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style></style></head><body>X</body></html>",
+        "noQuirksBodyHtml": "<style><!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style></style>X"
+      }
+    },
+    {
+      "data": "<!doctype html><style><!--...<style><!--...--!></style>--></style>",
+      "errors": [
+        "(1,66): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": "<!--...<style><!--...--!>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><style><!--...<style><!--...--!></style></head><body>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<style><!--...<style><!--...--!></style>--&gt;"
+      }
+    },
+    {
+      "data": "<!doctype html><style><!--...</style><!-- --><style>@import ...</style>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": "<!--...",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "comment": " "
+                  },
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": "@import ...",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><style><!--...</style><!-- --><style>@import ...</style></head><body></body></html>",
+        "noQuirksBodyHtml": "<style><!--...</style><!-- --><style>@import ...</style>"
+      }
+    },
+    {
+      "data": "<!doctype html><style>...<style><!--...</style><!-- --></style>",
+      "errors": [
+        "(1,63): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": "...<style><!--...",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "comment": " "
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><style>...<style><!--...</style><!-- --></head><body></body></html>",
+        "noQuirksBodyHtml": "<style>...<style><!--...</style><!-- -->"
+      }
+    },
+    {
+      "data": "<!doctype html><style>...<!--[if IE]><style>...</style>X",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": "...<!--[if IE]><style>...",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "X"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><style>...<!--[if IE]><style>...</style></head><body>X</body></html>",
+        "noQuirksBodyHtml": "<style>...<!--[if IE]><style>...</style>X"
+      }
+    },
+    {
+      "data": "<!doctype html><title><!--<title></title>--></title>",
+      "errors": [
+        "(1,52): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "title": true,
+            "body": true
+          },
+          "doctype": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "<!--<title>",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><title>&lt;!--&lt;title&gt;</title></head><body>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<title>&lt;!--&lt;title&gt;</title>--&gt;"
+      }
+    },
+    {
+      "data": "<!doctype html><title>&lt;/title></title>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "title": true,
+            "body": true
+          },
+          "doctype": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "</title>",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><title>&lt;/title&gt;</title></head><body></body></html>",
+        "noQuirksBodyHtml": "<title>&lt;/title&gt;</title>"
+      }
+    },
+    {
+      "data": "<!doctype html><title>foo/title><link></head><body>X",
+      "errors": [
+        "(1,52): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "title": true,
+            "body": true
+          },
+          "doctype": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "foo/title><link></head><body>X",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><title>foo/title&gt;&lt;link&gt;&lt;/head&gt;&lt;body&gt;X</title></head><body></body></html>",
+        "noQuirksBodyHtml": "<title>foo/title&gt;&lt;link&gt;&lt;/head&gt;&lt;body&gt;X</title>"
+      }
+    },
+    {
+      "data": "<!doctype html><noscript><!--<noscript></noscript>--></noscript>",
+      "errors": [
+        "(1,64): unexpected-end-tag"
+      ],
+      "script": "on",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "text": "<!--<noscript>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><noscript><!--<noscript></noscript></head><body>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<noscript><!--<noscript></noscript>--></noscript>"
+      }
+    },
+    {
+      "data": "<!doctype html><noscript><!--<noscript></noscript>--></noscript>",
+      "errors": [],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "doctype": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "comment": "<noscript></noscript>"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><noscript><!--<noscript></noscript>--></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><!--<noscript></noscript>--></noscript>"
+      }
+    },
+    {
+      "data": "<!doctype html><noscript><!--</noscript>X<noscript>--></noscript>",
+      "errors": [],
+      "script": "on",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "text": "<!--",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "X"
+                  },
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "text": "-->",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><noscript><!--</noscript></head><body>X<noscript>--></noscript></body></html>",
+        "noQuirksBodyHtml": "<noscript><!--</noscript>X<noscript>--></noscript>"
+      }
+    },
+    {
+      "data": "<!doctype html><noscript><!--</noscript>X<noscript>--></noscript>",
+      "errors": [],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "doctype": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "comment": "</noscript>X<noscript>"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><noscript><!--</noscript>X<noscript>--></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><!--</noscript>X<noscript>--></noscript>"
+      }
+    },
+    {
+      "data": "<!doctype html><noscript><iframe></noscript>X",
+      "errors": [],
+      "script": "on",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "text": "<iframe>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "X"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><noscript><iframe></noscript></head><body>X</body></html>",
+        "noQuirksBodyHtml": "<noscript><iframe></noscript>X</iframe></noscript>"
+      }
+    },
+    {
+      "data": "<!doctype html><noscript><iframe></noscript>X",
+      "errors": [
+        " * (1,34) unexpected token in head noscript",
+        " * (1,46) unexpected EOF"
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true,
+            "iframe": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript"
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "iframe",
+                    "children": [
+                      {
+                        "text": "</noscript>X",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><noscript></noscript></head><body><iframe></noscript>X</iframe></body></html>",
+        "noQuirksBodyHtml": "<noscript><iframe></noscript>X</iframe></noscript>"
+      }
+    },
+    {
+      "data": "<!doctype html><noframes><!--<noframes></noframes>--></noframes>",
+      "errors": [
+        "(1,64): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noframes": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noframes",
+                    "children": [
+                      {
+                        "text": "<!--<noframes>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><noframes><!--<noframes></noframes></head><body>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<noframes><!--<noframes></noframes>--&gt;"
+      }
+    },
+    {
+      "data": "<!doctype html><noframes><body><script><!--...</script></body></noframes></html>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noframes": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noframes",
+                    "children": [
+                      {
+                        "text": "<body><script><!--...</script></body>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><noframes><body><script><!--...</script></body></noframes></head><body></body></html>",
+        "noQuirksBodyHtml": "<noframes><body><script><!--...</script></body></noframes>"
+      }
+    },
+    {
+      "data": "<!doctype html><textarea><!--<textarea></textarea>--></textarea>",
+      "errors": [
+        "(1,64): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "textarea": true
+          },
+          "doctype": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "textarea",
+                    "children": [
+                      {
+                        "text": "<!--<textarea>",
+                        "escaped": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><textarea>&lt;!--&lt;textarea&gt;</textarea>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<textarea>&lt;!--&lt;textarea&gt;</textarea>--&gt;"
+      }
+    },
+    {
+      "data": "<!doctype html><textarea>&lt;/textarea></textarea>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "textarea": true
+          },
+          "doctype": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "textarea",
+                    "children": [
+                      {
+                        "text": "</textarea>",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><textarea>&lt;/textarea&gt;</textarea></body></html>",
+        "noQuirksBodyHtml": "<textarea>&lt;/textarea&gt;</textarea>"
+      }
+    },
+    {
+      "data": "<!doctype html><textarea>&lt;</textarea>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "textarea": true
+          },
+          "doctype": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "textarea",
+                    "children": [
+                      {
+                        "text": "<",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><textarea>&lt;</textarea></body></html>",
+        "noQuirksBodyHtml": "<textarea>&lt;</textarea>"
+      }
+    },
+    {
+      "data": "<!doctype html><textarea>a&lt;b</textarea>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "textarea": true
+          },
+          "doctype": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "textarea",
+                    "children": [
+                      {
+                        "text": "a<b",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><textarea>a&lt;b</textarea></body></html>",
+        "noQuirksBodyHtml": "<textarea>a&lt;b</textarea>"
+      }
+    },
+    {
+      "data": "<!doctype html><iframe><!--<iframe></iframe>--></iframe>",
+      "errors": [
+        "(1,56): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "iframe": true
+          },
+          "doctype": true,
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "iframe",
+                    "children": [
+                      {
+                        "text": "<!--<iframe>",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><iframe><!--<iframe></iframe>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<iframe><!--<iframe></iframe>--&gt;"
+      }
+    },
+    {
+      "data": "<!doctype html><iframe>...<!--X->...<!--/X->...</iframe>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "iframe": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "iframe",
+                    "children": [
+                      {
+                        "text": "...<!--X->...<!--/X->...",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><iframe>...<!--X->...<!--/X->...</iframe></body></html>",
+        "noQuirksBodyHtml": "<iframe>...<!--X->...<!--/X->...</iframe>"
+      }
+    },
+    {
+      "data": "<!doctype html><xmp><!--<xmp></xmp>--></xmp>",
+      "errors": [
+        "(1,44): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "xmp": true
+          },
+          "doctype": true,
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "xmp",
+                    "children": [
+                      {
+                        "text": "<!--<xmp>",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><xmp><!--<xmp></xmp>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<xmp><!--<xmp></xmp>--&gt;"
+      }
+    },
+    {
+      "data": "<!doctype html><noembed><!--<noembed></noembed>--></noembed>",
+      "errors": [
+        "(1,60): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "noembed": true
+          },
+          "doctype": true,
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "noembed",
+                    "children": [
+                      {
+                        "text": "<!--<noembed>",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><noembed><!--<noembed></noembed>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<noembed><!--<noembed></noembed>--&gt;"
+      }
+    },
+    {
+      "data": "<script>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,8): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script"
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></script>"
+      }
+    },
+    {
+      "data": "<script>a",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,9): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "a",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script>a</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script>a</script>"
+      }
+    },
+    {
+      "data": "<script><",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,9): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><</script>"
+      }
+    },
+    {
+      "data": "<script></",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,10): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script></</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></</script>"
+      }
+    },
+    {
+      "data": "<script></S",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,11): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</S",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script></S</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></S</script>"
+      }
+    },
+    {
+      "data": "<script></SC",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,12): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</SC",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script></SC</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></SC</script>"
+      }
+    },
+    {
+      "data": "<script></SCR",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,13): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</SCR",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script></SCR</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></SCR</script>"
+      }
+    },
+    {
+      "data": "<script></SCRI",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,14): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</SCRI",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script></SCRI</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></SCRI</script>"
+      }
+    },
+    {
+      "data": "<script></SCRIP",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,15): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</SCRIP",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script></SCRIP</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></SCRIP</script>"
+      }
+    },
+    {
+      "data": "<script></SCRIPT",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,16): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</SCRIPT",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script></SCRIPT</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></SCRIPT</script>"
+      }
+    },
+    {
+      "data": "<script></SCRIPT ",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,17): expected-attribute-name-but-got-eof",
+        "(1,17): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script"
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></script>"
+      }
+    },
+    {
+      "data": "<script></s",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,11): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</s",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script></s</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></s</script>"
+      }
+    },
+    {
+      "data": "<script></sc",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,12): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</sc",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script></sc</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></sc</script>"
+      }
+    },
+    {
+      "data": "<script></scr",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,13): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</scr",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script></scr</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></scr</script>"
+      }
+    },
+    {
+      "data": "<script></scri",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,14): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</scri",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script></scri</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></scri</script>"
+      }
+    },
+    {
+      "data": "<script></scrip",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,15): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</scrip",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script></scrip</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></scrip</script>"
+      }
+    },
+    {
+      "data": "<script></script",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,16): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</script",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script></script</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></script</script>"
+      }
+    },
+    {
+      "data": "<script></script ",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,17): expected-attribute-name-but-got-eof",
+        "(1,17): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script"
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></script>"
+      }
+    },
+    {
+      "data": "<script><!",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,10): expected-script-data-but-got-eof",
+        "(1,10): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!</script>"
+      }
+    },
+    {
+      "data": "<script><!a",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,11): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!a",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!a</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!a</script>"
+      }
+    },
+    {
+      "data": "<script><!-",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,11): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!-",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!-</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!-</script>"
+      }
+    },
+    {
+      "data": "<script><!-a",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,12): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!-a",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!-a</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!-a</script>"
+      }
+    },
+    {
+      "data": "<script><!--",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,12): expected-named-closing-tag-but-got-eof",
+        "(1,12): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--</script>"
+      }
+    },
+    {
+      "data": "<script><!--a",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,13): expected-named-closing-tag-but-got-eof",
+        "(1,13): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--a",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--a</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--a</script>"
+      }
+    },
+    {
+      "data": "<script><!--<",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,13): expected-named-closing-tag-but-got-eof",
+        "(1,13): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<</script>"
+      }
+    },
+    {
+      "data": "<script><!--<a",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,14): expected-named-closing-tag-but-got-eof",
+        "(1,14): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<a",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<a</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<a</script>"
+      }
+    },
+    {
+      "data": "<script><!--</",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,14): expected-named-closing-tag-but-got-eof",
+        "(1,14): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--</",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--</</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--</</script>"
+      }
+    },
+    {
+      "data": "<script><!--</script",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,20): expected-named-closing-tag-but-got-eof",
+        "(1,20): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--</script",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--</script</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--</script</script>"
+      }
+    },
+    {
+      "data": "<script><!--</script ",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,21): expected-attribute-name-but-got-eof",
+        "(1,21): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--</script>"
+      }
+    },
+    {
+      "data": "<script><!--<s",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,14): expected-named-closing-tag-but-got-eof",
+        "(1,14): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<s",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<s</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<s</script>"
+      }
+    },
+    {
+      "data": "<script><!--<script",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,19): expected-named-closing-tag-but-got-eof",
+        "(1,19): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script</script>"
+      }
+    },
+    {
+      "data": "<script><!--<script ",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,20): eof-in-script-in-script",
+        "(1,20): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script ",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script </script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script>"
+      }
+    },
+    {
+      "data": "<script><!--<script <",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,21): eof-in-script-in-script",
+        "(1,21): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script <",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script <</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script <</script>"
+      }
+    },
+    {
+      "data": "<script><!--<script <a",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,22): eof-in-script-in-script",
+        "(1,22): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script <a",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script <a</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script <a</script>"
+      }
+    },
+    {
+      "data": "<script><!--<script </",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,22): eof-in-script-in-script",
+        "(1,22): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script </</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </</script>"
+      }
+    },
+    {
+      "data": "<script><!--<script </s",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,23): eof-in-script-in-script",
+        "(1,23): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </s",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script </s</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </s</script>"
+      }
+    },
+    {
+      "data": "<script><!--<script </script",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,28): eof-in-script-in-script",
+        "(1,28): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </script",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script </script</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script</script>"
+      }
+    },
+    {
+      "data": "<script><!--<script </scripta",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,29): eof-in-script-in-script",
+        "(1,29): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </scripta",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script </scripta</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </scripta</script>"
+      }
+    },
+    {
+      "data": "<script><!--<script </script ",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,29): expected-named-closing-tag-but-got-eof",
+        "(1,29): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </script ",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script </script </script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script </script>"
+      }
+    },
+    {
+      "data": "<script><!--<script </script>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,29): expected-named-closing-tag-but-got-eof",
+        "(1,29): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </script>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script </script></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script></script>"
+      }
+    },
+    {
+      "data": "<script><!--<script </script/",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,29): expected-named-closing-tag-but-got-eof",
+        "(1,29): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </script/",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script </script/</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script/</script>"
+      }
+    },
+    {
+      "data": "<script><!--<script </script <",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,30): expected-named-closing-tag-but-got-eof",
+        "(1,30): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </script <",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script </script <</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script <</script>"
+      }
+    },
+    {
+      "data": "<script><!--<script </script <a",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,31): expected-named-closing-tag-but-got-eof",
+        "(1,31): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </script <a",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script </script <a</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script <a</script>"
+      }
+    },
+    {
+      "data": "<script><!--<script </script </",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,31): expected-named-closing-tag-but-got-eof",
+        "(1,31): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </script </",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script </script </</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script </</script>"
+      }
+    },
+    {
+      "data": "<script><!--<script </script </script",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,37): expected-named-closing-tag-but-got-eof",
+        "(1,37): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </script </script",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script </script </script</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script </script</script>"
+      }
+    },
+    {
+      "data": "<script><!--<script </script </script ",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,38): expected-attribute-name-but-got-eof",
+        "(1,38): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </script ",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script </script </script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script </script>"
+      }
+    },
+    {
+      "data": "<script><!--<script </script </script/",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,38): unexpected-EOF-after-solidus-in-tag",
+        "(1,38): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </script ",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script </script </script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script </script>"
+      }
+    },
+    {
+      "data": "<script><!--<script </script </script>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script </script ",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script </script </script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script </script </script>"
+      }
+    },
+    {
+      "data": "<script><!--<script -",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,21): eof-in-script-in-script",
+        "(1,21): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script -",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script -</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script -</script>"
+      }
+    },
+    {
+      "data": "<script><!--<script -a",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,22): eof-in-script-in-script",
+        "(1,22): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script -a",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script -a</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script -a</script>"
+      }
+    },
+    {
+      "data": "<script><!--<script --",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,22): eof-in-script-in-script",
+        "(1,22): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script --",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script --</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script --</script>"
+      }
+    },
+    {
+      "data": "<script><!--<script --a",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,23): eof-in-script-in-script",
+        "(1,23): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script --a",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script --a</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script --a</script>"
+      }
+    },
+    {
+      "data": "<script><!--<script -->",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,23): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script -->",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script --></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script --></script>"
+      }
+    },
+    {
+      "data": "<script><!--<script --><",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,24): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script --><",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script --><</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script --><</script>"
+      }
+    },
+    {
+      "data": "<script><!--<script --></",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,25): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script --></",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script --></</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script --></</script>"
+      }
+    },
+    {
+      "data": "<script><!--<script --></script",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,31): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script --></script",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script --></script</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script --></script</script>"
+      }
+    },
+    {
+      "data": "<script><!--<script --></script ",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,32): expected-attribute-name-but-got-eof",
+        "(1,32): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script -->",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script --></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script --></script>"
+      }
+    },
+    {
+      "data": "<script><!--<script --></script/",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,32): unexpected-EOF-after-solidus-in-tag",
+        "(1,32): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script -->",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script --></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script --></script>"
+      }
+    },
+    {
+      "data": "<script><!--<script --></script>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script -->",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script --></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script --></script>"
+      }
+    },
+    {
+      "data": "<script><!--<script><\\/script>--></script>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script><\\/script>-->",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script><\\/script>--></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script><\\/script>--></script>"
+      }
+    },
+    {
+      "data": "<script><!--<script></scr'+'ipt>--></script>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script></scr'+'ipt>-->",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script></scr'+'ipt>--></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script></scr'+'ipt>--></script>"
+      }
+    },
+    {
+      "data": "<script><!--<script></script><script></script></script>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script></script><script></script>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script></script><script></script></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script></script><script></script></script>"
+      }
+    },
+    {
+      "data": "<script><!--<script></script><script></script>--><!--</script>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script></script><script></script>--><!--",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script></script><script></script>--><!--</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script></script><script></script>--><!--</script>"
+      }
+    },
+    {
+      "data": "<script><!--<script></script><script></script>-- ></script>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script></script><script></script>-- >",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script></script><script></script>-- ></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script></script><script></script>-- ></script>"
+      }
+    },
+    {
+      "data": "<script><!--<script></script><script></script>- -></script>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script></script><script></script>- ->",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script></script><script></script>- -></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script></script><script></script>- -></script>"
+      }
+    },
+    {
+      "data": "<script><!--<script></script><script></script>- - ></script>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script></script><script></script>- - >",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script></script><script></script>- - ></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script></script><script></script>- - ></script>"
+      }
+    },
+    {
+      "data": "<script><!--<script></script><script></script>-></script>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script></script><script></script>->",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script></script><script></script>-></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script></script><script></script>-></script>"
+      }
+    },
+    {
+      "data": "<script><!--<script>--!></script>X",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,34): expected-named-closing-tag-but-got-eof",
+        "(1,34): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script>--!></script>X",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script>--!></script>X</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script>--!></script>X</script>"
+      }
+    },
+    {
+      "data": "<script><!--<scr'+'ipt></script>--></script>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,44): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<scr'+'ipt>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<scr'+'ipt></script></head><body>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<script><!--<scr'+'ipt></script>--&gt;"
+      }
+    },
+    {
+      "data": "<script><!--<script></scr'+'ipt></script>X",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,42): expected-named-closing-tag-but-got-eof",
+        "(1,42): unexpected-eof-in-text-mode"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "<!--<script></scr'+'ipt></script>X",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script><!--<script></scr'+'ipt></script>X</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script><!--<script></scr'+'ipt></script>X</script>"
+      }
+    },
+    {
+      "data": "<style><!--<style></style>--></style>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,37): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": "<!--<style>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><style><!--<style></style></head><body>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<style><!--<style></style>--&gt;"
+      }
+    },
+    {
+      "data": "<style><!--</style>X",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": "<!--",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "X"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><style><!--</style></head><body>X</body></html>",
+        "noQuirksBodyHtml": "<style><!--</style>X"
+      }
+    },
+    {
+      "data": "<style><!--...</style>...--></style>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,36): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": "<!--...",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "...-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><style><!--...</style></head><body>...--&gt;</body></html>",
+        "noQuirksBodyHtml": "<style><!--...</style>...--&gt;"
+      }
+    },
+    {
+      "data": "<style><!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style></style>X",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": "<!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "X"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><style><!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style></style></head><body>X</body></html>",
+        "noQuirksBodyHtml": "<style><!--<br><html xmlns:v=\"urn:schemas-microsoft-com:vml\"><!--[if !mso]><style></style>X"
+      }
+    },
+    {
+      "data": "<style><!--...<style><!--...--!></style>--></style>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,51): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": "<!--...<style><!--...--!>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><style><!--...<style><!--...--!></style></head><body>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<style><!--...<style><!--...--!></style>--&gt;"
+      }
+    },
+    {
+      "data": "<style><!--...</style><!-- --><style>@import ...</style>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "no_escape": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": "<!--...",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "comment": " "
+                  },
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": "@import ...",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><style><!--...</style><!-- --><style>@import ...</style></head><body></body></html>",
+        "noQuirksBodyHtml": "<style><!--...</style><!-- --><style>@import ...</style>"
+      }
+    },
+    {
+      "data": "<style>...<style><!--...</style><!-- --></style>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,48): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "no_escape": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": "...<style><!--...",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "comment": " "
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><style>...<style><!--...</style><!-- --></head><body></body></html>",
+        "noQuirksBodyHtml": "<style>...<style><!--...</style><!-- -->"
+      }
+    },
+    {
+      "data": "<style>...<!--[if IE]><style>...</style>X",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": "...<!--[if IE]><style>...",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "X"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><style>...<!--[if IE]><style>...</style></head><body>X</body></html>",
+        "noQuirksBodyHtml": "<style>...<!--[if IE]><style>...</style>X"
+      }
+    },
+    {
+      "data": "<title><!--<title></title>--></title>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,37): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "title": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "<!--<title>",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><title>&lt;!--&lt;title&gt;</title></head><body>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<title>&lt;!--&lt;title&gt;</title>--&gt;"
+      }
+    },
+    {
+      "data": "<title>&lt;/title></title>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "title": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "</title>",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><title>&lt;/title&gt;</title></head><body></body></html>",
+        "noQuirksBodyHtml": "<title>&lt;/title&gt;</title>"
+      }
+    },
+    {
+      "data": "<title>foo/title><link></head><body>X",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,37): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "title": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "foo/title><link></head><body>X",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><title>foo/title&gt;&lt;link&gt;&lt;/head&gt;&lt;body&gt;X</title></head><body></body></html>",
+        "noQuirksBodyHtml": "<title>foo/title&gt;&lt;link&gt;&lt;/head&gt;&lt;body&gt;X</title>"
+      }
+    },
+    {
+      "data": "<noscript><!--<noscript></noscript>--></noscript>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag",
+        "(1,49): unexpected-end-tag"
+      ],
+      "script": "on",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "text": "<!--<noscript>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript><!--<noscript></noscript></head><body>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<noscript><!--<noscript></noscript>--></noscript>"
+      }
+    },
+    {
+      "data": "<noscript><!--<noscript></noscript>--></noscript>",
+      "errors": [
+        " * (1,11) missing DOCTYPE"
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "comment": "<noscript></noscript>"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript><!--<noscript></noscript>--></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><!--<noscript></noscript>--></noscript>"
+      }
+    },
+    {
+      "data": "<noscript><!--</noscript>X<noscript>--></noscript>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag"
+      ],
+      "script": "on",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "text": "<!--",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "X"
+                  },
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "text": "-->",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript><!--</noscript></head><body>X<noscript>--></noscript></body></html>",
+        "noQuirksBodyHtml": "<noscript><!--</noscript>X<noscript>--></noscript>"
+      }
+    },
+    {
+      "data": "<noscript><!--</noscript>X<noscript>--></noscript>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag"
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "comment": "</noscript>X<noscript>"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript><!--</noscript>X<noscript>--></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><!--</noscript>X<noscript>--></noscript>"
+      }
+    },
+    {
+      "data": "<noscript><iframe></noscript>X",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag"
+      ],
+      "script": "on",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "text": "<iframe>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "X"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript><iframe></noscript></head><body>X</body></html>",
+        "noQuirksBodyHtml": "<noscript><iframe></noscript>X</iframe></noscript>"
+      }
+    },
+    {
+      "data": "<noscript><iframe></noscript>X",
+      "errors": [
+        " * (1,11) missing DOCTYPE",
+        " * (1,19) unexpected token in head noscript",
+        " * (1,31) unexpected EOF"
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true,
+            "iframe": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript"
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "iframe",
+                    "children": [
+                      {
+                        "text": "</noscript>X",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript></noscript></head><body><iframe></noscript>X</iframe></body></html>",
+        "noQuirksBodyHtml": "<noscript><iframe></noscript>X</iframe></noscript>"
+      }
+    },
+    {
+      "data": "<noframes><!--<noframes></noframes>--></noframes>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag",
+        "(1,49): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noframes": true,
+            "body": true
+          },
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noframes",
+                    "children": [
+                      {
+                        "text": "<!--<noframes>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noframes><!--<noframes></noframes></head><body>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<noframes><!--<noframes></noframes>--&gt;"
+      }
+    },
+    {
+      "data": "<noframes><body><script><!--...</script></body></noframes></html>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noframes": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noframes",
+                    "children": [
+                      {
+                        "text": "<body><script><!--...</script></body>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noframes><body><script><!--...</script></body></noframes></head><body></body></html>",
+        "noQuirksBodyHtml": "<noframes><body><script><!--...</script></body></noframes>"
+      }
+    },
+    {
+      "data": "<textarea><!--<textarea></textarea>--></textarea>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag",
+        "(1,49): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "textarea": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "textarea",
+                    "children": [
+                      {
+                        "text": "<!--<textarea>",
+                        "escaped": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><textarea>&lt;!--&lt;textarea&gt;</textarea>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<textarea>&lt;!--&lt;textarea&gt;</textarea>--&gt;"
+      }
+    },
+    {
+      "data": "<textarea>&lt;/textarea></textarea>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "textarea": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "textarea",
+                    "children": [
+                      {
+                        "text": "</textarea>",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><textarea>&lt;/textarea&gt;</textarea></body></html>",
+        "noQuirksBodyHtml": "<textarea>&lt;/textarea&gt;</textarea>"
+      }
+    },
+    {
+      "data": "<iframe><!--<iframe></iframe>--></iframe>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,41): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "iframe": true
+          },
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "iframe",
+                    "children": [
+                      {
+                        "text": "<!--<iframe>",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><iframe><!--<iframe></iframe>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<iframe><!--<iframe></iframe>--&gt;"
+      }
+    },
+    {
+      "data": "<iframe>...<!--X->...<!--/X->...</iframe>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "iframe": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "iframe",
+                    "children": [
+                      {
+                        "text": "...<!--X->...<!--/X->...",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><iframe>...<!--X->...<!--/X->...</iframe></body></html>",
+        "noQuirksBodyHtml": "<iframe>...<!--X->...<!--/X->...</iframe>"
+      }
+    },
+    {
+      "data": "<xmp><!--<xmp></xmp>--></xmp>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,29): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "xmp": true
+          },
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "xmp",
+                    "children": [
+                      {
+                        "text": "<!--<xmp>",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><xmp><!--<xmp></xmp>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<xmp><!--<xmp></xmp>--&gt;"
+      }
+    },
+    {
+      "data": "<noembed><!--<noembed></noembed>--></noembed>",
+      "errors": [
+        "(1,9): expected-doctype-but-got-start-tag",
+        "(1,45): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "noembed": true
+          },
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "noembed",
+                    "children": [
+                      {
+                        "text": "<!--<noembed>",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><noembed><!--<noembed></noembed>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<noembed><!--<noembed></noembed>--&gt;"
+      }
+    },
+    {
+      "data": "<!doctype html><table>\n",
+      "errors": [
+        "(2,0): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "text": "\n"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table>\n</table></body></html>",
+        "noQuirksBodyHtml": "<table>\n</table>"
+      }
+    },
+    {
+      "data": "<!doctype html><table><td><span><font></span><span>",
+      "errors": [
+        "(1,26): unexpected-cell-in-table-body",
+        "(1,45): unexpected-end-tag",
+        "(1,51): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "span": true,
+            "font": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "span",
+                                    "children": [
+                                      {
+                                        "tag": "font"
+                                      }
+                                    ]
+                                  },
+                                  {
+                                    "tag": "font",
+                                    "children": [
+                                      {
+                                        "tag": "span"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><span><font></font></span><font><span></span></font></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><span><font></font></span><font><span></span></font></td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><form><table></form><form></table></form>",
+      "errors": [
+        "(1,35): unexpected-end-tag-implies-table-voodoo",
+        "(1,35): unexpected-end-tag",
+        "(1,41): unexpected-form-in-table",
+        "(1,56): unexpected-end-tag",
+        "(1,56): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "form": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "form",
+                    "children": [
+                      {
+                        "tag": "table",
+                        "children": [
+                          {
+                            "tag": "form"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><form><table><form></form></table></form></body></html>",
+        "noQuirksBodyHtml": "<form><table><form></form></table></form>"
+      }
+    }
+  ],
+  "tests17.dat": [
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "table": true,
+            "tbody": true,
+            "tr": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select></select><table><tbody><tr></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<select></select><table><tbody><tr></tr></tbody></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select></select><table><tbody><tr><td></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<select></select><table><tbody><tr><td></td></tr></tbody></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "select": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "select"
+                                  }
+                                ]
+                              },
+                              {
+                                "tag": "td"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><select></select></td><td></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><select></select></td><td></td></tr></tbody></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "th": true,
+            "select": true,
+            "td": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "th",
+                                "children": [
+                                  {
+                                    "tag": "select"
+                                  }
+                                ]
+                              },
+                              {
+                                "tag": "td"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><th><select></select></th><td></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><th><select></select></th><td></td></tr></tbody></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "caption": true,
+            "select": true,
+            "tbody": true,
+            "tr": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "caption",
+                        "children": [
+                          {
+                            "tag": "select"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><caption><select></select></caption><tbody><tr></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><caption><select></select></caption><tbody><tr></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><select><tr>",
+      "errors": [
+        "(1,27): unexpected-start-tag-in-select",
+        "(1,27): eof-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select></select></body></html>",
+        "noQuirksBodyHtml": "<select></select>"
+      }
+    },
+    {
+      "data": "<!doctype html><select><td>",
+      "errors": [
+        "(1,27): unexpected-start-tag-in-select",
+        "(1,27): eof-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select></select></body></html>",
+        "noQuirksBodyHtml": "<select></select>"
+      }
+    },
+    {
+      "data": "<!doctype html><select><th>",
+      "errors": [
+        "(1,27): unexpected-start-tag-in-select",
+        "(1,27): eof-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select></select></body></html>",
+        "noQuirksBodyHtml": "<select></select>"
+      }
+    },
+    {
+      "data": "<!doctype html><select><tbody>",
+      "errors": [
+        "(1,30): unexpected-start-tag-in-select",
+        "(1,30): eof-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select></select></body></html>",
+        "noQuirksBodyHtml": "<select></select>"
+      }
+    },
+    {
+      "data": "<!doctype html><select><thead>",
+      "errors": [
+        "(1,30): unexpected-start-tag-in-select",
+        "(1,30): eof-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select></select></body></html>",
+        "noQuirksBodyHtml": "<select></select>"
+      }
+    },
+    {
+      "data": "<!doctype html><select><tfoot>",
+      "errors": [
+        "(1,30): unexpected-start-tag-in-select",
+        "(1,30): eof-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select></select></body></html>",
+        "noQuirksBodyHtml": "<select></select>"
+      }
+    },
+    {
+      "data": "<!doctype html><select><caption>",
+      "errors": [
+        "(1,32): unexpected-start-tag-in-select",
+        "(1,32): eof-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select></select></body></html>",
+        "noQuirksBodyHtml": "<select></select>"
+      }
+    },
+    {
+      "data": "<!doctype html><table><tr></table>a",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "text": "a"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr></tr></tbody></table>a</body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr></tr></tbody></table>a"
+      }
+    }
+  ],
+  "tests18.dat": [
+    {
+      "data": "<!doctype html><plaintext></plaintext>",
+      "errors": [
+        "(1,38): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "plaintext": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "plaintext",
+                    "children": [
+                      {
+                        "text": "</plaintext>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><plaintext></plaintext></plaintext></body></html>",
+        "noQuirksBodyHtml": "<plaintext></plaintext></plaintext>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "plaintext": true,
+            "table": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "plaintext",
+                    "children": [
+                      {
+                        "text": "</plaintext>",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><plaintext></plaintext></plaintext><table></table></body></html>",
+        "noQuirksBodyHtml": "<plaintext></plaintext></plaintext><table></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "plaintext": true,
+            "table": true,
+            "tbody": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "plaintext",
+                    "children": [
+                      {
+                        "text": "</plaintext>",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><plaintext></plaintext></plaintext><table><tbody></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<plaintext></plaintext></plaintext><table><tbody></tbody></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "plaintext": true,
+            "table": true,
+            "tbody": true,
+            "tr": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "plaintext",
+                    "children": [
+                      {
+                        "text": "</plaintext>",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><plaintext></plaintext></plaintext><table><tbody><tr></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<plaintext></plaintext></plaintext><table><tbody><tr></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><table><td><plaintext></plaintext>",
+      "errors": [
+        "(1,26): unexpected-cell-in-table-body",
+        "(1,49): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "plaintext": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "plaintext",
+                                    "children": [
+                                      {
+                                        "text": "</plaintext>",
+                                        "no_escape": true
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><plaintext></plaintext></plaintext></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><plaintext></plaintext></plaintext></td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><table><caption><plaintext></plaintext>",
+      "errors": [
+        "(1,54): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "caption": true,
+            "plaintext": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "caption",
+                        "children": [
+                          {
+                            "tag": "plaintext",
+                            "children": [
+                              {
+                                "text": "</plaintext>",
+                                "no_escape": true
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><caption><plaintext></plaintext></plaintext></caption></table></body></html>",
+        "noQuirksBodyHtml": "<table><caption><plaintext></plaintext></plaintext></caption></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "style": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "abc"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "style",
+                                "children": [
+                                  {
+                                    "text": "</script>",
+                                    "no_escape": true
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>abc<table><tbody><tr><style></script></style></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "abc<table><tbody><tr><style></script></style></tr></tbody></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "script": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "abc"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "script",
+                                "children": [
+                                  {
+                                    "text": "</style>",
+                                    "no_escape": true
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>abc<table><tbody><tr><script></style></script></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "abc<table><tbody><tr><script></style></script></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><table><caption><style></script></style>abc",
+      "errors": [
+        "(1,58): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "caption": true,
+            "style": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "caption",
+                        "children": [
+                          {
+                            "tag": "style",
+                            "children": [
+                              {
+                                "text": "</script>",
+                                "no_escape": true
+                              }
+                            ]
+                          },
+                          {
+                            "text": "abc"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><caption><style></script></style>abc</caption></table></body></html>",
+        "noQuirksBodyHtml": "<table><caption><style></script></style>abc</caption></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "style": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "style",
+                                    "children": [
+                                      {
+                                        "text": "</script>",
+                                        "no_escape": true
+                                      }
+                                    ]
+                                  },
+                                  {
+                                    "text": "abc"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><style></script></style>abc</td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><style></script></style>abc</td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><select><script></style></script>abc",
+      "errors": [
+        "(1,51): eof-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "script": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "script",
+                        "children": [
+                          {
+                            "text": "</style>",
+                            "no_escape": true
+                          }
+                        ]
+                      },
+                      {
+                        "text": "abc"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select><script></style></script>abc</select></body></html>",
+        "noQuirksBodyHtml": "<select><script></style></script>abc</select>"
+      }
+    },
+    {
+      "data": "<!doctype html><table><select><script></style></script>abc",
+      "errors": [
+        "(1,30): unexpected-start-tag-implies-table-voodoo",
+        "(1,58): eof-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "script": true,
+            "table": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "script",
+                        "children": [
+                          {
+                            "text": "</style>",
+                            "no_escape": true
+                          }
+                        ]
+                      },
+                      {
+                        "text": "abc"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select><script></style></script>abc</select><table></table></body></html>",
+        "noQuirksBodyHtml": "<select><script></style></script>abc</select><table></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "script": true,
+            "table": true,
+            "tbody": true,
+            "tr": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "script",
+                        "children": [
+                          {
+                            "text": "</style>",
+                            "no_escape": true
+                          }
+                        ]
+                      },
+                      {
+                        "text": "abc"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select><script></style></script>abc</select><table><tbody><tr></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<select><script></style></script>abc</select><table><tbody><tr></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><frameset></frameset><noframes>abc",
+      "errors": [
+        "(1,49): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true,
+            "noframes": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              },
+              {
+                "tag": "noframes",
+                "children": [
+                  {
+                    "text": "abc",
+                    "no_escape": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset></frameset><noframes>abc</noframes></html>",
+        "noQuirksBodyHtml": "<noframes>abc</noframes>"
+      }
+    },
+    {
+      "data": "<!doctype html><frameset></frameset><noframes>abc</noframes><!--abc-->",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true,
+            "noframes": true
+          },
+          "doctype": true,
+          "no_escape": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              },
+              {
+                "tag": "noframes",
+                "children": [
+                  {
+                    "text": "abc",
+                    "no_escape": true
+                  }
+                ]
+              },
+              {
+                "comment": "abc"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset></frameset><noframes>abc</noframes><!--abc--></html>",
+        "noQuirksBodyHtml": "<noframes>abc</noframes><!--abc-->"
+      }
+    },
+    {
+      "data": "<!doctype html><frameset></frameset></html><noframes>abc",
+      "errors": [
+        "(1,56): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true,
+            "noframes": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              },
+              {
+                "tag": "noframes",
+                "children": [
+                  {
+                    "text": "abc",
+                    "no_escape": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset></frameset><noframes>abc</noframes></html>",
+        "noQuirksBodyHtml": "<noframes>abc</noframes>"
+      }
+    },
+    {
+      "data": "<!doctype html><frameset></frameset></html><noframes>abc</noframes><!--abc-->",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true,
+            "noframes": true
+          },
+          "doctype": true,
+          "no_escape": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              },
+              {
+                "tag": "noframes",
+                "children": [
+                  {
+                    "text": "abc",
+                    "no_escape": true
+                  }
+                ]
+              }
+            ]
+          },
+          {
+            "comment": "abc"
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset></frameset><noframes>abc</noframes></html><!--abc-->",
+        "noQuirksBodyHtml": "<noframes>abc</noframes><!--abc-->"
+      }
+    },
+    {
+      "data": "<!doctype html><table><tr></tbody><tfoot>",
+      "errors": [
+        "(1,41): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "tfoot": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "tfoot"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr></tr></tbody><tfoot></tfoot></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr></tr></tbody><tfoot></tfoot></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "svg svg": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "svg",
+                                    "ns": "http://www.w3.org/2000/svg"
+                                  },
+                                  {
+                                    "text": "abc"
+                                  }
+                                ]
+                              },
+                              {
+                                "tag": "td"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><svg></svg>abc</td><td></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><svg></svg>abc</td><td></td></tr></tbody></table>"
+      }
+    }
+  ],
+  "tests19.dat": [
+    {
+      "data": "<!doctype html><math><mn DefinitionUrl=\"foo\">",
+      "errors": [
+        "(1,45): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mn": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mn",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "attrs": [
+                          {
+                            "name": "definitionURL",
+                            "value": "foo"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math><mn definitionURL=\"foo\"></mn></math></body></html>",
+        "noQuirksBodyHtml": "<math><mn definitionURL=\"foo\"></mn></math>"
+      }
+    },
+    {
+      "data": "<!doctype html><html></p><!--foo-->",
+      "errors": [
+        "(1,25): end-tag-after-implied-root"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "comment": "foo"
+              },
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><!--foo--><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<p></p><!--foo-->"
+      }
+    },
+    {
+      "data": "<!doctype html><head></head></p><!--foo-->",
+      "errors": [
+        "(1,32): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "comment": "foo"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><!--foo--><body></body></html>",
+        "noQuirksBodyHtml": "<p></p><!--foo-->"
+      }
+    },
+    {
+      "data": "<!doctype html><body><p><pre>",
+      "errors": [
+        "(1,29): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "pre": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p"
+                  },
+                  {
+                    "tag": "pre"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p></p><pre></pre></body></html>",
+        "noQuirksBodyHtml": "<p></p><pre></pre>"
+      }
+    },
+    {
+      "data": "<!doctype html><body><p><listing>",
+      "errors": [
+        "(1,33): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "listing": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p"
+                  },
+                  {
+                    "tag": "listing"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p></p><listing></listing></body></html>",
+        "noQuirksBodyHtml": "<p></p><listing></listing>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><plaintext>",
+      "errors": [
+        "(1,29): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "plaintext": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p"
+                  },
+                  {
+                    "tag": "plaintext"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p></p><plaintext></plaintext></body></html>",
+        "noQuirksBodyHtml": "<p></p><plaintext></plaintext>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><h1>",
+      "errors": [
+        "(1,22): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "h1": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p"
+                  },
+                  {
+                    "tag": "h1"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p></p><h1></h1></body></html>",
+        "noQuirksBodyHtml": "<p></p><h1></h1>"
+      }
+    },
+    {
+      "data": "<!doctype html><isindex type=\"hidden\">",
+      "errors": [
+        "(1,38): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "isindex": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "isindex",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "hidden"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><isindex type=\"hidden\"></isindex></body></html>",
+        "noQuirksBodyHtml": "<isindex type=\"hidden\"></isindex>"
+      }
+    },
+    {
+      "data": "<!doctype html><ruby><p><rp>",
+      "errors": [
+        "(1,28): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "p": true,
+            "rp": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "tag": "p"
+                      },
+                      {
+                        "tag": "rp"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><ruby><p></p><rp></rp></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby><p></p><rp></rp></ruby>"
+      }
+    },
+    {
+      "data": "<!doctype html><ruby><div><span><rp>",
+      "errors": [
+        "(1,36): XXX-undefined-error",
+        "(1,36): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "div": true,
+            "span": true,
+            "rp": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "tag": "div",
+                        "children": [
+                          {
+                            "tag": "span",
+                            "children": [
+                              {
+                                "tag": "rp"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><ruby><div><span><rp></rp></span></div></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby><div><span><rp></rp></span></div></ruby>"
+      }
+    },
+    {
+      "data": "<!doctype html><ruby><div><p><rp>",
+      "errors": [
+        "(1,33): XXX-undefined-error",
+        "(1,33): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "div": true,
+            "p": true,
+            "rp": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "tag": "div",
+                        "children": [
+                          {
+                            "tag": "p"
+                          },
+                          {
+                            "tag": "rp"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><ruby><div><p></p><rp></rp></div></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby><div><p></p><rp></rp></div></ruby>"
+      }
+    },
+    {
+      "data": "<!doctype html><ruby><p><rt>",
+      "errors": [
+        "(1,28): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "p": true,
+            "rt": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "tag": "p"
+                      },
+                      {
+                        "tag": "rt"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><ruby><p></p><rt></rt></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby><p></p><rt></rt></ruby>"
+      }
+    },
+    {
+      "data": "<!doctype html><ruby><div><span><rt>",
+      "errors": [
+        "(1,36): XXX-undefined-error",
+        "(1,36): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "div": true,
+            "span": true,
+            "rt": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "tag": "div",
+                        "children": [
+                          {
+                            "tag": "span",
+                            "children": [
+                              {
+                                "tag": "rt"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><ruby><div><span><rt></rt></span></div></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby><div><span><rt></rt></span></div></ruby>"
+      }
+    },
+    {
+      "data": "<!doctype html><ruby><div><p><rt>",
+      "errors": [
+        "(1,33): XXX-undefined-error",
+        "(1,33): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "div": true,
+            "p": true,
+            "rt": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "tag": "div",
+                        "children": [
+                          {
+                            "tag": "p"
+                          },
+                          {
+                            "tag": "rt"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><ruby><div><p></p><rt></rt></div></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby><div><p></p><rt></rt></div></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rb>b<rt></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rb": true,
+            "rt": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rb",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "rt"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rb>b</rb><rt></rt></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rb>b</rb><rt></rt></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rp>b<rt></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rp": true,
+            "rt": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rp",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "rt"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rp>b</rp><rt></rt></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rp>b</rp><rt></rt></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rt>b<rt></ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rt": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rt",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "rt"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rt>b</rt><rt></rt></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rt>b</rt><rt></rt></ruby>"
+      }
+    },
+    {
+      "data": "<html><ruby>a<rtc>b<rt>c<rb>d</ruby></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "rtc": true,
+            "rt": true,
+            "rb": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "rtc",
+                        "children": [
+                          {
+                            "text": "b"
+                          },
+                          {
+                            "tag": "rt",
+                            "children": [
+                              {
+                                "text": "c"
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "rb",
+                        "children": [
+                          {
+                            "text": "d"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby>a<rtc>b<rt>c</rt></rtc><rb>d</rb></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby>a<rtc>b<rt>c</rt></rtc><rb>d</rb></ruby>"
+      }
+    },
+    {
+      "data": "<!doctype html><math/><foo>",
+      "errors": [
+        "(1,27): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "foo": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML"
+                  },
+                  {
+                    "tag": "foo"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math></math><foo></foo></body></html>",
+        "noQuirksBodyHtml": "<math></math><foo></foo>"
+      }
+    },
+    {
+      "data": "<!doctype html><svg/><foo>",
+      "errors": [
+        "(1,26): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "foo": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg"
+                  },
+                  {
+                    "tag": "foo"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg></svg><foo></foo></body></html>",
+        "noQuirksBodyHtml": "<svg></svg><foo></foo>"
+      }
+    },
+    {
+      "data": "<!doctype html><div></body><!--foo-->",
+      "errors": [
+        "(1,27): expected-one-end-tag-but-got-another"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          },
+          "doctype": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div"
+                  }
+                ]
+              },
+              {
+                "comment": "foo"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><div></div></body><!--foo--></html>",
+        "noQuirksBodyHtml": "<div><!--foo--></div>"
+      }
+    },
+    {
+      "data": "<!doctype html><h1><div><h3><span></h1>foo",
+      "errors": [
+        "(1,39): end-tag-too-early",
+        "(1,42): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "h1": true,
+            "div": true,
+            "h3": true,
+            "span": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "h1",
+                    "children": [
+                      {
+                        "tag": "div",
+                        "children": [
+                          {
+                            "tag": "h3",
+                            "children": [
+                              {
+                                "tag": "span"
+                              }
+                            ]
+                          },
+                          {
+                            "text": "foo"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><h1><div><h3><span></span></h3>foo</div></h1></body></html>",
+        "noQuirksBodyHtml": "<h1><div><h3><span></span></h3>foo</div></h1>"
+      }
+    },
+    {
+      "data": "<!doctype html><p></h3>foo",
+      "errors": [
+        "(1,23): end-tag-too-early"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "foo"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p>foo</p></body></html>",
+        "noQuirksBodyHtml": "<p>foo</p>"
+      }
+    },
+    {
+      "data": "<!doctype html><h3><li>abc</h2>foo",
+      "errors": [
+        "(1,31): end-tag-too-early"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "h3": true,
+            "li": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "h3",
+                    "children": [
+                      {
+                        "tag": "li",
+                        "children": [
+                          {
+                            "text": "abc"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "text": "foo"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><h3><li>abc</li></h3>foo</body></html>",
+        "noQuirksBodyHtml": "<h3><li>abc</li></h3>foo"
+      }
+    },
+    {
+      "data": "<!doctype html><table>abc<!--foo-->",
+      "errors": [
+        "(1,23): foster-parenting-character",
+        "(1,24): foster-parenting-character",
+        "(1,25): foster-parenting-character",
+        "(1,35): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true
+          },
+          "doctype": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "abc"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "comment": "foo"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>abc<table><!--foo--></table></body></html>",
+        "noQuirksBodyHtml": "abc<table><!--foo--></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><table>  <!--foo-->",
+      "errors": [
+        "(1,34): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true
+          },
+          "doctype": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "text": "  "
+                      },
+                      {
+                        "comment": "foo"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table>  <!--foo--></table></body></html>",
+        "noQuirksBodyHtml": "<table>  <!--foo--></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><table> b <!--foo-->",
+      "errors": [
+        "(1,23): foster-parenting-character",
+        "(1,24): foster-parenting-character",
+        "(1,25): foster-parenting-character",
+        "(1,35): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true
+          },
+          "doctype": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": " b "
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "comment": "foo"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body> b <table><!--foo--></table></body></html>",
+        "noQuirksBodyHtml": " b <table><!--foo--></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><select><option><option>",
+      "errors": [
+        "(1,39): eof-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "option": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "option"
+                      },
+                      {
+                        "tag": "option"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select><option></option><option></option></select></body></html>",
+        "noQuirksBodyHtml": "<select><option></option><option></option></select>"
+      }
+    },
+    {
+      "data": "<!doctype html><select><option></optgroup>",
+      "errors": [
+        "(1,42): unexpected-end-tag-in-select",
+        "(1,42): eof-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "option": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "option"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select><option></option></select></body></html>",
+        "noQuirksBodyHtml": "<select><option></option></select>"
+      }
+    },
+    {
+      "data": "<!doctype html><select><option></optgroup>",
+      "errors": [
+        "(1,42): unexpected-end-tag-in-select",
+        "(1,42): eof-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "option": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "option"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select><option></option></select></body></html>",
+        "noQuirksBodyHtml": "<select><option></option></select>"
+      }
+    },
+    {
+      "data": "<!doctype html><dd><optgroup><dd>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "dd": true,
+            "optgroup": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "dd",
+                    "children": [
+                      {
+                        "tag": "optgroup"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "dd"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><dd><optgroup></optgroup></dd><dd></dd></body></html>",
+        "noQuirksBodyHtml": "<dd><optgroup></optgroup></dd><dd></dd>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><math><mi><p><h1>",
+      "errors": [
+        "(1,35): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "math math": true,
+            "math mi": true,
+            "h1": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "math",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "mi",
+                            "ns": "http://www.w3.org/1998/Math/MathML",
+                            "children": [
+                              {
+                                "tag": "p"
+                              },
+                              {
+                                "tag": "h1"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><math><mi><p></p><h1></h1></mi></math></p></body></html>",
+        "noQuirksBodyHtml": "<p><math><mi><p></p><h1></h1></mi></math></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><math><mo><p><h1>",
+      "errors": [
+        "(1,35): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "math math": true,
+            "math mo": true,
+            "h1": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "math",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "mo",
+                            "ns": "http://www.w3.org/1998/Math/MathML",
+                            "children": [
+                              {
+                                "tag": "p"
+                              },
+                              {
+                                "tag": "h1"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><math><mo><p></p><h1></h1></mo></math></p></body></html>",
+        "noQuirksBodyHtml": "<p><math><mo><p></p><h1></h1></mo></math></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><math><mn><p><h1>",
+      "errors": [
+        "(1,35): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "math math": true,
+            "math mn": true,
+            "h1": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "math",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "mn",
+                            "ns": "http://www.w3.org/1998/Math/MathML",
+                            "children": [
+                              {
+                                "tag": "p"
+                              },
+                              {
+                                "tag": "h1"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><math><mn><p></p><h1></h1></mn></math></p></body></html>",
+        "noQuirksBodyHtml": "<p><math><mn><p></p><h1></h1></mn></math></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><math><ms><p><h1>",
+      "errors": [
+        "(1,35): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "math math": true,
+            "math ms": true,
+            "h1": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "math",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "ms",
+                            "ns": "http://www.w3.org/1998/Math/MathML",
+                            "children": [
+                              {
+                                "tag": "p"
+                              },
+                              {
+                                "tag": "h1"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><math><ms><p></p><h1></h1></ms></math></p></body></html>",
+        "noQuirksBodyHtml": "<p><math><ms><p></p><h1></h1></ms></math></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><math><mtext><p><h1>",
+      "errors": [
+        "(1,38): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "math math": true,
+            "math mtext": true,
+            "h1": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "math",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "mtext",
+                            "ns": "http://www.w3.org/1998/Math/MathML",
+                            "children": [
+                              {
+                                "tag": "p"
+                              },
+                              {
+                                "tag": "h1"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><math><mtext><p></p><h1></h1></mtext></math></p></body></html>",
+        "noQuirksBodyHtml": "<p><math><mtext><p></p><h1></h1></mtext></math></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><frameset></noframes>",
+      "errors": [
+        "(1,36): unexpected-end-tag-in-frameset",
+        "(1,36): eof-in-frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<!doctype html><html c=d><body></html><html a=b>",
+      "errors": [
+        "(1,48): non-html-root"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "attrs": [
+              {
+                "name": "a",
+                "value": "b"
+              },
+              {
+                "name": "c",
+                "value": "d"
+              }
+            ],
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html c=\"d\" a=\"b\"><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<!doctype html><html c=d><frameset></frameset></html><html a=b>",
+      "errors": [
+        "(1,63): non-html-root"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "attrs": [
+              {
+                "name": "a",
+                "value": "b"
+              },
+              {
+                "name": "c",
+                "value": "d"
+              }
+            ],
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html c=\"d\" a=\"b\"><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<!doctype html><html><frameset></frameset></html><!--foo-->",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          },
+          "doctype": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          },
+          {
+            "comment": "foo"
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html><!--foo-->",
+        "noQuirksBodyHtml": "<!--foo-->"
+      }
+    },
+    {
+      "data": "<!doctype html><html><frameset></frameset></html>  ",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              },
+              {
+                "text": "  "
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset></frameset>  </html>",
+        "noQuirksBodyHtml": "  "
+      }
+    },
+    {
+      "data": "<!doctype html><html><frameset></frameset></html>abc",
+      "errors": [
+        "(1,50): expected-eof-but-got-char",
+        "(1,51): expected-eof-but-got-char",
+        "(1,52): expected-eof-but-got-char"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "abc"
+      }
+    },
+    {
+      "data": "<!doctype html><html><frameset></frameset></html><p>",
+      "errors": [
+        "(1,52): expected-eof-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "<p></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><html><frameset></frameset></html></p>",
+      "errors": [
+        "(1,53): expected-eof-but-got-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "<p></p>"
+      }
+    },
+    {
+      "data": "<html><frameset></frameset></html><!doctype html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,49): unexpected-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<!doctype html><body><frameset>",
+      "errors": [
+        "(1,31): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<!doctype html><p><frameset><frame>",
+      "errors": [
+        "(1,28): unexpected-start-tag",
+        "(1,35): eof-in-frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true,
+            "frame": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset",
+                "children": [
+                  {
+                    "tag": "frame"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset><frame></frameset></html>",
+        "noQuirksBodyHtml": "<p></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p>a<frameset>",
+      "errors": [
+        "(1,29): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "a"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p>a</p></body></html>",
+        "noQuirksBodyHtml": "<p>a</p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p> <frameset><frame>",
+      "errors": [
+        "(1,29): unexpected-start-tag",
+        "(1,36): eof-in-frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true,
+            "frame": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset",
+                "children": [
+                  {
+                    "tag": "frame"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset><frame></frameset></html>",
+        "noQuirksBodyHtml": "<p> </p>"
+      }
+    },
+    {
+      "data": "<!doctype html><pre><frameset>",
+      "errors": [
+        "(1,30): unexpected-start-tag",
+        "(1,30): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "pre": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "pre"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><pre></pre></body></html>",
+        "noQuirksBodyHtml": "<pre></pre>"
+      }
+    },
+    {
+      "data": "<!doctype html><listing><frameset>",
+      "errors": [
+        "(1,34): unexpected-start-tag",
+        "(1,34): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "listing": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "listing"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><listing></listing></body></html>",
+        "noQuirksBodyHtml": "<listing></listing>"
+      }
+    },
+    {
+      "data": "<!doctype html><li><frameset>",
+      "errors": [
+        "(1,29): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "li": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "li"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><li></li></body></html>",
+        "noQuirksBodyHtml": "<li></li>"
+      }
+    },
+    {
+      "data": "<!doctype html><dd><frameset>",
+      "errors": [
+        "(1,29): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "dd": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "dd"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><dd></dd></body></html>",
+        "noQuirksBodyHtml": "<dd></dd>"
+      }
+    },
+    {
+      "data": "<!doctype html><dt><frameset>",
+      "errors": [
+        "(1,29): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "dt": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "dt"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><dt></dt></body></html>",
+        "noQuirksBodyHtml": "<dt></dt>"
+      }
+    },
+    {
+      "data": "<!doctype html><button><frameset>",
+      "errors": [
+        "(1,33): unexpected-start-tag",
+        "(1,33): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "button": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "button"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><button></button></body></html>",
+        "noQuirksBodyHtml": "<button></button>"
+      }
+    },
+    {
+      "data": "<!doctype html><applet><frameset>",
+      "errors": [
+        "(1,33): unexpected-start-tag",
+        "(1,33): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "applet": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "applet"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><applet></applet></body></html>",
+        "noQuirksBodyHtml": "<applet></applet>"
+      }
+    },
+    {
+      "data": "<!doctype html><marquee><frameset>",
+      "errors": [
+        "(1,34): unexpected-start-tag",
+        "(1,34): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "marquee": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "marquee"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><marquee></marquee></body></html>",
+        "noQuirksBodyHtml": "<marquee></marquee>"
+      }
+    },
+    {
+      "data": "<!doctype html><object><frameset>",
+      "errors": [
+        "(1,33): unexpected-start-tag",
+        "(1,33): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "object": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "object"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><object></object></body></html>",
+        "noQuirksBodyHtml": "<object></object>"
+      }
+    },
+    {
+      "data": "<!doctype html><table><frameset>",
+      "errors": [
+        "(1,32): unexpected-start-tag-implies-table-voodoo",
+        "(1,32): unexpected-start-tag",
+        "(1,32): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table></table></body></html>",
+        "noQuirksBodyHtml": "<table></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><area><frameset>",
+      "errors": [
+        "(1,31): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "area": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "area"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><area></body></html>",
+        "noQuirksBodyHtml": "<area>"
+      }
+    },
+    {
+      "data": "<!doctype html><basefont><frameset>",
+      "errors": [
+        "(1,35): eof-in-frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "basefont": true,
+            "frameset": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "basefont"
+                  }
+                ]
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><basefont></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "<basefont>"
+      }
+    },
+    {
+      "data": "<!doctype html><bgsound><frameset>",
+      "errors": [
+        "(1,34): eof-in-frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "bgsound": true,
+            "frameset": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "bgsound"
+                  }
+                ]
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><bgsound></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "<bgsound>"
+      }
+    },
+    {
+      "data": "<!doctype html><br><frameset>",
+      "errors": [
+        "(1,29): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "br": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "br"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><br></body></html>",
+        "noQuirksBodyHtml": "<br>"
+      }
+    },
+    {
+      "data": "<!doctype html><embed><frameset>",
+      "errors": [
+        "(1,32): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "embed": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "embed"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><embed></body></html>",
+        "noQuirksBodyHtml": "<embed>"
+      }
+    },
+    {
+      "data": "<!doctype html><img><frameset>",
+      "errors": [
+        "(1,30): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "img": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "img"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><img></body></html>",
+        "noQuirksBodyHtml": "<img>"
+      }
+    },
+    {
+      "data": "<!doctype html><input><frameset>",
+      "errors": [
+        "(1,32): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "input": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "input"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><input></body></html>",
+        "noQuirksBodyHtml": "<input>"
+      }
+    },
+    {
+      "data": "<!doctype html><keygen><frameset>",
+      "errors": [
+        "(1,33): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "keygen": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "keygen"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><keygen></body></html>",
+        "noQuirksBodyHtml": "<keygen>"
+      }
+    },
+    {
+      "data": "<!doctype html><wbr><frameset>",
+      "errors": [
+        "(1,30): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "wbr": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "wbr"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><wbr></body></html>",
+        "noQuirksBodyHtml": "<wbr>"
+      }
+    },
+    {
+      "data": "<!doctype html><hr><frameset>",
+      "errors": [
+        "(1,29): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "hr": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "hr"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><hr></body></html>",
+        "noQuirksBodyHtml": "<hr>"
+      }
+    },
+    {
+      "data": "<!doctype html><textarea></textarea><frameset>",
+      "errors": [
+        "(1,46): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "textarea": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "textarea"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><textarea></textarea></body></html>",
+        "noQuirksBodyHtml": "<textarea></textarea>"
+      }
+    },
+    {
+      "data": "<!doctype html><xmp></xmp><frameset>",
+      "errors": [
+        "(1,36): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "xmp": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "xmp"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><xmp></xmp></body></html>",
+        "noQuirksBodyHtml": "<xmp></xmp>"
+      }
+    },
+    {
+      "data": "<!doctype html><iframe></iframe><frameset>",
+      "errors": [
+        "(1,42): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "iframe": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "iframe"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><iframe></iframe></body></html>",
+        "noQuirksBodyHtml": "<iframe></iframe>"
+      }
+    },
+    {
+      "data": "<!doctype html><select></select><frameset>",
+      "errors": [
+        "(1,42): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select></select></body></html>",
+        "noQuirksBodyHtml": "<select></select>"
+      }
+    },
+    {
+      "data": "<!doctype html><svg></svg><frameset><frame>",
+      "errors": [
+        "(1,36): unexpected-start-tag",
+        "(1,43): eof-in-frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true,
+            "frame": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset",
+                "children": [
+                  {
+                    "tag": "frame"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset><frame></frameset></html>",
+        "noQuirksBodyHtml": "<svg></svg>"
+      }
+    },
+    {
+      "data": "<!doctype html><math></math><frameset><frame>",
+      "errors": [
+        "(1,38): unexpected-start-tag",
+        "(1,45): eof-in-frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true,
+            "frame": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset",
+                "children": [
+                  {
+                    "tag": "frame"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset><frame></frameset></html>",
+        "noQuirksBodyHtml": "<math></math>"
+      }
+    },
+    {
+      "data": "<!doctype html><svg><foreignObject><div> <frameset><frame>",
+      "errors": [
+        "(1,51): unexpected-start-tag",
+        "(1,58): eof-in-frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true,
+            "frame": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset",
+                "children": [
+                  {
+                    "tag": "frame"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset><frame></frameset></html>",
+        "noQuirksBodyHtml": "<svg><foreignObject><div> </div></foreignObject></svg>"
+      }
+    },
+    {
+      "data": "<!doctype html><svg>a</svg><frameset><frame>",
+      "errors": [
+        "(1,37): unexpected-start-tag",
+        "(1,44): unexpected-start-tag-ignored"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "a"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg>a</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>a</svg>"
+      }
+    },
+    {
+      "data": "<!doctype html><svg> </svg><frameset><frame>",
+      "errors": [
+        "(1,37): unexpected-start-tag",
+        "(1,44): eof-in-frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true,
+            "frame": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset",
+                "children": [
+                  {
+                    "tag": "frame"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset><frame></frameset></html>",
+        "noQuirksBodyHtml": "<svg> </svg>"
+      }
+    },
+    {
+      "data": "<html>aaa<frameset></frameset>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,19): unexpected-start-tag",
+        "(1,30): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "aaa"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>aaa</body></html>",
+        "noQuirksBodyHtml": "aaa"
+      }
+    },
+    {
+      "data": "<html> a <frameset></frameset>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,19): unexpected-start-tag",
+        "(1,30): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "a "
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>a </body></html>",
+        "noQuirksBodyHtml": " a "
+      }
+    },
+    {
+      "data": "<!doctype html><div><frameset>",
+      "errors": [
+        "(1,30): unexpected-start-tag",
+        "(1,30): eof-in-frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "<div></div>"
+      }
+    },
+    {
+      "data": "<!doctype html><div><body><frameset>",
+      "errors": [
+        "(1,26): unexpected-start-tag",
+        "(1,36): unexpected-start-tag",
+        "(1,36): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><div></div></body></html>",
+        "noQuirksBodyHtml": "<div></div>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><math></p>a",
+      "errors": [
+        "(1,28): unexpected-end-tag",
+        "(1,28): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "math math": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "math",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      }
+                    ]
+                  },
+                  {
+                    "text": "a"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><math></math></p>a</body></html>",
+        "noQuirksBodyHtml": "<p><math></math></p>a"
+      }
+    },
+    {
+      "data": "<!doctype html><p><math><mn><span></p>a",
+      "errors": [
+        "(1,38): unexpected-end-tag",
+        "(1,39): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "math math": true,
+            "math mn": true,
+            "span": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "math",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "mn",
+                            "ns": "http://www.w3.org/1998/Math/MathML",
+                            "children": [
+                              {
+                                "tag": "span",
+                                "children": [
+                                  {
+                                    "tag": "p"
+                                  },
+                                  {
+                                    "text": "a"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><math><mn><span><p></p>a</span></mn></math></p></body></html>",
+        "noQuirksBodyHtml": "<p><math><mn><span><p></p>a</span></mn></math></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><math></html>",
+      "errors": [
+        "(1,28): unexpected-end-tag",
+        "(1,28): expected-one-end-tag-but-got-another",
+        "(1,28): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math></math></body></html>",
+        "noQuirksBodyHtml": "<math></math>"
+      }
+    },
+    {
+      "data": "<!doctype html><meta charset=\"ascii\">",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "meta": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "meta",
+                    "attrs": [
+                      {
+                        "name": "charset",
+                        "value": "ascii"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><meta charset=\"ascii\"></head><body></body></html>",
+        "noQuirksBodyHtml": "<meta charset=\"ascii\">"
+      }
+    },
+    {
+      "data": "<!doctype html><meta http-equiv=\"content-type\" content=\"text/html;charset=ascii\">",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "meta": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "meta",
+                    "attrs": [
+                      {
+                        "name": "content",
+                        "value": "text/html;charset=ascii"
+                      },
+                      {
+                        "name": "http-equiv",
+                        "value": "content-type"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><meta http-equiv=\"content-type\" content=\"text/html;charset=ascii\"></head><body></body></html>",
+        "noQuirksBodyHtml": "<meta http-equiv=\"content-type\" content=\"text/html;charset=ascii\">"
+      }
+    },
+    {
+      "data": "<!doctype html><head><!--aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--><meta charset=\"utf8\">",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "meta": true,
+            "body": true
+          },
+          "doctype": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "comment": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+                  },
+                  {
+                    "tag": "meta",
+                    "attrs": [
+                      {
+                        "name": "charset",
+                        "value": "utf8"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><!--aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--><meta charset=\"utf8\"></head><body></body></html>",
+        "noQuirksBodyHtml": "<!--aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa--><meta charset=\"utf8\">"
+      }
+    },
+    {
+      "data": "<!doctype html><html a=b><head></head><html c=d>",
+      "errors": [
+        "(1,48): non-html-root"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "attrs": [
+              {
+                "name": "a",
+                "value": "b"
+              },
+              {
+                "name": "c",
+                "value": "d"
+              }
+            ],
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html a=\"b\" c=\"d\"><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<!doctype html><image/>",
+      "errors": [
+        "(1,23): image-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "img": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "img"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><img></body></html>",
+        "noQuirksBodyHtml": "<img>"
+      }
+    },
+    {
+      "data": "<!doctype html>a<i>b<table>c<b>d</i>e</b>f",
+      "errors": [
+        "(1,28): foster-parenting-character",
+        "(1,31): foster-parenting-start-tag",
+        "(1,32): foster-parenting-character",
+        "(1,36): foster-parenting-end-tag",
+        "(1,36): adoption-agency-1.3",
+        "(1,37): foster-parenting-character",
+        "(1,41): foster-parenting-end-tag",
+        "(1,42): foster-parenting-character",
+        "(1,42): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "i": true,
+            "b": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "a"
+                  },
+                  {
+                    "tag": "i",
+                    "children": [
+                      {
+                        "text": "bc"
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": "de"
+                          }
+                        ]
+                      },
+                      {
+                        "text": "f"
+                      },
+                      {
+                        "tag": "table"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>a<i>bc<b>de</b>f<table></table></i></body></html>",
+        "noQuirksBodyHtml": "a<i>bc<b>de</b>f<table></table></i>"
+      }
+    },
+    {
+      "data": "<!doctype html><table><i>a<b>b<div>c<a>d</i>e</b>f",
+      "errors": [
+        "(1,25): foster-parenting-start-tag",
+        "(1,26): foster-parenting-character",
+        "(1,29): foster-parenting-start-tag",
+        "(1,30): foster-parenting-character",
+        "(1,35): foster-parenting-start-tag",
+        "(1,36): foster-parenting-character",
+        "(1,39): foster-parenting-start-tag",
+        "(1,40): foster-parenting-character",
+        "(1,44): foster-parenting-end-tag",
+        "(1,44): adoption-agency-1.3",
+        "(1,44): adoption-agency-1.3",
+        "(1,45): foster-parenting-character",
+        "(1,49): foster-parenting-end-tag",
+        "(1,49): adoption-agency-1.3",
+        "(1,49): adoption-agency-1.3",
+        "(1,50): foster-parenting-character",
+        "(1,50): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "i": true,
+            "b": true,
+            "div": true,
+            "a": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "i",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "b"
+                  },
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "text": "c"
+                              },
+                              {
+                                "tag": "a",
+                                "children": [
+                                  {
+                                    "text": "d"
+                                  }
+                                ]
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "a",
+                            "children": [
+                              {
+                                "text": "e"
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "a",
+                        "children": [
+                          {
+                            "text": "f"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><i>a<b>b</b></i><b></b><div><b><i>c<a>d</a></i><a>e</a></b><a>f</a></div><table></table></body></html>",
+        "noQuirksBodyHtml": "<i>a<b>b</b></i><b></b><div><b><i>c<a>d</a></i><a>e</a></b><a>f</a></div><table></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><i>a<b>b<div>c<a>d</i>e</b>f",
+      "errors": [
+        "(1,37): adoption-agency-1.3",
+        "(1,37): adoption-agency-1.3",
+        "(1,42): adoption-agency-1.3",
+        "(1,42): adoption-agency-1.3",
+        "(1,43): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "i": true,
+            "b": true,
+            "div": true,
+            "a": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "i",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "b"
+                  },
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "text": "c"
+                              },
+                              {
+                                "tag": "a",
+                                "children": [
+                                  {
+                                    "text": "d"
+                                  }
+                                ]
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "a",
+                            "children": [
+                              {
+                                "text": "e"
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "a",
+                        "children": [
+                          {
+                            "text": "f"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><i>a<b>b</b></i><b></b><div><b><i>c<a>d</a></i><a>e</a></b><a>f</a></div></body></html>",
+        "noQuirksBodyHtml": "<i>a<b>b</b></i><b></b><div><b><i>c<a>d</a></i><a>e</a></b><a>f</a></div>"
+      }
+    },
+    {
+      "data": "<!doctype html><table><i>a<b>b<div>c</i>",
+      "errors": [
+        "(1,25): foster-parenting-start-tag",
+        "(1,26): foster-parenting-character",
+        "(1,29): foster-parenting-start-tag",
+        "(1,30): foster-parenting-character",
+        "(1,35): foster-parenting-start-tag",
+        "(1,36): foster-parenting-character",
+        "(1,40): foster-parenting-end-tag",
+        "(1,40): adoption-agency-1.3",
+        "(1,40): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "i": true,
+            "b": true,
+            "div": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "i",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "div",
+                        "children": [
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "text": "c"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><i>a<b>b</b></i><b><div><i>c</i></div></b><table></table></body></html>",
+        "noQuirksBodyHtml": "<i>a<b>b</b></i><b><div><i>c</i></div></b><table></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><table><i>a<b>b<div>c<a>d</i>e</b>f",
+      "errors": [
+        "(1,25): foster-parenting-start-tag",
+        "(1,26): foster-parenting-character",
+        "(1,29): foster-parenting-start-tag",
+        "(1,30): foster-parenting-character",
+        "(1,35): foster-parenting-start-tag",
+        "(1,36): foster-parenting-character",
+        "(1,39): foster-parenting-start-tag",
+        "(1,40): foster-parenting-character",
+        "(1,44): foster-parenting-end-tag",
+        "(1,44): adoption-agency-1.3",
+        "(1,44): adoption-agency-1.3",
+        "(1,45): foster-parenting-character",
+        "(1,49): foster-parenting-end-tag",
+        "(1,44): adoption-agency-1.3",
+        "(1,44): adoption-agency-1.3",
+        "(1,50): foster-parenting-character",
+        "(1,50): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "i": true,
+            "b": true,
+            "div": true,
+            "a": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "i",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "b"
+                  },
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "text": "c"
+                              },
+                              {
+                                "tag": "a",
+                                "children": [
+                                  {
+                                    "text": "d"
+                                  }
+                                ]
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "a",
+                            "children": [
+                              {
+                                "text": "e"
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "a",
+                        "children": [
+                          {
+                            "text": "f"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><i>a<b>b</b></i><b></b><div><b><i>c<a>d</a></i><a>e</a></b><a>f</a></div><table></table></body></html>",
+        "noQuirksBodyHtml": "<i>a<b>b</b></i><b></b><div><b><i>c<a>d</a></i><a>e</a></b><a>f</a></div><table></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><table><i>a<div>b<tr>c<b>d</i>e",
+      "errors": [
+        "(1,25): foster-parenting-start-tag",
+        "(1,26): foster-parenting-character",
+        "(1,31): foster-parenting-start-tag",
+        "(1,32): foster-parenting-character",
+        "(1,37): foster-parenting-character",
+        "(1,40): foster-parenting-start-tag",
+        "(1,41): foster-parenting-character",
+        "(1,45): foster-parenting-end-tag",
+        "(1,45): adoption-agency-1.3",
+        "(1,46): foster-parenting-character",
+        "(1,46): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "i": true,
+            "div": true,
+            "b": true,
+            "table": true,
+            "tbody": true,
+            "tr": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "i",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "div",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "i",
+                    "children": [
+                      {
+                        "text": "c"
+                      },
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": "d"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "text": "e"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><i>a<div>b</div></i><i>c<b>d</b></i><b>e</b><table><tbody><tr></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<i>a<div>b</div></i><i>c<b>d</b></i><b>e</b><table><tbody><tr></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><table><td><table><i>a<div>b<b>c</i>d",
+      "errors": [
+        "(1,26): unexpected-cell-in-table-body",
+        "(1,36): foster-parenting-start-tag",
+        "(1,37): foster-parenting-character",
+        "(1,42): foster-parenting-start-tag",
+        "(1,43): foster-parenting-character",
+        "(1,46): foster-parenting-start-tag",
+        "(1,47): foster-parenting-character",
+        "(1,51): foster-parenting-end-tag",
+        "(1,51): adoption-agency-1.3",
+        "(1,51): adoption-agency-1.3",
+        "(1,52): foster-parenting-character",
+        "(1,52): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "i": true,
+            "div": true,
+            "b": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "i",
+                                    "children": [
+                                      {
+                                        "text": "a"
+                                      }
+                                    ]
+                                  },
+                                  {
+                                    "tag": "div",
+                                    "children": [
+                                      {
+                                        "tag": "i",
+                                        "children": [
+                                          {
+                                            "text": "b"
+                                          },
+                                          {
+                                            "tag": "b",
+                                            "children": [
+                                              {
+                                                "text": "c"
+                                              }
+                                            ]
+                                          }
+                                        ]
+                                      },
+                                      {
+                                        "tag": "b",
+                                        "children": [
+                                          {
+                                            "text": "d"
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  },
+                                  {
+                                    "tag": "table"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><i>a</i><div><i>b<b>c</b></i><b>d</b></div><table></table></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><i>a</i><div><i>b<b>c</b></i><b>d</b></div><table></table></td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><body><bgsound>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "bgsound": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "bgsound"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><bgsound></body></html>",
+        "noQuirksBodyHtml": "<bgsound>"
+      }
+    },
+    {
+      "data": "<!doctype html><body><basefont>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "basefont": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "basefont"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><basefont></body></html>",
+        "noQuirksBodyHtml": "<basefont>"
+      }
+    },
+    {
+      "data": "<!doctype html><a><b></a><basefont>",
+      "errors": [
+        "(1,25): adoption-agency-1.3"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "b": true,
+            "basefont": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "tag": "b"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "basefont"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><a><b></b></a><basefont></body></html>",
+        "noQuirksBodyHtml": "<a><b></b></a><basefont>"
+      }
+    },
+    {
+      "data": "<!doctype html><a><b></a><bgsound>",
+      "errors": [
+        "(1,25): adoption-agency-1.3"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "b": true,
+            "bgsound": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "tag": "b"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "bgsound"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><a><b></b></a><bgsound></body></html>",
+        "noQuirksBodyHtml": "<a><b></b></a><bgsound>"
+      }
+    },
+    {
+      "data": "<!doctype html><figcaption><article></figcaption>a",
+      "errors": [
+        "(1,49): end-tag-too-early"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "figcaption": true,
+            "article": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "figcaption",
+                    "children": [
+                      {
+                        "tag": "article"
+                      }
+                    ]
+                  },
+                  {
+                    "text": "a"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><figcaption><article></article></figcaption>a</body></html>",
+        "noQuirksBodyHtml": "<figcaption><article></article></figcaption>a"
+      }
+    },
+    {
+      "data": "<!doctype html><summary><article></summary>a",
+      "errors": [
+        "(1,43): end-tag-too-early"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "summary": true,
+            "article": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "summary",
+                    "children": [
+                      {
+                        "tag": "article"
+                      }
+                    ]
+                  },
+                  {
+                    "text": "a"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><summary><article></article></summary>a</body></html>",
+        "noQuirksBodyHtml": "<summary><article></article></summary>a"
+      }
+    },
+    {
+      "data": "<!doctype html><p><a><plaintext>b",
+      "errors": [
+        "(1,32): unexpected-end-tag",
+        "(1,33): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "a": true,
+            "plaintext": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "a"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "plaintext",
+                    "children": [
+                      {
+                        "tag": "a",
+                        "children": [
+                          {
+                            "text": "b"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><a></a></p><plaintext><a>b</a></plaintext></body></html>",
+        "noQuirksBodyHtml": "<p><a></a></p><plaintext><a>b</a></plaintext>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><div>a<a></div>b<p>c</p>d",
+      "errors": [
+        "(1,30): end-tag-too-early",
+        "(1,40): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "a": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "a"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "text": "b"
+                      },
+                      {
+                        "tag": "p",
+                        "children": [
+                          {
+                            "text": "c"
+                          }
+                        ]
+                      },
+                      {
+                        "text": "d"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><div>a<a></a></div><a>b<p>c</p>d</a></body></html>",
+        "noQuirksBodyHtml": "<div>a<a></a></div><a>b<p>c</p>d</a>"
+      }
+    }
+  ],
+  "tests2.dat": [
+    {
+      "data": "<!DOCTYPE html>Test",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Test"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>Test</body></html>",
+        "noQuirksBodyHtml": "Test"
+      }
+    },
+    {
+      "data": "<textarea>test</div>test",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag",
+        "(1,24): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "textarea": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "textarea",
+                    "children": [
+                      {
+                        "text": "test</div>test",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><textarea>test&lt;/div&gt;test</textarea></body></html>",
+        "noQuirksBodyHtml": "<textarea>test&lt;/div&gt;test</textarea>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><tr><td></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td></td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<table><td>test</tbody></table>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,11): unexpected-cell-in-table-body"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "text": "test"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><tr><td>test</td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td>test</td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<frame>test",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,7): unexpected-start-tag-ignored"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "test"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>test</body></html>",
+        "noQuirksBodyHtml": "test"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><frameset>test",
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "test"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset",
+                "children": [
+                  {
+                    "text": "  "
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset>  </frameset></html>",
+        "noQuirksBodyHtml": " te st"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              },
+              {
+                "text": "  "
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset></frameset>  </html>",
+        "noQuirksBodyHtml": " te st"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><frameset><!DOCTYPE html>",
+      "errors": [
+        "(1,40): unexpected-doctype",
+        "(1,40): eof-in-frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><font><p><b>test</font>",
+      "errors": [
+        "(1,38): adoption-agency-1.3",
+        "(1,38): adoption-agency-1.3"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "font": true,
+            "p": true,
+            "b": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "font"
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "font",
+                        "children": [
+                          {
+                            "tag": "b",
+                            "children": [
+                              {
+                                "text": "test"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><font></font><p><font><b>test</b></font></p></body></html>",
+        "noQuirksBodyHtml": "<font></font><p><font><b>test</b></font></p>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><dt><div><dd>",
+      "errors": [
+        "(1,28): end-tag-too-early"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "dt": true,
+            "div": true,
+            "dd": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "dt",
+                    "children": [
+                      {
+                        "tag": "div"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "dd"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><dt><div></div></dt><dd></dd></body></html>",
+        "noQuirksBodyHtml": "<dt><div></div></dt><dd></dd>"
+      }
+    },
+    {
+      "data": "<script></x",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,11): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "</x",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script></x</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></x</script>"
+      }
+    },
+    {
+      "data": "<table><plaintext><td>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "plaintext": true,
+            "table": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "plaintext",
+                    "children": [
+                      {
+                        "text": "<td>",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><plaintext><td></plaintext><table></table></body></html>",
+        "noQuirksBodyHtml": "<plaintext><td></plaintext><table></table>"
+      }
+    },
+    {
+      "data": "<plaintext></plaintext>",
+      "errors": [
+        "(1,11): expected-doctype-but-got-start-tag",
+        "(1,23): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "plaintext": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "plaintext",
+                    "children": [
+                      {
+                        "text": "</plaintext>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><plaintext></plaintext></plaintext></body></html>",
+        "noQuirksBodyHtml": "<plaintext></plaintext></plaintext>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><table><tr>TEST",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "TEST"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>TEST<table><tbody><tr></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "TEST<table><tbody><tr></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body t1=1><body t2=2><body t3=3 t4=4>",
+      "errors": [
+        "(1,37): unexpected-start-tag",
+        "(1,53): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "attrs": [
+                  {
+                    "name": "t1",
+                    "value": "1"
+                  },
+                  {
+                    "name": "t2",
+                    "value": "2"
+                  },
+                  {
+                    "name": "t3",
+                    "value": "3"
+                  },
+                  {
+                    "name": "t4",
+                    "value": "4"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body t1=\"1\" t2=\"2\" t3=\"3\" t4=\"4\"></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "</b test",
+      "errors": [
+        "(1,8): eof-in-attribute-name",
+        "(1,8): expected-doctype-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<!DOCTYPE html></b test<b &=&amp>X",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "X"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>X</body></html>",
+        "noQuirksBodyHtml": "X"
+      }
+    },
+    {
+      "data": "<!doctypehtml><scrIPt type=text/x-foobar;baz>X</SCRipt",
+      "errors": [
+        "(1,9): need-space-after-doctype",
+        "(1,54): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "text/x-foobar;baz"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "X</SCRipt",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script type=\"text/x-foobar;baz\">X</SCRipt</script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script type=\"text/x-foobar;baz\">X</SCRipt</script>"
+      }
+    },
+    {
+      "data": "&",
+      "errors": [
+        "(1,1): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "&",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>&amp;</body></html>",
+        "noQuirksBodyHtml": "&amp;"
+      }
+    },
+    {
+      "data": "&#",
+      "errors": [
+        "(1,2): expected-numeric-entity",
+        "(1,2): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "&#",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>&amp;#</body></html>",
+        "noQuirksBodyHtml": "&amp;#"
+      }
+    },
+    {
+      "data": "&#X",
+      "errors": [
+        "(1,3): expected-numeric-entity",
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "&#X",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>&amp;#X</body></html>",
+        "noQuirksBodyHtml": "&amp;#X"
+      }
+    },
+    {
+      "data": "&#x",
+      "errors": [
+        "(1,3): expected-numeric-entity",
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "&#x",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>&amp;#x</body></html>",
+        "noQuirksBodyHtml": "&amp;#x"
+      }
+    },
+    {
+      "data": "&#45",
+      "errors": [
+        "(1,4): numeric-entity-without-semicolon",
+        "(1,4): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "-"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>-</body></html>",
+        "noQuirksBodyHtml": "-"
+      }
+    },
+    {
+      "data": "&x-test",
+      "errors": [
+        "(1,2): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "&x-test",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>&amp;x-test</body></html>",
+        "noQuirksBodyHtml": "&amp;x-test"
+      }
+    },
+    {
+      "data": "<!doctypehtml><p><li>",
+      "errors": [
+        "(1,9): need-space-after-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "li": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p"
+                  },
+                  {
+                    "tag": "li"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p></p><li></li></body></html>",
+        "noQuirksBodyHtml": "<p></p><li></li>"
+      }
+    },
+    {
+      "data": "<!doctypehtml><p><dt>",
+      "errors": [
+        "(1,9): need-space-after-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "dt": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p"
+                  },
+                  {
+                    "tag": "dt"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p></p><dt></dt></body></html>",
+        "noQuirksBodyHtml": "<p></p><dt></dt>"
+      }
+    },
+    {
+      "data": "<!doctypehtml><p><dd>",
+      "errors": [
+        "(1,9): need-space-after-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "dd": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p"
+                  },
+                  {
+                    "tag": "dd"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p></p><dd></dd></body></html>",
+        "noQuirksBodyHtml": "<p></p><dd></dd>"
+      }
+    },
+    {
+      "data": "<!doctypehtml><p><form>",
+      "errors": [
+        "(1,9): need-space-after-doctype",
+        "(1,23): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "form": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p"
+                  },
+                  {
+                    "tag": "form"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p></p><form></form></body></html>",
+        "noQuirksBodyHtml": "<p></p><form></form>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><p></P>X",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p"
+                  },
+                  {
+                    "text": "X"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p></p>X</body></html>",
+        "noQuirksBodyHtml": "<p></p>X"
+      }
+    },
+    {
+      "data": "&AMP",
+      "errors": [
+        "(1,4): named-entity-without-semicolon",
+        "(1,4): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "&",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>&amp;</body></html>",
+        "noQuirksBodyHtml": "&amp;"
+      }
+    },
+    {
+      "data": "&AMp;",
+      "errors": [
+        "(1,3): expected-named-entity",
+        "(1,3): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "&AMp;",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>&amp;AMp;</body></html>",
+        "noQuirksBodyHtml": "&amp;AMp;"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><html><head></head><body><thisISasillyTESTelementNameToMakeSureCrazyTagNamesArePARSEDcorrectLY>",
+      "errors": [
+        "(1,110): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "thisisasillytestelementnametomakesurecrazytagnamesareparsedcorrectly": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "thisisasillytestelementnametomakesurecrazytagnamesareparsedcorrectly"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><thisisasillytestelementnametomakesurecrazytagnamesareparsedcorrectly></thisisasillytestelementnametomakesurecrazytagnamesareparsedcorrectly></body></html>",
+        "noQuirksBodyHtml": "<thisisasillytestelementnametomakesurecrazytagnamesareparsedcorrectly></thisisasillytestelementnametomakesurecrazytagnamesareparsedcorrectly>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html>X</body>X",
+      "errors": [
+        "(1,24): unexpected-char-after-body"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "XX"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>XX</body></html>",
+        "noQuirksBodyHtml": "XX"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><!-- X",
+      "errors": [
+        "(1,21): eof-in-comment"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "comment": " X"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><!-- X--><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!-- X-->"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><table><caption>test TEST</caption><td>test",
+      "errors": [
+        "(1,54): unexpected-cell-in-table-body",
+        "(1,58): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "caption": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "caption",
+                        "children": [
+                          {
+                            "text": "test TEST"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "text": "test"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><caption>test TEST</caption><tbody><tr><td>test</td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><caption>test TEST</caption><tbody><tr><td>test</td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><select><option><optgroup>",
+      "errors": [
+        "(1,41): eof-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "option": true,
+            "optgroup": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "option"
+                      },
+                      {
+                        "tag": "optgroup"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select><option></option><optgroup></optgroup></select></body></html>",
+        "noQuirksBodyHtml": "<select><option></option><optgroup></optgroup></select>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><select><optgroup><option></optgroup><option><select><option>",
+      "errors": [
+        "(1,68): unexpected-select-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "optgroup": true,
+            "option": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "optgroup",
+                        "children": [
+                          {
+                            "tag": "option"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "option"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "option"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select><optgroup><option></option></optgroup><option></option></select><option></option></body></html>",
+        "noQuirksBodyHtml": "<select><optgroup><option></option></optgroup><option></option></select><option></option>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><select><optgroup><option><optgroup>",
+      "errors": [
+        "(1,51): eof-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "optgroup": true,
+            "option": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "optgroup",
+                        "children": [
+                          {
+                            "tag": "option"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "optgroup"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select><optgroup><option></option></optgroup><optgroup></optgroup></select></body></html>",
+        "noQuirksBodyHtml": "<select><optgroup><option></option></optgroup><optgroup></optgroup></select>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><datalist><option>foo</datalist>bar",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "datalist": true,
+            "option": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "datalist",
+                    "children": [
+                      {
+                        "tag": "option",
+                        "children": [
+                          {
+                            "text": "foo"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "text": "bar"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><datalist><option>foo</option></datalist>bar</body></html>",
+        "noQuirksBodyHtml": "<datalist><option>foo</option></datalist>bar"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><font><input><input></font>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "font": true,
+            "input": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "font",
+                    "children": [
+                      {
+                        "tag": "input"
+                      },
+                      {
+                        "tag": "input"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><font><input><input></font></body></html>",
+        "noQuirksBodyHtml": "<font><input><input></font>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><!-- XXX - XXX -->",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "comment": " XXX - XXX "
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><!-- XXX - XXX --><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!-- XXX - XXX -->"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><!-- XXX - XXX",
+      "errors": [
+        "(1,29): eof-in-comment"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "comment": " XXX - XXX"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><!-- XXX - XXX--><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!-- XXX - XXX-->"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><!-- XXX - XXX - XXX -->",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "comment": " XXX - XXX - XXX "
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><!-- XXX - XXX - XXX --><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!-- XXX - XXX - XXX -->"
+      }
+    },
+    {
+      "data": "test\ntest",
+      "errors": [
+        "(2,4): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "test\ntest"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>test\ntest</body></html>",
+        "noQuirksBodyHtml": "test\ntest"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><title>test</body></title>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "title": true
+          },
+          "doctype": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "test</body>",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><title>test&lt;/body&gt;</title></body></html>",
+        "noQuirksBodyHtml": "<title>test&lt;/body&gt;</title>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><title>X</title><meta name=z><link rel=foo><style>\nx { content:\"</style\" } </style>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "title": true,
+            "meta": true,
+            "link": true,
+            "style": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "X"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "meta",
+                    "attrs": [
+                      {
+                        "name": "name",
+                        "value": "z"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "link",
+                    "attrs": [
+                      {
+                        "name": "rel",
+                        "value": "foo"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": "\nx { content:\"</style\" } ",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><title>X</title><meta name=\"z\"><link rel=\"foo\"><style>\nx { content:\"</style\" } </style></body></html>",
+        "noQuirksBodyHtml": "<title>X</title><meta name=\"z\"><link rel=\"foo\"><style>\nx { content:\"</style\" } </style>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><select><optgroup></optgroup></select>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "optgroup": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "optgroup"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select><optgroup></optgroup></select></body></html>",
+        "noQuirksBodyHtml": "<select><optgroup></optgroup></select>"
+      }
+    },
+    {
+      "data": " \n ",
+      "errors": [
+        "(2,1): expected-doctype-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": " \n "
+      }
+    },
+    {
+      "data": "<!DOCTYPE html>  <html>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "  "
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><script>\n</script>  <title>x</title>  </head>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "title": true,
+            "body": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "\n",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "  "
+                  },
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "x"
+                      }
+                    ]
+                  },
+                  {
+                    "text": "  "
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><script>\n</script>  <title>x</title>  </head><body></body></html>",
+        "noQuirksBodyHtml": "<script>\n</script>  <title>x</title>  "
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><html><body><html id=x>",
+      "errors": [
+        "(1,38): non-html-root"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "attrs": [
+              {
+                "name": "id",
+                "value": "x"
+              }
+            ],
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html id=\"x\"><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<!DOCTYPE html>X</body><html id=\"x\">",
+      "errors": [
+        "(1,36): non-html-root"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "attrs": [
+              {
+                "name": "id",
+                "value": "x"
+              }
+            ],
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "X"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html id=\"x\"><head></head><body>X</body></html>",
+        "noQuirksBodyHtml": "X"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><head><html id=x>",
+      "errors": [
+        "(1,32): non-html-root"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "attrs": [
+              {
+                "name": "id",
+                "value": "x"
+              }
+            ],
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html id=\"x\"><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<!DOCTYPE html>X</html>X",
+      "errors": [
+        "(1,24): expected-eof-but-got-char"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "XX"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>XX</body></html>",
+        "noQuirksBodyHtml": "XX"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html>X</html> ",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "X "
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>X </body></html>",
+        "noQuirksBodyHtml": "X "
+      }
+    },
+    {
+      "data": "<!DOCTYPE html>X</html><p>X",
+      "errors": [
+        "(1,26): expected-eof-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "X"
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "X"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>X<p>X</p></body></html>",
+        "noQuirksBodyHtml": "X<p>X</p>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html>X<p/x/y/z>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "X"
+                  },
+                  {
+                    "tag": "p",
+                    "attrs": [
+                      {
+                        "name": "x",
+                        "value": ""
+                      },
+                      {
+                        "name": "y",
+                        "value": ""
+                      },
+                      {
+                        "name": "z",
+                        "value": ""
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>X<p x=\"\" y=\"\" z=\"\"></p></body></html>",
+        "noQuirksBodyHtml": "X<p x=\"\" y=\"\" z=\"\"></p>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><!--x--",
+      "errors": [
+        "(1,22): eof-in-comment-double-dash"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "comment": "x"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><!--x--><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!--x-->"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><table><tr><td></p></table>",
+      "errors": [
+        "(1,34): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "p"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><p></p></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><p></p></td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE <!DOCTYPE HTML>><!--<!--x-->-->",
+      "errors": [
+        "(1,20): expected-space-or-right-bracket-in-doctype",
+        "(1,25): unknown-doctype",
+        "(1,35): unexpected-char-in-comment"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true,
+          "escaped": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "<!doctype"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": ">",
+                    "escaped": true
+                  },
+                  {
+                    "comment": "<!--x"
+                  },
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE <!doctype><html><head></head><body>&gt;<!--<!--x-->--&gt;</body></html>",
+        "noQuirksBodyHtml": "&gt;<!--<!--x-->--&gt;"
+      }
+    },
+    {
+      "data": "<!doctype html><div><form></form><div></div></div>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "form": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "form"
+                      },
+                      {
+                        "tag": "div"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><div><form></form><div></div></div></body></html>",
+        "noQuirksBodyHtml": "<div><form></form><div></div></div>"
+      }
+    }
+  ],
+  "tests20.dat": [
+    {
+      "data": "<!doctype html><p><button><button>",
+      "errors": [
+        "(1,34): unexpected-start-tag-implies-end-tag",
+        "(1,34): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "button": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "button"
+                      },
+                      {
+                        "tag": "button"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><button></button><button></button></p></body></html>",
+        "noQuirksBodyHtml": "<p><button></button><button></button></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><button><address>",
+      "errors": [
+        "(1,35): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "button": true,
+            "address": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "button",
+                        "children": [
+                          {
+                            "tag": "address"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><button><address></address></button></p></body></html>",
+        "noQuirksBodyHtml": "<p><button><address></address></button></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><button><blockquote>",
+      "errors": [
+        "(1,38): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "button": true,
+            "blockquote": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "button",
+                        "children": [
+                          {
+                            "tag": "blockquote"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><button><blockquote></blockquote></button></p></body></html>",
+        "noQuirksBodyHtml": "<p><button><blockquote></blockquote></button></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><button><menu>",
+      "errors": [
+        "(1,32): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "button": true,
+            "menu": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "button",
+                        "children": [
+                          {
+                            "tag": "menu"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><button><menu></menu></button></p></body></html>",
+        "noQuirksBodyHtml": "<p><button><menu></menu></button></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><button><p>",
+      "errors": [
+        "(1,29): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "button": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "button",
+                        "children": [
+                          {
+                            "tag": "p"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><button><p></p></button></p></body></html>",
+        "noQuirksBodyHtml": "<p><button><p></p></button></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><button><ul>",
+      "errors": [
+        "(1,30): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "button": true,
+            "ul": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "button",
+                        "children": [
+                          {
+                            "tag": "ul"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><button><ul></ul></button></p></body></html>",
+        "noQuirksBodyHtml": "<p><button><ul></ul></button></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><button><h1>",
+      "errors": [
+        "(1,30): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "button": true,
+            "h1": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "button",
+                        "children": [
+                          {
+                            "tag": "h1"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><button><h1></h1></button></p></body></html>",
+        "noQuirksBodyHtml": "<p><button><h1></h1></button></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><button><h6>",
+      "errors": [
+        "(1,30): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "button": true,
+            "h6": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "button",
+                        "children": [
+                          {
+                            "tag": "h6"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><button><h6></h6></button></p></body></html>",
+        "noQuirksBodyHtml": "<p><button><h6></h6></button></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><button><listing>",
+      "errors": [
+        "(1,35): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "button": true,
+            "listing": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "button",
+                        "children": [
+                          {
+                            "tag": "listing"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><button><listing></listing></button></p></body></html>",
+        "noQuirksBodyHtml": "<p><button><listing></listing></button></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><button><pre>",
+      "errors": [
+        "(1,31): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "button": true,
+            "pre": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "button",
+                        "children": [
+                          {
+                            "tag": "pre"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><button><pre></pre></button></p></body></html>",
+        "noQuirksBodyHtml": "<p><button><pre></pre></button></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><button><form>",
+      "errors": [
+        "(1,32): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "button": true,
+            "form": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "button",
+                        "children": [
+                          {
+                            "tag": "form"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><button><form></form></button></p></body></html>",
+        "noQuirksBodyHtml": "<p><button><form></form></button></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><button><li>",
+      "errors": [
+        "(1,30): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "button": true,
+            "li": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "button",
+                        "children": [
+                          {
+                            "tag": "li"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><button><li></li></button></p></body></html>",
+        "noQuirksBodyHtml": "<p><button><li></li></button></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><button><dd>",
+      "errors": [
+        "(1,30): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "button": true,
+            "dd": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "button",
+                        "children": [
+                          {
+                            "tag": "dd"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><button><dd></dd></button></p></body></html>",
+        "noQuirksBodyHtml": "<p><button><dd></dd></button></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><button><dt>",
+      "errors": [
+        "(1,30): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "button": true,
+            "dt": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "button",
+                        "children": [
+                          {
+                            "tag": "dt"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><button><dt></dt></button></p></body></html>",
+        "noQuirksBodyHtml": "<p><button><dt></dt></button></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><button><plaintext>",
+      "errors": [
+        "(1,37): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "button": true,
+            "plaintext": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "button",
+                        "children": [
+                          {
+                            "tag": "plaintext"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><button><plaintext></plaintext></button></p></body></html>",
+        "noQuirksBodyHtml": "<p><button><plaintext></plaintext></button></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><button><table>",
+      "errors": [
+        "(1,33): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "button": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "button",
+                        "children": [
+                          {
+                            "tag": "table"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><button><table></table></button></p></body></html>",
+        "noQuirksBodyHtml": "<p><button><table></table></button></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><button><hr>",
+      "errors": [
+        "(1,30): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "button": true,
+            "hr": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "button",
+                        "children": [
+                          {
+                            "tag": "hr"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><button><hr></button></p></body></html>",
+        "noQuirksBodyHtml": "<p><button><hr></button></p>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "button": true,
+            "xmp": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "button",
+                        "children": [
+                          {
+                            "tag": "xmp"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><button><xmp></xmp></button></p></body></html>",
+        "noQuirksBodyHtml": "<p><button><xmp></xmp></button></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><button></p>",
+      "errors": [
+        "(1,30): unexpected-end-tag",
+        "(1,30): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "button": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "button",
+                        "children": [
+                          {
+                            "tag": "p"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><button><p></p></button></p></body></html>",
+        "noQuirksBodyHtml": "<p><button><p></p></button></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><address><button></address>a",
+      "errors": [
+        "(1,42): end-tag-too-early"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "address": true,
+            "button": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "address",
+                    "children": [
+                      {
+                        "tag": "button"
+                      }
+                    ]
+                  },
+                  {
+                    "text": "a"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><address><button></button></address>a</body></html>",
+        "noQuirksBodyHtml": "<address><button></button></address>a"
+      }
+    },
+    {
+      "data": "<!doctype html><address><button></address>a",
+      "errors": [
+        "(1,42): end-tag-too-early"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "address": true,
+            "button": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "address",
+                    "children": [
+                      {
+                        "tag": "button"
+                      }
+                    ]
+                  },
+                  {
+                    "text": "a"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><address><button></button></address>a</body></html>",
+        "noQuirksBodyHtml": "<address><button></button></address>a"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "table": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "p"
+                      },
+                      {
+                        "tag": "table"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><p><p></p><table></table></p></body></html>",
+        "noQuirksBodyHtml": "<p></p><p></p><table></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><svg>",
+      "errors": [
+        "(1,20): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg></svg></body></html>",
+        "noQuirksBodyHtml": "<svg></svg>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><figcaption>",
+      "errors": [
+        "(1,30): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "figcaption": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p"
+                  },
+                  {
+                    "tag": "figcaption"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p></p><figcaption></figcaption></body></html>",
+        "noQuirksBodyHtml": "<p></p><figcaption></figcaption>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><summary>",
+      "errors": [
+        "(1,27): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "summary": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p"
+                  },
+                  {
+                    "tag": "summary"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p></p><summary></summary></body></html>",
+        "noQuirksBodyHtml": "<p></p><summary></summary>"
+      }
+    },
+    {
+      "data": "<!doctype html><form><table><form>",
+      "errors": [
+        "(1,34): unexpected-form-in-table",
+        "(1,34): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "form": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "form",
+                    "children": [
+                      {
+                        "tag": "table"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><form><table></table></form></body></html>",
+        "noQuirksBodyHtml": "<form><table></table></form>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "form": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "form"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><form></form></table></body></html>",
+        "noQuirksBodyHtml": "<table><form></form></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><table><form></table><form>",
+      "errors": [
+        "(1,28): unexpected-form-in-table",
+        "(1,42): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "form": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "form"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><form></form></table></body></html>",
+        "noQuirksBodyHtml": "<table><form></form></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><svg><foreignObject><p>",
+      "errors": [
+        "(1,38): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg foreignObject": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "foreignObject",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "tag": "p"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg><foreignObject><p></p></foreignObject></svg></body></html>",
+        "noQuirksBodyHtml": "<svg><foreignObject><p></p></foreignObject></svg>"
+      }
+    },
+    {
+      "data": "<!doctype html><svg><title>abc",
+      "errors": [
+        "(1,30): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg title": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "title",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "text": "abc"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg><title>abc</title></svg></body></html>",
+        "noQuirksBodyHtml": "<svg><title>abc</title></svg>"
+      }
+    },
+    {
+      "data": "<option><span><option>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,22): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "option": true,
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "option",
+                    "children": [
+                      {
+                        "tag": "span",
+                        "children": [
+                          {
+                            "tag": "option"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><option><span><option></option></span></option></body></html>",
+        "noQuirksBodyHtml": "<option><span><option></option></span></option>"
+      }
+    },
+    {
+      "data": "<option><option>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "option": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "option"
+                  },
+                  {
+                    "tag": "option"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><option></option><option></option></body></html>",
+        "noQuirksBodyHtml": "<option></option><option></option>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math annotation-xml": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "annotation-xml",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "div"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><annotation-xml></annotation-xml></math><div></div></body></html>",
+        "noQuirksBodyHtml": "<math><annotation-xml><div></div></annotation-xml></math>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math annotation-xml": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "annotation-xml",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "attrs": [
+                          {
+                            "name": "encoding",
+                            "value": "application/svg+xml"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "div"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><annotation-xml encoding=\"application/svg+xml\"></annotation-xml></math><div></div></body></html>",
+        "noQuirksBodyHtml": "<math><annotation-xml encoding=\"application/svg+xml\"><div></div></annotation-xml></math>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math annotation-xml": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "annotation-xml",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "attrs": [
+                          {
+                            "name": "encoding",
+                            "value": "application/xhtml+xml"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "tag": "div"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><annotation-xml encoding=\"application/xhtml+xml\"><div></div></annotation-xml></math></body></html>",
+        "noQuirksBodyHtml": "<math><annotation-xml encoding=\"application/xhtml+xml\"><div></div></annotation-xml></math>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math annotation-xml": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "annotation-xml",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "attrs": [
+                          {
+                            "name": "encoding",
+                            "value": "aPPlication/xhtmL+xMl"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "tag": "div"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><annotation-xml encoding=\"aPPlication/xhtmL+xMl\"><div></div></annotation-xml></math></body></html>",
+        "noQuirksBodyHtml": "<math><annotation-xml encoding=\"aPPlication/xhtmL+xMl\"><div></div></annotation-xml></math>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math annotation-xml": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "annotation-xml",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "attrs": [
+                          {
+                            "name": "encoding",
+                            "value": "text/html"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "tag": "div"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><annotation-xml encoding=\"text/html\"><div></div></annotation-xml></math></body></html>",
+        "noQuirksBodyHtml": "<math><annotation-xml encoding=\"text/html\"><div></div></annotation-xml></math>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math annotation-xml": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "annotation-xml",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "attrs": [
+                          {
+                            "name": "encoding",
+                            "value": "Text/htmL"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "tag": "div"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><annotation-xml encoding=\"Text/htmL\"><div></div></annotation-xml></math></body></html>",
+        "noQuirksBodyHtml": "<math><annotation-xml encoding=\"Text/htmL\"><div></div></annotation-xml></math>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math annotation-xml": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "annotation-xml",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "attrs": [
+                          {
+                            "name": "encoding",
+                            "value": " text/html "
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "div"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><annotation-xml encoding=\" text/html \"></annotation-xml></math><div></div></body></html>",
+        "noQuirksBodyHtml": "<math><annotation-xml encoding=\" text/html \"><div></div></annotation-xml></math>"
+      }
+    },
+    {
+      "data": "<math><annotation-xml> </annotation-xml>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,40): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math annotation-xml": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "annotation-xml",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "text": " "
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><annotation-xml> </annotation-xml></math></body></html>",
+        "noQuirksBodyHtml": "<math><annotation-xml> </annotation-xml></math>"
+      }
+    },
+    {
+      "data": "<math><annotation-xml>c</annotation-xml>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,40): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math annotation-xml": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "annotation-xml",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "text": "c"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><annotation-xml>c</annotation-xml></math></body></html>",
+        "noQuirksBodyHtml": "<math><annotation-xml>c</annotation-xml></math>"
+      }
+    },
+    {
+      "data": "<math><annotation-xml><!--foo-->",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,32): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math annotation-xml": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "annotation-xml",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "comment": "foo"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><annotation-xml><!--foo--></annotation-xml></math></body></html>",
+        "noQuirksBodyHtml": "<math><annotation-xml><!--foo--></annotation-xml></math>"
+      }
+    },
+    {
+      "data": "<math><annotation-xml></svg>x",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,28): unexpected-end-tag",
+        "(1,29): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math annotation-xml": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "annotation-xml",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "text": "x"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><annotation-xml>x</annotation-xml></math></body></html>",
+        "noQuirksBodyHtml": "<math><annotation-xml>x</annotation-xml></math>"
+      }
+    },
+    {
+      "data": "<math><annotation-xml><svg>x",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,28): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math annotation-xml": true,
+            "svg svg": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "annotation-xml",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "svg",
+                            "ns": "http://www.w3.org/2000/svg",
+                            "children": [
+                              {
+                                "text": "x"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><annotation-xml><svg>x</svg></annotation-xml></math></body></html>",
+        "noQuirksBodyHtml": "<math><annotation-xml><svg>x</svg></annotation-xml></math>"
+      }
+    }
+  ],
+  "tests21.dat": [
+    {
+      "data": "<svg><![CDATA[foo]]>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,20): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "foo"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>foo</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>foo</svg>"
+      }
+    },
+    {
+      "data": "<math><![CDATA[foo]]>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,21): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "text": "foo"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math>foo</math></body></html>",
+        "noQuirksBodyHtml": "<math>foo</math>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "comment": "[CDATA[foo]]"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div><!--[CDATA[foo]]--></div></body></html>",
+        "noQuirksBodyHtml": "<div><!--[CDATA[foo]]--></div>"
+      }
+    },
+    {
+      "data": "<svg><![CDATA[foo",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,17): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "foo"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>foo</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>foo</svg>"
+      }
+    },
+    {
+      "data": "<svg><![CDATA[foo",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,17): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "foo"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>foo</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>foo</svg>"
+      }
+    },
+    {
+      "data": "<svg><![CDATA[",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,14): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg></svg></body></html>",
+        "noQuirksBodyHtml": "<svg></svg>"
+      }
+    },
+    {
+      "data": "<svg><![CDATA[]]>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,17): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg></svg></body></html>",
+        "noQuirksBodyHtml": "<svg></svg>"
+      }
+    },
+    {
+      "data": "<svg><![CDATA[]] >]]>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,21): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "]] >",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>]] &gt;</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>]] &gt;</svg>"
+      }
+    },
+    {
+      "data": "<svg><![CDATA[]] >]]>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,21): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "]] >",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>]] &gt;</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>]] &gt;</svg>"
+      }
+    },
+    {
+      "data": "<svg><![CDATA[]]",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,16): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "]]"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>]]</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>]]</svg>"
+      }
+    },
+    {
+      "data": "<svg><![CDATA[]",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,15): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "]"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>]</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>]</svg>"
+      }
+    },
+    {
+      "data": "<svg><![CDATA[]>a",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,17): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "]>a",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>]&gt;a</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>]&gt;a</svg>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><svg><![CDATA[foo]]]>",
+      "errors": [
+        "(1,36): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "foo]"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg>foo]</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>foo]</svg>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><svg><![CDATA[foo]]]]>",
+      "errors": [
+        "(1,37): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "foo]]"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg>foo]]</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>foo]]</svg>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><svg><![CDATA[foo]]]]]>",
+      "errors": [
+        "(1,38): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "foo]]]"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg>foo]]]</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>foo]]]</svg>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg foreignObject": true,
+            "div": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "foreignObject",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "tag": "div",
+                            "children": [
+                              {
+                                "comment": "[CDATA[foo]]"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg><foreignObject><div><!--[CDATA[foo]]--></div></foreignObject></svg></body></html>",
+        "noQuirksBodyHtml": "<svg><foreignObject><div><!--[CDATA[foo]]--></div></foreignObject></svg>"
+      }
+    },
+    {
+      "data": "<svg><![CDATA[<svg>]]>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,22): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "<svg>",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>&lt;svg&gt;</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>&lt;svg&gt;</svg>"
+      }
+    },
+    {
+      "data": "<svg><![CDATA[</svg>a]]>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,24): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "</svg>a",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>&lt;/svg&gt;a</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>&lt;/svg&gt;a</svg>"
+      }
+    },
+    {
+      "data": "<svg><![CDATA[<svg>a",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,20): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "<svg>a",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>&lt;svg&gt;a</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>&lt;svg&gt;a</svg>"
+      }
+    },
+    {
+      "data": "<svg><![CDATA[</svg>a",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,21): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "</svg>a",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>&lt;/svg&gt;a</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>&lt;/svg&gt;a</svg>"
+      }
+    },
+    {
+      "data": "<svg><![CDATA[<svg>]]><path>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,28): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg path": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "<svg>",
+                        "escaped": true
+                      },
+                      {
+                        "tag": "path",
+                        "ns": "http://www.w3.org/2000/svg"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>&lt;svg&gt;<path></path></svg></body></html>",
+        "noQuirksBodyHtml": "<svg>&lt;svg&gt;<path></path></svg>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "<svg>",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>&lt;svg&gt;</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>&lt;svg&gt;</svg>"
+      }
+    },
+    {
+      "data": "<svg><![CDATA[<svg>]]><!--path-->",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,33): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "escaped": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "<svg>",
+                        "escaped": true
+                      },
+                      {
+                        "comment": "path"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>&lt;svg&gt;<!--path--></svg></body></html>",
+        "noQuirksBodyHtml": "<svg>&lt;svg&gt;<!--path--></svg>"
+      }
+    },
+    {
+      "data": "<svg><![CDATA[<svg>]]>path",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,26): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "<svg>path",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>&lt;svg&gt;path</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>&lt;svg&gt;path</svg>"
+      }
+    },
+    {
+      "data": "<svg><![CDATA[<!--svg-->]]>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,27): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "text": "<!--svg-->",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg>&lt;!--svg--&gt;</svg></body></html>",
+        "noQuirksBodyHtml": "<svg>&lt;!--svg--&gt;</svg>"
+      }
+    }
+  ],
+  "tests22.dat": [
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "b": true,
+            "big": true,
+            "em": true,
+            "strong": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "tag": "big",
+                            "children": [
+                              {
+                                "tag": "em",
+                                "children": [
+                                  {
+                                    "tag": "strong"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "big",
+                    "children": [
+                      {
+                        "tag": "em",
+                        "children": [
+                          {
+                            "tag": "strong",
+                            "children": [
+                              {
+                                "tag": "div",
+                                "children": [
+                                  {
+                                    "tag": "a",
+                                    "children": [
+                                      {
+                                        "text": "X"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a><b><big><em><strong></strong></em></big></b></a><big><em><strong><div><a>X</a></div></strong></em></big></body></html>",
+        "noQuirksBodyHtml": "<a><b><big><em><strong></strong></em></big></b></a><big><em><strong><div><a>X</a></div></strong></em></big>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "b": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "tag": "b"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "div",
+                        "attrs": [
+                          {
+                            "name": "id",
+                            "value": "1"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "tag": "a"
+                          },
+                          {
+                            "tag": "div",
+                            "attrs": [
+                              {
+                                "name": "id",
+                                "value": "2"
+                              }
+                            ],
+                            "children": [
+                              {
+                                "tag": "a"
+                              },
+                              {
+                                "tag": "div",
+                                "attrs": [
+                                  {
+                                    "name": "id",
+                                    "value": "3"
+                                  }
+                                ],
+                                "children": [
+                                  {
+                                    "tag": "a"
+                                  },
+                                  {
+                                    "tag": "div",
+                                    "attrs": [
+                                      {
+                                        "name": "id",
+                                        "value": "4"
+                                      }
+                                    ],
+                                    "children": [
+                                      {
+                                        "tag": "a"
+                                      },
+                                      {
+                                        "tag": "div",
+                                        "attrs": [
+                                          {
+                                            "name": "id",
+                                            "value": "5"
+                                          }
+                                        ],
+                                        "children": [
+                                          {
+                                            "tag": "a"
+                                          },
+                                          {
+                                            "tag": "div",
+                                            "attrs": [
+                                              {
+                                                "name": "id",
+                                                "value": "6"
+                                              }
+                                            ],
+                                            "children": [
+                                              {
+                                                "tag": "a"
+                                              },
+                                              {
+                                                "tag": "div",
+                                                "attrs": [
+                                                  {
+                                                    "name": "id",
+                                                    "value": "7"
+                                                  }
+                                                ],
+                                                "children": [
+                                                  {
+                                                    "tag": "a"
+                                                  },
+                                                  {
+                                                    "tag": "div",
+                                                    "attrs": [
+                                                      {
+                                                        "name": "id",
+                                                        "value": "8"
+                                                      }
+                                                    ],
+                                                    "children": [
+                                                      {
+                                                        "tag": "a",
+                                                        "children": [
+                                                          {
+                                                            "text": "A"
+                                                          }
+                                                        ]
+                                                      }
+                                                    ]
+                                                  }
+                                                ]
+                                              }
+                                            ]
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a><b></b></a><b><div id=\"1\"><a></a><div id=\"2\"><a></a><div id=\"3\"><a></a><div id=\"4\"><a></a><div id=\"5\"><a></a><div id=\"6\"><a></a><div id=\"7\"><a></a><div id=\"8\"><a>A</a></div></div></div></div></div></div></div></div></b></body></html>",
+        "noQuirksBodyHtml": "<a><b></b></a><b><div id=\"1\"><a></a><div id=\"2\"><a></a><div id=\"3\"><a></a><div id=\"4\"><a></a><div id=\"5\"><a></a><div id=\"6\"><a></a><div id=\"7\"><a></a><div id=\"8\"><a>A</a></div></div></div></div></div></div></div></div></b>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "b": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "tag": "b"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "div",
+                        "attrs": [
+                          {
+                            "name": "id",
+                            "value": "1"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "tag": "a"
+                          },
+                          {
+                            "tag": "div",
+                            "attrs": [
+                              {
+                                "name": "id",
+                                "value": "2"
+                              }
+                            ],
+                            "children": [
+                              {
+                                "tag": "a"
+                              },
+                              {
+                                "tag": "div",
+                                "attrs": [
+                                  {
+                                    "name": "id",
+                                    "value": "3"
+                                  }
+                                ],
+                                "children": [
+                                  {
+                                    "tag": "a"
+                                  },
+                                  {
+                                    "tag": "div",
+                                    "attrs": [
+                                      {
+                                        "name": "id",
+                                        "value": "4"
+                                      }
+                                    ],
+                                    "children": [
+                                      {
+                                        "tag": "a"
+                                      },
+                                      {
+                                        "tag": "div",
+                                        "attrs": [
+                                          {
+                                            "name": "id",
+                                            "value": "5"
+                                          }
+                                        ],
+                                        "children": [
+                                          {
+                                            "tag": "a"
+                                          },
+                                          {
+                                            "tag": "div",
+                                            "attrs": [
+                                              {
+                                                "name": "id",
+                                                "value": "6"
+                                              }
+                                            ],
+                                            "children": [
+                                              {
+                                                "tag": "a"
+                                              },
+                                              {
+                                                "tag": "div",
+                                                "attrs": [
+                                                  {
+                                                    "name": "id",
+                                                    "value": "7"
+                                                  }
+                                                ],
+                                                "children": [
+                                                  {
+                                                    "tag": "a"
+                                                  },
+                                                  {
+                                                    "tag": "div",
+                                                    "attrs": [
+                                                      {
+                                                        "name": "id",
+                                                        "value": "8"
+                                                      }
+                                                    ],
+                                                    "children": [
+                                                      {
+                                                        "tag": "a",
+                                                        "children": [
+                                                          {
+                                                            "tag": "div",
+                                                            "attrs": [
+                                                              {
+                                                                "name": "id",
+                                                                "value": "9"
+                                                              }
+                                                            ],
+                                                            "children": [
+                                                              {
+                                                                "text": "A"
+                                                              }
+                                                            ]
+                                                          }
+                                                        ]
+                                                      }
+                                                    ]
+                                                  }
+                                                ]
+                                              }
+                                            ]
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a><b></b></a><b><div id=\"1\"><a></a><div id=\"2\"><a></a><div id=\"3\"><a></a><div id=\"4\"><a></a><div id=\"5\"><a></a><div id=\"6\"><a></a><div id=\"7\"><a></a><div id=\"8\"><a><div id=\"9\">A</div></a></div></div></div></div></div></div></div></div></b></body></html>",
+        "noQuirksBodyHtml": "<a><b></b></a><b><div id=\"1\"><a></a><div id=\"2\"><a></a><div id=\"3\"><a></a><div id=\"4\"><a></a><div id=\"5\"><a></a><div id=\"6\"><a></a><div id=\"7\"><a></a><div id=\"8\"><a><div id=\"9\">A</div></a></div></div></div></div></div></div></div></div></b>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "b": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "tag": "b"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "div",
+                        "attrs": [
+                          {
+                            "name": "id",
+                            "value": "1"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "tag": "a"
+                          },
+                          {
+                            "tag": "div",
+                            "attrs": [
+                              {
+                                "name": "id",
+                                "value": "2"
+                              }
+                            ],
+                            "children": [
+                              {
+                                "tag": "a"
+                              },
+                              {
+                                "tag": "div",
+                                "attrs": [
+                                  {
+                                    "name": "id",
+                                    "value": "3"
+                                  }
+                                ],
+                                "children": [
+                                  {
+                                    "tag": "a"
+                                  },
+                                  {
+                                    "tag": "div",
+                                    "attrs": [
+                                      {
+                                        "name": "id",
+                                        "value": "4"
+                                      }
+                                    ],
+                                    "children": [
+                                      {
+                                        "tag": "a"
+                                      },
+                                      {
+                                        "tag": "div",
+                                        "attrs": [
+                                          {
+                                            "name": "id",
+                                            "value": "5"
+                                          }
+                                        ],
+                                        "children": [
+                                          {
+                                            "tag": "a"
+                                          },
+                                          {
+                                            "tag": "div",
+                                            "attrs": [
+                                              {
+                                                "name": "id",
+                                                "value": "6"
+                                              }
+                                            ],
+                                            "children": [
+                                              {
+                                                "tag": "a"
+                                              },
+                                              {
+                                                "tag": "div",
+                                                "attrs": [
+                                                  {
+                                                    "name": "id",
+                                                    "value": "7"
+                                                  }
+                                                ],
+                                                "children": [
+                                                  {
+                                                    "tag": "a"
+                                                  },
+                                                  {
+                                                    "tag": "div",
+                                                    "attrs": [
+                                                      {
+                                                        "name": "id",
+                                                        "value": "8"
+                                                      }
+                                                    ],
+                                                    "children": [
+                                                      {
+                                                        "tag": "a",
+                                                        "children": [
+                                                          {
+                                                            "tag": "div",
+                                                            "attrs": [
+                                                              {
+                                                                "name": "id",
+                                                                "value": "9"
+                                                              }
+                                                            ],
+                                                            "children": [
+                                                              {
+                                                                "tag": "div",
+                                                                "attrs": [
+                                                                  {
+                                                                    "name": "id",
+                                                                    "value": "10"
+                                                                  }
+                                                                ],
+                                                                "children": [
+                                                                  {
+                                                                    "text": "A"
+                                                                  }
+                                                                ]
+                                                              }
+                                                            ]
+                                                          }
+                                                        ]
+                                                      }
+                                                    ]
+                                                  }
+                                                ]
+                                              }
+                                            ]
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a><b></b></a><b><div id=\"1\"><a></a><div id=\"2\"><a></a><div id=\"3\"><a></a><div id=\"4\"><a></a><div id=\"5\"><a></a><div id=\"6\"><a></a><div id=\"7\"><a></a><div id=\"8\"><a><div id=\"9\"><div id=\"10\">A</div></div></a></div></div></div></div></div></div></div></div></b></body></html>",
+        "noQuirksBodyHtml": "<a><b></b></a><b><div id=\"1\"><a></a><div id=\"2\"><a></a><div id=\"3\"><a></a><div id=\"4\"><a></a><div id=\"5\"><a></a><div id=\"6\"><a></a><div id=\"7\"><a></a><div id=\"8\"><a><div id=\"9\"><div id=\"10\">A</div></div></a></div></div></div></div></div></div></div></div></b>"
+      }
+    },
+    {
+      "data": "<cite><b><cite><i><cite><i><cite><i><div>X</b>TEST",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,46): adoption-agency-1.3",
+        "(1,50): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "cite": true,
+            "b": true,
+            "i": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "cite",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "tag": "cite",
+                            "children": [
+                              {
+                                "tag": "i",
+                                "children": [
+                                  {
+                                    "tag": "cite",
+                                    "children": [
+                                      {
+                                        "tag": "i",
+                                        "children": [
+                                          {
+                                            "tag": "cite",
+                                            "children": [
+                                              {
+                                                "tag": "i"
+                                              }
+                                            ]
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "i",
+                        "children": [
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "tag": "div",
+                                "children": [
+                                  {
+                                    "tag": "b",
+                                    "children": [
+                                      {
+                                        "text": "X"
+                                      }
+                                    ]
+                                  },
+                                  {
+                                    "text": "TEST"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><cite><b><cite><i><cite><i><cite><i></i></cite></i></cite></i></cite></b><i><i><div><b>X</b>TEST</div></i></i></cite></body></html>",
+        "noQuirksBodyHtml": "<cite><b><cite><i><cite><i><cite><i></i></cite></i></cite></i></cite></b><i><i><div><b>X</b>TEST</div></i></i></cite>"
+      }
+    }
+  ],
+  "tests23.dat": [
+    {
+      "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": [
+        "(1,3): expected-doctype-but-got-start-tag",
+        "(1,116): unexpected-end-tag",
+        "(1,117): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "font": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "font",
+                        "attrs": [
+                          {
+                            "name": "size",
+                            "value": "4"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "tag": "font",
+                            "attrs": [
+                              {
+                                "name": "color",
+                                "value": "red"
+                              }
+                            ],
+                            "children": [
+                              {
+                                "tag": "font",
+                                "attrs": [
+                                  {
+                                    "name": "size",
+                                    "value": "4"
+                                  }
+                                ],
+                                "children": [
+                                  {
+                                    "tag": "font",
+                                    "attrs": [
+                                      {
+                                        "name": "size",
+                                        "value": "4"
+                                      }
+                                    ],
+                                    "children": [
+                                      {
+                                        "tag": "font",
+                                        "attrs": [
+                                          {
+                                            "name": "size",
+                                            "value": "4"
+                                          }
+                                        ],
+                                        "children": [
+                                          {
+                                            "tag": "font",
+                                            "attrs": [
+                                              {
+                                                "name": "size",
+                                                "value": "4"
+                                              }
+                                            ],
+                                            "children": [
+                                              {
+                                                "tag": "font",
+                                                "attrs": [
+                                                  {
+                                                    "name": "size",
+                                                    "value": "4"
+                                                  }
+                                                ],
+                                                "children": [
+                                                  {
+                                                    "tag": "font",
+                                                    "attrs": [
+                                                      {
+                                                        "name": "color",
+                                                        "value": "red"
+                                                      }
+                                                    ]
+                                                  }
+                                                ]
+                                              }
+                                            ]
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "font",
+                        "attrs": [
+                          {
+                            "name": "color",
+                            "value": "red"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "tag": "font",
+                            "attrs": [
+                              {
+                                "name": "size",
+                                "value": "4"
+                              }
+                            ],
+                            "children": [
+                              {
+                                "tag": "font",
+                                "attrs": [
+                                  {
+                                    "name": "size",
+                                    "value": "4"
+                                  }
+                                ],
+                                "children": [
+                                  {
+                                    "tag": "font",
+                                    "attrs": [
+                                      {
+                                        "name": "size",
+                                        "value": "4"
+                                      }
+                                    ],
+                                    "children": [
+                                      {
+                                        "tag": "font",
+                                        "attrs": [
+                                          {
+                                            "name": "color",
+                                            "value": "red"
+                                          }
+                                        ],
+                                        "children": [
+                                          {
+                                            "text": "X"
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><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\"></font></font></font></font></font></font></font></font></p><p><font color=\"red\"><font size=\"4\"><font size=\"4\"><font size=\"4\"><font color=\"red\">X</font></font></font></font></font></p></body></html>",
+        "noQuirksBodyHtml": "<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\"></font></font></font></font></font></font></font></font></p><p><font color=\"red\"><font size=\"4\"><font size=\"4\"><font size=\"4\"><font color=\"red\">X</font></font></font></font></font></p>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "font": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "font",
+                        "attrs": [
+                          {
+                            "name": "size",
+                            "value": "4"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "tag": "font",
+                            "attrs": [
+                              {
+                                "name": "size",
+                                "value": "4"
+                              }
+                            ],
+                            "children": [
+                              {
+                                "tag": "font",
+                                "attrs": [
+                                  {
+                                    "name": "size",
+                                    "value": "4"
+                                  }
+                                ],
+                                "children": [
+                                  {
+                                    "tag": "font",
+                                    "attrs": [
+                                      {
+                                        "name": "size",
+                                        "value": "4"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "font",
+                        "attrs": [
+                          {
+                            "name": "size",
+                            "value": "4"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "tag": "font",
+                            "attrs": [
+                              {
+                                "name": "size",
+                                "value": "4"
+                              }
+                            ],
+                            "children": [
+                              {
+                                "tag": "font",
+                                "attrs": [
+                                  {
+                                    "name": "size",
+                                    "value": "4"
+                                  }
+                                ],
+                                "children": [
+                                  {
+                                    "text": "X"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><p><font size=\"4\"><font size=\"4\"><font size=\"4\"><font size=\"4\"></font></font></font></font></p><p><font size=\"4\"><font size=\"4\"><font size=\"4\">X</font></font></font></p></body></html>",
+        "noQuirksBodyHtml": "<p><font size=\"4\"><font size=\"4\"><font size=\"4\"><font size=\"4\"></font></font></font></font></p><p><font size=\"4\"><font size=\"4\"><font size=\"4\">X</font></font></font></p>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "font": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "font",
+                        "attrs": [
+                          {
+                            "name": "size",
+                            "value": "4"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "tag": "font",
+                            "attrs": [
+                              {
+                                "name": "size",
+                                "value": "4"
+                              }
+                            ],
+                            "children": [
+                              {
+                                "tag": "font",
+                                "attrs": [
+                                  {
+                                    "name": "size",
+                                    "value": "4"
+                                  }
+                                ],
+                                "children": [
+                                  {
+                                    "tag": "font",
+                                    "attrs": [
+                                      {
+                                        "name": "size",
+                                        "value": "5"
+                                      }
+                                    ],
+                                    "children": [
+                                      {
+                                        "tag": "font",
+                                        "attrs": [
+                                          {
+                                            "name": "size",
+                                            "value": "4"
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "font",
+                        "attrs": [
+                          {
+                            "name": "size",
+                            "value": "4"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "tag": "font",
+                            "attrs": [
+                              {
+                                "name": "size",
+                                "value": "4"
+                              }
+                            ],
+                            "children": [
+                              {
+                                "tag": "font",
+                                "attrs": [
+                                  {
+                                    "name": "size",
+                                    "value": "5"
+                                  }
+                                ],
+                                "children": [
+                                  {
+                                    "tag": "font",
+                                    "attrs": [
+                                      {
+                                        "name": "size",
+                                        "value": "4"
+                                      }
+                                    ],
+                                    "children": [
+                                      {
+                                        "text": "X"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><p><font size=\"4\"><font size=\"4\"><font size=\"4\"><font size=\"5\"><font size=\"4\"></font></font></font></font></font></p><p><font size=\"4\"><font size=\"4\"><font size=\"5\"><font size=\"4\">X</font></font></font></font></p></body></html>",
+        "noQuirksBodyHtml": "<p><font size=\"4\"><font size=\"4\"><font size=\"4\"><font size=\"5\"><font size=\"4\"></font></font></font></font></font></p><p><font size=\"4\"><font size=\"4\"><font size=\"5\"><font size=\"4\">X</font></font></font></font></p>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "font": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "font",
+                        "attrs": [
+                          {
+                            "name": "id",
+                            "value": "a"
+                          },
+                          {
+                            "name": "size",
+                            "value": "4"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "tag": "font",
+                            "attrs": [
+                              {
+                                "name": "id",
+                                "value": "b"
+                              },
+                              {
+                                "name": "size",
+                                "value": "4"
+                              }
+                            ],
+                            "children": [
+                              {
+                                "tag": "font",
+                                "attrs": [
+                                  {
+                                    "name": "size",
+                                    "value": "4"
+                                  }
+                                ],
+                                "children": [
+                                  {
+                                    "tag": "font",
+                                    "attrs": [
+                                      {
+                                        "name": "size",
+                                        "value": "4"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "font",
+                        "attrs": [
+                          {
+                            "name": "id",
+                            "value": "a"
+                          },
+                          {
+                            "name": "size",
+                            "value": "4"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "tag": "font",
+                            "attrs": [
+                              {
+                                "name": "id",
+                                "value": "b"
+                              },
+                              {
+                                "name": "size",
+                                "value": "4"
+                              }
+                            ],
+                            "children": [
+                              {
+                                "tag": "font",
+                                "attrs": [
+                                  {
+                                    "name": "size",
+                                    "value": "4"
+                                  }
+                                ],
+                                "children": [
+                                  {
+                                    "tag": "font",
+                                    "attrs": [
+                                      {
+                                        "name": "size",
+                                        "value": "4"
+                                      }
+                                    ],
+                                    "children": [
+                                      {
+                                        "text": "X"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><p><font size=\"4\" id=\"a\"><font size=\"4\" id=\"b\"><font size=\"4\"><font size=\"4\"></font></font></font></font></p><p><font size=\"4\" id=\"a\"><font size=\"4\" id=\"b\"><font size=\"4\"><font size=\"4\">X</font></font></font></font></p></body></html>",
+        "noQuirksBodyHtml": "<p><font size=\"4\" id=\"a\"><font size=\"4\" id=\"b\"><font size=\"4\"><font size=\"4\"></font></font></font></font></p><p><font size=\"4\" id=\"a\"><font size=\"4\" id=\"b\"><font size=\"4\"><font size=\"4\">X</font></font></font></font></p>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "b": true,
+            "object": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "attrs": [
+                          {
+                            "name": "id",
+                            "value": "a"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "tag": "b",
+                            "attrs": [
+                              {
+                                "name": "id",
+                                "value": "a"
+                              }
+                            ],
+                            "children": [
+                              {
+                                "tag": "b",
+                                "attrs": [
+                                  {
+                                    "name": "id",
+                                    "value": "a"
+                                  }
+                                ],
+                                "children": [
+                                  {
+                                    "tag": "b",
+                                    "children": [
+                                      {
+                                        "tag": "object",
+                                        "children": [
+                                          {
+                                            "tag": "b",
+                                            "attrs": [
+                                              {
+                                                "name": "id",
+                                                "value": "a"
+                                              }
+                                            ],
+                                            "children": [
+                                              {
+                                                "tag": "b",
+                                                "attrs": [
+                                                  {
+                                                    "name": "id",
+                                                    "value": "a"
+                                                  }
+                                                ],
+                                                "children": [
+                                                  {
+                                                    "text": "X"
+                                                  }
+                                                ]
+                                              }
+                                            ]
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "attrs": [
+                          {
+                            "name": "id",
+                            "value": "a"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "tag": "b",
+                            "attrs": [
+                              {
+                                "name": "id",
+                                "value": "a"
+                              }
+                            ],
+                            "children": [
+                              {
+                                "tag": "b",
+                                "attrs": [
+                                  {
+                                    "name": "id",
+                                    "value": "a"
+                                  }
+                                ],
+                                "children": [
+                                  {
+                                    "tag": "b",
+                                    "children": [
+                                      {
+                                        "text": "Y"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><p><b id=\"a\"><b id=\"a\"><b id=\"a\"><b><object><b id=\"a\"><b id=\"a\">X</b></b></object></b></b></b></b></p><p><b id=\"a\"><b id=\"a\"><b id=\"a\"><b>Y</b></b></b></b></p></body></html>",
+        "noQuirksBodyHtml": "<p><b id=\"a\"><b id=\"a\"><b id=\"a\"><b><object><b id=\"a\"><b id=\"a\">X</b></b></object></b></b></b></b></p><p><b id=\"a\"><b id=\"a\"><b id=\"a\"><b>Y</b></b></b></b></p>"
+      }
+    }
+  ],
+  "tests24.dat": [
+    {
+      "data": "<!DOCTYPE html>&NotEqualTilde;",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "≂̸"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>≂̸</body></html>",
+        "noQuirksBodyHtml": "≂̸"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html>&NotEqualTilde;A",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "≂̸A"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>≂̸A</body></html>",
+        "noQuirksBodyHtml": "≂̸A"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html>&ThickSpace;",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "  "
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>  </body></html>",
+        "noQuirksBodyHtml": "  "
+      }
+    },
+    {
+      "data": "<!DOCTYPE html>&ThickSpace;A",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "  A"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>  A</body></html>",
+        "noQuirksBodyHtml": "  A"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html>&NotSubset;",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "⊂⃒"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>⊂⃒</body></html>",
+        "noQuirksBodyHtml": "⊂⃒"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html>&NotSubset;A",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "⊂⃒A"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>⊂⃒A</body></html>",
+        "noQuirksBodyHtml": "⊂⃒A"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html>&Gopf;",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "𝔾"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>𝔾</body></html>",
+        "noQuirksBodyHtml": "𝔾"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html>&Gopf;A",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "𝔾A"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>𝔾A</body></html>",
+        "noQuirksBodyHtml": "𝔾A"
+      }
+    }
+  ],
+  "tests25.dat": [
+    {
+      "data": "<!DOCTYPE html><body><foo>A",
+      "errors": [
+        "(1,27): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "foo": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "foo",
+                    "children": [
+                      {
+                        "text": "A"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><foo>A</foo></body></html>",
+        "noQuirksBodyHtml": "<foo>A</foo>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><area>A",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "area": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "area"
+                  },
+                  {
+                    "text": "A"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><area>A</body></html>",
+        "noQuirksBodyHtml": "<area>A"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><base>A",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "base": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "base"
+                  },
+                  {
+                    "text": "A"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><base>A</body></html>",
+        "noQuirksBodyHtml": "<base>A"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><basefont>A",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "basefont": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "basefont"
+                  },
+                  {
+                    "text": "A"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><basefont>A</body></html>",
+        "noQuirksBodyHtml": "<basefont>A"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><bgsound>A",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "bgsound": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "bgsound"
+                  },
+                  {
+                    "text": "A"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><bgsound>A</body></html>",
+        "noQuirksBodyHtml": "<bgsound>A"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><br>A",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "br": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "br"
+                  },
+                  {
+                    "text": "A"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><br>A</body></html>",
+        "noQuirksBodyHtml": "<br>A"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><col>A",
+      "errors": [
+        "(1,26): unexpected-start-tag-ignored"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "A"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>A</body></html>",
+        "noQuirksBodyHtml": "A"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><command>A",
+      "errors": [
+        "eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "command": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "command",
+                    "children": [
+                      {
+                        "text": "A"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><command>A</command></body></html>",
+        "noQuirksBodyHtml": "<command>A</command>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><embed>A",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "embed": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "embed"
+                  },
+                  {
+                    "text": "A"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><embed>A</body></html>",
+        "noQuirksBodyHtml": "<embed>A"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><frame>A",
+      "errors": [
+        "(1,28): unexpected-start-tag-ignored"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "A"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>A</body></html>",
+        "noQuirksBodyHtml": "A"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><hr>A",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "hr": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "hr"
+                  },
+                  {
+                    "text": "A"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><hr>A</body></html>",
+        "noQuirksBodyHtml": "<hr>A"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><img>A",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "img": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "img"
+                  },
+                  {
+                    "text": "A"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><img>A</body></html>",
+        "noQuirksBodyHtml": "<img>A"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><input>A",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "input": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "input"
+                  },
+                  {
+                    "text": "A"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><input>A</body></html>",
+        "noQuirksBodyHtml": "<input>A"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><keygen>A",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "keygen": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "keygen"
+                  },
+                  {
+                    "text": "A"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><keygen>A</body></html>",
+        "noQuirksBodyHtml": "<keygen>A"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><link>A",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "link": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "link"
+                  },
+                  {
+                    "text": "A"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><link>A</body></html>",
+        "noQuirksBodyHtml": "<link>A"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><meta>A",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "meta": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "meta"
+                  },
+                  {
+                    "text": "A"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><meta>A</body></html>",
+        "noQuirksBodyHtml": "<meta>A"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><param>A",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "param": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "param"
+                  },
+                  {
+                    "text": "A"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><param>A</body></html>",
+        "noQuirksBodyHtml": "<param>A"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><source>A",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "source": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "source"
+                  },
+                  {
+                    "text": "A"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><source>A</body></html>",
+        "noQuirksBodyHtml": "<source>A"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><track>A",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "track": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "track"
+                  },
+                  {
+                    "text": "A"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><track>A</body></html>",
+        "noQuirksBodyHtml": "<track>A"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><wbr>A",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "wbr": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "wbr"
+                  },
+                  {
+                    "text": "A"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><wbr>A</body></html>",
+        "noQuirksBodyHtml": "<wbr>A"
+      }
+    }
+  ],
+  "tests26.dat": [
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "nobr": true,
+            "br": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "attrs": [
+                      {
+                        "name": "href",
+                        "value": "#1"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "tag": "nobr",
+                        "children": [
+                          {
+                            "text": "1"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "nobr"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "nobr",
+                    "children": [
+                      {
+                        "tag": "br"
+                      },
+                      {
+                        "tag": "a",
+                        "attrs": [
+                          {
+                            "name": "href",
+                            "value": "#2"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "a",
+                    "attrs": [
+                      {
+                        "name": "href",
+                        "value": "#2"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "tag": "nobr",
+                        "children": [
+                          {
+                            "text": "2"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "nobr"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "nobr",
+                    "children": [
+                      {
+                        "tag": "br"
+                      },
+                      {
+                        "tag": "a",
+                        "attrs": [
+                          {
+                            "name": "href",
+                            "value": "#3"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "a",
+                    "attrs": [
+                      {
+                        "name": "href",
+                        "value": "#3"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "tag": "nobr",
+                        "children": [
+                          {
+                            "text": "3"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "nobr"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><a href=\"#1\"><nobr>1</nobr><nobr></nobr></a><nobr><br><a href=\"#2\"></a></nobr><a href=\"#2\"><nobr>2</nobr><nobr></nobr></a><nobr><br><a href=\"#3\"></a></nobr><a href=\"#3\"><nobr>3</nobr><nobr></nobr></a></body></html>",
+        "noQuirksBodyHtml": "<a href=\"#1\"><nobr>1</nobr><nobr></nobr></a><nobr><br><a href=\"#2\"></a></nobr><a href=\"#2\"><nobr>2</nobr><nobr></nobr></a><nobr><br><a href=\"#3\"></a></nobr><a href=\"#3\"><nobr>3</nobr><nobr></nobr></a>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "nobr": true,
+            "i": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "nobr",
+                        "children": [
+                          {
+                            "text": "1"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "nobr"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "nobr",
+                    "children": [
+                      {
+                        "tag": "i"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "i",
+                    "children": [
+                      {
+                        "tag": "nobr",
+                        "children": [
+                          {
+                            "text": "2"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "nobr"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "nobr",
+                    "children": [
+                      {
+                        "text": "3"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><b><nobr>1</nobr><nobr></nobr></b><nobr><i></i></nobr><i><nobr>2</nobr><nobr></nobr></i><nobr>3</nobr></body></html>",
+        "noQuirksBodyHtml": "<b><nobr>1</nobr><nobr></nobr></b><nobr><i></i></nobr><i><nobr>2</nobr><nobr></nobr></i><nobr>3</nobr>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "nobr": true,
+            "i": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "nobr",
+                        "children": [
+                          {
+                            "text": "1"
+                          },
+                          {
+                            "tag": "nobr",
+                            "children": [
+                              {
+                                "tag": "i"
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "tag": "nobr",
+                                "children": [
+                                  {
+                                    "text": "2"
+                                  }
+                                ]
+                              },
+                              {
+                                "tag": "nobr"
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "nobr",
+                            "children": [
+                              {
+                                "text": "3"
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "table"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><b><nobr>1<nobr><i></i></nobr><i><nobr>2</nobr><nobr></nobr></i><nobr>3</nobr><table></table></nobr></b></body></html>",
+        "noQuirksBodyHtml": "<b><nobr>1<nobr><i></i></nobr><i><nobr>2</nobr><nobr></nobr></i><nobr>3</nobr><table></table></nobr></b>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "nobr": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "i": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "nobr",
+                        "children": [
+                          {
+                            "text": "1"
+                          },
+                          {
+                            "tag": "table",
+                            "children": [
+                              {
+                                "tag": "tbody",
+                                "children": [
+                                  {
+                                    "tag": "tr",
+                                    "children": [
+                                      {
+                                        "tag": "td",
+                                        "children": [
+                                          {
+                                            "tag": "nobr",
+                                            "children": [
+                                              {
+                                                "tag": "i"
+                                              }
+                                            ]
+                                          },
+                                          {
+                                            "tag": "i",
+                                            "children": [
+                                              {
+                                                "tag": "nobr",
+                                                "children": [
+                                                  {
+                                                    "text": "2"
+                                                  }
+                                                ]
+                                              },
+                                              {
+                                                "tag": "nobr"
+                                              }
+                                            ]
+                                          },
+                                          {
+                                            "tag": "nobr",
+                                            "children": [
+                                              {
+                                                "text": "3"
+                                              }
+                                            ]
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><b><nobr>1<table><tbody><tr><td><nobr><i></i></nobr><i><nobr>2</nobr><nobr></nobr></i><nobr>3</nobr></td></tr></tbody></table></nobr></b></body></html>",
+        "noQuirksBodyHtml": "<b><nobr>1<table><tbody><tr><td><nobr><i></i></nobr><i><nobr>2</nobr><nobr></nobr></i><nobr>3</nobr></td></tr></tbody></table></nobr></b>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "nobr": true,
+            "div": true,
+            "i": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "nobr",
+                        "children": [
+                          {
+                            "text": "1"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "tag": "nobr"
+                          },
+                          {
+                            "tag": "nobr"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "nobr",
+                        "children": [
+                          {
+                            "tag": "i"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "i",
+                        "children": [
+                          {
+                            "tag": "nobr",
+                            "children": [
+                              {
+                                "text": "2"
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "nobr"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "nobr",
+                        "children": [
+                          {
+                            "text": "3"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><b><nobr>1</nobr></b><div><b><nobr></nobr><nobr></nobr></b><nobr><i></i></nobr><i><nobr>2</nobr><nobr></nobr></i><nobr>3</nobr></div></body></html>",
+        "noQuirksBodyHtml": "<b><nobr>1</nobr></b><div><b><nobr></nobr><nobr></nobr></b><nobr><i></i></nobr><i><nobr>2</nobr><nobr></nobr></i><nobr>3</nobr></div>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "nobr": true,
+            "div": true,
+            "i": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "nobr",
+                        "children": [
+                          {
+                            "text": "1"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "nobr"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "nobr",
+                        "children": [
+                          {
+                            "tag": "i"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "i",
+                        "children": [
+                          {
+                            "tag": "nobr",
+                            "children": [
+                              {
+                                "text": "2"
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "nobr"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "nobr",
+                        "children": [
+                          {
+                            "text": "3"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><b><nobr>1</nobr><nobr></nobr></b><div><nobr><i></i></nobr><i><nobr>2</nobr><nobr></nobr></i><nobr>3</nobr></div></body></html>",
+        "noQuirksBodyHtml": "<b><nobr>1</nobr><nobr></nobr></b><div><nobr><i></i></nobr><i><nobr>2</nobr><nobr></nobr></i><nobr>3</nobr></div>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "nobr": true,
+            "ins": true,
+            "i": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "nobr",
+                        "children": [
+                          {
+                            "text": "1"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "nobr",
+                        "children": [
+                          {
+                            "tag": "ins"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "nobr",
+                    "children": [
+                      {
+                        "tag": "i"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "i",
+                    "children": [
+                      {
+                        "tag": "nobr"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><b><nobr>1</nobr><nobr><ins></ins></nobr></b><nobr><i></i></nobr><i><nobr></nobr></i></body></html>",
+        "noQuirksBodyHtml": "<b><nobr>1</nobr><nobr><ins></ins></nobr></b><nobr><i></i></nobr><i><nobr></nobr></i>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "nobr": true,
+            "ins": true,
+            "i": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "nobr",
+                        "children": [
+                          {
+                            "text": "1"
+                          },
+                          {
+                            "tag": "ins"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "nobr"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "nobr",
+                    "children": [
+                      {
+                        "tag": "i",
+                        "children": [
+                          {
+                            "text": "2"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><b><nobr>1<ins></ins></nobr><nobr></nobr></b><nobr><i>2</i></nobr></body></html>",
+        "noQuirksBodyHtml": "<b><nobr>1<ins></ins></nobr><nobr></nobr></b><nobr><i>2</i></nobr>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "nobr": true,
+            "i": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "text": "1"
+                      },
+                      {
+                        "tag": "nobr"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "nobr",
+                    "children": [
+                      {
+                        "tag": "i"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "i",
+                    "children": [
+                      {
+                        "tag": "nobr",
+                        "children": [
+                          {
+                            "text": "2"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><b>1<nobr></nobr></b><nobr><i></i></nobr><i><nobr>2</nobr></i></body></html>",
+        "noQuirksBodyHtml": "<b>1<nobr></nobr></b><nobr><i></i></nobr><i><nobr>2</nobr></i>"
+      }
+    },
+    {
+      "data": "<p><code x</code></p>\n",
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "code": true
+          },
+          "attrWithFunnyChar": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "code",
+                        "attrs": [
+                          {
+                            "name": "code",
+                            "value": ""
+                          },
+                          {
+                            "name": "x<",
+                            "value": ""
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "code",
+                    "attrs": [
+                      {
+                        "name": "code",
+                        "value": ""
+                      },
+                      {
+                        "name": "x<",
+                        "value": ""
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "\n"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><p><code x<=\"\" code=\"\"></code></p><code x<=\"\" code=\"\">\n</code></body></html>",
+        "noQuirksBodyHtml": "<p><code x<=\"\" code=\"\"></code></p><code x<=\"\" code=\"\">\n</code>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><svg><foreignObject><p><i></p>a",
+      "errors": [
+        "(1,45): unexpected-end-tag",
+        "(1,46): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg foreignObject": true,
+            "p": true,
+            "i": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "foreignObject",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "tag": "p",
+                            "children": [
+                              {
+                                "tag": "i"
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "text": "a"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><svg><foreignObject><p><i></i></p><i>a</i></foreignObject></svg></body></html>",
+        "noQuirksBodyHtml": "<svg><foreignObject><p><i></i></p><i>a</i></foreignObject></svg>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><table><tr><td><svg><foreignObject><p><i></p>a",
+      "errors": [
+        "(1,60): unexpected-end-tag",
+        "(1,61): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "svg svg": true,
+            "svg foreignObject": true,
+            "p": true,
+            "i": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "svg",
+                                    "ns": "http://www.w3.org/2000/svg",
+                                    "children": [
+                                      {
+                                        "tag": "foreignObject",
+                                        "ns": "http://www.w3.org/2000/svg",
+                                        "children": [
+                                          {
+                                            "tag": "p",
+                                            "children": [
+                                              {
+                                                "tag": "i"
+                                              }
+                                            ]
+                                          },
+                                          {
+                                            "tag": "i",
+                                            "children": [
+                                              {
+                                                "text": "a"
+                                              }
+                                            ]
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><svg><foreignObject><p><i></i></p><i>a</i></foreignObject></svg></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><svg><foreignObject><p><i></i></p><i>a</i></foreignObject></svg></td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><math><mtext><p><i></p>a",
+      "errors": [
+        "(1,38): unexpected-end-tag",
+        "(1,39): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mtext": true,
+            "p": true,
+            "i": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mtext",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "p",
+                            "children": [
+                              {
+                                "tag": "i"
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "text": "a"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math><mtext><p><i></i></p><i>a</i></mtext></math></body></html>",
+        "noQuirksBodyHtml": "<math><mtext><p><i></i></p><i>a</i></mtext></math>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><table><tr><td><math><mtext><p><i></p>a",
+      "errors": [
+        "(1,53): unexpected-end-tag",
+        "(1,54): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "math math": true,
+            "math mtext": true,
+            "p": true,
+            "i": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "math",
+                                    "ns": "http://www.w3.org/1998/Math/MathML",
+                                    "children": [
+                                      {
+                                        "tag": "mtext",
+                                        "ns": "http://www.w3.org/1998/Math/MathML",
+                                        "children": [
+                                          {
+                                            "tag": "p",
+                                            "children": [
+                                              {
+                                                "tag": "i"
+                                              }
+                                            ]
+                                          },
+                                          {
+                                            "tag": "i",
+                                            "children": [
+                                              {
+                                                "text": "a"
+                                              }
+                                            ]
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><math><mtext><p><i></i></p><i>a</i></mtext></math></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><math><mtext><p><i></i></p><i>a</i></mtext></math></td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><div><!/div>a",
+      "errors": [
+        "(1,28): expected-dashes-or-doctype",
+        "(1,34): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          },
+          "doctype": true,
+          "comment": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "comment": "/div"
+                      },
+                      {
+                        "text": "a"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><div><!--/div-->a</div></body></html>",
+        "noQuirksBodyHtml": "<div><!--/div-->a</div>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "button": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "button",
+                    "children": [
+                      {
+                        "tag": "p"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "button"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><button><p></p></button><button></button></body></html>",
+        "noQuirksBodyHtml": "<button><p></p></button><button></button>"
+      }
+    }
+  ],
+  "tests3.dat": [
+    {
+      "data": "<head></head><style></style>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,20): unexpected-start-tag-out-of-my-head"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style"
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><style></style></head><body></body></html>",
+        "noQuirksBodyHtml": "<style></style>"
+      }
+    },
+    {
+      "data": "<head></head><script></script>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,21): unexpected-start-tag-out-of-my-head"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script"
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script></script></head><body></body></html>",
+        "noQuirksBodyHtml": "<script></script>"
+      }
+    },
+    {
+      "data": "<head></head><!-- --><style></style><!-- --><script></script>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "script": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style"
+                  },
+                  {
+                    "tag": "script"
+                  }
+                ]
+              },
+              {
+                "comment": " "
+              },
+              {
+                "comment": " "
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><style></style><script></script></head><!-- --><!-- --><body></body></html>",
+        "noQuirksBodyHtml": "<!-- --><style></style><!-- --><script></script>"
+      }
+    },
+    {
+      "data": "<head></head><!-- -->x<style></style><!-- --><script></script>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "style": true,
+            "script": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "comment": " "
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "x"
+                  },
+                  {
+                    "tag": "style"
+                  },
+                  {
+                    "comment": " "
+                  },
+                  {
+                    "tag": "script"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><!-- --><body>x<style></style><!-- --><script></script></body></html>",
+        "noQuirksBodyHtml": "<!-- -->x<style></style><!-- --><script></script>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><html><head></head><body><pre>\n</pre></body></html>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "pre": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "pre"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><pre></pre></body></html>",
+        "noQuirksBodyHtml": "<pre></pre>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><html><head></head><body><pre>\nfoo</pre></body></html>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "pre": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "pre",
+                    "children": [
+                      {
+                        "text": "foo"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><pre>foo</pre></body></html>",
+        "noQuirksBodyHtml": "<pre>foo</pre>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><html><head></head><body><pre>\n\nfoo</pre></body></html>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "pre": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "pre",
+                    "children": [
+                      {
+                        "text": "\nfoo"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><pre>\nfoo</pre></body></html>",
+        "noQuirksBodyHtml": "<pre>\nfoo</pre>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><html><head></head><body><pre>\nfoo\n</pre></body></html>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "pre": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "pre",
+                    "children": [
+                      {
+                        "text": "foo\n"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><pre>foo\n</pre></body></html>",
+        "noQuirksBodyHtml": "<pre>foo\n</pre>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><html><head></head><body><pre>x</pre><span>\n</span></body></html>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "pre": true,
+            "span": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "pre",
+                    "children": [
+                      {
+                        "text": "x"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "span",
+                    "children": [
+                      {
+                        "text": "\n"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><pre>x</pre><span>\n</span></body></html>",
+        "noQuirksBodyHtml": "<pre>x</pre><span>\n</span>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><html><head></head><body><pre>x\ny</pre></body></html>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "pre": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "pre",
+                    "children": [
+                      {
+                        "text": "x\ny"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><pre>x\ny</pre></body></html>",
+        "noQuirksBodyHtml": "<pre>x\ny</pre>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><html><head></head><body><pre>x<div>\ny</pre></body></html>",
+      "errors": [
+        "(2,7): end-tag-too-early"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "pre": true,
+            "div": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "pre",
+                    "children": [
+                      {
+                        "text": "x"
+                      },
+                      {
+                        "tag": "div",
+                        "children": [
+                          {
+                            "text": "\ny"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><pre>x<div>\ny</div></pre></body></html>",
+        "noQuirksBodyHtml": "<pre>x<div>\ny</div></pre>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><pre>&#x0a;&#x0a;A</pre>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "pre": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "pre",
+                    "children": [
+                      {
+                        "text": "\nA"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><pre>\nA</pre></body></html>",
+        "noQuirksBodyHtml": "<pre>\nA</pre>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><HTML><META><HEAD></HEAD></HTML>",
+      "errors": [
+        "(1,33): two-heads-are-not-better-than-one"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "meta": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "meta"
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><meta></head><body></body></html>",
+        "noQuirksBodyHtml": "<meta>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><HTML><HEAD><head></HEAD></HTML>",
+      "errors": [
+        "(1,33): two-heads-are-not-better-than-one"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<textarea>foo<span>bar</span><i>baz",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag",
+        "(1,35): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "textarea": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "textarea",
+                    "children": [
+                      {
+                        "text": "foo<span>bar</span><i>baz",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><textarea>foo&lt;span&gt;bar&lt;/span&gt;&lt;i&gt;baz</textarea></body></html>",
+        "noQuirksBodyHtml": "<textarea>foo&lt;span&gt;bar&lt;/span&gt;&lt;i&gt;baz</textarea>"
+      }
+    },
+    {
+      "data": "<title>foo<span>bar</em><i>baz",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,30): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "title": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "foo<span>bar</em><i>baz",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><title>foo&lt;span&gt;bar&lt;/em&gt;&lt;i&gt;baz</title></head><body></body></html>",
+        "noQuirksBodyHtml": "<title>foo&lt;span&gt;bar&lt;/em&gt;&lt;i&gt;baz</title>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><textarea>\n</textarea>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "textarea": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "textarea"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><textarea></textarea></body></html>",
+        "noQuirksBodyHtml": "<textarea></textarea>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><textarea>\nfoo</textarea>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "textarea": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "textarea",
+                    "children": [
+                      {
+                        "text": "foo"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><textarea>foo</textarea></body></html>",
+        "noQuirksBodyHtml": "<textarea>foo</textarea>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><textarea>\n\nfoo</textarea>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "textarea": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "textarea",
+                    "children": [
+                      {
+                        "text": "\nfoo"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><textarea>\nfoo</textarea></body></html>",
+        "noQuirksBodyHtml": "<textarea>\nfoo</textarea>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><html><head></head><body><ul><li><div><p><li></ul></body></html>",
+      "errors": [
+        "(1,60): end-tag-too-early"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ul": true,
+            "li": true,
+            "div": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ul",
+                    "children": [
+                      {
+                        "tag": "li",
+                        "children": [
+                          {
+                            "tag": "div",
+                            "children": [
+                              {
+                                "tag": "p"
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "li"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><ul><li><div><p></p></div></li><li></li></ul></body></html>",
+        "noQuirksBodyHtml": "<ul><li><div><p></p></div></li><li></li></ul>"
+      }
+    },
+    {
+      "data": "<!doctype html><nobr><nobr><nobr>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "nobr": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "nobr"
+                  },
+                  {
+                    "tag": "nobr"
+                  },
+                  {
+                    "tag": "nobr"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><nobr></nobr><nobr></nobr><nobr></nobr></body></html>",
+        "noQuirksBodyHtml": "<nobr></nobr><nobr></nobr><nobr></nobr>"
+      }
+    },
+    {
+      "data": "<!doctype html><nobr><nobr></nobr><nobr>",
+      "errors": [
+        "(1,27): unexpected-start-tag-implies-end-tag",
+        "(1,40): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "nobr": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "nobr"
+                  },
+                  {
+                    "tag": "nobr"
+                  },
+                  {
+                    "tag": "nobr"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><nobr></nobr><nobr></nobr><nobr></nobr></body></html>",
+        "noQuirksBodyHtml": "<nobr></nobr><nobr></nobr><nobr></nobr>"
+      }
+    },
+    {
+      "data": "<!doctype html><html><body><p><table></table></body></html>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p"
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p></p><table></table></body></html>",
+        "noQuirksBodyHtml": "<p></p><table></table>"
+      }
+    },
+    {
+      "data": "<p><table></table>",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "table": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "table"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><p><table></table></p></body></html>",
+        "noQuirksBodyHtml": "<p></p><table></table>"
+      }
+    }
+  ],
+  "tests4.dat": [
+    {
+      "data": "direct div content",
+      "errors": [],
+      "fragment": {
+        "name": "div"
+      },
+      "document": {
+        "props": {
+          "tags": {}
+        },
+        "tree": [
+          {
+            "text": "direct div content"
+          }
+        ],
+        "html": "direct div content",
+        "noQuirksBodyHtml": "direct div content"
+      }
+    },
+    {
+      "data": "direct textarea content",
+      "errors": [],
+      "fragment": {
+        "name": "textarea"
+      },
+      "document": {
+        "props": {
+          "tags": {}
+        },
+        "tree": [
+          {
+            "text": "direct textarea content"
+          }
+        ],
+        "html": "direct textarea content",
+        "noQuirksBodyHtml": "direct textarea content"
+      }
+    },
+    {
+      "data": "textarea content with <em>pseudo</em> <foo>markup",
+      "errors": [],
+      "fragment": {
+        "name": "textarea"
+      },
+      "document": {
+        "props": {
+          "tags": {},
+          "escaped": true
+        },
+        "tree": [
+          {
+            "text": "textarea content with <em>pseudo</em> <foo>markup",
+            "escaped": true
+          }
+        ],
+        "html": "textarea content with &lt;em&gt;pseudo&lt;/em&gt; &lt;foo&gt;markup",
+        "noQuirksBodyHtml": "textarea content with <em>pseudo</em> <foo>markup</foo>"
+      }
+    },
+    {
+      "data": "this is &#x0043;DATA inside a <style> element",
+      "errors": [],
+      "fragment": {
+        "name": "style"
+      },
+      "document": {
+        "props": {
+          "tags": {},
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "text": "this is &#x0043;DATA inside a <style> element",
+            "no_escape": true
+          }
+        ],
+        "html": "this is &#x0043;DATA inside a <style> element",
+        "noQuirksBodyHtml": "this is CDATA inside a <style> element</style>"
+      }
+    },
+    {
+      "data": "</plaintext>",
+      "errors": [],
+      "fragment": {
+        "name": "plaintext"
+      },
+      "document": {
+        "props": {
+          "tags": {},
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "text": "</plaintext>",
+            "no_escape": true
+          }
+        ],
+        "html": "</plaintext>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "setting html's innerHTML",
+      "errors": [],
+      "fragment": {
+        "name": "html"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "head"
+          },
+          {
+            "tag": "body",
+            "children": [
+              {
+                "text": "setting html's innerHTML"
+              }
+            ]
+          }
+        ],
+        "html": "<head></head><body>setting html's innerHTML</body>",
+        "noQuirksBodyHtml": "setting html's innerHTML"
+      }
+    },
+    {
+      "data": "<title>setting head's innerHTML</title>",
+      "errors": [],
+      "fragment": {
+        "name": "head"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "title": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "title",
+            "children": [
+              {
+                "text": "setting head's innerHTML"
+              }
+            ]
+          }
+        ],
+        "html": "<title>setting head's innerHTML</title>",
+        "noQuirksBodyHtml": "<title>setting head's innerHTML</title>"
+      }
+    }
+  ],
+  "tests5.dat": [
+    {
+      "data": "<style> <!-- </style>x",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": " <!-- ",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "x"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><style> <!-- </style></head><body>x</body></html>",
+        "noQuirksBodyHtml": "<style> <!-- </style>x"
+      }
+    },
+    {
+      "data": "<style> <!-- </style> --> </style>x",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,34): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": " <!-- ",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": " "
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "--> x",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><style> <!-- </style> </head><body>--&gt; x</body></html>",
+        "noQuirksBodyHtml": "<style> <!-- </style> --&gt; x"
+      }
+    },
+    {
+      "data": "<style> <!--> </style>x",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": " <!--> ",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "x"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><style> <!--> </style></head><body>x</body></html>",
+        "noQuirksBodyHtml": "<style> <!--> </style>x"
+      }
+    },
+    {
+      "data": "<style> <!---> </style>x",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": " <!---> ",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "x"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><style> <!---> </style></head><body>x</body></html>",
+        "noQuirksBodyHtml": "<style> <!---> </style>x"
+      }
+    },
+    {
+      "data": "<iframe> <!---> </iframe>x",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "iframe": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "iframe",
+                    "children": [
+                      {
+                        "text": " <!---> ",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "x"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><iframe> <!---> </iframe>x</body></html>",
+        "noQuirksBodyHtml": "<iframe> <!---> </iframe>x"
+      }
+    },
+    {
+      "data": "<iframe> <!--- </iframe>->x</iframe> --> </iframe>x",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,36): unexpected-end-tag",
+        "(1,50): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "iframe": true
+          },
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "iframe",
+                    "children": [
+                      {
+                        "text": " <!--- ",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "->x --> x",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><iframe> <!--- </iframe>-&gt;x --&gt; x</body></html>",
+        "noQuirksBodyHtml": "<iframe> <!--- </iframe>-&gt;x --&gt; x"
+      }
+    },
+    {
+      "data": "<script> <!-- </script> --> </script>x",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,37): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "script": true,
+            "body": true
+          },
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": " <!-- ",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": " "
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "--> x",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><script> <!-- </script> </head><body>--&gt; x</body></html>",
+        "noQuirksBodyHtml": "<script> <!-- </script> --&gt; x"
+      }
+    },
+    {
+      "data": "<title> <!-- </title> --> </title>x",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,34): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "title": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": " <!-- ",
+                        "escaped": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": " "
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "--> x",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><title> &lt;!-- </title> </head><body>--&gt; x</body></html>",
+        "noQuirksBodyHtml": "<title> &lt;!-- </title> --&gt; x"
+      }
+    },
+    {
+      "data": "<textarea> <!--- </textarea>->x</textarea> --> </textarea>x",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag",
+        "(1,42): unexpected-end-tag",
+        "(1,58): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "textarea": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "textarea",
+                    "children": [
+                      {
+                        "text": " <!--- ",
+                        "escaped": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "->x --> x",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><textarea> &lt;!--- </textarea>-&gt;x --&gt; x</body></html>",
+        "noQuirksBodyHtml": "<textarea> &lt;!--- </textarea>-&gt;x --&gt; x"
+      }
+    },
+    {
+      "data": "<style> <!</-- </style>x",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style",
+                    "children": [
+                      {
+                        "text": " <!</-- ",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "x"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><style> <!</-- </style></head><body>x</body></html>",
+        "noQuirksBodyHtml": "<style> <!</-- </style>x"
+      }
+    },
+    {
+      "data": "<p><xmp></xmp>",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "xmp": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p"
+                  },
+                  {
+                    "tag": "xmp"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><p></p><xmp></xmp></body></html>",
+        "noQuirksBodyHtml": "<p></p><xmp></xmp>"
+      }
+    },
+    {
+      "data": "<xmp> <!-- > --> </xmp>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "xmp": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "xmp",
+                    "children": [
+                      {
+                        "text": " <!-- > --> ",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><xmp> <!-- > --> </xmp></body></html>",
+        "noQuirksBodyHtml": "<xmp> <!-- > --> </xmp>"
+      }
+    },
+    {
+      "data": "<title>&amp;</title>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "title": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "&",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><title>&amp;</title></head><body></body></html>",
+        "noQuirksBodyHtml": "<title>&amp;</title>"
+      }
+    },
+    {
+      "data": "<title><!--&amp;--></title>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "title": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "<!--&-->",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><title>&lt;!--&amp;--&gt;</title></head><body></body></html>",
+        "noQuirksBodyHtml": "<title>&lt;!--&amp;--&gt;</title>"
+      }
+    },
+    {
+      "data": "<title><!--</title>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "title": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "<!--",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><title>&lt;!--</title></head><body></body></html>",
+        "noQuirksBodyHtml": "<title>&lt;!--</title>"
+      }
+    },
+    {
+      "data": "<noscript><!--</noscript>--></noscript>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag",
+        "(1,39): unexpected-end-tag"
+      ],
+      "script": "on",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "no_escape": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "text": "<!--",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "-->",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript><!--</noscript></head><body>--&gt;</body></html>",
+        "noQuirksBodyHtml": "<noscript><!--</noscript>--></noscript>"
+      }
+    },
+    {
+      "data": "<noscript><!--</noscript>--></noscript>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag"
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "comment": "</noscript>"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><noscript><!--</noscript>--></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><!--</noscript>--></noscript>"
+      }
+    }
+  ],
+  "tests6.dat": [
+    {
+      "data": "<!doctype html></head> <head>",
+      "errors": [
+        "(1,29): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "text": " "
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head> <body></body></html>",
+        "noQuirksBodyHtml": " "
+      }
+    },
+    {
+      "data": "<!doctype html><form><div></form><div>",
+      "errors": [
+        "(1,33): end-tag-too-early-ignored",
+        "(1,38): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "form": true,
+            "div": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "form",
+                    "children": [
+                      {
+                        "tag": "div",
+                        "children": [
+                          {
+                            "tag": "div"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><form><div><div></div></div></form></body></html>",
+        "noQuirksBodyHtml": "<form><div><div></div></div></form>"
+      }
+    },
+    {
+      "data": "<!doctype html><title>&amp;</title>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "title": true,
+            "body": true
+          },
+          "doctype": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "&",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><title>&amp;</title></head><body></body></html>",
+        "noQuirksBodyHtml": "<title>&amp;</title>"
+      }
+    },
+    {
+      "data": "<!doctype html><title><!--&amp;--></title>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "title": true,
+            "body": true
+          },
+          "doctype": true,
+          "escaped": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "<!--&-->",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><title>&lt;!--&amp;--&gt;</title></head><body></body></html>",
+        "noQuirksBodyHtml": "<title>&lt;!--&amp;--&gt;</title>"
+      }
+    },
+    {
+      "data": "<!doctype>",
+      "errors": [
+        "(1,9): need-space-after-doctype",
+        "(1,10): expected-doctype-name-but-got-right-bracket",
+        "(1,10): unknown-doctype"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": ""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE ><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<!---x",
+      "errors": [
+        "(1,6): eof-in-comment",
+        "(1,6): expected-doctype-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "comment": "-x"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!---x--><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!---x-->"
+      }
+    },
+    {
+      "data": "<body>\n<div>",
+      "errors": [
+        "(1,6): unexpected-start-tag",
+        "(2,5): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "div"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "text": "\n"
+          },
+          {
+            "tag": "div"
+          }
+        ],
+        "html": "\n<div></div>",
+        "noQuirksBodyHtml": "\n<div></div>"
+      }
+    },
+    {
+      "data": "<frameset></frameset>\nfoo",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              },
+              {
+                "text": "\n"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset>\n</html>",
+        "noQuirksBodyHtml": "\nfoo"
+      }
+    },
+    {
+      "data": "<frameset></frameset>\n<noframes>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag",
+        "(2,10): expected-named-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true,
+            "noframes": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              },
+              {
+                "text": "\n"
+              },
+              {
+                "tag": "noframes"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset>\n<noframes></noframes></html>",
+        "noQuirksBodyHtml": "\n<noframes></noframes>"
+      }
+    },
+    {
+      "data": "<frameset></frameset>\n<div>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag",
+        "(2,5): unexpected-start-tag-after-frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              },
+              {
+                "text": "\n"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset>\n</html>",
+        "noQuirksBodyHtml": "\n<div></div>"
+      }
+    },
+    {
+      "data": "<frameset></frameset>\n</html>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              },
+              {
+                "text": "\n"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset>\n</html>",
+        "noQuirksBodyHtml": "\n"
+      }
+    },
+    {
+      "data": "<frameset></frameset>\n</div>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag",
+        "(2,6): unexpected-end-tag-after-frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              },
+              {
+                "text": "\n"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset>\n</html>",
+        "noQuirksBodyHtml": "\n"
+      }
+    },
+    {
+      "data": "<form><form>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,12): unexpected-start-tag",
+        "(1,12): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "form": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "form"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><form></form></body></html>",
+        "noQuirksBodyHtml": "<form></form>"
+      }
+    },
+    {
+      "data": "<button><button>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "button": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "button"
+                  },
+                  {
+                    "tag": "button"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><button></button><button></button></body></html>",
+        "noQuirksBodyHtml": "<button></button><button></button>"
+      }
+    },
+    {
+      "data": "<table><tr><td></th>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,20): unexpected-end-tag",
+        "(1,20): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><tr><td></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td></td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<table><caption><td>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,20): unexpected-cell-in-table-body",
+        "(1,20): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "caption": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "caption"
+                      },
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><caption></caption><tbody><tr><td></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><caption></caption><tbody><tr><td></td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<table><caption><div>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,21): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "caption": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "caption",
+                        "children": [
+                          {
+                            "tag": "div"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><caption><div></div></caption></table></body></html>",
+        "noQuirksBodyHtml": "<table><caption><div></div></caption></table>"
+      }
+    },
+    {
+      "data": "</caption><div>",
+      "errors": [
+        "(1,10): XXX-undefined-error",
+        "(1,15): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "caption"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "div"
+          }
+        ],
+        "html": "<div></div>",
+        "noQuirksBodyHtml": "<div></div>"
+      }
+    },
+    {
+      "data": "<table><caption><div></caption>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,31): expected-one-end-tag-but-got-another",
+        "(1,31): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "caption": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "caption",
+                        "children": [
+                          {
+                            "tag": "div"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><caption><div></div></caption></table></body></html>",
+        "noQuirksBodyHtml": "<table><caption><div></div></caption></table>"
+      }
+    },
+    {
+      "data": "<table><caption></table>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "caption": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "caption"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><caption></caption></table></body></html>",
+        "noQuirksBodyHtml": "<table><caption></caption></table>"
+      }
+    },
+    {
+      "data": "</table><div>",
+      "errors": [
+        "(1,8): unexpected-end-tag",
+        "(1,13): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "caption"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "div"
+          }
+        ],
+        "html": "<div></div>",
+        "noQuirksBodyHtml": "<div></div>"
+      }
+    },
+    {
+      "data": "<table><caption></body></col></colgroup></html></tbody></td></tfoot></th></thead></tr>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "caption": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "caption"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><caption></caption></table></body></html>",
+        "noQuirksBodyHtml": "<table><caption></caption></table>"
+      }
+    },
+    {
+      "data": "<table><caption><div></div>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,27): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "caption": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "caption",
+                        "children": [
+                          {
+                            "tag": "div"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><caption><div></div></caption></table></body></html>",
+        "noQuirksBodyHtml": "<table><caption><div></div></caption></table>"
+      }
+    },
+    {
+      "data": "<table><tr><td></body></caption></col></colgroup></html>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><tr><td></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td></td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "</table></tbody></tfoot></thead></tr><div>",
+      "errors": [
+        "(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"
+      ],
+      "fragment": {
+        "name": "td"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "div"
+          }
+        ],
+        "html": "<div></div>",
+        "noQuirksBodyHtml": "<div></div>"
+      }
+    },
+    {
+      "data": "<table><colgroup>foo",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "colgroup": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "foo"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "colgroup"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>foo<table><colgroup></colgroup></table></body></html>",
+        "noQuirksBodyHtml": "foo<table><colgroup></colgroup></table>"
+      }
+    },
+    {
+      "data": "foo<col>",
+      "errors": [
+        "(1,1): unexpected-character-in-colgroup",
+        "(1,2): unexpected-character-in-colgroup",
+        "(1,3): unexpected-character-in-colgroup"
+      ],
+      "fragment": {
+        "name": "colgroup"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "col": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "col"
+          }
+        ],
+        "html": "<col>",
+        "noQuirksBodyHtml": "foo"
+      }
+    },
+    {
+      "data": "<table><colgroup></col>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,23): no-end-tag",
+        "(1,23): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "colgroup": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "colgroup"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><colgroup></colgroup></table></body></html>",
+        "noQuirksBodyHtml": "<table><colgroup></colgroup></table>"
+      }
+    },
+    {
+      "data": "<frameset><div>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag",
+        "(1,15): unexpected-start-tag-in-frameset",
+        "(1,15): eof-in-frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "<div></div>"
+      }
+    },
+    {
+      "data": "</frameset><frame>",
+      "errors": [
+        "(1,11): unexpected-frameset-in-frameset-innerhtml"
+      ],
+      "fragment": {
+        "name": "frameset"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "frame": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "frame"
+          }
+        ],
+        "html": "<frame>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<frameset></div>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag",
+        "(1,16): unexpected-end-tag-in-frameset",
+        "(1,16): eof-in-frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "</body><div>",
+      "errors": [
+        "(1,7): unexpected-close-tag",
+        "(1,12): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "body"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "div"
+          }
+        ],
+        "html": "<div></div>",
+        "noQuirksBodyHtml": "<div></div>"
+      }
+    },
+    {
+      "data": "<table><tr><div>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,16): unexpected-start-tag-implies-table-voodoo",
+        "(1,16): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "table": true,
+            "tbody": true,
+            "tr": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div></div><table><tbody><tr></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<div></div><table><tbody><tr></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "</tr><td>",
+      "errors": [
+        "(1,5): unexpected-end-tag"
+      ],
+      "fragment": {
+        "name": "tr"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "td"
+          }
+        ],
+        "html": "<td></td>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "</tbody></tfoot></thead><td>",
+      "errors": [
+        "(1,8): unexpected-end-tag",
+        "(1,16): unexpected-end-tag",
+        "(1,24): unexpected-end-tag"
+      ],
+      "fragment": {
+        "name": "tr"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "td"
+          }
+        ],
+        "html": "<td></td>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<table><tr><div><td>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,16): foster-parenting-start-tag",
+        "(1,20): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div></div><table><tbody><tr><td></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<div></div><table><tbody><tr><td></td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<caption><col><colgroup><tbody><tfoot><thead><tr>",
+      "errors": [
+        "(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"
+      ],
+      "fragment": {
+        "name": "tbody"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "tr": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "tr"
+          }
+        ],
+        "html": "<tr></tr>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<table><tbody></thead>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,22): unexpected-end-tag-in-table-body",
+        "(1,22): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody></tbody></table>"
+      }
+    },
+    {
+      "data": "</table><tr>",
+      "errors": [
+        "(1,8): unexpected-end-tag"
+      ],
+      "fragment": {
+        "name": "tbody"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "tr": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "tr"
+          }
+        ],
+        "html": "<tr></tr>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<table><tbody></body></caption></col></colgroup></html></td></th></tr>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody></tbody></table>"
+      }
+    },
+    {
+      "data": "<table><tbody></div>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody></tbody></table>"
+      }
+    },
+    {
+      "data": "<table><table>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,14): unexpected-start-tag-implies-end-tag",
+        "(1,14): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table"
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table></table><table></table></body></html>",
+        "noQuirksBodyHtml": "<table></table><table></table>"
+      }
+    },
+    {
+      "data": "<table></body></caption></col></colgroup></html></tbody></td></tfoot></th></thead></tr>",
+      "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,87): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table></table></body></html>",
+        "noQuirksBodyHtml": "<table></table>"
+      }
+    },
+    {
+      "data": "</table><tr>",
+      "errors": [
+        "(1,8): unexpected-end-tag"
+      ],
+      "fragment": {
+        "name": "table"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "tbody": true,
+            "tr": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "tbody",
+            "children": [
+              {
+                "tag": "tr"
+              }
+            ]
+          }
+        ],
+        "html": "<tbody><tr></tr></tbody>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<body></body></html>",
+      "errors": [
+        "(1,20): unexpected-end-tag-after-body-innerhtml"
+      ],
+      "fragment": {
+        "name": "html"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "head"
+          },
+          {
+            "tag": "body"
+          }
+        ],
+        "html": "<head></head><body></body>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<html><frameset></frameset></html> ",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              },
+              {
+                "text": " "
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset> </html>",
+        "noQuirksBodyHtml": " "
+      }
+    },
+    {
+      "data": "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\"><html></html>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html \"-//W3C//DTD HTML 4.01//EN\" \"\""
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<param><frameset></frameset>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,17): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "<param>"
+      }
+    },
+    {
+      "data": "<source><frameset></frameset>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,18): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "<source>"
+      }
+    },
+    {
+      "data": "<track><frameset></frameset>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,17): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "<track>"
+      }
+    },
+    {
+      "data": "</html><frameset></frameset>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-end-tag",
+        "(1,17): expected-eof-but-got-start-tag",
+        "(1,17): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "</body><frameset></frameset>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-end-tag",
+        "(1,17): unexpected-start-tag-after-body",
+        "(1,17): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": ""
+      }
+    }
+  ],
+  "tests7.dat": [
+    {
+      "data": "<!doctype html><body><title>X</title>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "title": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "X"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><title>X</title></body></html>",
+        "noQuirksBodyHtml": "<title>X</title>"
+      }
+    },
+    {
+      "data": "<!doctype html><table><title>X</title></table>",
+      "errors": [
+        "(1,29): unexpected-start-tag-implies-table-voodoo"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "title": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "X"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><title>X</title><table></table></body></html>",
+        "noQuirksBodyHtml": "<title>X</title><table></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><head></head><title>X</title>",
+      "errors": [
+        "(1,35): unexpected-start-tag-out-of-my-head"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "title": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "X"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><title>X</title></head><body></body></html>",
+        "noQuirksBodyHtml": "<title>X</title>"
+      }
+    },
+    {
+      "data": "<!doctype html></head><title>X</title>",
+      "errors": [
+        "(1,29): unexpected-start-tag-out-of-my-head"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "title": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "title",
+                    "children": [
+                      {
+                        "text": "X"
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head><title>X</title></head><body></body></html>",
+        "noQuirksBodyHtml": "<title>X</title>"
+      }
+    },
+    {
+      "data": "<!doctype html><table><meta></table>",
+      "errors": [
+        "(1,28): unexpected-start-tag-implies-table-voodoo"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "meta": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "meta"
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><meta><table></table></body></html>",
+        "noQuirksBodyHtml": "<meta><table></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><table>X<tr><td><table> <meta></table></table>",
+      "errors": [
+        "unexpected text in table",
+        "(1,45): unexpected-start-tag-implies-table-voodoo"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "meta": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "X"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "meta"
+                                  },
+                                  {
+                                    "tag": "table",
+                                    "children": [
+                                      {
+                                        "text": " "
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>X<table><tbody><tr><td><meta><table> </table></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "X<table><tbody><tr><td><meta><table> </table></td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><html> <head>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": " "
+      }
+    },
+    {
+      "data": "<!doctype html> <head>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": " "
+      }
+    },
+    {
+      "data": "<!doctype html><table><style> <tr>x </style> </table>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "style": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "style",
+                        "children": [
+                          {
+                            "text": " <tr>x ",
+                            "no_escape": true
+                          }
+                        ]
+                      },
+                      {
+                        "text": " "
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><style> <tr>x </style> </table></body></html>",
+        "noQuirksBodyHtml": "<table><style> <tr>x </style> </table>"
+      }
+    },
+    {
+      "data": "<!doctype html><table><TBODY><script> <tr>x </script> </table>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "script": true
+          },
+          "doctype": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "script",
+                            "children": [
+                              {
+                                "text": " <tr>x ",
+                                "no_escape": true
+                              }
+                            ]
+                          },
+                          {
+                            "text": " "
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><script> <tr>x </script> </tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><script> <tr>x </script> </tbody></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><applet><p>X</p></applet>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "applet": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "applet",
+                        "children": [
+                          {
+                            "tag": "p",
+                            "children": [
+                              {
+                                "text": "X"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><applet><p>X</p></applet></p></body></html>",
+        "noQuirksBodyHtml": "<p><applet><p>X</p></applet></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><p><object type=\"application/x-non-existant-plugin\"><p>X</p></object>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "object": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "object",
+                        "attrs": [
+                          {
+                            "name": "type",
+                            "value": "application/x-non-existant-plugin"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "tag": "p",
+                            "children": [
+                              {
+                                "text": "X"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><p><object type=\"application/x-non-existant-plugin\"><p>X</p></object></p></body></html>",
+        "noQuirksBodyHtml": "<p><object type=\"application/x-non-existant-plugin\"><p>X</p></object></p>"
+      }
+    },
+    {
+      "data": "<!doctype html><listing>\nX</listing>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "listing": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "listing",
+                    "children": [
+                      {
+                        "text": "X"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><listing>X</listing></body></html>",
+        "noQuirksBodyHtml": "<listing>X</listing>"
+      }
+    },
+    {
+      "data": "<!doctype html><select><input>X",
+      "errors": [
+        "(1,30): unexpected-input-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "input": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select"
+                  },
+                  {
+                    "tag": "input"
+                  },
+                  {
+                    "text": "X"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select></select><input>X</body></html>",
+        "noQuirksBodyHtml": "<select></select><input>X"
+      }
+    },
+    {
+      "data": "<!doctype html><select><select>X",
+      "errors": [
+        "(1,31): unexpected-select-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select"
+                  },
+                  {
+                    "text": "X"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select></select>X</body></html>",
+        "noQuirksBodyHtml": "<select></select>X"
+      }
+    },
+    {
+      "data": "<!doctype html><table><input type=hidDEN></table>",
+      "errors": [
+        "(1,41): unexpected-hidden-input-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "input": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "input",
+                        "attrs": [
+                          {
+                            "name": "type",
+                            "value": "hidDEN"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><input type=\"hidDEN\"></table></body></html>",
+        "noQuirksBodyHtml": "<table><input type=\"hidDEN\"></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><table>X<input type=hidDEN></table>",
+      "errors": [
+        "(1,23): foster-parenting-character",
+        "(1,42): unexpected-hidden-input-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "input": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "X"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "input",
+                        "attrs": [
+                          {
+                            "name": "type",
+                            "value": "hidDEN"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body>X<table><input type=\"hidDEN\"></table></body></html>",
+        "noQuirksBodyHtml": "X<table><input type=\"hidDEN\"></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><table>  <input type=hidDEN></table>",
+      "errors": [
+        "(1,43): unexpected-hidden-input-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "input": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "text": "  "
+                      },
+                      {
+                        "tag": "input",
+                        "attrs": [
+                          {
+                            "name": "type",
+                            "value": "hidDEN"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table>  <input type=\"hidDEN\"></table></body></html>",
+        "noQuirksBodyHtml": "<table>  <input type=\"hidDEN\"></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><table>  <input type='hidDEN'></table>",
+      "errors": [
+        "(1,45): unexpected-hidden-input-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "input": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "text": "  "
+                      },
+                      {
+                        "tag": "input",
+                        "attrs": [
+                          {
+                            "name": "type",
+                            "value": "hidDEN"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table>  <input type=\"hidDEN\"></table></body></html>",
+        "noQuirksBodyHtml": "<table>  <input type=\"hidDEN\"></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><table><input type=\" hidden\"><input type=hidDEN></table>",
+      "errors": [
+        "(1,44): unexpected-start-tag-implies-table-voodoo",
+        "(1,63): unexpected-hidden-input-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "input": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "input",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": " hidden"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "input",
+                        "attrs": [
+                          {
+                            "name": "type",
+                            "value": "hidDEN"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><input type=\" hidden\"><table><input type=\"hidDEN\"></table></body></html>",
+        "noQuirksBodyHtml": "<input type=\" hidden\"><table><input type=\"hidDEN\"></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><table><select>X<tr>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "table": true,
+            "tbody": true,
+            "tr": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "text": "X"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select>X</select><table><tbody><tr></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<select>X</select><table><tbody><tr></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!doctype html><select>X</select>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "text": "X"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select>X</select></body></html>",
+        "noQuirksBodyHtml": "<select>X</select>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE hTmL><html></html>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<!DOCTYPE HTML><html></html>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<body>X</body></body>",
+      "errors": [
+        "(1,21): unexpected-end-tag-after-body"
+      ],
+      "fragment": {
+        "name": "html"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "head"
+          },
+          {
+            "tag": "body",
+            "children": [
+              {
+                "text": "X"
+              }
+            ]
+          }
+        ],
+        "html": "<head></head><body>X</body>",
+        "noQuirksBodyHtml": "X"
+      }
+    },
+    {
+      "data": "<div><p>a</x> b",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,13): unexpected-end-tag",
+        "(1,15): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "p",
+                        "children": [
+                          {
+                            "text": "a b"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div><p>a b</p></div></body></html>",
+        "noQuirksBodyHtml": "<div><p>a b</p></div>"
+      }
+    },
+    {
+      "data": "<table><tr><td><code></code> </table>",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "code": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "code"
+                                  },
+                                  {
+                                    "text": " "
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><tr><td><code></code> </td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><code></code> </td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<table><b><tr><td>aaa</td></tr>bbb</table>ccc",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b"
+                  },
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "text": "bbb"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "text": "aaa"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "text": "ccc"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b></b><b>bbb</b><table><tbody><tr><td>aaa</td></tr></tbody></table><b>ccc</b></body></html>",
+        "noQuirksBodyHtml": "<b></b><b>bbb</b><table><tbody><tr><td>aaa</td></tr></tbody></table><b>ccc</b>"
+      }
+    },
+    {
+      "data": "A<table><tr> B</tr> B</table>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "A B B"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>A B B<table><tbody><tr></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "A B B<table><tbody><tr></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "A<table><tr> B</tr> </em>C</table>",
+      "errors": [
+        "(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,25): unexpected-end-tag-in-special-element",
+        "(1,26): foster-parenting-character"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "A BC"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          },
+                          {
+                            "text": " "
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>A BC<table><tbody><tr></tr> </tbody></table></body></html>",
+        "noQuirksBodyHtml": "A BC<table><tbody><tr></tr> </tbody></table>"
+      }
+    },
+    {
+      "data": "<select><keygen>",
+      "errors": [
+        "(1,8): expected-doctype-but-got-start-tag",
+        "(1,16): unexpected-input-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "keygen": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select"
+                  },
+                  {
+                    "tag": "keygen"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><select></select><keygen></body></html>",
+        "noQuirksBodyHtml": "<select></select><keygen>"
+      }
+    }
+  ],
+  "tests8.dat": [
+    {
+      "data": "<div>\n<div></div>\n</span>x",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(3,7): unexpected-end-tag",
+        "(3,8): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": "\n"
+                      },
+                      {
+                        "tag": "div"
+                      },
+                      {
+                        "text": "\nx"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div>\n<div></div>\nx</div></body></html>",
+        "noQuirksBodyHtml": "<div>\n<div></div>\nx</div>"
+      }
+    },
+    {
+      "data": "<div>x<div></div>\n</span>x",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(2,7): unexpected-end-tag",
+        "(2,8): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": "x"
+                      },
+                      {
+                        "tag": "div"
+                      },
+                      {
+                        "text": "\nx"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div>x<div></div>\nx</div></body></html>",
+        "noQuirksBodyHtml": "<div>x<div></div>\nx</div>"
+      }
+    },
+    {
+      "data": "<div>x<div></div>x</span>x",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,25): unexpected-end-tag",
+        "(1,26): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": "x"
+                      },
+                      {
+                        "tag": "div"
+                      },
+                      {
+                        "text": "xx"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div>x<div></div>xx</div></body></html>",
+        "noQuirksBodyHtml": "<div>x<div></div>xx</div>"
+      }
+    },
+    {
+      "data": "<div>x<div></div>y</span>z",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,25): unexpected-end-tag",
+        "(1,26): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": "x"
+                      },
+                      {
+                        "tag": "div"
+                      },
+                      {
+                        "text": "yz"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div>x<div></div>yz</div></body></html>",
+        "noQuirksBodyHtml": "<div>x<div></div>yz</div>"
+      }
+    },
+    {
+      "data": "<table><div>x<div></div>x</span>x",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "table": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": "x"
+                      },
+                      {
+                        "tag": "div"
+                      },
+                      {
+                        "text": "xx"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div>x<div></div>xx</div><table></table></body></html>",
+        "noQuirksBodyHtml": "<div>x<div></div>xx</div><table></table>"
+      }
+    },
+    {
+      "data": "x<table>x",
+      "errors": [
+        "(1,1): expected-doctype-but-got-chars",
+        "(1,9): foster-parenting-character",
+        "(1,9): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "xx"
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>xx<table></table></body></html>",
+        "noQuirksBodyHtml": "xx<table></table>"
+      }
+    },
+    {
+      "data": "x<table><table>x",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "x"
+                  },
+                  {
+                    "tag": "table"
+                  },
+                  {
+                    "text": "x"
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>x<table></table>x<table></table></body></html>",
+        "noQuirksBodyHtml": "x<table></table>x<table></table>"
+      }
+    },
+    {
+      "data": "<b>a<div></div><div></b>y",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag",
+        "(1,24): adoption-agency-1.3",
+        "(1,25): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "text": "a"
+                      },
+                      {
+                        "tag": "div"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "b"
+                      },
+                      {
+                        "text": "y"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b>a<div></div></b><div><b></b>y</div></body></html>",
+        "noQuirksBodyHtml": "<b>a<div></div></b><div><b></b>y</div>"
+      }
+    },
+    {
+      "data": "<a><div><p></a>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "div": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a"
+                  },
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "a"
+                      },
+                      {
+                        "tag": "p",
+                        "children": [
+                          {
+                            "tag": "a"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a></a><div><a></a><p><a></a></p></div></body></html>",
+        "noQuirksBodyHtml": "<a></a><div><a></a><p><a></a></p></div>"
+      }
+    }
+  ],
+  "tests9.dat": [
+    {
+      "data": "<!DOCTYPE html><math></math>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math></math></body></html>",
+        "noQuirksBodyHtml": "<math></math>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><math></math>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math></math></body></html>",
+        "noQuirksBodyHtml": "<math></math>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><math><mi>",
+      "errors": [
+        "(1,25) expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mi": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math><mi></mi></math></body></html>",
+        "noQuirksBodyHtml": "<math><mi></mi></math>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><math><annotation-xml><svg><u>",
+      "errors": [
+        "(1,45) unexpected-html-element-in-foreign-content",
+        "(1,45) expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math annotation-xml": true,
+            "svg svg": true,
+            "u": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "annotation-xml",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "svg",
+                            "ns": "http://www.w3.org/2000/svg"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "u"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math><annotation-xml><svg></svg></annotation-xml></math><u></u></body></html>",
+        "noQuirksBodyHtml": "<math><annotation-xml><svg><u></u></svg></annotation-xml></math>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><select><math></math></select>",
+      "errors": [
+        "(1,35) unexpected-start-tag-in-select",
+        "(1,42) unexpected-end-tag-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select></select></body></html>",
+        "noQuirksBodyHtml": "<select></select>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><select><option><math></math></option></select>",
+      "errors": [
+        "(1,43) unexpected-start-tag-in-select",
+        "(1,50) unexpected-end-tag-in-select"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "option": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "option"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select><option></option></select></body></html>",
+        "noQuirksBodyHtml": "<select><option></option></select>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><math></math></table>",
+      "errors": [
+        "(1,34) unexpected-start-tag-implies-table-voodoo"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML"
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math></math><table></table></body></html>",
+        "noQuirksBodyHtml": "<math></math><table></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><math><mi>foo</mi></math></table>",
+      "errors": [
+        "(1,34) foster-parenting-start-token",
+        "(1,39) foster-parenting-character",
+        "(1,40) foster-parenting-character",
+        "(1,41) foster-parenting-character"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mi": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "text": "foo"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math><mi>foo</mi></math><table></table></body></html>",
+        "noQuirksBodyHtml": "<math><mi>foo</mi></math><table></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><math><mi>foo</mi><mi>bar</mi></math></table>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mi": true,
+            "table": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "text": "foo"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "text": "bar"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math><mi>foo</mi><mi>bar</mi></math><table></table></body></html>",
+        "noQuirksBodyHtml": "<math><mi>foo</mi><mi>bar</mi></math><table></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><tbody><math><mi>foo</mi><mi>bar</mi></math></tbody></table>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mi": true,
+            "table": true,
+            "tbody": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "text": "foo"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "text": "bar"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math><mi>foo</mi><mi>bar</mi></math><table><tbody></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<math><mi>foo</mi><mi>bar</mi></math><table><tbody></tbody></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><tbody><tr><math><mi>foo</mi><mi>bar</mi></math></tr></tbody></table>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mi": true,
+            "table": true,
+            "tbody": true,
+            "tr": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "text": "foo"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "text": "bar"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math><mi>foo</mi><mi>bar</mi></math><table><tbody><tr></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<math><mi>foo</mi><mi>bar</mi></math><table><tbody><tr></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><tbody><tr><td><math><mi>foo</mi><mi>bar</mi></math></td></tr></tbody></table>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "math math": true,
+            "math mi": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "math",
+                                    "ns": "http://www.w3.org/1998/Math/MathML",
+                                    "children": [
+                                      {
+                                        "tag": "mi",
+                                        "ns": "http://www.w3.org/1998/Math/MathML",
+                                        "children": [
+                                          {
+                                            "text": "foo"
+                                          }
+                                        ]
+                                      },
+                                      {
+                                        "tag": "mi",
+                                        "ns": "http://www.w3.org/1998/Math/MathML",
+                                        "children": [
+                                          {
+                                            "text": "bar"
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><math><mi>foo</mi><mi>bar</mi></math></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><math><mi>foo</mi><mi>bar</mi></math></td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><tbody><tr><td><math><mi>foo</mi><mi>bar</mi></math><p>baz</td></tr></tbody></table>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "math math": true,
+            "math mi": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "math",
+                                    "ns": "http://www.w3.org/1998/Math/MathML",
+                                    "children": [
+                                      {
+                                        "tag": "mi",
+                                        "ns": "http://www.w3.org/1998/Math/MathML",
+                                        "children": [
+                                          {
+                                            "text": "foo"
+                                          }
+                                        ]
+                                      },
+                                      {
+                                        "tag": "mi",
+                                        "ns": "http://www.w3.org/1998/Math/MathML",
+                                        "children": [
+                                          {
+                                            "text": "bar"
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  },
+                                  {
+                                    "tag": "p",
+                                    "children": [
+                                      {
+                                        "text": "baz"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><math><mi>foo</mi><mi>bar</mi></math><p>baz</p></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><math><mi>foo</mi><mi>bar</mi></math><p>baz</p></td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><caption><math><mi>foo</mi><mi>bar</mi></math><p>baz</caption></table>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "caption": true,
+            "math math": true,
+            "math mi": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "caption",
+                        "children": [
+                          {
+                            "tag": "math",
+                            "ns": "http://www.w3.org/1998/Math/MathML",
+                            "children": [
+                              {
+                                "tag": "mi",
+                                "ns": "http://www.w3.org/1998/Math/MathML",
+                                "children": [
+                                  {
+                                    "text": "foo"
+                                  }
+                                ]
+                              },
+                              {
+                                "tag": "mi",
+                                "ns": "http://www.w3.org/1998/Math/MathML",
+                                "children": [
+                                  {
+                                    "text": "bar"
+                                  }
+                                ]
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "p",
+                            "children": [
+                              {
+                                "text": "baz"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><caption><math><mi>foo</mi><mi>bar</mi></math><p>baz</p></caption></table></body></html>",
+        "noQuirksBodyHtml": "<table><caption><math><mi>foo</mi><mi>bar</mi></math><p>baz</p></caption></table>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><caption><math><mi>foo</mi><mi>bar</mi><p>baz</table><p>quux",
+      "errors": [
+        "(1,70) unexpected-html-element-in-foreign-content"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "caption": true,
+            "math math": true,
+            "math mi": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "caption",
+                        "children": [
+                          {
+                            "tag": "math",
+                            "ns": "http://www.w3.org/1998/Math/MathML",
+                            "children": [
+                              {
+                                "tag": "mi",
+                                "ns": "http://www.w3.org/1998/Math/MathML",
+                                "children": [
+                                  {
+                                    "text": "foo"
+                                  }
+                                ]
+                              },
+                              {
+                                "tag": "mi",
+                                "ns": "http://www.w3.org/1998/Math/MathML",
+                                "children": [
+                                  {
+                                    "text": "bar"
+                                  }
+                                ]
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "p",
+                            "children": [
+                              {
+                                "text": "baz"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "quux"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><caption><math><mi>foo</mi><mi>bar</mi></math><p>baz</p></caption></table><p>quux</p></body></html>",
+        "noQuirksBodyHtml": "<table><caption><math><mi>foo</mi><mi>bar</mi><p>baz</p></math></caption></table><p>quux</p>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><caption><math><mi>foo</mi><mi>bar</mi>baz</table><p>quux",
+      "errors": [
+        "(1,78) unexpected-end-tag",
+        "(1,78) expected-one-end-tag-but-got-another"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "caption": true,
+            "math math": true,
+            "math mi": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "caption",
+                        "children": [
+                          {
+                            "tag": "math",
+                            "ns": "http://www.w3.org/1998/Math/MathML",
+                            "children": [
+                              {
+                                "tag": "mi",
+                                "ns": "http://www.w3.org/1998/Math/MathML",
+                                "children": [
+                                  {
+                                    "text": "foo"
+                                  }
+                                ]
+                              },
+                              {
+                                "tag": "mi",
+                                "ns": "http://www.w3.org/1998/Math/MathML",
+                                "children": [
+                                  {
+                                    "text": "bar"
+                                  }
+                                ]
+                              },
+                              {
+                                "text": "baz"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "quux"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><caption><math><mi>foo</mi><mi>bar</mi>baz</math></caption></table><p>quux</p></body></html>",
+        "noQuirksBodyHtml": "<table><caption><math><mi>foo</mi><mi>bar</mi>baz</math></caption></table><p>quux</p>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><colgroup><math><mi>foo</mi><mi>bar</mi><p>baz</table><p>quux",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mi": true,
+            "p": true,
+            "table": true,
+            "colgroup": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "text": "foo"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "text": "bar"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "baz"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "colgroup"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "quux"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math><mi>foo</mi><mi>bar</mi></math><p>baz</p><table><colgroup></colgroup></table><p>quux</p></body></html>",
+        "noQuirksBodyHtml": "<math><mi>foo</mi><mi>bar</mi><p>baz</p></math><table><colgroup></colgroup></table><p>quux</p>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><tr><td><select><math><mi>foo</mi><mi>bar</mi><p>baz</table><p>quux",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "select": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "select",
+                                    "children": [
+                                      {
+                                        "text": "foobarbaz"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "quux"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><table><tbody><tr><td><select>foobarbaz</select></td></tr></tbody></table><p>quux</p></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><select>foobarbaz</select></td></tr></tbody></table><p>quux</p>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body><table><select><math><mi>foo</mi><mi>bar</mi><p>baz</table><p>quux",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "table": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "text": "foobarbaz"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table"
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "quux"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><select>foobarbaz</select><table></table><p>quux</p></body></html>",
+        "noQuirksBodyHtml": "<select>foobarbaz</select><table></table><p>quux</p>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body></body></html><math><mi>foo</mi><mi>bar</mi><p>baz",
+      "errors": [
+        "(1,41) expected-eof-but-got-start-tag",
+        "(1,68) unexpected-html-element-in-foreign-content"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mi": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "text": "foo"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "text": "bar"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "baz"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math><mi>foo</mi><mi>bar</mi></math><p>baz</p></body></html>",
+        "noQuirksBodyHtml": "<math><mi>foo</mi><mi>bar</mi><p>baz</p></math>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body></body><math><mi>foo</mi><mi>bar</mi><p>baz",
+      "errors": [
+        "(1,34) unexpected-start-tag-after-body",
+        "(1,61) unexpected-html-element-in-foreign-content"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mi": true,
+            "p": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "text": "foo"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "text": "bar"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "baz"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><math><mi>foo</mi><mi>bar</mi></math><p>baz</p></body></html>",
+        "noQuirksBodyHtml": "<math><mi>foo</mi><mi>bar</mi><p>baz</p></math>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><frameset><math><mi></mi><mi></mi><p><span>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "<math><mi></mi><mi></mi><p><span></span></p></math>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><frameset></frameset><math><mi></mi><mi></mi><p><span>",
+      "errors": [
+        "(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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "<math><mi></mi><mi></mi><p><span></span></p></math>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body xlink:href=foo><math xlink:href=foo></math>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "attrs": [
+                  {
+                    "name": "xlink:href",
+                    "value": "foo"
+                  }
+                ],
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "attrs": [
+                      {
+                        "name": "href",
+                        "ns": "http://www.w3.org/1999/xlink",
+                        "value": "foo"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body xlink:href=\"foo\"><math xlink:href=\"foo\"></math></body></html>",
+        "noQuirksBodyHtml": "<math xlink:href=\"foo\"></math>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body xlink:href=foo xml:lang=en><math><mi xml:lang=en xlink:href=foo></mi></math>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mi": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "attrs": [
+                  {
+                    "name": "xlink:href",
+                    "value": "foo"
+                  },
+                  {
+                    "name": "xml:lang",
+                    "value": "en"
+                  }
+                ],
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "attrs": [
+                          {
+                            "name": "href",
+                            "ns": "http://www.w3.org/1999/xlink",
+                            "value": "foo"
+                          },
+                          {
+                            "name": "lang",
+                            "ns": "http://www.w3.org/XML/1998/namespace",
+                            "value": "en"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body xlink:href=\"foo\" xml:lang=\"en\"><math><mi xml:lang=\"en\" xlink:href=\"foo\"></mi></math></body></html>",
+        "noQuirksBodyHtml": "<math><mi xml:lang=\"en\" xlink:href=\"foo\"></mi></math>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body xlink:href=foo xml:lang=en><math><mi xml:lang=en xlink:href=foo /></math>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mi": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "attrs": [
+                  {
+                    "name": "xlink:href",
+                    "value": "foo"
+                  },
+                  {
+                    "name": "xml:lang",
+                    "value": "en"
+                  }
+                ],
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "attrs": [
+                          {
+                            "name": "href",
+                            "ns": "http://www.w3.org/1999/xlink",
+                            "value": "foo"
+                          },
+                          {
+                            "name": "lang",
+                            "ns": "http://www.w3.org/XML/1998/namespace",
+                            "value": "en"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body xlink:href=\"foo\" xml:lang=\"en\"><math><mi xml:lang=\"en\" xlink:href=\"foo\"></mi></math></body></html>",
+        "noQuirksBodyHtml": "<math><mi xml:lang=\"en\" xlink:href=\"foo\"></mi></math>"
+      }
+    },
+    {
+      "data": "<!DOCTYPE html><body xlink:href=foo xml:lang=en><math><mi xml:lang=en xlink:href=foo />bar</math>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mi": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "attrs": [
+                  {
+                    "name": "xlink:href",
+                    "value": "foo"
+                  },
+                  {
+                    "name": "xml:lang",
+                    "value": "en"
+                  }
+                ],
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mi",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "attrs": [
+                          {
+                            "name": "href",
+                            "ns": "http://www.w3.org/1999/xlink",
+                            "value": "foo"
+                          },
+                          {
+                            "name": "lang",
+                            "ns": "http://www.w3.org/XML/1998/namespace",
+                            "value": "en"
+                          }
+                        ]
+                      },
+                      {
+                        "text": "bar"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body xlink:href=\"foo\" xml:lang=\"en\"><math><mi xml:lang=\"en\" xlink:href=\"foo\"></mi>bar</math></body></html>",
+        "noQuirksBodyHtml": "<math><mi xml:lang=\"en\" xlink:href=\"foo\"></mi>bar</math>"
+      }
+    }
+  ],
+  "tests_innerHTML_1.dat": [
+    {
+      "data": "<body><span>",
+      "errors": [
+        "(1,6): unexpected-start-tag",
+        "(1,12): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "body"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "span"
+          }
+        ],
+        "html": "<span></span>",
+        "noQuirksBodyHtml": "<span></span>"
+      }
+    },
+    {
+      "data": "<span><body>",
+      "errors": [
+        "(1,12): unexpected-start-tag",
+        "(1,12): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "body"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "span"
+          }
+        ],
+        "html": "<span></span>",
+        "noQuirksBodyHtml": "<span></span>"
+      }
+    },
+    {
+      "data": "<span><body>",
+      "errors": [
+        "(1,12): unexpected-start-tag",
+        "(1,12): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "div"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "span"
+          }
+        ],
+        "html": "<span></span>",
+        "noQuirksBodyHtml": "<span></span>"
+      }
+    },
+    {
+      "data": "<body><span>",
+      "errors": [
+        "(1,12): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "html"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "head": true,
+            "body": true,
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "head"
+          },
+          {
+            "tag": "body",
+            "children": [
+              {
+                "tag": "span"
+              }
+            ]
+          }
+        ],
+        "html": "<head></head><body><span></span></body>",
+        "noQuirksBodyHtml": "<span></span>"
+      }
+    },
+    {
+      "data": "<frameset><span>",
+      "errors": [
+        "(1,10): unexpected-start-tag",
+        "(1,16): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "body"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "span"
+          }
+        ],
+        "html": "<span></span>",
+        "noQuirksBodyHtml": "<span></span>"
+      }
+    },
+    {
+      "data": "<span><frameset>",
+      "errors": [
+        "(1,16): unexpected-start-tag",
+        "(1,16): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "body"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "span"
+          }
+        ],
+        "html": "<span></span>",
+        "noQuirksBodyHtml": "<span></span>"
+      }
+    },
+    {
+      "data": "<span><frameset>",
+      "errors": [
+        "(1,16): unexpected-start-tag",
+        "(1,16): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "div"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "span"
+          }
+        ],
+        "html": "<span></span>",
+        "noQuirksBodyHtml": "<span></span>"
+      }
+    },
+    {
+      "data": "<frameset><span>",
+      "errors": [
+        "(1,16): unexpected-start-tag-in-frameset",
+        "(1,16): eof-in-frameset"
+      ],
+      "fragment": {
+        "name": "html"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "head": true,
+            "frameset": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "head"
+          },
+          {
+            "tag": "frameset"
+          }
+        ],
+        "html": "<head></head><frameset></frameset>",
+        "noQuirksBodyHtml": "<span></span>"
+      }
+    },
+    {
+      "data": "<table><tr>",
+      "errors": [
+        "(1,7): unexpected-start-tag"
+      ],
+      "fragment": {
+        "name": "table"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "tbody": true,
+            "tr": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "tbody",
+            "children": [
+              {
+                "tag": "tr"
+              }
+            ]
+          }
+        ],
+        "html": "<tbody><tr></tr></tbody>",
+        "noQuirksBodyHtml": "<table><tbody><tr></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "</table><tr>",
+      "errors": [
+        "(1,8): unexpected-end-tag"
+      ],
+      "fragment": {
+        "name": "table"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "tbody": true,
+            "tr": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "tbody",
+            "children": [
+              {
+                "tag": "tr"
+              }
+            ]
+          }
+        ],
+        "html": "<tbody><tr></tr></tbody>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<a>",
+      "errors": [
+        "(1,3): unexpected-start-tag-implies-table-voodoo",
+        "(1,3): eof-in-table"
+      ],
+      "fragment": {
+        "name": "table"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<a>",
+      "errors": [
+        "(1,3): unexpected-start-tag-implies-table-voodoo",
+        "(1,3): eof-in-table"
+      ],
+      "fragment": {
+        "name": "table"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<a><caption>a",
+      "errors": [
+        "(1,3): unexpected-start-tag-implies-table-voodoo",
+        "(1,13): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "table"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true,
+            "caption": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          },
+          {
+            "tag": "caption",
+            "children": [
+              {
+                "text": "a"
+              }
+            ]
+          }
+        ],
+        "html": "<a></a><caption>a</caption>",
+        "noQuirksBodyHtml": "<a>a</a>"
+      }
+    },
+    {
+      "data": "<a><colgroup><col>",
+      "errors": [
+        "(1,3): foster-parenting-start-token",
+        "(1,18): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "table"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true,
+            "colgroup": true,
+            "col": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          },
+          {
+            "tag": "colgroup",
+            "children": [
+              {
+                "tag": "col"
+              }
+            ]
+          }
+        ],
+        "html": "<a></a><colgroup><col></colgroup>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<a><tbody><tr>",
+      "errors": [
+        "(1,3): foster-parenting-start-tag"
+      ],
+      "fragment": {
+        "name": "table"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true,
+            "tbody": true,
+            "tr": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          },
+          {
+            "tag": "tbody",
+            "children": [
+              {
+                "tag": "tr"
+              }
+            ]
+          }
+        ],
+        "html": "<a></a><tbody><tr></tr></tbody>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<a><tfoot><tr>",
+      "errors": [
+        "(1,3): foster-parenting-start-tag"
+      ],
+      "fragment": {
+        "name": "table"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true,
+            "tfoot": true,
+            "tr": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          },
+          {
+            "tag": "tfoot",
+            "children": [
+              {
+                "tag": "tr"
+              }
+            ]
+          }
+        ],
+        "html": "<a></a><tfoot><tr></tr></tfoot>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<a><thead><tr>",
+      "errors": [
+        "(1,3): foster-parenting-start-tag"
+      ],
+      "fragment": {
+        "name": "table"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true,
+            "thead": true,
+            "tr": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          },
+          {
+            "tag": "thead",
+            "children": [
+              {
+                "tag": "tr"
+              }
+            ]
+          }
+        ],
+        "html": "<a></a><thead><tr></tr></thead>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<a><tr>",
+      "errors": [
+        "(1,3): foster-parenting-start-tag"
+      ],
+      "fragment": {
+        "name": "table"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true,
+            "tbody": true,
+            "tr": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          },
+          {
+            "tag": "tbody",
+            "children": [
+              {
+                "tag": "tr"
+              }
+            ]
+          }
+        ],
+        "html": "<a></a><tbody><tr></tr></tbody>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<a><th>",
+      "errors": [
+        "(1,3): unexpected-start-tag-implies-table-voodoo",
+        "(1,7): unexpected-cell-in-table-body"
+      ],
+      "fragment": {
+        "name": "table"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true,
+            "tbody": true,
+            "tr": true,
+            "th": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          },
+          {
+            "tag": "tbody",
+            "children": [
+              {
+                "tag": "tr",
+                "children": [
+                  {
+                    "tag": "th"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<a></a><tbody><tr><th></th></tr></tbody>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<a><td>",
+      "errors": [
+        "(1,3): unexpected-start-tag-implies-table-voodoo",
+        "(1,7): unexpected-cell-in-table-body"
+      ],
+      "fragment": {
+        "name": "table"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          },
+          {
+            "tag": "tbody",
+            "children": [
+              {
+                "tag": "tr",
+                "children": [
+                  {
+                    "tag": "td"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<a></a><tbody><tr><td></td></tr></tbody>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<table></table><tbody>",
+      "errors": [
+        "(1,22): unexpected-start-tag"
+      ],
+      "fragment": {
+        "name": "caption"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "table": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "table"
+          }
+        ],
+        "html": "<table></table>",
+        "noQuirksBodyHtml": "<table></table>"
+      }
+    },
+    {
+      "data": "</table><span>",
+      "errors": [
+        "(1,8): unexpected-end-tag",
+        "(1,14): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "caption"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "span"
+          }
+        ],
+        "html": "<span></span>",
+        "noQuirksBodyHtml": "<span></span>"
+      }
+    },
+    {
+      "data": "<span></table>",
+      "errors": [
+        "(1,14): unexpected-end-tag",
+        "(1,14): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "caption"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "span"
+          }
+        ],
+        "html": "<span></span>",
+        "noQuirksBodyHtml": "<span></span>"
+      }
+    },
+    {
+      "data": "</caption><span>",
+      "errors": [
+        "(1,10): XXX-undefined-error",
+        "(1,16): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "caption"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "span"
+          }
+        ],
+        "html": "<span></span>",
+        "noQuirksBodyHtml": "<span></span>"
+      }
+    },
+    {
+      "data": "<span></caption><span>",
+      "errors": [
+        "(1,16): XXX-undefined-error",
+        "(1,22): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "caption"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "span",
+            "children": [
+              {
+                "tag": "span"
+              }
+            ]
+          }
+        ],
+        "html": "<span><span></span></span>",
+        "noQuirksBodyHtml": "<span><span></span></span>"
+      }
+    },
+    {
+      "data": "<span><caption><span>",
+      "errors": [
+        "(1,15): unexpected-start-tag",
+        "(1,21): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "caption"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "span",
+            "children": [
+              {
+                "tag": "span"
+              }
+            ]
+          }
+        ],
+        "html": "<span><span></span></span>",
+        "noQuirksBodyHtml": "<span><span></span></span>"
+      }
+    },
+    {
+      "data": "<span><col><span>",
+      "errors": [
+        "(1,11): unexpected-start-tag",
+        "(1,17): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "caption"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "span",
+            "children": [
+              {
+                "tag": "span"
+              }
+            ]
+          }
+        ],
+        "html": "<span><span></span></span>",
+        "noQuirksBodyHtml": "<span><span></span></span>"
+      }
+    },
+    {
+      "data": "<span><colgroup><span>",
+      "errors": [
+        "(1,16): unexpected-start-tag",
+        "(1,22): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "caption"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "span",
+            "children": [
+              {
+                "tag": "span"
+              }
+            ]
+          }
+        ],
+        "html": "<span><span></span></span>",
+        "noQuirksBodyHtml": "<span><span></span></span>"
+      }
+    },
+    {
+      "data": "<span><html><span>",
+      "errors": [
+        "(1,12): non-html-root",
+        "(1,18): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "caption"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "span",
+            "children": [
+              {
+                "tag": "span"
+              }
+            ]
+          }
+        ],
+        "html": "<span><span></span></span>",
+        "noQuirksBodyHtml": "<span><span></span></span>"
+      }
+    },
+    {
+      "data": "<span><tbody><span>",
+      "errors": [
+        "(1,13): unexpected-start-tag",
+        "(1,19): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "caption"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "span",
+            "children": [
+              {
+                "tag": "span"
+              }
+            ]
+          }
+        ],
+        "html": "<span><span></span></span>",
+        "noQuirksBodyHtml": "<span><span></span></span>"
+      }
+    },
+    {
+      "data": "<span><td><span>",
+      "errors": [
+        "(1,10): unexpected-start-tag",
+        "(1,16): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "caption"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "span",
+            "children": [
+              {
+                "tag": "span"
+              }
+            ]
+          }
+        ],
+        "html": "<span><span></span></span>",
+        "noQuirksBodyHtml": "<span><span></span></span>"
+      }
+    },
+    {
+      "data": "<span><tfoot><span>",
+      "errors": [
+        "(1,13): unexpected-start-tag",
+        "(1,19): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "caption"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "span",
+            "children": [
+              {
+                "tag": "span"
+              }
+            ]
+          }
+        ],
+        "html": "<span><span></span></span>",
+        "noQuirksBodyHtml": "<span><span></span></span>"
+      }
+    },
+    {
+      "data": "<span><thead><span>",
+      "errors": [
+        "(1,13): unexpected-start-tag",
+        "(1,19): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "caption"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "span",
+            "children": [
+              {
+                "tag": "span"
+              }
+            ]
+          }
+        ],
+        "html": "<span><span></span></span>",
+        "noQuirksBodyHtml": "<span><span></span></span>"
+      }
+    },
+    {
+      "data": "<span><th><span>",
+      "errors": [
+        "(1,10): unexpected-start-tag",
+        "(1,16): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "caption"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "span",
+            "children": [
+              {
+                "tag": "span"
+              }
+            ]
+          }
+        ],
+        "html": "<span><span></span></span>",
+        "noQuirksBodyHtml": "<span><span></span></span>"
+      }
+    },
+    {
+      "data": "<span><tr><span>",
+      "errors": [
+        "(1,10): unexpected-start-tag",
+        "(1,16): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "caption"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "span",
+            "children": [
+              {
+                "tag": "span"
+              }
+            ]
+          }
+        ],
+        "html": "<span><span></span></span>",
+        "noQuirksBodyHtml": "<span><span></span></span>"
+      }
+    },
+    {
+      "data": "<span></table><span>",
+      "errors": [
+        "(1,14): unexpected-end-tag",
+        "(1,20): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "caption"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "span",
+            "children": [
+              {
+                "tag": "span"
+              }
+            ]
+          }
+        ],
+        "html": "<span><span></span></span>",
+        "noQuirksBodyHtml": "<span><span></span></span>"
+      }
+    },
+    {
+      "data": "</colgroup><col>",
+      "errors": [
+        "(1,11): XXX-undefined-error"
+      ],
+      "fragment": {
+        "name": "colgroup"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "col": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "col"
+          }
+        ],
+        "html": "<col>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<a><col>",
+      "errors": [
+        "(1,3): XXX-undefined-error"
+      ],
+      "fragment": {
+        "name": "colgroup"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "col": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "col"
+          }
+        ],
+        "html": "<col>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<caption><a>",
+      "errors": [
+        "(1,9): XXX-undefined-error",
+        "(1,12): unexpected-start-tag-implies-table-voodoo",
+        "(1,12): eof-in-table"
+      ],
+      "fragment": {
+        "name": "tbody"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<col><a>",
+      "errors": [
+        "(1,5): XXX-undefined-error",
+        "(1,8): unexpected-start-tag-implies-table-voodoo",
+        "(1,8): eof-in-table"
+      ],
+      "fragment": {
+        "name": "tbody"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<colgroup><a>",
+      "errors": [
+        "(1,10): XXX-undefined-error",
+        "(1,13): unexpected-start-tag-implies-table-voodoo",
+        "(1,13): eof-in-table"
+      ],
+      "fragment": {
+        "name": "tbody"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<tbody><a>",
+      "errors": [
+        "(1,7): XXX-undefined-error",
+        "(1,10): unexpected-start-tag-implies-table-voodoo",
+        "(1,10): eof-in-table"
+      ],
+      "fragment": {
+        "name": "tbody"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<tfoot><a>",
+      "errors": [
+        "(1,7): XXX-undefined-error",
+        "(1,10): unexpected-start-tag-implies-table-voodoo",
+        "(1,10): eof-in-table"
+      ],
+      "fragment": {
+        "name": "tbody"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<thead><a>",
+      "errors": [
+        "(1,7): XXX-undefined-error",
+        "(1,10): unexpected-start-tag-implies-table-voodoo",
+        "(1,10): eof-in-table"
+      ],
+      "fragment": {
+        "name": "tbody"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "</table><a>",
+      "errors": [
+        "(1,8): XXX-undefined-error",
+        "(1,11): unexpected-start-tag-implies-table-voodoo",
+        "(1,11): eof-in-table"
+      ],
+      "fragment": {
+        "name": "tbody"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<a><tr>",
+      "errors": [
+        "(1,3): unexpected-start-tag-implies-table-voodoo"
+      ],
+      "fragment": {
+        "name": "tbody"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true,
+            "tr": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          },
+          {
+            "tag": "tr"
+          }
+        ],
+        "html": "<a></a><tr></tr>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<a><td>",
+      "errors": [
+        "(1,3): unexpected-start-tag-implies-table-voodoo",
+        "(1,7): unexpected-cell-in-table-body"
+      ],
+      "fragment": {
+        "name": "tbody"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          },
+          {
+            "tag": "tr",
+            "children": [
+              {
+                "tag": "td"
+              }
+            ]
+          }
+        ],
+        "html": "<a></a><tr><td></td></tr>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<a><td>",
+      "errors": [
+        "(1,3): unexpected-start-tag-implies-table-voodoo",
+        "(1,7): unexpected-cell-in-table-body"
+      ],
+      "fragment": {
+        "name": "tbody"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          },
+          {
+            "tag": "tr",
+            "children": [
+              {
+                "tag": "td"
+              }
+            ]
+          }
+        ],
+        "html": "<a></a><tr><td></td></tr>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<a><td>",
+      "errors": [
+        "(1,3): unexpected-start-tag-implies-table-voodoo",
+        "(1,7): unexpected-cell-in-table-body"
+      ],
+      "fragment": {
+        "name": "tbody"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          },
+          {
+            "tag": "tr",
+            "children": [
+              {
+                "tag": "td"
+              }
+            ]
+          }
+        ],
+        "html": "<a></a><tr><td></td></tr>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "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"
+      ],
+      "fragment": {
+        "name": "tbody"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "tr": true,
+            "td": true,
+            "a": true,
+            "table": true,
+            "tbody": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "tr",
+            "children": [
+              {
+                "tag": "td",
+                "children": [
+                  {
+                    "tag": "a"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<tr><td><a></a><table><tbody><tr></tr></tbody></table></td></tr>",
+        "noQuirksBodyHtml": "<a></a><table><tbody><tr></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "</tr><td>",
+      "errors": [
+        "(1,5): XXX-undefined-error"
+      ],
+      "fragment": {
+        "name": "tr"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "td"
+          }
+        ],
+        "html": "<td></td>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<td><table><a><tr></tr><tr>",
+      "errors": [
+        "(1,14): unexpected-start-tag-implies-table-voodoo",
+        "(1,27): eof-in-table"
+      ],
+      "fragment": {
+        "name": "tr"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "td": true,
+            "a": true,
+            "table": true,
+            "tbody": true,
+            "tr": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "td",
+            "children": [
+              {
+                "tag": "a"
+              },
+              {
+                "tag": "table",
+                "children": [
+                  {
+                    "tag": "tbody",
+                    "children": [
+                      {
+                        "tag": "tr"
+                      },
+                      {
+                        "tag": "tr"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<td><a></a><table><tbody><tr></tr><tr></tr></tbody></table></td>",
+        "noQuirksBodyHtml": "<a></a><table><tbody><tr></tr><tr></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<caption><td>",
+      "errors": [
+        "(1,9): XXX-undefined-error"
+      ],
+      "fragment": {
+        "name": "tr"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "td"
+          }
+        ],
+        "html": "<td></td>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<col><td>",
+      "errors": [
+        "(1,5): XXX-undefined-error"
+      ],
+      "fragment": {
+        "name": "tr"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "td"
+          }
+        ],
+        "html": "<td></td>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<colgroup><td>",
+      "errors": [
+        "(1,10): XXX-undefined-error"
+      ],
+      "fragment": {
+        "name": "tr"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "td"
+          }
+        ],
+        "html": "<td></td>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<tbody><td>",
+      "errors": [
+        "(1,7): XXX-undefined-error"
+      ],
+      "fragment": {
+        "name": "tr"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "td"
+          }
+        ],
+        "html": "<td></td>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<tfoot><td>",
+      "errors": [
+        "(1,7): XXX-undefined-error"
+      ],
+      "fragment": {
+        "name": "tr"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "td"
+          }
+        ],
+        "html": "<td></td>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<thead><td>",
+      "errors": [
+        "(1,7): XXX-undefined-error"
+      ],
+      "fragment": {
+        "name": "tr"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "td"
+          }
+        ],
+        "html": "<td></td>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<tr><td>",
+      "errors": [
+        "(1,4): XXX-undefined-error"
+      ],
+      "fragment": {
+        "name": "tr"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "td"
+          }
+        ],
+        "html": "<td></td>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "</table><td>",
+      "errors": [
+        "(1,8): XXX-undefined-error"
+      ],
+      "fragment": {
+        "name": "tr"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "td"
+          }
+        ],
+        "html": "<td></td>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<td><table></table><td>",
+      "errors": [],
+      "fragment": {
+        "name": "tr"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "td": true,
+            "table": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "td",
+            "children": [
+              {
+                "tag": "table"
+              }
+            ]
+          },
+          {
+            "tag": "td"
+          }
+        ],
+        "html": "<td><table></table></td><td></td>",
+        "noQuirksBodyHtml": "<table></table>"
+      }
+    },
+    {
+      "data": "<td><table></table><td>",
+      "errors": [],
+      "fragment": {
+        "name": "tr"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "td": true,
+            "table": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "td",
+            "children": [
+              {
+                "tag": "table"
+              }
+            ]
+          },
+          {
+            "tag": "td"
+          }
+        ],
+        "html": "<td><table></table></td><td></td>",
+        "noQuirksBodyHtml": "<table></table>"
+      }
+    },
+    {
+      "data": "<caption><a>",
+      "errors": [
+        "(1,9): XXX-undefined-error",
+        "(1,12): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "td"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<col><a>",
+      "errors": [
+        "(1,5): XXX-undefined-error",
+        "(1,8): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "td"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<colgroup><a>",
+      "errors": [
+        "(1,10): XXX-undefined-error",
+        "(1,13): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "td"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<tbody><a>",
+      "errors": [
+        "(1,7): XXX-undefined-error",
+        "(1,10): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "td"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<tfoot><a>",
+      "errors": [
+        "(1,7): XXX-undefined-error",
+        "(1,10): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "td"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<th><a>",
+      "errors": [
+        "(1,4): XXX-undefined-error",
+        "(1,7): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "td"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<thead><a>",
+      "errors": [
+        "(1,7): XXX-undefined-error",
+        "(1,10): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "td"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<tr><a>",
+      "errors": [
+        "(1,4): XXX-undefined-error",
+        "(1,7): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "td"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "</table><a>",
+      "errors": [
+        "(1,8): XXX-undefined-error",
+        "(1,11): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "td"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "</tbody><a>",
+      "errors": [
+        "(1,8): XXX-undefined-error",
+        "(1,11): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "td"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "</td><a>",
+      "errors": [
+        "(1,5): unexpected-end-tag",
+        "(1,8): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "td"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "</tfoot><a>",
+      "errors": [
+        "(1,8): XXX-undefined-error",
+        "(1,11): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "td"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "</thead><a>",
+      "errors": [
+        "(1,8): XXX-undefined-error",
+        "(1,11): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "td"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "</th><a>",
+      "errors": [
+        "(1,5): unexpected-end-tag",
+        "(1,8): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "td"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "</tr><a>",
+      "errors": [
+        "(1,5): XXX-undefined-error",
+        "(1,8): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "td"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "a"
+          }
+        ],
+        "html": "<a></a>",
+        "noQuirksBodyHtml": "<a></a>"
+      }
+    },
+    {
+      "data": "<table><td><td>",
+      "errors": [
+        "(1,11): unexpected-cell-in-table-body",
+        "(1,15): expected-closing-tag-but-got-eof"
+      ],
+      "fragment": {
+        "name": "td"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "table",
+            "children": [
+              {
+                "tag": "tbody",
+                "children": [
+                  {
+                    "tag": "tr",
+                    "children": [
+                      {
+                        "tag": "td"
+                      },
+                      {
+                        "tag": "td"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<table><tbody><tr><td></td><td></td></tr></tbody></table>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td></td><td></td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "</select><option>",
+      "errors": [
+        "(1,9): XXX-undefined-error"
+      ],
+      "fragment": {
+        "name": "select"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "option": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "option"
+          }
+        ],
+        "html": "<option></option>",
+        "noQuirksBodyHtml": "<option></option>"
+      }
+    },
+    {
+      "data": "<input><option>",
+      "errors": [
+        "(1,7): unexpected-input-in-select"
+      ],
+      "fragment": {
+        "name": "select"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "option": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "option"
+          }
+        ],
+        "html": "<option></option>",
+        "noQuirksBodyHtml": "<input><option></option>"
+      }
+    },
+    {
+      "data": "<keygen><option>",
+      "errors": [
+        "(1,8): unexpected-input-in-select"
+      ],
+      "fragment": {
+        "name": "select"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "option": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "option"
+          }
+        ],
+        "html": "<option></option>",
+        "noQuirksBodyHtml": "<keygen><option></option>"
+      }
+    },
+    {
+      "data": "<textarea><option>",
+      "errors": [
+        "(1,10): unexpected-input-in-select"
+      ],
+      "fragment": {
+        "name": "select"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "option": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "option"
+          }
+        ],
+        "html": "<option></option>",
+        "noQuirksBodyHtml": "<textarea>&lt;option&gt;</textarea>"
+      }
+    },
+    {
+      "data": "</html><!--abc-->",
+      "errors": [
+        "(1,7): unexpected-end-tag-after-body-innerhtml"
+      ],
+      "fragment": {
+        "name": "html"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "head"
+          },
+          {
+            "tag": "body"
+          },
+          {
+            "comment": "abc"
+          }
+        ],
+        "html": "<head></head><body></body><!--abc-->",
+        "noQuirksBodyHtml": "<!--abc-->"
+      }
+    },
+    {
+      "data": "</frameset><frame>",
+      "errors": [
+        "(1,11): unexpected-frameset-in-frameset-innerhtml"
+      ],
+      "fragment": {
+        "name": "frameset"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "frame": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "frame"
+          }
+        ],
+        "html": "<frame>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "",
+      "errors": [],
+      "fragment": {
+        "name": "html"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "head"
+          },
+          {
+            "tag": "body"
+          }
+        ],
+        "html": "<head></head><body></body>",
+        "noQuirksBodyHtml": ""
+      }
+    }
+  ],
+  "tricky01.dat": [
+    {
+      "data": "<b><p>Bold </b> Not bold</p>\nAlso not bold.",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag",
+        "(1,15): adoption-agency-1.3"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b"
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "text": "Bold "
+                          }
+                        ]
+                      },
+                      {
+                        "text": " Not bold"
+                      }
+                    ]
+                  },
+                  {
+                    "text": "\nAlso not bold."
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b></b><p><b>Bold </b> Not bold</p>\nAlso not bold.</body></html>",
+        "noQuirksBodyHtml": "<b></b><p><b>Bold </b> Not bold</p>\nAlso not bold."
+      }
+    },
+    {
+      "data": "<html>\n<font color=red><i>Italic and Red<p>Italic and Red </font> Just italic.</p> Italic only.</i> Plain\n<p>I should not be red. <font color=red>Red. <i>Italic and red.</p>\n<p>Italic and red. </i> Red.</font> I should not be red.</p>\n<b>Bold <i>Bold and italic</b> Only Italic </i> Plain",
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "font": true,
+            "i": true,
+            "p": true,
+            "b": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "font",
+                    "attrs": [
+                      {
+                        "name": "color",
+                        "value": "red"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "tag": "i",
+                        "children": [
+                          {
+                            "text": "Italic and Red"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "i",
+                    "children": [
+                      {
+                        "tag": "p",
+                        "children": [
+                          {
+                            "tag": "font",
+                            "attrs": [
+                              {
+                                "name": "color",
+                                "value": "red"
+                              }
+                            ],
+                            "children": [
+                              {
+                                "text": "Italic and Red "
+                              }
+                            ]
+                          },
+                          {
+                            "text": " Just italic."
+                          }
+                        ]
+                      },
+                      {
+                        "text": " Italic only."
+                      }
+                    ]
+                  },
+                  {
+                    "text": " Plain\n"
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "I should not be red. "
+                      },
+                      {
+                        "tag": "font",
+                        "attrs": [
+                          {
+                            "name": "color",
+                            "value": "red"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "text": "Red. "
+                          },
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "text": "Italic and red."
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "font",
+                    "attrs": [
+                      {
+                        "name": "color",
+                        "value": "red"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "tag": "i",
+                        "children": [
+                          {
+                            "text": "\n"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "font",
+                        "attrs": [
+                          {
+                            "name": "color",
+                            "value": "red"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "text": "Italic and red. "
+                              }
+                            ]
+                          },
+                          {
+                            "text": " Red."
+                          }
+                        ]
+                      },
+                      {
+                        "text": " I should not be red."
+                      }
+                    ]
+                  },
+                  {
+                    "text": "\n"
+                  },
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "text": "Bold "
+                      },
+                      {
+                        "tag": "i",
+                        "children": [
+                          {
+                            "text": "Bold and italic"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "i",
+                    "children": [
+                      {
+                        "text": " Only Italic "
+                      }
+                    ]
+                  },
+                  {
+                    "text": " Plain"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><font color=\"red\"><i>Italic and Red</i></font><i><p><font color=\"red\">Italic and Red </font> Just italic.</p> Italic only.</i> Plain\n<p>I should not be red. <font color=\"red\">Red. <i>Italic and red.</i></font></p><font color=\"red\"><i>\n</i></font><p><font color=\"red\"><i>Italic and red. </i> Red.</font> I should not be red.</p>\n<b>Bold <i>Bold and italic</i></b><i> Only Italic </i> Plain</body></html>",
+        "noQuirksBodyHtml": "\n<font color=\"red\"><i>Italic and Red</i></font><i><p><font color=\"red\">Italic and Red </font> Just italic.</p> Italic only.</i> Plain\n<p>I should not be red. <font color=\"red\">Red. <i>Italic and red.</i></font></p><font color=\"red\"><i>\n</i></font><p><font color=\"red\"><i>Italic and red. </i> Red.</font> I should not be red.</p>\n<b>Bold <i>Bold and italic</i></b><i> Only Italic </i> Plain"
+      }
+    },
+    {
+      "data": "<html><body>\n<p><font size=\"7\">First paragraph.</p>\n<p>Second paragraph.</p></font>\n<b><p><i>Bold and Italic</b> Italic</p>",
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "font": true,
+            "b": true,
+            "i": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "\n"
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "font",
+                        "attrs": [
+                          {
+                            "name": "size",
+                            "value": "7"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "text": "First paragraph."
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "font",
+                    "attrs": [
+                      {
+                        "name": "size",
+                        "value": "7"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "\n"
+                      },
+                      {
+                        "tag": "p",
+                        "children": [
+                          {
+                            "text": "Second paragraph."
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "text": "\n"
+                  },
+                  {
+                    "tag": "b"
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "tag": "i",
+                            "children": [
+                              {
+                                "text": "Bold and Italic"
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "i",
+                        "children": [
+                          {
+                            "text": " Italic"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>\n<p><font size=\"7\">First paragraph.</font></p><font size=\"7\">\n<p>Second paragraph.</p></font>\n<b></b><p><b><i>Bold and Italic</i></b><i> Italic</i></p></body></html>",
+        "noQuirksBodyHtml": "\n<p><font size=\"7\">First paragraph.</font></p><font size=\"7\">\n<p>Second paragraph.</p></font>\n<b></b><p><b><i>Bold and Italic</i></b><i> Italic</i></p>"
+      }
+    },
+    {
+      "data": "<html>\n<dl>\n<dt><b>Boo\n<dd>Goo?\n</dl>\n</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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "dl": true,
+            "dt": true,
+            "b": true,
+            "dd": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "dl",
+                    "children": [
+                      {
+                        "text": "\n"
+                      },
+                      {
+                        "tag": "dt",
+                        "children": [
+                          {
+                            "tag": "b",
+                            "children": [
+                              {
+                                "text": "Boo\n"
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "dd",
+                        "children": [
+                          {
+                            "tag": "b",
+                            "children": [
+                              {
+                                "text": "Goo?\n"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "text": "\n"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><dl>\n<dt><b>Boo\n</b></dt><dd><b>Goo?\n</b></dd></dl><b>\n</b></body></html>",
+        "noQuirksBodyHtml": "\n<dl>\n<dt><b>Boo\n</b></dt><dd><b>Goo?\n</b></dd></dl><b>\n</b>"
+      }
+    },
+    {
+      "data": "<html><body>\n<label><a><div>Hello<div>World</div></a></label>  \n</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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "label": true,
+            "a": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "\n"
+                  },
+                  {
+                    "tag": "label",
+                    "children": [
+                      {
+                        "tag": "a"
+                      },
+                      {
+                        "tag": "div",
+                        "children": [
+                          {
+                            "tag": "a",
+                            "children": [
+                              {
+                                "text": "Hello"
+                              },
+                              {
+                                "tag": "div",
+                                "children": [
+                                  {
+                                    "text": "World"
+                                  }
+                                ]
+                              }
+                            ]
+                          },
+                          {
+                            "text": "  \n"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>\n<label><a></a><div><a>Hello<div>World</div></a>  \n</div></label></body></html>",
+        "noQuirksBodyHtml": "\n<label><a></a><div><a>Hello<div>World</div></a>  \n</div></label>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "center": true,
+            "font": true,
+            "img": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "center",
+                    "children": [
+                      {
+                        "text": " "
+                      },
+                      {
+                        "tag": "font",
+                        "children": [
+                          {
+                            "text": "a"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "font",
+                    "children": [
+                      {
+                        "tag": "img"
+                      },
+                      {
+                        "text": " "
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "text": " "
+                      },
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "text": " "
+                                  }
+                                ]
+                              },
+                              {
+                                "text": " "
+                              }
+                            ]
+                          },
+                          {
+                            "text": " "
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><center> <font>a</font></center><font><img> </font><table> <tbody><tr><td> </td> </tr> </tbody></table></body></html>",
+        "noQuirksBodyHtml": "<center> <font>a</font></center><font><img> </font><table> <tbody><tr><td> </td> </tr> </tbody></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "a": true,
+            "table": true,
+            "tbody": true,
+            "tr": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "a"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "a",
+                        "children": [
+                          {
+                            "text": "You should see this text."
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><p><a></a></p><p><a>You should see this text.</a></p><table><tbody><tr></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<p><a></a></p><p><a>You should see this text.</a></p><table><tbody><tr></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<TABLE>\n<TR>\n<CENTER><CENTER><TD></TD></TR><TR>\n<FONT>\n<TABLE><tr></tr></TABLE>\n</P>\n<a></font><font></a>\nThis page contains an insanely badly-nested tag sequence.",
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "center": true,
+            "font": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "p": true,
+            "a": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "center",
+                    "children": [
+                      {
+                        "tag": "center"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "font",
+                    "children": [
+                      {
+                        "text": "\n"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "text": "\n"
+                      },
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "text": "\n"
+                              },
+                              {
+                                "tag": "td"
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "text": "\n"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "font",
+                    "children": [
+                      {
+                        "text": "\n"
+                      },
+                      {
+                        "tag": "p"
+                      },
+                      {
+                        "text": "\n"
+                      },
+                      {
+                        "tag": "a"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "tag": "font"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "font",
+                    "children": [
+                      {
+                        "text": "\nThis page contains an insanely badly-nested tag sequence."
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><center><center></center></center><font>\n</font><table>\n<tbody><tr>\n<td></td></tr><tr>\n</tr></tbody></table><table><tbody><tr></tr></tbody></table><font>\n<p></p>\n<a></a></font><a><font></font></a><font>\nThis page contains an insanely badly-nested tag sequence.</font></body></html>",
+        "noQuirksBodyHtml": "<center><center></center></center><font>\n</font><table>\n<tbody><tr>\n<td></td></tr><tr>\n</tr></tbody></table><table><tbody><tr></tr></tbody></table><font>\n<p></p>\n<a></a></font><a><font></font></a><font>\nThis page contains an insanely badly-nested tag sequence.</font>"
+      }
+    },
+    {
+      "data": "<html>\n<body>\n<b><nobr><div>This text is in a div inside a nobr</nobr>More text that should not be in the nobr, i.e., the\nnobr should have closed the div inside it implicitly. </b><pre>A pre tag outside everything else.</pre>\n</body>\n</html>",
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "nobr": true,
+            "div": true,
+            "pre": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "\n"
+                  },
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "nobr"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "tag": "nobr",
+                            "children": [
+                              {
+                                "text": "This text is in a div inside a nobr"
+                              }
+                            ]
+                          },
+                          {
+                            "text": "More text that should not be in the nobr, i.e., the\nnobr should have closed the div inside it implicitly. "
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "pre",
+                        "children": [
+                          {
+                            "text": "A pre tag outside everything else."
+                          }
+                        ]
+                      },
+                      {
+                        "text": "\n\n"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>\n<b><nobr></nobr></b><div><b><nobr>This text is in a div inside a nobr</nobr>More text that should not be in the nobr, i.e., the\nnobr should have closed the div inside it implicitly. </b><pre>A pre tag outside everything else.</pre>\n\n</div></body></html>",
+        "noQuirksBodyHtml": "\n\n<b><nobr></nobr></b><div><b><nobr>This text is in a div inside a nobr</nobr>More text that should not be in the nobr, i.e., the\nnobr should have closed the div inside it implicitly. </b><pre>A pre tag outside everything else.</pre>\n\n</div>"
+      }
+    }
+  ],
+  "webkit01.dat": [
+    {
+      "data": "Test",
+      "errors": [
+        "(1,4): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "Test"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>Test</body></html>",
+        "noQuirksBodyHtml": "Test"
+      }
+    },
+    {
+      "data": "<div></div>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div></div></body></html>",
+        "noQuirksBodyHtml": "<div></div>"
+      }
+    },
+    {
+      "data": "<div>Test</div>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": "Test"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div>Test</div></body></html>",
+        "noQuirksBodyHtml": "<div>Test</div>"
+      }
+    },
+    {
+      "data": "<di",
+      "errors": [
+        "(1,3): eof-in-tag-name",
+        "(1,3): expected-doctype-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<div>Hello</div>\n<script>\nconsole.log(\"PASS\");\n</script>\n<div>Bye</div>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": "Hello"
+                      }
+                    ]
+                  },
+                  {
+                    "text": "\n"
+                  },
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "\nconsole.log(\"PASS\");\n",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "\n"
+                  },
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": "Bye"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div>Hello</div>\n<script>\nconsole.log(\"PASS\");\n</script>\n<div>Bye</div></body></html>",
+        "noQuirksBodyHtml": "<div>Hello</div>\n<script>\nconsole.log(\"PASS\");\n</script>\n<div>Bye</div>"
+      }
+    },
+    {
+      "data": "<div foo=\"bar\">Hello</div>",
+      "errors": [
+        "(1,15): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "foo",
+                        "value": "bar"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "text": "Hello"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div foo=\"bar\">Hello</div></body></html>",
+        "noQuirksBodyHtml": "<div foo=\"bar\">Hello</div>"
+      }
+    },
+    {
+      "data": "<div>Hello</div>\n<script>\nconsole.log(\"FOO<span>BAR</span>BAZ\");\n</script>\n<div>Bye</div>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "script": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": "Hello"
+                      }
+                    ]
+                  },
+                  {
+                    "text": "\n"
+                  },
+                  {
+                    "tag": "script",
+                    "children": [
+                      {
+                        "text": "\nconsole.log(\"FOO<span>BAR</span>BAZ\");\n",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "text": "\n"
+                  },
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "text": "Bye"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div>Hello</div>\n<script>\nconsole.log(\"FOO<span>BAR</span>BAZ\");\n</script>\n<div>Bye</div></body></html>",
+        "noQuirksBodyHtml": "<div>Hello</div>\n<script>\nconsole.log(\"FOO<span>BAR</span>BAZ\");\n</script>\n<div>Bye</div>"
+      }
+    },
+    {
+      "data": "<foo bar=\"baz\"></foo><potato quack=\"duck\"></potato>",
+      "errors": [
+        "(1,15): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "foo": true,
+            "potato": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "foo",
+                    "attrs": [
+                      {
+                        "name": "bar",
+                        "value": "baz"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "potato",
+                    "attrs": [
+                      {
+                        "name": "quack",
+                        "value": "duck"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><foo bar=\"baz\"></foo><potato quack=\"duck\"></potato></body></html>",
+        "noQuirksBodyHtml": "<foo bar=\"baz\"></foo><potato quack=\"duck\"></potato>"
+      }
+    },
+    {
+      "data": "<foo bar=\"baz\"><potato quack=\"duck\"></potato></foo>",
+      "errors": [
+        "(1,15): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "foo": true,
+            "potato": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "foo",
+                    "attrs": [
+                      {
+                        "name": "bar",
+                        "value": "baz"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "tag": "potato",
+                        "attrs": [
+                          {
+                            "name": "quack",
+                            "value": "duck"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><foo bar=\"baz\"><potato quack=\"duck\"></potato></foo></body></html>",
+        "noQuirksBodyHtml": "<foo bar=\"baz\"><potato quack=\"duck\"></potato></foo>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "foo": true,
+            "potato": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "foo"
+                  },
+                  {
+                    "tag": "potato"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><foo></foo><potato></potato></body></html>",
+        "noQuirksBodyHtml": "<foo></foo><potato></potato>"
+      }
+    },
+    {
+      "data": "</ tttt>",
+      "errors": [
+        "(1,2): expected-closing-tag-but-got-char",
+        "(1,8): expected-doctype-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "comment": " tttt"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<!-- tttt--><html><head></head><body></body></html>",
+        "noQuirksBodyHtml": "<!-- tttt-->"
+      }
+    },
+    {
+      "data": "<div FOO ><img><img></div>",
+      "errors": [
+        "(1,10): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "img": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "attrs": [
+                      {
+                        "name": "foo",
+                        "value": ""
+                      }
+                    ],
+                    "children": [
+                      {
+                        "tag": "img"
+                      },
+                      {
+                        "tag": "img"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div foo=\"\"><img><img></div></body></html>",
+        "noQuirksBodyHtml": "<div foo=\"\"><img><img></div>"
+      }
+    },
+    {
+      "data": "<p>Test</p<p>Test2</p>",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag",
+        "(1,13): unexpected-end-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "text": "TestTest2"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><p>TestTest2</p></body></html>",
+        "noQuirksBodyHtml": "<p>TestTest2</p>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "rdar:": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "rdar:",
+                    "attrs": [
+                      {
+                        "name": "6869687",
+                        "value": ""
+                      },
+                      {
+                        "name": "problem",
+                        "value": ""
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><rdar: problem=\"\" 6869687=\"\"></rdar:></body></html>",
+        "noQuirksBodyHtml": "<rdar: problem=\"\" 6869687=\"\"></rdar:>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a",
+                    "children": [
+                      {
+                        "text": "test< /A>",
+                        "escaped": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a>test&lt; /A&gt;</a></body></html>",
+        "noQuirksBodyHtml": "<a>test&lt; /A&gt;</a>"
+      }
+    },
+    {
+      "data": "&lt;",
+      "errors": [
+        "(1,4): expected-doctype-but-got-chars"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "escaped": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "<",
+                    "escaped": true
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>&lt;</body></html>",
+        "noQuirksBodyHtml": "&lt;"
+      }
+    },
+    {
+      "data": "<body foo='bar'><body foo='baz' yo='mama'>",
+      "errors": [
+        "(1,16): expected-doctype-but-got-start-tag",
+        "(1,42): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "attrs": [
+                  {
+                    "name": "foo",
+                    "value": "bar"
+                  },
+                  {
+                    "name": "yo",
+                    "value": "mama"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body foo=\"bar\" yo=\"mama\"></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "br": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "br"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><br></body></html>",
+        "noQuirksBodyHtml": "<br>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "bdy": true,
+            "br": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "bdy",
+                    "children": [
+                      {
+                        "tag": "br",
+                        "attrs": [
+                          {
+                            "name": "foo",
+                            "value": "bar"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><bdy><br foo=\"bar\"></bdy></body></html>",
+        "noQuirksBodyHtml": "<bdy><br foo=\"bar\"></bdy>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "br": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "br"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><br></body></html>",
+        "noQuirksBodyHtml": "<br>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "bdy": true,
+            "br": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "bdy",
+                    "children": [
+                      {
+                        "tag": "br",
+                        "attrs": [
+                          {
+                            "name": "foo",
+                            "value": "bar"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><bdy><br foo=\"bar\"></bdy></body></html>",
+        "noQuirksBodyHtml": "<bdy><br foo=\"bar\"></bdy>"
+      }
+    },
+    {
+      "data": "<html><body></body></html><!-- Hi there -->",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          },
+          {
+            "comment": " Hi there "
+          }
+        ],
+        "html": "<html><head></head><body></body></html><!-- Hi there -->",
+        "noQuirksBodyHtml": "<!-- Hi there -->"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "x"
+                  },
+                  {
+                    "comment": " Hi there "
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>x<!-- Hi there --></body></html>",
+        "noQuirksBodyHtml": "x<!-- Hi there -->"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "x"
+                  },
+                  {
+                    "comment": " Hi there "
+                  }
+                ]
+              }
+            ]
+          },
+          {
+            "comment": " Again "
+          }
+        ],
+        "html": "<html><head></head><body>x<!-- Hi there --></body></html><!-- Again -->",
+        "noQuirksBodyHtml": "x<!-- Hi there --><!-- Again -->"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          },
+          "comment": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "x"
+                  },
+                  {
+                    "comment": " Hi there "
+                  }
+                ]
+              }
+            ]
+          },
+          {
+            "comment": " Again "
+          }
+        ],
+        "html": "<html><head></head><body>x<!-- Hi there --></body></html><!-- Again -->",
+        "noQuirksBodyHtml": "x<!-- Hi there --><!-- Again -->"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "div": true,
+            "rp": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "tag": "div",
+                        "children": [
+                          {
+                            "tag": "rp",
+                            "children": [
+                              {
+                                "text": "xx"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby><div><rp>xx</rp></div></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby><div><rp>xx</rp></div></ruby>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ruby": true,
+            "div": true,
+            "rt": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ruby",
+                    "children": [
+                      {
+                        "tag": "div",
+                        "children": [
+                          {
+                            "tag": "rt",
+                            "children": [
+                              {
+                                "text": "xx"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ruby><div><rt>xx</rt></div></ruby></body></html>",
+        "noQuirksBodyHtml": "<ruby><div><rt>xx</rt></div></ruby>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true,
+            "noframes": true
+          },
+          "comment": true,
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset",
+                "children": [
+                  {
+                    "comment": "1"
+                  },
+                  {
+                    "tag": "noframes",
+                    "children": [
+                      {
+                        "text": "A",
+                        "no_escape": true
+                      }
+                    ]
+                  },
+                  {
+                    "comment": "2"
+                  }
+                ]
+              },
+              {
+                "comment": "3"
+              },
+              {
+                "tag": "noframes",
+                "children": [
+                  {
+                    "text": "B",
+                    "no_escape": true
+                  }
+                ]
+              },
+              {
+                "comment": "4"
+              },
+              {
+                "tag": "noframes",
+                "children": [
+                  {
+                    "text": "C",
+                    "no_escape": true
+                  }
+                ]
+              }
+            ]
+          },
+          {
+            "comment": "5"
+          },
+          {
+            "comment": "6"
+          }
+        ],
+        "html": "<html><head></head><frameset><!--1--><noframes>A</noframes><!--2--></frameset><!--3--><noframes>B</noframes><!--4--><noframes>C</noframes></html><!--5--><!--6-->",
+        "noQuirksBodyHtml": "<!--1--><noframes>A</noframes><!--2--><!--3--><noframes>B</noframes><!--4--><!--5--><noframes>C</noframes><!--6-->"
+      }
+    },
+    {
+      "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"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "select": true,
+            "option": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "select",
+                    "children": [
+                      {
+                        "tag": "option",
+                        "children": [
+                          {
+                            "text": "A"
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "option",
+                    "children": [
+                      {
+                        "text": "B"
+                      },
+                      {
+                        "tag": "select",
+                        "children": [
+                          {
+                            "tag": "option",
+                            "children": [
+                              {
+                                "text": "C"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "option",
+                    "children": [
+                      {
+                        "text": "D"
+                      },
+                      {
+                        "tag": "select",
+                        "children": [
+                          {
+                            "tag": "option",
+                            "children": [
+                              {
+                                "text": "E"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "option",
+                    "children": [
+                      {
+                        "text": "F"
+                      },
+                      {
+                        "tag": "select",
+                        "children": [
+                          {
+                            "tag": "option",
+                            "children": [
+                              {
+                                "text": "G"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><select><option>A</option></select><option>B<select><option>C</option></select></option><option>D<select><option>E</option></select></option><option>F<select><option>G</option></select></option></body></html>",
+        "noQuirksBodyHtml": "<select><option>A</option></select><option>B<select><option>C</option></select></option><option>D<select><option>E</option></select></option><option>F<select><option>G</option></select></option>"
+      }
+    },
+    {
+      "data": "<dd><dd><dt><dt><dd><li><li>",
+      "errors": [
+        "(1,4): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "dd": true,
+            "dt": true,
+            "li": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "dd"
+                  },
+                  {
+                    "tag": "dd"
+                  },
+                  {
+                    "tag": "dt"
+                  },
+                  {
+                    "tag": "dt"
+                  },
+                  {
+                    "tag": "dd",
+                    "children": [
+                      {
+                        "tag": "li"
+                      },
+                      {
+                        "tag": "li"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><dd></dd><dd></dd><dt></dt><dt></dt><dd><li></li><li></li></dd></body></html>",
+        "noQuirksBodyHtml": "<dd></dd><dd></dd><dt></dt><dt></dt><dd><li></li><li></li></dd>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "b": true,
+            "nobr": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "b"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "b",
+                        "children": [
+                          {
+                            "tag": "nobr",
+                            "children": [
+                              {
+                                "text": "a"
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "nobr"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div><b></b></div><div><b><nobr>a</nobr><nobr></nobr></b></div></body></html>",
+        "noQuirksBodyHtml": "<div><b></b></div><div><b><nobr>a</nobr><nobr></nobr></b></div>"
+      }
+    },
+    {
+      "data": "<head></head>\n<body></body>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "text": "\n"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head>\n<body></body></html>",
+        "noQuirksBodyHtml": "\n"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "style": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head",
+                "children": [
+                  {
+                    "tag": "style"
+                  }
+                ]
+              },
+              {
+                "text": " "
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "ddd"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head><style></style></head> <body>ddd</body></html>",
+        "noQuirksBodyHtml": " <style></style>ddd"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "kbd": true,
+            "select": true,
+            "table": true,
+            "colgroup": true,
+            "col": true,
+            "tbody": true,
+            "tr": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "kbd",
+                    "children": [
+                      {
+                        "tag": "select"
+                      },
+                      {
+                        "tag": "table",
+                        "children": [
+                          {
+                            "tag": "colgroup",
+                            "children": [
+                              {
+                                "tag": "col"
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "tbody",
+                            "children": [
+                              {
+                                "tag": "tr"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><kbd><select></select><table><colgroup><col></colgroup><tbody><tr></tr></tbody></table></kbd></body></html>",
+        "noQuirksBodyHtml": "<kbd><select></select><table><colgroup><col></colgroup><tbody><tr></tr></tbody></table></kbd>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "kbd": true,
+            "select": true,
+            "table": true,
+            "colgroup": true,
+            "col": true,
+            "tbody": true,
+            "tr": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "kbd",
+                    "children": [
+                      {
+                        "tag": "select"
+                      },
+                      {
+                        "tag": "table",
+                        "children": [
+                          {
+                            "tag": "colgroup",
+                            "children": [
+                              {
+                                "tag": "col"
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "tbody",
+                            "children": [
+                              {
+                                "tag": "tr"
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "div"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><kbd><select></select><table><colgroup><col></colgroup><tbody><tr></tr></tbody></table><div></div></kbd></body></html>",
+        "noQuirksBodyHtml": "<kbd><select></select><table><colgroup><col></colgroup><tbody><tr></tr></tbody></table><div></div></kbd>"
+      }
+    },
+    {
+      "data": "<a><li><style></style><title></title></a>",
+      "errors": [
+        "(1,3): expected-doctype-but-got-start-tag",
+        "(1,41): adoption-agency-1.3"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "li": true,
+            "style": true,
+            "title": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a"
+                  },
+                  {
+                    "tag": "li",
+                    "children": [
+                      {
+                        "tag": "a",
+                        "children": [
+                          {
+                            "tag": "style"
+                          },
+                          {
+                            "tag": "title"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a></a><li><a><style></style><title></title></a></li></body></html>",
+        "noQuirksBodyHtml": "<a></a><li><a><style></style><title></title></a></li>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "font": true,
+            "p": true,
+            "meta": true,
+            "title": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "font",
+                    "children": [
+                      {
+                        "tag": "p"
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "tag": "font",
+                        "children": [
+                          {
+                            "tag": "meta"
+                          },
+                          {
+                            "tag": "title"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><font><p></p></font><p><font><meta><title></title></font></p></body></html>",
+        "noQuirksBodyHtml": "<font><p></p></font><p><font><meta><title></title></font></p>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "a": true,
+            "center": true,
+            "title": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "a"
+                  },
+                  {
+                    "tag": "center",
+                    "children": [
+                      {
+                        "tag": "a",
+                        "children": [
+                          {
+                            "tag": "title"
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "a"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><a></a><center><a><title></title></a><a></a></center></body></html>",
+        "noQuirksBodyHtml": "<a></a><center><a><title></title></a><a></a></center>"
+      }
+    },
+    {
+      "data": "<svg><title><div>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,17): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg title": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "title",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "tag": "div"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg><title><div></div></title></svg></body></html>",
+        "noQuirksBodyHtml": "<svg><title><div></div></title></svg>"
+      }
+    },
+    {
+      "data": "<svg><title><rect><div>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag",
+        "(1,23): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg title": true,
+            "rect": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "title",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "tag": "rect",
+                            "children": [
+                              {
+                                "tag": "div"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg><title><rect><div></div></rect></title></svg></body></html>",
+        "noQuirksBodyHtml": "<svg><title><rect><div></div></rect></title></svg>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg title": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "title",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "tag": "svg",
+                            "ns": "http://www.w3.org/2000/svg"
+                          },
+                          {
+                            "tag": "div"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg><title><svg></svg><div></div></title></svg></body></html>",
+        "noQuirksBodyHtml": "<svg><title><svg><div></div></svg></title></svg>"
+      }
+    },
+    {
+      "data": "<img <=\"\" FAIL>",
+      "errors": [
+        "(1,6): invalid-character-in-attribute-name",
+        "(1,15): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "img": true
+          },
+          "attrWithFunnyChar": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "img",
+                    "attrs": [
+                      {
+                        "name": "<",
+                        "value": ""
+                      },
+                      {
+                        "name": "fail",
+                        "value": ""
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><img <=\"\" fail=\"\"></body></html>",
+        "noQuirksBodyHtml": "<img <=\"\" fail=\"\">"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "ul": true,
+            "li": true,
+            "div": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "ul",
+                    "children": [
+                      {
+                        "tag": "li",
+                        "children": [
+                          {
+                            "tag": "div",
+                            "attrs": [
+                              {
+                                "name": "id",
+                                "value": "foo"
+                              }
+                            ],
+                            "children": [
+                              {
+                                "text": "A"
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "li",
+                        "children": [
+                          {
+                            "text": "B"
+                          },
+                          {
+                            "tag": "div",
+                            "children": [
+                              {
+                                "text": "C"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><ul><li><div id=\"foo\">A</div></li><li>B<div>C</div></li></ul></body></html>",
+        "noQuirksBodyHtml": "<ul><li><div id=\"foo\">A</div></li><li>B<div>C</div></li></ul>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "em": true,
+            "desc": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg"
+                  },
+                  {
+                    "tag": "em",
+                    "children": [
+                      {
+                        "tag": "desc"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg></svg><em><desc></desc></em></body></html>",
+        "noQuirksBodyHtml": "<svg><em><desc></desc></em></svg>"
+      }
+    },
+    {
+      "data": "<table><tr><td><svg><desc><td></desc><circle>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true,
+            "svg svg": true,
+            "svg desc": true,
+            "circle": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "svg",
+                                    "ns": "http://www.w3.org/2000/svg",
+                                    "children": [
+                                      {
+                                        "tag": "desc",
+                                        "ns": "http://www.w3.org/2000/svg"
+                                      }
+                                    ]
+                                  }
+                                ]
+                              },
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "tag": "circle"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><tr><td><svg><desc></desc></svg></td><td><circle></circle></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td><svg><desc></desc></svg></td><td><circle></circle></td></tr></tbody></table>"
+      }
+    },
+    {
+      "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": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg tfoot": true,
+            "svg td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "tfoot",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "tag": "td",
+                            "ns": "http://www.w3.org/2000/svg"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg><tfoot><td></td></tfoot></svg></body></html>",
+        "noQuirksBodyHtml": "<svg><tfoot><td></td></tfoot></svg>"
+      }
+    },
+    {
+      "data": "<math><mrow><mrow><mn>1</mn></mrow><mi>a</mi></mrow></math>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "math math": true,
+            "math mrow": true,
+            "math mn": true,
+            "math mi": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "math",
+                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "children": [
+                      {
+                        "tag": "mrow",
+                        "ns": "http://www.w3.org/1998/Math/MathML",
+                        "children": [
+                          {
+                            "tag": "mrow",
+                            "ns": "http://www.w3.org/1998/Math/MathML",
+                            "children": [
+                              {
+                                "tag": "mn",
+                                "ns": "http://www.w3.org/1998/Math/MathML",
+                                "children": [
+                                  {
+                                    "text": "1"
+                                  }
+                                ]
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "mi",
+                            "ns": "http://www.w3.org/1998/Math/MathML",
+                            "children": [
+                              {
+                                "text": "a"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><math><mrow><mrow><mn>1</mn></mrow><mi>a</mi></mrow></math></body></html>",
+        "noQuirksBodyHtml": "<math><mrow><mrow><mn>1</mn></mrow><mi>a</mi></mrow></math>"
+      }
+    },
+    {
+      "data": "<!doctype html><input type=\"hidden\"><frameset>",
+      "errors": [
+        "(1,46): unexpected-start-tag",
+        "(1,46): eof-in-frameset"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "frameset": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "frameset"
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><frameset></frameset></html>",
+        "noQuirksBodyHtml": "<input type=\"hidden\">"
+      }
+    },
+    {
+      "data": "<!doctype html><input type=\"button\"><frameset>",
+      "errors": [
+        "(1,46): unexpected-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "input": true
+          },
+          "doctype": true
+        },
+        "tree": [
+          {
+            "doctype": "html"
+          },
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "input",
+                    "attrs": [
+                      {
+                        "name": "type",
+                        "value": "button"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<!DOCTYPE html><html><head></head><body><input type=\"button\"></body></html>",
+        "noQuirksBodyHtml": "<input type=\"button\">"
+      }
+    }
+  ],
+  "webkit02.dat": [
+    {
+      "data": "<foo bar=qux/>",
+      "errors": [
+        "(1,14): expected-doctype-but-got-start-tag",
+        "(1,14): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "foo": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "foo",
+                    "attrs": [
+                      {
+                        "name": "bar",
+                        "value": "qux/"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><foo bar=\"qux/\"></foo></body></html>",
+        "noQuirksBodyHtml": "<foo bar=\"qux/\"></foo>"
+      }
+    },
+    {
+      "data": "<p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p>",
+      "errors": [
+        "(1,15): expected-doctype-but-got-start-tag"
+      ],
+      "script": "on",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "noscript": true,
+            "span": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "attrs": [
+                      {
+                        "name": "id",
+                        "value": "status"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "tag": "noscript",
+                        "children": [
+                          {
+                            "text": "<strong>A</strong>",
+                            "no_escape": true
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "span",
+                        "children": [
+                          {
+                            "text": "B"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p></body></html>",
+        "noQuirksBodyHtml": "<p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p>"
+      }
+    },
+    {
+      "data": "<p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p>",
+      "errors": [
+        "(1,15): expected-doctype-but-got-start-tag"
+      ],
+      "script": "off",
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "p": true,
+            "noscript": true,
+            "strong": true,
+            "span": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "attrs": [
+                      {
+                        "name": "id",
+                        "value": "status"
+                      }
+                    ],
+                    "children": [
+                      {
+                        "tag": "noscript",
+                        "children": [
+                          {
+                            "tag": "strong",
+                            "children": [
+                              {
+                                "text": "A"
+                              }
+                            ]
+                          }
+                        ]
+                      },
+                      {
+                        "tag": "span",
+                        "children": [
+                          {
+                            "text": "B"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p></body></html>",
+        "noQuirksBodyHtml": "<p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p>"
+      }
+    },
+    {
+      "data": "<div><sarcasm><div></div></sarcasm></div>",
+      "errors": [
+        "(1,5): expected-doctype-but-got-start-tag"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "div": true,
+            "sarcasm": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "div",
+                    "children": [
+                      {
+                        "tag": "sarcasm",
+                        "children": [
+                          {
+                            "tag": "div"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><div><sarcasm><div></div></sarcasm></div></body></html>",
+        "noQuirksBodyHtml": "<div><sarcasm><div></div></sarcasm></div>"
+      }
+    },
+    {
+      "data": "<html><body><img src=\"\" border=\"0\" alt=\"><div>A</div></body></html>",
+      "errors": [
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,67): eof-in-attribute-value-double-quote"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body"
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body></body></html>",
+        "noQuirksBodyHtml": ""
+      }
+    },
+    {
+      "data": "<table><td></tbody>A",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,11): unexpected-cell-in-table-body",
+        "(1,20): foster-parenting-character",
+        "(1,20): eof-in-table"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "A"
+                  },
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body>A<table><tbody><tr><td></td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "A<table><tbody><tr><td></td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<table><td></thead>A",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,11): unexpected-cell-in-table-body",
+        "(1,19): XXX-undefined-error",
+        "(1,20): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "text": "A"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><tr><td>A</td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td>A</td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<table><td></tfoot>A",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,11): unexpected-cell-in-table-body",
+        "(1,19): XXX-undefined-error",
+        "(1,20): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "tbody": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "tbody",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "text": "A"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><tbody><tr><td>A</td></tr></tbody></table></body></html>",
+        "noQuirksBodyHtml": "<table><tbody><tr><td>A</td></tr></tbody></table>"
+      }
+    },
+    {
+      "data": "<table><thead><td></tbody>A",
+      "errors": [
+        "(1,7): expected-doctype-but-got-start-tag",
+        "(1,18): unexpected-cell-in-table-body",
+        "(1,26): XXX-undefined-error",
+        "(1,27): expected-closing-tag-but-got-eof"
+      ],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "table": true,
+            "thead": true,
+            "tr": true,
+            "td": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "table",
+                    "children": [
+                      {
+                        "tag": "thead",
+                        "children": [
+                          {
+                            "tag": "tr",
+                            "children": [
+                              {
+                                "tag": "td",
+                                "children": [
+                                  {
+                                    "text": "A"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><table><thead><tr><td>A</td></tr></thead></table></body></html>",
+        "noQuirksBodyHtml": "<table><thead><tr><td>A</td></tr></thead></table>"
+      }
+    },
+    {
+      "data": "<legend>test</legend>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "legend": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "legend",
+                    "children": [
+                      {
+                        "text": "test"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><legend>test</legend></body></html>",
+        "noQuirksBodyHtml": "<legend>test</legend>"
+      }
+    },
+    {
+      "data": "<table><input>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "input": true,
+            "table": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "input"
+                  },
+                  {
+                    "tag": "table"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><input><table></table></body></html>",
+        "noQuirksBodyHtml": "<input><table></table>"
+      }
+    },
+    {
+      "data": "<b><em><foo><foo><aside></b>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "em": true,
+            "foo": true,
+            "aside": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "em",
+                        "children": [
+                          {
+                            "tag": "foo",
+                            "children": [
+                              {
+                                "tag": "foo"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "em",
+                    "children": [
+                      {
+                        "tag": "aside",
+                        "children": [
+                          {
+                            "tag": "b"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b><em><foo><foo></foo></foo></em></b><em><aside><b></b></aside></em></body></html>",
+        "noQuirksBodyHtml": "<b><em><foo><foo></foo></foo></em></b><em><aside><b></b></aside></em>"
+      }
+    },
+    {
+      "data": "<b><em><foo><foo><aside></b></em>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "em": true,
+            "foo": true,
+            "aside": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "em",
+                        "children": [
+                          {
+                            "tag": "foo",
+                            "children": [
+                              {
+                                "tag": "foo"
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "em"
+                  },
+                  {
+                    "tag": "aside",
+                    "children": [
+                      {
+                        "tag": "em",
+                        "children": [
+                          {
+                            "tag": "b"
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b><em><foo><foo></foo></foo></em></b><em></em><aside><em><b></b></em></aside></body></html>",
+        "noQuirksBodyHtml": "<b><em><foo><foo></foo></foo></em></b><em></em><aside><em><b></b></em></aside>"
+      }
+    },
+    {
+      "data": "<b><em><foo><foo><foo><aside></b>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "em": true,
+            "foo": true,
+            "aside": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "em",
+                        "children": [
+                          {
+                            "tag": "foo",
+                            "children": [
+                              {
+                                "tag": "foo",
+                                "children": [
+                                  {
+                                    "tag": "foo"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "aside",
+                    "children": [
+                      {
+                        "tag": "b"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b><em><foo><foo><foo></foo></foo></foo></em></b><aside><b></b></aside></body></html>",
+        "noQuirksBodyHtml": "<b><em><foo><foo><foo></foo></foo></foo></em></b><aside><b></b></aside>"
+      }
+    },
+    {
+      "data": "<b><em><foo><foo><foo><aside></b></em>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "b": true,
+            "em": true,
+            "foo": true,
+            "aside": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "b",
+                    "children": [
+                      {
+                        "tag": "em",
+                        "children": [
+                          {
+                            "tag": "foo",
+                            "children": [
+                              {
+                                "tag": "foo",
+                                "children": [
+                                  {
+                                    "tag": "foo"
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  },
+                  {
+                    "tag": "aside",
+                    "children": [
+                      {
+                        "tag": "b"
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><b><em><foo><foo><foo></foo></foo></foo></em></b><aside><b></b></aside></body></html>",
+        "noQuirksBodyHtml": "<b><em><foo><foo><foo></foo></foo></foo></em></b><aside><b></b></aside>"
+      }
+    },
+    {
+      "data": "<b><em><foo><foo><foo><foo><foo><foo><foo><foo><foo><foo><aside></b></em>",
+      "errors": [],
+      "fragment": {
+        "name": "div"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "b": true,
+            "em": true,
+            "foo": true,
+            "aside": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "b",
+            "children": [
+              {
+                "tag": "em",
+                "children": [
+                  {
+                    "tag": "foo",
+                    "children": [
+                      {
+                        "tag": "foo",
+                        "children": [
+                          {
+                            "tag": "foo",
+                            "children": [
+                              {
+                                "tag": "foo",
+                                "children": [
+                                  {
+                                    "tag": "foo",
+                                    "children": [
+                                      {
+                                        "tag": "foo",
+                                        "children": [
+                                          {
+                                            "tag": "foo",
+                                            "children": [
+                                              {
+                                                "tag": "foo",
+                                                "children": [
+                                                  {
+                                                    "tag": "foo",
+                                                    "children": [
+                                                      {
+                                                        "tag": "foo"
+                                                      }
+                                                    ]
+                                                  }
+                                                ]
+                                              }
+                                            ]
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          },
+          {
+            "tag": "aside",
+            "children": [
+              {
+                "tag": "b"
+              }
+            ]
+          }
+        ],
+        "html": "<b><em><foo><foo><foo><foo><foo><foo><foo><foo><foo><foo></foo></foo></foo></foo></foo></foo></foo></foo></foo></foo></em></b><aside><b></b></aside>",
+        "noQuirksBodyHtml": "<b><em><foo><foo><foo><foo><foo><foo><foo><foo><foo><foo></foo></foo></foo></foo></foo></foo></foo></foo></foo></foo></em></b><aside><b></b></aside>"
+      }
+    },
+    {
+      "data": "<b><em><foo><foob><foob><foob><foob><fooc><fooc><fooc><fooc><food><aside></b></em>",
+      "errors": [],
+      "fragment": {
+        "name": "div"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "b": true,
+            "em": true,
+            "foo": true,
+            "foob": true,
+            "fooc": true,
+            "food": true,
+            "aside": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "b",
+            "children": [
+              {
+                "tag": "em",
+                "children": [
+                  {
+                    "tag": "foo",
+                    "children": [
+                      {
+                        "tag": "foob",
+                        "children": [
+                          {
+                            "tag": "foob",
+                            "children": [
+                              {
+                                "tag": "foob",
+                                "children": [
+                                  {
+                                    "tag": "foob",
+                                    "children": [
+                                      {
+                                        "tag": "fooc",
+                                        "children": [
+                                          {
+                                            "tag": "fooc",
+                                            "children": [
+                                              {
+                                                "tag": "fooc",
+                                                "children": [
+                                                  {
+                                                    "tag": "fooc",
+                                                    "children": [
+                                                      {
+                                                        "tag": "food"
+                                                      }
+                                                    ]
+                                                  }
+                                                ]
+                                              }
+                                            ]
+                                          }
+                                        ]
+                                      }
+                                    ]
+                                  }
+                                ]
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          },
+          {
+            "tag": "aside",
+            "children": [
+              {
+                "tag": "b"
+              }
+            ]
+          }
+        ],
+        "html": "<b><em><foo><foob><foob><foob><foob><fooc><fooc><fooc><fooc><food></food></fooc></fooc></fooc></fooc></foob></foob></foob></foob></foo></em></b><aside><b></b></aside>",
+        "noQuirksBodyHtml": "<b><em><foo><foob><foob><foob><foob><fooc><fooc><fooc><fooc><food></food></fooc></fooc></fooc></fooc></foob></foob></foob></foob></foo></em></b><aside><b></b></aside>"
+      }
+    },
+    {
+      "data": "<option><XH<optgroup></optgroup>",
+      "errors": [],
+      "fragment": {
+        "name": "select"
+      },
+      "document": {
+        "props": {
+          "tags": {
+            "option": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "option"
+          }
+        ],
+        "html": "<option></option>",
+        "noQuirksBodyHtml": "<option><xh<optgroup></xh<optgroup></option>"
+      }
+    },
+    {
+      "data": "<svg><foreignObject><div>foo</div><plaintext></foreignObject></svg><div>bar</div>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg foreignObject": true,
+            "div": true,
+            "plaintext": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "foreignObject",
+                        "ns": "http://www.w3.org/2000/svg",
+                        "children": [
+                          {
+                            "tag": "div",
+                            "children": [
+                              {
+                                "text": "foo"
+                              }
+                            ]
+                          },
+                          {
+                            "tag": "plaintext",
+                            "children": [
+                              {
+                                "text": "</foreignObject></svg><div>bar</div>",
+                                "no_escape": true
+                              }
+                            ]
+                          }
+                        ]
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg><foreignObject><div>foo</div><plaintext></foreignObject></svg><div>bar</div></plaintext></foreignObject></svg></body></html>",
+        "noQuirksBodyHtml": "<svg><foreignObject><div>foo</div><plaintext></foreignObject></svg><div>bar</div></plaintext></foreignObject></svg>"
+      }
+    },
+    {
+      "data": "<svg><foreignObject></foreignObject><title></svg>foo",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "svg svg": true,
+            "svg foreignObject": true,
+            "svg title": true
+          }
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "svg",
+                    "ns": "http://www.w3.org/2000/svg",
+                    "children": [
+                      {
+                        "tag": "foreignObject",
+                        "ns": "http://www.w3.org/2000/svg"
+                      },
+                      {
+                        "tag": "title",
+                        "ns": "http://www.w3.org/2000/svg"
+                      }
+                    ]
+                  },
+                  {
+                    "text": "foo"
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><svg><foreignObject></foreignObject><title></title></svg>foo</body></html>",
+        "noQuirksBodyHtml": "<svg><foreignObject></foreignObject><title></title></svg>foo"
+      }
+    },
+    {
+      "data": "</foreignObject><plaintext><div>foo</div>",
+      "errors": [],
+      "document": {
+        "props": {
+          "tags": {
+            "html": true,
+            "head": true,
+            "body": true,
+            "plaintext": true
+          },
+          "no_escape": true
+        },
+        "tree": [
+          {
+            "tag": "html",
+            "children": [
+              {
+                "tag": "head"
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "plaintext",
+                    "children": [
+                      {
+                        "text": "<div>foo</div>",
+                        "no_escape": true
+                      }
+                    ]
+                  }
+                ]
+              }
+            ]
+          }
+        ],
+        "html": "<html><head></head><body><plaintext><div>foo</div></plaintext></body></html>",
+        "noQuirksBodyHtml": "<plaintext><div>foo</div></plaintext>"
+      }
+    }
+  ]
+}
\ No newline at end of file
diff --git a/tests/phpunit/unit/includes/utils/AvroValidatorTest.php b/tests/phpunit/unit/includes/utils/AvroValidatorTest.php
new file mode 100644 (file)
index 0000000..bdf493d
--- /dev/null
@@ -0,0 +1,116 @@
+<?php
+/**
+ * Tests for IP validity functions.
+ *
+ * Ported from /t/inc/IP.t by avar.
+ *
+ * @todo Test methods in this call should be split into a method and a
+ * dataprovider.
+ */
+
+/**
+ * @group IP
+ * @covers AvroValidator
+ */
+class AvroValidatorTest extends MediaWikiUnitTestCase {
+
+       public function setUp() {
+               if ( !class_exists( 'AvroSchema' ) ) {
+                       $this->markTestSkipped( 'Avro is required to run the AvroValidatorTest' );
+               }
+               parent::setUp();
+       }
+
+       public function getErrorsProvider() {
+               $stringSchema = AvroSchema::parse( json_encode( [ 'type' => 'string' ] ) );
+               $stringArraySchema = AvroSchema::parse( json_encode( [
+                       'type' => 'array',
+                       'items' => 'string',
+               ] ) );
+               $recordSchema = AvroSchema::parse( json_encode( [
+                       'type' => 'record',
+                       'name' => 'ut',
+                       'fields' => [
+                               [ 'name' => 'id', 'type' => 'int', 'required' => true ],
+                       ],
+               ] ) );
+               $enumSchema = AvroSchema::parse( json_encode( [
+                       'type' => 'record',
+                       'name' => 'ut',
+                       'fields' => [
+                               [ 'name' => 'count', 'type' => [ 'int', 'null' ] ],
+                       ],
+               ] ) );
+
+               return [
+                       [
+                               'No errors with a simple string serialization',
+                               $stringSchema, 'foobar', [],
+                       ],
+
+                       [
+                               'Cannot serialize integer into string',
+                               $stringSchema, 5, 'Expected string, but recieved integer',
+                       ],
+
+                       [
+                               'Cannot serialize array into string',
+                               $stringSchema, [], 'Expected string, but recieved array',
+                       ],
+
+                       [
+                               'allows and ignores extra fields',
+                               $recordSchema, [ 'id' => 4, 'foo' => 'bar' ], [],
+                       ],
+
+                       [
+                               'detects missing fields',
+                               $recordSchema, [], [ 'id' => 'Missing expected field' ],
+                       ],
+
+                       [
+                               'handles first element in enum',
+                               $enumSchema, [ 'count' => 4 ], [],
+                       ],
+
+                       [
+                               'handles second element in enum',
+                               $enumSchema, [ 'count' => null ], [],
+                       ],
+
+                       [
+                               'rejects element not in union',
+                               $enumSchema, [ 'count' => 'invalid' ], [ 'count' => [
+                                       'Expected any one of these to be true',
+                                       [
+                                               'Expected integer, but recieved string',
+                                               'Expected null, but recieved string',
+                                       ]
+                               ] ]
+                       ],
+                       [
+                               'Empty array is accepted',
+                               $stringArraySchema, [], []
+                       ],
+                       [
+                               'correct array element accepted',
+                               $stringArraySchema, [ 'fizzbuzz' ], []
+                       ],
+                       [
+                               'incorrect array element rejected',
+                               $stringArraySchema, [ '12', 34 ], [ 'Expected string, but recieved integer' ]
+                       ],
+               ];
+       }
+
+       /**
+        * @dataProvider getErrorsProvider
+        */
+       public function testGetErrors( $message, $schema, $datum, $expected ) {
+               $this->assertEquals(
+                       $expected,
+                       AvroValidator::getErrors( $schema, $datum ),
+                       $message
+               );
+       }
+}
diff --git a/tests/phpunit/unit/includes/utils/ClassCollectorTest.php b/tests/phpunit/unit/includes/utils/ClassCollectorTest.php
new file mode 100644 (file)
index 0000000..6ce5e9d
--- /dev/null
@@ -0,0 +1,69 @@
+<?php
+
+/**
+ * @covers ClassCollector
+ */
+class ClassCollectorTest extends MediaWikiUnitTestCase {
+
+       public static function provideCases() {
+               return [
+                       [
+                               "class Foo {}",
+                               [ 'Foo' ],
+                       ],
+                       [
+                               "namespace Example;\nclass Foo {}\nclass Bar {}",
+                               [ 'Example\Foo', 'Example\Bar' ],
+                       ],
+                       [
+                               "class_alias( 'Foo', 'Bar' );",
+                               [ 'Bar' ],
+                       ],
+                       [
+                               "namespace Example;\nclass Foo {}\nclass_alias( 'Example\Foo', 'Foo' );",
+                               [ 'Example\Foo', 'Foo' ],
+                       ],
+                       [
+                               "namespace Example;\nclass Foo {}\nclass_alias( 'Example\Foo', 'Bar' );",
+                               [ 'Example\Foo', 'Bar' ],
+                       ],
+                       [
+                               // Support a multiline 'class' statement
+                               "namespace Example;\nclass Foo extends\n\tFooBase {\n\t"
+                                               . "public function x() {}\n}\nclass_alias( 'Example\Foo', 'Bar' );",
+                               [ 'Example\Foo', 'Bar' ],
+                       ],
+                       [
+                               "class_alias( Foo::class, 'Bar' );",
+                               [ 'Bar' ],
+                       ],
+                       [
+                               // Support nested class_alias() calls
+                                       "if ( false ) {\n\tclass_alias( Foo::class, 'Bar' );\n}",
+                                       [ 'Bar' ],
+                       ],
+                       [
+                               // Namespaced class is not currently supported. Must use namespace declaration
+                               // earlier in the file.
+                               "class_alias( Example\Foo::class, 'Bar' );",
+                               [],
+                       ],
+                       [
+                               "namespace Example;\nclass Foo {}\nclass_alias( Foo::class, 'Bar' );",
+                               [ 'Example\Foo', 'Bar' ],
+                       ],
+                       [
+                               "new class() extends Foo {}",
+                               []
+                       ]
+               ];
+       }
+
+       /**
+        * @dataProvider provideCases
+        */
+       public function testGetClasses( $code, array $classes, $message = null ) {
+               $cc = new ClassCollector();
+               $this->assertEquals( $classes, $cc->getClasses( "<?php\n$code" ), $message );
+       }
+}
diff --git a/tests/phpunit/unit/includes/utils/MWCryptHashTest.php b/tests/phpunit/unit/includes/utils/MWCryptHashTest.php
new file mode 100644 (file)
index 0000000..3a9f48c
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+
+/**
+ * @group Hash
+ *
+ * @covers MWCryptHash
+ */
+class MWCryptHashTest extends MediaWikiUnitTestCase {
+
+       public function testHashLength() {
+               if ( MWCryptHash::hashAlgo() !== 'whirlpool' ) {
+                       $this->markTestSkipped( 'Hash algorithm isn\'t whirlpool' );
+               }
+
+               $this->assertEquals( 64, MWCryptHash::hashLength(), 'Raw hash length' );
+               $this->assertEquals( 128, MWCryptHash::hashLength( false ), 'Hex hash length' );
+       }
+
+       public function testHash() {
+               if ( MWCryptHash::hashAlgo() !== 'whirlpool' ) {
+                       $this->markTestSkipped( 'Hash algorithm isn\'t whirlpool' );
+               }
+
+               $data = 'foobar';
+               // phpcs:ignore Generic.Files.LineLength
+               $hash = '9923afaec3a86f865bb231a588f453f84e8151a2deb4109aebc6de4284be5bebcff4fab82a7e51d920237340a043736e9d13bab196006dcca0fe65314d68eab9';
+
+               $this->assertEquals(
+                       hex2bin( $hash ),
+                       MWCryptHash::hash( $data ),
+                       'Raw hash'
+               );
+               $this->assertEquals(
+                       $hash,
+                       MWCryptHash::hash( $data, false ),
+                       'Hex hash'
+               );
+       }
+
+       public function testHmac() {
+               if ( MWCryptHash::hashAlgo() !== 'whirlpool' ) {
+                       $this->markTestSkipped( 'Hash algorithm isn\'t whirlpool' );
+               }
+
+               $data = 'foobar';
+               $key = 'secret';
+               // phpcs:ignore Generic.Files.LineLength
+               $hash = 'ddc94177b2020e55ce2049199fd9cc6327f416ff6dc621cc34cb43d9bec61d73372b4790c0e24957f565ecaf2d42821e6303619093e99cbe14a3b9250bda5f81';
+
+               $this->assertEquals(
+                       hex2bin( $hash ),
+                       MWCryptHash::hmac( $data, $key ),
+                       'Raw hmac'
+               );
+               $this->assertEquals(
+                       $hash,
+                       MWCryptHash::hmac( $data, $key, false ),
+                       'Hex hmac'
+               );
+       }
+
+}
diff --git a/tests/phpunit/unit/includes/utils/MWRestrictionsTest.php b/tests/phpunit/unit/includes/utils/MWRestrictionsTest.php
new file mode 100644 (file)
index 0000000..bb7fc53
--- /dev/null
@@ -0,0 +1,215 @@
+<?php
+class MWRestrictionsTest extends MediaWikiUnitTestCase {
+
+       protected static $restrictionsForChecks;
+
+       public static function setUpBeforeClass() {
+               self::$restrictionsForChecks = MWRestrictions::newFromArray( [
+                       'IPAddresses' => [
+                               '10.0.0.0/8',
+                               '172.16.0.0/12',
+                               '2001:db8::/33',
+                       ]
+               ] );
+       }
+
+       /**
+        * @covers MWRestrictions::newDefault
+        * @covers MWRestrictions::__construct
+        */
+       public function testNewDefault() {
+               $ret = MWRestrictions::newDefault();
+               $this->assertInstanceOf( MWRestrictions::class, $ret );
+               $this->assertSame(
+                       '{"IPAddresses":["0.0.0.0/0","::/0"]}',
+                       $ret->toJson()
+               );
+       }
+
+       /**
+        * @covers MWRestrictions::newFromArray
+        * @covers MWRestrictions::__construct
+        * @covers MWRestrictions::loadFromArray
+        * @covers MWRestrictions::toArray
+        * @dataProvider provideArray
+        * @param array $data
+        * @param bool|InvalidArgumentException $expect True if the call succeeds,
+        *  otherwise the exception that should be thrown.
+        */
+       public function testArray( $data, $expect ) {
+               if ( $expect === true ) {
+                       $ret = MWRestrictions::newFromArray( $data );
+                       $this->assertInstanceOf( MWRestrictions::class, $ret );
+                       $this->assertSame( $data, $ret->toArray() );
+               } else {
+                       try {
+                               MWRestrictions::newFromArray( $data );
+                               $this->fail( 'Expected exception not thrown' );
+                       } catch ( InvalidArgumentException $ex ) {
+                               $this->assertEquals( $expect, $ex );
+                       }
+               }
+       }
+
+       public static function provideArray() {
+               return [
+                       [ [ 'IPAddresses' => [] ], true ],
+                       [ [ 'IPAddresses' => [ '127.0.0.1/32' ] ], true ],
+                       [
+                               [ 'IPAddresses' => [ '256.0.0.1/32' ] ],
+                               new InvalidArgumentException( 'Invalid IP address: 256.0.0.1/32' )
+                       ],
+                       [
+                               [ 'IPAddresses' => '127.0.0.1/32' ],
+                               new InvalidArgumentException( 'IPAddresses is not an array' )
+                       ],
+                       [
+                               [],
+                               new InvalidArgumentException( 'Array is missing required keys: IPAddresses' )
+                       ],
+                       [
+                               [ 'foo' => 'bar', 'bar' => 42 ],
+                               new InvalidArgumentException( 'Array contains invalid keys: foo, bar' )
+                       ],
+               ];
+       }
+
+       /**
+        * @covers MWRestrictions::newFromJson
+        * @covers MWRestrictions::__construct
+        * @covers MWRestrictions::loadFromArray
+        * @covers MWRestrictions::toJson
+        * @covers MWRestrictions::__toString
+        * @dataProvider provideJson
+        * @param string $json
+        * @param array|InvalidArgumentException $expect
+        */
+       public function testJson( $json, $expect ) {
+               if ( is_array( $expect ) ) {
+                       $ret = MWRestrictions::newFromJson( $json );
+                       $this->assertInstanceOf( MWRestrictions::class, $ret );
+                       $this->assertSame( $expect, $ret->toArray() );
+
+                       $this->assertSame( $json, $ret->toJson( false ) );
+                       $this->assertSame( $json, (string)$ret );
+
+                       $this->assertSame(
+                               FormatJson::encode( $expect, true, FormatJson::ALL_OK ),
+                               $ret->toJson( true )
+                       );
+               } else {
+                       try {
+                               MWRestrictions::newFromJson( $json );
+                               $this->fail( 'Expected exception not thrown' );
+                       } catch ( InvalidArgumentException $ex ) {
+                               $this->assertTrue( true );
+                       }
+               }
+       }
+
+       public static function provideJson() {
+               return [
+                       [
+                               '{"IPAddresses":[]}',
+                               [ 'IPAddresses' => [] ]
+                       ],
+                       [
+                               '{"IPAddresses":["127.0.0.1/32"]}',
+                               [ 'IPAddresses' => [ '127.0.0.1/32' ] ]
+                       ],
+                       [
+                               '{"IPAddresses":["256.0.0.1/32"]}',
+                               new InvalidArgumentException( 'Invalid IP address: 256.0.0.1/32' )
+                       ],
+                       [
+                               '{"IPAddresses":"127.0.0.1/32"}',
+                               new InvalidArgumentException( 'IPAddresses is not an array' )
+                       ],
+                       [
+                               '{}',
+                               new InvalidArgumentException( 'Array is missing required keys: IPAddresses' )
+                       ],
+                       [
+                               '{"foo":"bar","bar":42}',
+                               new InvalidArgumentException( 'Array contains invalid keys: foo, bar' )
+                       ],
+                       [
+                               '{"IPAddresses":[]',
+                               new InvalidArgumentException( 'Invalid restrictions JSON' )
+                       ],
+                       [
+                               '"IPAddresses"',
+                               new InvalidArgumentException( 'Invalid restrictions JSON' )
+                       ],
+               ];
+       }
+
+       /**
+        * @covers MWRestrictions::checkIP
+        * @dataProvider provideCheckIP
+        * @param string $ip
+        * @param bool $pass
+        */
+       public function testCheckIP( $ip, $pass ) {
+               $this->assertSame( $pass, self::$restrictionsForChecks->checkIP( $ip ) );
+       }
+
+       public static function provideCheckIP() {
+               return [
+                       [ '10.0.0.1', true ],
+                       [ '172.16.0.0', true ],
+                       [ '192.0.2.1', false ],
+                       [ '2001:db8:1::', true ],
+                       [ '2001:0db8:0000:0000:0000:0000:0000:0000', true ],
+                       [ '2001:0DB8:8000::', false ],
+               ];
+       }
+
+       /**
+        * @covers MWRestrictions::check
+        * @dataProvider provideCheck
+        * @param WebRequest $request
+        * @param Status $expect
+        */
+       public function testCheck( $request, $expect ) {
+               $this->assertEquals( $expect, self::$restrictionsForChecks->check( $request ) );
+       }
+
+       public function provideCheck() {
+               $ret = [];
+
+               $mockBuilder = $this->getMockBuilder( FauxRequest::class )
+                       ->setMethods( [ 'getIP' ] );
+
+               foreach ( self::provideCheckIP() as $checkIP ) {
+                       $ok = [];
+                       $request = $mockBuilder->getMock();
+
+                       $request->expects( $this->any() )->method( 'getIP' )
+                               ->will( $this->returnValue( $checkIP[0] ) );
+                       $ok['ip'] = $checkIP[1];
+
+                       /* If we ever add more restrictions, add nested for loops here:
+                        *  foreach ( self::provideCheckFoo() as $checkFoo ) {
+                        *      $request->expects( $this->any() )->method( 'getFoo' )
+                        *          ->will( $this->returnValue( $checkFoo[0] );
+                        *      $ok['foo'] = $checkFoo[1];
+                        *
+                        *      foreach ( self::provideCheckBar() as $checkBar ) {
+                        *          $request->expects( $this->any() )->method( 'getBar' )
+                        *              ->will( $this->returnValue( $checkBar[0] );
+                        *          $ok['bar'] = $checkBar[1];
+                        *
+                        *          // etc.
+                        *      }
+                        *  }
+                        */
+
+                       $status = Status::newGood();
+                       $status->setResult( $ok === array_filter( $ok ), $ok );
+                       $ret[] = [ $request, $status ];
+               }
+
+               return $ret;
+       }
+}
diff --git a/tests/phpunit/unit/languages/SpecialPageAliasTest.php b/tests/phpunit/unit/languages/SpecialPageAliasTest.php
new file mode 100644 (file)
index 0000000..cce9d0e
--- /dev/null
@@ -0,0 +1,64 @@
+<?php
+
+/**
+ * Verifies that special page aliases are valid, with no slashes.
+ *
+ * @group Language
+ * @group SpecialPageAliases
+ * @group SystemTest
+ * @group medium
+ * @todo This should be a structure test
+ *
+ * @author Katie Filbert < aude.wiki@gmail.com >
+ */
+class SpecialPageAliasTest extends \MediaWikiUnitTestCase {
+
+       /**
+        * @coversNothing
+        * @dataProvider validSpecialPageAliasesProvider
+        */
+       public function testValidSpecialPageAliases( $code, $specialPageAliases ) {
+               foreach ( $specialPageAliases as $specialPage => $aliases ) {
+                       foreach ( $aliases as $alias ) {
+                               $msg = "$specialPage alias '$alias' in $code is valid with no slashes";
+                               $this->assertRegExp( '/^[^\/]*$/', $msg );
+                       }
+               }
+       }
+
+       public function validSpecialPageAliasesProvider() {
+               $codes = array_keys( Language::fetchLanguageNames( null, 'mwfile' ) );
+
+               $data = [];
+
+               foreach ( $codes as $code ) {
+                       $specialPageAliases = $this->getSpecialPageAliases( $code );
+
+                       if ( $specialPageAliases !== [] ) {
+                               $data[] = [ $code, $specialPageAliases ];
+                       }
+               }
+
+               return $data;
+       }
+
+       /**
+        * @param string $code
+        *
+        * @return array
+        */
+       protected function getSpecialPageAliases( $code ) {
+               $file = Language::getMessagesFileName( $code );
+
+               if ( is_readable( $file ) ) {
+                       include $file;
+
+                       if ( isset( $specialPageAliases ) && $specialPageAliases !== null ) {
+                               return $specialPageAliases;
+                       }
+               }
+
+               return [];
+       }
+
+}
index 3679ed7..17672db 100644 (file)
        QUnit.module( 'mediawiki.util', QUnit.newMwEnvironment( {
                setup: function () {
                        $.fn.updateTooltipAccessKeys.setTestMode( true );
+                       this.origConfig = mw.util.setOptionsForTest( {
+                               FragmentMode: [ 'legacy', 'html5' ],
+                               LoadScript: '/w/load.php'
+                       } );
                },
                teardown: function () {
                        $.fn.updateTooltipAccessKeys.setTestMode( false );
-                       mw.util.resetOptionsForTest();
+                       mw.util.setOptionsForTest( this.origConfig );
                },
                messages: {
                        // Used by accessKeyLabel in test for addPortletLink
index 148001d..ab547e8 100644 (file)
@@ -1,5 +1,6 @@
 const assert = require( 'assert' ),
        Api = require( 'wdio-mediawiki/Api' ),
+       BlankPage = require( 'wdio-mediawiki/BlankPage' ),
        DeletePage = require( '../pageobjects/delete.page' ),
        RestorePage = require( '../pageobjects/restore.page' ),
        EditPage = require( '../pageobjects/edit.page' ),
@@ -14,7 +15,7 @@ describe( 'Page', function () {
 
        before( function () {
                // disable VisualEditor welcome dialog
-               UserLoginPage.open();
+               BlankPage.open();
                browser.localStorage( 'POST', { key: 've-beta-welcome-dialog', value: '1' } );
        } );
 
index d85b27b..daf7112 100644 (file)
@@ -1,4 +1,5 @@
 const assert = require( 'assert' ),
+       BlankPage = require( 'wdio-mediawiki/BlankPage' ),
        HistoryPage = require( '../pageobjects/history.page' ),
        UserLoginPage = require( 'wdio-mediawiki/LoginPage' ),
        Util = require( 'wdio-mediawiki/Util' );
@@ -10,7 +11,7 @@ describe( 'Rollback with confirmation', function () {
        before( function () {
                // disable VisualEditor welcome dialog
                browser.deleteCookie();
-               UserLoginPage.open();
+               BlankPage.open();
                browser.localStorage( 'POST', { key: 've-beta-welcome-dialog', value: '1' } );
 
                // Enable rollback confirmation for admin user
@@ -90,7 +91,7 @@ describe( 'Rollback without confirmation', function () {
        before( function () {
                // disable VisualEditor welcome dialog
                browser.deleteCookie();
-               UserLoginPage.open();
+               BlankPage.open();
                browser.localStorage( 'POST', { key: 've-beta-welcome-dialog', value: '1' } );
 
                // Disable rollback confirmation for admin user
index d55ff4c..1db49ae 100644 (file)
@@ -1,4 +1,5 @@
 const assert = require( 'assert' ),
+       BlankPage = require( 'wdio-mediawiki/BlankPage' ),
        CreateAccountPage = require( '../pageobjects/createaccount.page' ),
        PreferencesPage = require( '../pageobjects/preferences.page' ),
        UserLoginPage = require( 'wdio-mediawiki/LoginPage' ),
@@ -11,7 +12,7 @@ describe( 'User', function () {
 
        before( function () {
                // disable VisualEditor welcome dialog
-               UserLoginPage.open();
+               BlankPage.open();
                browser.localStorage( 'POST', { key: 've-beta-welcome-dialog', value: '1' } );
        } );