Merge "Remove unused protected method SpecialUserrights::splitGroups"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 25 Jan 2017 11:01:58 +0000 (11:01 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 25 Jan 2017 11:01:58 +0000 (11:01 +0000)
47 files changed:
includes/EditPage.php
includes/api/i18n/es.json
includes/api/i18n/nl.json
includes/api/i18n/zh-hans.json
includes/installer/Installer.php
includes/installer/i18n/en.json
includes/installer/i18n/qqq.json
includes/specials/pagers/CategoryPager.php [changed mode: 0755->0644]
includes/tidy/Balancer.php
languages/i18n/be-tarask.json
languages/i18n/br.json
languages/i18n/el.json
languages/i18n/en.json
languages/i18n/eo.json
languages/i18n/es.json
languages/i18n/gl.json
languages/i18n/ko.json
languages/i18n/oc.json
languages/i18n/pt-br.json
languages/i18n/qqq.json
languages/i18n/sv.json
languages/i18n/th.json
languages/i18n/zh-hant.json
languages/messages/MessagesCa.php
languages/messages/MessagesOc.php
languages/messages/MessagesSh.php
resources/Resources.php
resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FilterItem.js
resources/src/mediawiki.rcfilters/dm/mw.rcfilters.dm.FiltersViewModel.js
resources/src/mediawiki.rcfilters/mw.rcfilters.Controller.js
resources/src/mediawiki.rcfilters/mw.rcfilters.init.js
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less [deleted file]
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterCapsuleMultiselectWidget.less
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterGroupWidget.less
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterItemWidget.less
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterWrapperWidget.less
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterCapsuleMultiselectWidget.js
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterGroupWidget.js
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterItemWidget.js
resources/src/mediawiki.rcfilters/ui/mw.rcfilters.ui.FilterWrapperWidget.js
resources/src/mediawiki/api/options.js
tests/phan/config.php
tests/phan/stubs/mail.php
tests/phpunit/includes/OutputPageTest.php
tests/phpunit/includes/tidy/BalancerTest.php
tests/phpunit/includes/tidy/html5lib-tests.json
tests/qunit/suites/resources/mediawiki.rcfilters/dm.FiltersViewModel.test.js

index 238c25e..e070ca3 100644 (file)
@@ -498,6 +498,9 @@ class EditPage {
                $this->enableApiEditOverride = $enableOverride;
        }
 
+       /**
+        * @deprecated since 1.29, call edit directly
+        */
        function submit() {
                $this->edit();
        }
index d832ead..534c359 100644 (file)
        "apihelp-parse-param-sectionpreview": "Analizar sección en modo de vista previa (también activa el modo de vista previa).",
        "apihelp-parse-param-disabletoc": "Omitir la tabla de contenidos en la salida.",
        "apihelp-parse-param-contentformat": "Formato de serialización de contenido utilizado para la introducción de texto. Sólo es válido cuando se utiliza con $1text.",
+       "apihelp-parse-param-contentmodel": "Modelo de contenido del texto de entrada. Si se omite, se debe especificar $1title, y el valor por defecto será el modelo del título especificado. Solo es válido cuando se use junto con $1text.",
        "apihelp-parse-example-page": "Analizar una página.",
        "apihelp-parse-example-text": "Analizar wikitexto.",
        "apihelp-parse-example-texttitle": "Analizar wikitexto, especificando el título de la página.",
        "apihelp-query+imageinfo-example-dated": "Obtener información sobre las versiones de [[:File:Test.jpg]] a partir de 2008.",
        "apihelp-query+images-description": "Devuelve todos los archivos contenidos en las páginas dadas.",
        "apihelp-query+images-param-limit": "Cuántos archivos se devolverán.",
+       "apihelp-query+images-param-images": "Mostrar solo estos archivos. Útil para comprobar si una determinada página tiene un determinado archivo.",
        "apihelp-query+images-param-dir": "La dirección en que ordenar la lista.",
        "apihelp-query+images-example-simple": "Obtener una lista de los archivos usados en la [[Main Page|Portada]].",
        "apihelp-query+images-example-generator": "Obtener información sobre todos los archivos empleados en [[Main Page]].",
        "apihelp-query+info-param-token": "Usa [[Special:ApiHelp/query+tokens|action=query&meta=tokens]] en su lugar.",
        "apihelp-query+info-example-simple": "Obtener información acerca de la página <kbd>Main Page</kbd>.",
        "apihelp-query+info-example-protection": "Obtén información general y protección acerca de la página <kbd>Main Page</kbd>.",
+       "apihelp-query+iwbacklinks-description": "Encontrar todas las páginas que enlazan al enlace interwiki dado.\n\nPuede utilizarse para encontrar todos los enlaces con un prefijo, o todos los enlaces a un título (con un determinado prefijo). Si no se introduce ninguno de los parámetros, se entiende como «todos los enlaces interwiki».",
        "apihelp-query+iwbacklinks-param-prefix": "Prefijo para el interwiki.",
        "apihelp-query+iwbacklinks-param-title": "Enlace interlingüístico que buscar. Se debe usar junto con <var>$1blprefix</var>.",
        "apihelp-query+iwbacklinks-param-limit": "Cuántas páginas se devolverán.",
index b10a22f..fc3fe7b 100644 (file)
        "apihelp-block-param-hidename": "Verberg de gebruikersnaam uit het blokkeerlogboek. (Vereist het <code>hideuser</code> recht).",
        "apihelp-block-param-reblock": "De huidige blokkade aanpassen als de gebruiker al geblokkeerd is.",
        "apihelp-block-param-watchuser": "De gebruikerspagina en overlegpagina van de gebruiker of het IP-adres volgen.",
+       "apihelp-block-param-tags": "Wijzigingslabels om toe te passen op de regel in het blokkeerlogboek.",
        "apihelp-block-example-ip-simple": "Het IP-adres <kbd>192.0.2.5</kbd> voor drie dagen blokkeren met <kbd>First strike</kbd> als opgegeven reden.",
        "apihelp-block-example-user-complex": "Blokkeer gebruiker<kbd>Vandal</kbd> voor altijd met reden <kbd>Vandalism</kbd> en voorkom het aanmaken van nieuwe accounts en het versturen van email",
+       "apihelp-changeauthenticationdata-example-password": "Poging tot het wachtwoord van de huidige gebruiker te veranderen naar <kbd>ExamplePassword</kbd>.",
+       "apihelp-checktoken-description": "Controleer de geldigheid van een token van <kbd>[[Special:ApiHelp/query+tokens|action=query&meta=tokens]]</kbd>.",
        "apihelp-checktoken-param-type": "Tokentype wordt getest.",
        "apihelp-checktoken-param-token": "Token om te controleren.",
+       "apihelp-checktoken-param-maxtokenage": "Maximum levensduur van de token, in seconden.",
        "apihelp-checktoken-example-simple": "Test de geldigheid van een <kbd>csrf</kbd> token.",
        "apihelp-clearhasmsg-description": "Wist de <code>hasmsg</code> vlag voor de huidige gebruiker.",
        "apihelp-clearhasmsg-example-1": "Wis de <code>hasmsg</code> vlag voor de huidige gebruiker.",
+       "apihelp-clientlogin-description": "Log in op de wiki met behulp van de interactieve flow.",
+       "apihelp-clientlogin-example-login": "Start het inlogproces op de wiki als gebruiker <kbd>Example</kbd> met wachtwoord <kbd>ExamplePassword</kbd>.",
        "apihelp-compare-param-fromtitle": "Eerste paginanaam om te vergelijken.",
        "apihelp-compare-param-fromid": "Eerste pagina-ID om te vergelijken.",
        "apihelp-compare-param-fromrev": "Eerste versie om te vergelijken.",
        "apihelp-feedrecentchanges-param-tagfilter": "Filteren op label.",
        "apihelp-feedrecentchanges-example-simple": "Recente wijzigingen weergeven.",
        "apihelp-feedrecentchanges-example-30days": "Recente wijzigingen van de afgelopen 30 dagen weergeven.",
+       "apihelp-feedwatchlist-param-feedformat": "De indeling van de feed.",
        "apihelp-filerevert-description": "Een oude versie van een bestand terugplaatsen.",
        "apihelp-filerevert-param-filename": "Doel bestandsnaam, zonder het Bestand: voorvoegsel.",
        "apihelp-filerevert-param-comment": "Opmerking voor het uploaden.",
index 0cf2411..b88e72f 100644 (file)
        "apierror-spamdetected": "您的编辑被拒绝,因为它包含垃圾部分:<code>$1</code>。",
        "apierror-specialpage-cantexecute": "您没有权限查看此特殊页面的结果。",
        "apierror-stashedfilenotfound": "无法在暂存处找到文件:$1。",
+       "apierror-stashedit-missingtext": "提供的哈希中找不到暂存文本。",
        "apierror-stashfailed-complete": "大块上传已经完成,检查状态以获取详情。",
        "apierror-stashfailed-nosession": "没有带此关键词的大块上传会话。",
        "apierror-stashfilestorage": "不能在暂存处存储上传:$1",
index d887a13..9c87cf0 100644 (file)
@@ -1656,8 +1656,13 @@ abstract class Installer {
         */
        protected function createMainpage( DatabaseInstaller $installer ) {
                $status = Status::newGood();
+               $title = Title::newMainPage();
+               if ( $title->exists() ) {
+                       $status->warning( 'config-install-mainpage-exists' );
+                       return $status;
+               }
                try {
-                       $page = WikiPage::factory( Title::newMainPage() );
+                       $page = WikiPage::factory( $title );
                        $content = new WikitextContent(
                                wfMessage( 'mainpagetext' )->inContentLanguage()->text() . "\n\n" .
                                wfMessage( 'mainpagedocfooter' )->inContentLanguage()->text()
index 95d2ba3..db92652 100644 (file)
        "config-install-subscribe-fail": "Unable to subscribe to mediawiki-announce: $1",
        "config-install-subscribe-notpossible": "cURL is not installed and <code>allow_url_fopen</code> is not available.",
        "config-install-mainpage": "Creating main page with default content",
+       "config-install-mainpage-exists": "Main page already exists, skipping",
        "config-install-extension-tables": "Creating tables for enabled extensions",
        "config-install-mainpage-failed": "Could not insert main page: $1",
        "config-install-done": "<strong>Congratulations!</strong>\nYou have installed MediaWiki.\n\nThe installer has generated a <code>LocalSettings.php</code> file.\nIt contains all your configuration.\n\nYou will need to download it and put it in the base of your wiki installation (the same directory as index.php). The download should have started automatically.\n\nIf the download was not offered, or if you cancelled it, you can restart the download by clicking the link below:\n\n$3\n\n<strong>Note:</strong> If you do not do this now, this generated configuration file will not be available to you later if you exit the installation without downloading it.\n\nWhen that has been done, you can <strong>[$2 enter your wiki]</strong>.",
index 7b60ed0..8d10b51 100644 (file)
        "config-install-subscribe-fail": "{{doc-important|\"[[m:mail:mediawiki-announce|mediawiki-announce]]\" is the name of a mailing list and should not be translated.}}\nA message displayed if the MediaWiki installer encounters an error making a request to lists.wikimedia.org which hosts the mailing list.\n* $1 - the HTTP error encountered, reproduced as is (English string)",
        "config-install-subscribe-notpossible": "Error shown when automatically subscribing to the MediaWiki announcements mailing list fails.",
        "config-install-mainpage": "*{{msg-mw|Config-install-database}}\n*{{msg-mw|Config-install-tables}}\n*{{msg-mw|Config-install-schema}}\n*{{msg-mw|Config-install-user}}\n*{{msg-mw|Config-install-interwiki}}\n*{{msg-mw|Config-install-stats}}\n*{{msg-mw|Config-install-keys}}\n*{{msg-mw|Config-install-sysop}}\n*{{msg-mw|Config-install-mainpage}}",
+       "config-install-mainpage-exists": "Warning shown when installer attempts to create main page but it already exists.",
        "config-install-extension-tables": "Notice shown to the user during the install about progress.",
        "config-install-mainpage-failed": "Used as error message. Parameters:\n* $1 - detailed error message",
        "config-install-done": "Parameters:\n* $1 is the URL to LocalSettings download\n* $2 is a link to the wiki.\n* $3 is a download link with attached download icon. The config-download-localsettings message will be used as the link text.",
old mode 100755 (executable)
new mode 100644 (file)
index eb36980..7db90c1
@@ -104,12 +104,8 @@ class CategoryPager extends AlphabeticPager {
                                'default' => $from,
                        ],
                ];
-               $hiddenFields = [
-                       'title' => $this->getTitle()->getPrefixedText(),
-               ];
 
                $htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, $this->getContext() )
-                       ->addHiddenFields( $hiddenFields )
                        ->setSubmitTextMsg( 'categories-submit' )
                        ->setWrapperLegendMsg( 'categories' )
                        ->setMethod( 'get' );
index 95cbe09..8da1553 100644 (file)
@@ -75,7 +75,7 @@ class BalanceSets {
                self::HTML_NAMESPACE => [
                        'html' => true, 'head' => true, 'body' => true, 'frameset' => true,
                        'frame' => true,
-                       'plaintext' => true, 'isindex' => true,
+                       'plaintext' => true,
                        'xmp' => true, 'iframe' => true, 'noembed' => true,
                        'noscript' => true, 'script' => true,
                        'title' => true
@@ -119,9 +119,9 @@ class BalanceSets {
                        'h2' => true, 'h3' => true, 'h4' => true, 'h5' => true,
                        'h6' => true, 'head' => true, 'header' => true, 'hgroup' => true,
                        'hr' => true, 'html' => true, 'iframe' => true, 'img' => true,
-                       'input' => true, 'isindex' => true, 'li' => true, 'link' => true,
+                       'input' => true, 'li' => true, 'link' => true,
                        'listing' => true, 'main' => true, 'marquee' => true,
-                       'menu' => true, 'menuitem' => true, 'meta' => true, 'nav' => true,
+                       'menu' => true, 'meta' => true, 'nav' => true,
                        'noembed' => true, 'noframes' => true, 'noscript' => true,
                        'object' => true, 'ol' => true, 'p' => true, 'param' => true,
                        'plaintext' => true, 'pre' => true, 'script' => true,
@@ -156,7 +156,8 @@ class BalanceSets {
 
        public static $impliedEndTagsSet = [
                self::HTML_NAMESPACE => [
-                       'dd' => true, 'dt' => true, 'li' => true, 'optgroup' => true,
+                       'dd' => true, 'dt' => true, 'li' => true,
+                       'menuitem' => true, 'optgroup' => true,
                        'option' => true, 'p' => true, 'rb' => true, 'rp' => true,
                        'rt' => true, 'rtc' => true
                ]
@@ -498,6 +499,16 @@ class BalanceElement {
                                        $this->attribs = [ 'class' => "mw-empty-elt" ];
                                }
                                $blank = false;
+                       } elseif (
+                               $this->isA( BalanceSets::$extraLinefeedSet ) &&
+                               count( $this->children ) > 0 &&
+                               substr( $this->children[0], 0, 1 ) == "\n"
+                       ) {
+                               // Double the linefeed after pre/listing/textarea
+                               // according to the (old) HTML5 fragment serialization
+                               // algorithm (see https://github.com/whatwg/html/issues/944)
+                               // to ensure this will round-trip.
+                               array_unshift( $this->children, "\n" );
                        }
                        $flat = $blank ? '' : "{$this}";
                } else {
@@ -529,15 +540,6 @@ class BalanceElement {
                                $out .= "{$elt}";
                        }
                        $out .= "</{$this->localName}>";
-                       if (
-                               $this->isA( BalanceSets::$extraLinefeedSet ) &&
-                               $out[$len] === "\n"
-                       ) {
-                               // Double the linefeed after pre/listing/textarea
-                               // according to the HTML5 fragment serialization algorithm.
-                               $out = substr( $out, 0, $len + 1 ) .
-                                       substr( $out, $len );
-                       }
                } else {
                        $out = "<{$this->localName}{$encAttribs} />";
                        Assert::invariant(
@@ -1770,7 +1772,7 @@ class BalanceActiveFormattingElements {
  *   and escaped.
  * - All null characters are assumed to have been removed.
  * - The following elements are disallowed: <html>, <head>, <body>, <frameset>,
- *   <frame>, <plaintext>, <isindex>, <xmp>, <iframe>,
+ *   <frame>, <plaintext>, <xmp>, <iframe>,
  *   <noembed>, <noscript>, <script>, <title>.  As a result,
  *   further simplifications can be made:
  *   - `frameset-ok` is not tracked.
@@ -1865,7 +1867,9 @@ class Balancer {
         *         provide historical compatibility with the old "tidy"
         *         program: <p>-wrapping is done to the children of
         *         <body> and <blockquote> elements, and empty elements
-        *         are removed.
+        *         are removed.  The <pre>/<listing>/<textarea> serialization
+        *         is also tweaked to allow lossless round trips.
+        *         (See: https://github.com/whatwg/html/issues/944)
         *     'allowComments': boolean, defaults to true.
         *         When true, allows HTML comments in the input.
         *         The Sanitizer generally strips all comments, so if you
@@ -1997,6 +2001,7 @@ class Balancer {
                // Some hoops we have to jump through
                $adjusted = $this->stack->adjustedCurrentNode( $this->fragmentContext );
 
+               // The spec calls this the "tree construction dispatcher".
                $isForeign = true;
                if (
                        $this->stack->length() === 0 ||
@@ -2037,6 +2042,9 @@ class Balancer {
                if ( $token === 'text' ) {
                        $this->stack->insertText( $value );
                        return true;
+               } elseif ( $token === 'comment' ) {
+                       $this->stack->insertComment( $value );
+                       return true;
                } elseif ( $token === 'tag' ) {
                        switch ( $value ) {
                        case 'font':
@@ -2468,7 +2476,6 @@ class Balancer {
                        case 'header':
                        case 'hgroup':
                        case 'main':
-                       case 'menu':
                        case 'nav':
                        case 'ol':
                        case 'p':
@@ -2481,6 +2488,16 @@ class Balancer {
                                $this->stack->insertHTMLElement( $value, $attribs );
                                return true;
 
+                       case 'menu':
+                               if ( $this->stack->inButtonScope( "p" ) ) {
+                                       $this->inBodyMode( 'endtag', 'p' );
+                               }
+                               if ( $this->stack->currentNode->isHtmlNamed( 'menuitem' ) ) {
+                                       $this->stack->pop();
+                               }
+                               $this->stack->insertHTMLElement( $value, $attribs );
+                               return true;
+
                        case 'h1':
                        case 'h2':
                        case 'h3':
@@ -2656,7 +2673,6 @@ class Balancer {
                                // (hence we don't need to examine the tag's "type" attribute)
                                return true;
 
-                       case 'menuitem':
                        case 'param':
                        case 'source':
                        case 'track':
@@ -2668,6 +2684,9 @@ class Balancer {
                                if ( $this->stack->inButtonScope( 'p' ) ) {
                                        $this->inBodyMode( 'endtag', 'p' );
                                }
+                               if ( $this->stack->currentNode->isHtmlNamed( 'menuitem' ) ) {
+                                       $this->stack->pop();
+                               }
                                $this->stack->insertHTMLElement( $value, $attribs );
                                $this->stack->pop();
                                return true;
@@ -2676,8 +2695,6 @@ class Balancer {
                                // warts!
                                return $this->inBodyMode( $token, 'img', $attribs, $selfClose );
 
-                       // OMITTED: <isindex>
-
                        case 'textarea':
                                $this->stack->insertHTMLElement( $value, $attribs );
                                $this->ignoreLinefeed = true;
@@ -2715,6 +2732,14 @@ class Balancer {
                                $this->stack->insertHTMLElement( $value, $attribs );
                                return true;
 
+                       case 'menuitem':
+                               if ( $this->stack->currentNode->isHtmlNamed( 'menuitem' ) ) {
+                                       $this->stack->pop();
+                               }
+                               $this->afe->reconstruct( $this->stack );
+                               $this->stack->insertHTMLElement( $value, $attribs );
+                               return true;
+
                        case 'rb':
                        case 'rtc':
                                if ( $this->stack->inScope( 'ruby' ) ) {
index e917c23..b7c3b18 100644 (file)
        "rcfilters-filter-userExpLevel-learner-description": "Болей дзён актыўнасьці і правак, чым у «навічкоў», але меней чым у «дасьведчаных удзельнікаў».",
        "rcfilters-filter-userExpLevel-experienced-label": "Дасьведчаныя ўдзельнікі",
        "rcfilters-filter-userExpLevel-experienced-description": "Больш за 30 дзён актыўнасьці і 500 правак.",
+       "rcfilters-filtergroup-automated": "Аўтаматычны ўнёсак",
+       "rcfilters-filter-bots-label": "Робат",
        "rcnotefrom": "Ніжэй {{PLURAL:$5|знаходзіцца зьмена|знаходзяцца зьмены}} з <strong>$4 $3</strong> (да <strong>$1</strong> на старонку).",
        "rclistfrom": "Паказаць зьмены з $2 $3",
        "rcshowhideminor": "$1 дробныя праўкі",
index 352d7e5..5e61cbc 100644 (file)
        "searcharticle": "Mont",
        "history": "Istor ar bajenn",
        "history_short": "Istor",
+       "history_small": "istor",
        "updatedmarker": "kemmet abaoe ma zaol-sell diwezhañ",
        "printableversion": "Stumm da voullañ",
        "permalink": "Chomlec'h ar stumm-mañ",
        "pool-timeout": "Aet eur dreist d'an termen gortoz evit ar stankadenn",
        "pool-queuefull": "Soulgarget eo ar servijerioù",
        "pool-errorunknown": "Fazi dianav",
+       "pool-servererror": "N'eo ket hegerz ar servij kontañ ($1).",
        "poolcounter-usage-error": "Fazi implij : $1",
        "aboutsite": "Diwar-benn {{SITENAME}}",
        "aboutpage": "Project:Diwar-benn",
        "content-model-css": "CSS",
        "content-json-empty-object": "Elfenn goullo",
        "content-json-empty-array": "Taolenn c'houllo",
+       "deprecated-self-close-category": "Pajennoù a ra gant tikedennoù HTML emserriñ direizh",
        "expensive-parserfunction-warning": "Diwallit : Re a c'halvoù koustus e-keñver an arc'hwelioù parser zo gant ar bajenn-mañ.\n\nDleout a rafe bezañ nebeutoc'h eget $2 {{PLURAL:$2|galv|galv}}, ha {{PLURAL:$1|$1 galv|$1 galv}} zo.",
        "expensive-parserfunction-category": "Pagjennoù enno re a c'halvoù koustus e-keñver an arc'hwelioù parser.",
        "post-expand-template-inclusion-warning": "Diwallit : re a batromoù zo war ar bajenn-mañ.\nLod anezho a vo lakaet a-gostez.",
        "mergehistory-empty": "N'haller ket kendeuziñ stumm ebet.",
        "mergehistory-done": "Kendeuzet ez eus bet $3 {{PLURAL:$3|stumm|stumm}} eus $1 e [[:$2]].",
        "mergehistory-fail": "Dibosupl kendeuziñ an istorioù. Gwiriit ar bajenn hag arventennoù an deiziadoù.",
+       "mergehistory-fail-bad-timestamp": "Merk amzer direizh.",
+       "mergehistory-fail-invalid-source": "Pajenn darzh direizh.",
+       "mergehistory-fail-invalid-dest": "Pajenn vuket direizh.",
        "mergehistory-fail-toobig": "Ne c'haller ket kendeuziñ an istorioù o vezañ ma vefe mont en tu all d'ar harzh a $1 reizhadenn da zilec'hiañ.",
        "mergehistory-no-source": "N'eus ket eus ar bajenn orin $1.",
        "mergehistory-no-destination": "N'eus ket eus ar bajenn dal $1.",
        "prefs-rc": "Kemmoù diwezhañ",
        "prefs-watchlist": "Roll evezhiañ",
        "prefs-editwatchlist": "Kemmañ ar roll evezhiañ",
+       "prefs-editwatchlist-edit": "Gwelet ha lemel titloù a-ziwar ho roll evezhiañ",
        "prefs-editwatchlist-raw": "Kemmañ ar roll evezhiañ (mod diginkl)",
        "prefs-editwatchlist-clear": "Diverkañ ho roll evezhiañ",
        "prefs-watchlist-days": "Niver a zevezhioù da ziskouez er rollad evezhiañ :",
        "grouppage-bot": "{{ns:project}}:Botoù",
        "grouppage-sysop": "{{ns:project}}:Merourien",
        "grouppage-bureaucrat": "{{ns:project}}: Burevidi",
-       "grouppage-suppress": "{{ns:project}}: Dindan evezh",
+       "grouppage-suppress": "{{ns:project}}: Diverkerien",
        "right-read": "Lenn ar pajennoù",
        "right-edit": "Kemmañ ar pajennoù",
        "right-createpage": "Krouiñ pajennoù (estreget pajennoù kaozeal)",
        "right-createtalk": "Krouiñ pajennoù kaozeal",
        "right-createaccount": "Krouiñ kontoù implijer nevez",
+       "right-autocreateaccount": "Kevreañ ent emgefre gant ur gont implijer diavaez",
        "right-minoredit": "Merkañ ar c'hemmoù evel kemmoù dister",
        "right-move": "Adenvel pajennoù",
        "right-move-subpages": "Dilec'hiañ ar pajennoù gant o ispajennoù",
        "rcfilters-invalid-filter": "Sil direizh",
        "rcfilters-filterlist-title": "Siloù",
        "rcfilters-filterlist-noresults": "N'eus bet kavet sil ebet",
+       "rcfilters-filter-registered-label": "Marilhet",
+       "rcfilters-filter-unregistered-label": "Divarilh",
+       "rcfilters-filter-unregistered-description": "Aozerien n'int ket kevreet.",
        "rcfilters-filter-editsbyself-label": "Kemmet ganeoc'h",
        "rcfilters-filter-editsbyself-description": "Kemmet ganeoc'h",
        "rcfilters-filter-editsbyother-label": "Kemmet gant tud all",
        "rcfilters-filter-userExpLevel-learner-label": "Deskarded",
        "rcfilters-filter-userExpLevel-experienced-label": "Implijerien arroutet",
        "rcfilters-filter-userExpLevel-experienced-description": "Ouzhpenn 30 devezh oberiantiz ha 500 kemm.",
+       "rcfilters-filter-bots-label": "Robot",
+       "rcfilters-filter-bots-description": "Kemmoù graet gant ostilhoù emgefre.",
+       "rcfilters-filter-humans-label": "Den (ket ur robot)",
+       "rcfilters-filter-minor-label": "Kemmoù dister",
+       "rcfilters-filtergroup-changetype": "Seurt kemm",
+       "rcfilters-filter-categorization-label": "Kemmoù rummad",
        "rcnotefrom": "Setu aze {{PLURAL:$5|ar c'hemm|ar c'hemmoù}} c'hoarvezet abaoe an <strong>$3, $4</strong> (<strong>$1</strong> d'ar muiañ).",
        "rclistfrom": "Diskouez ar c'hemmoù diwezhañ abaoe an/ar $3 $2",
        "rcshowhideminor": "$1 ar c'hemmoù dister",
        "apisandbox-dynamic-parameters-add-label": "Ouzhpennañ un arventenn:",
        "apisandbox-dynamic-parameters-add-placeholder": "Anv an arventenn",
        "apisandbox-results": "Disoc'hoù",
-       "apisandbox-request-params-json": "Arventennoù JSON :",
        "apisandbox-request-url-label": "Goulenn URL :",
        "apisandbox-request-time": "Pad ar goulenn: $1",
        "apisandbox-continue": "Kenderc'hel",
index f919ed5..b30ba0e 100644 (file)
        "limitreport-templateargumentsize-value": "$1 από $2 {{PLURAL:$2|byte|bytes}}",
        "limitreport-expansiondepth": "Μεγαλύτερο βάθος ανάπτυξης",
        "limitreport-expensivefunctioncount": "Πλήθος ακριβών συναρτήσεων συντακτικού αναλυτή",
-       "expandtemplates": "Î\95Ï\80έκÏ\84εινε Ï\84α Ï\80Ï\81Ï\8cÏ\84Ï\85Ï\80α",
+       "expandtemplates": "Î\95Ï\80έκÏ\84αÏ\83η Ï\80Ï\81οÏ\84Ï\8dÏ\80Ï\89ν",
        "expand_templates_intro": "Αυτή η ειδική σελίδα παίρνει κείμενο και αναπτύσσει όλα τα πρότυπα σε αυτό αναδρομικά. \nΕπίσης αναπτύσσει συναρτήσεις συντακτικού αναλυτή όπως η\n<nowiki>{{</nowiki>#language:…}}, και μεταβλητές όπως η\n<nowiki>{{</nowiki>CURRENTDAY}}.\nΟυσιαστικά επεκτείνει οτιδήποτε βρίσκεται σε διπλές αγκύλες.",
        "expand_templates_title": "Τίτλων συμφραζόμενων, για την {{FULLPAGENAME}} κ.τ.λ.:",
        "expand_templates_input": "Κείμενο εισόδου:",
index f2ff14b..9f03ce9 100644 (file)
        "recentchanges-legend-plusminus": "(<em>±123</em>)",
        "recentchanges-submit": "Show",
        "rcfilters-activefilters": "Active filters",
+       "rcfilters-restore-default-filters": "Restore default filters",
+       "rcfilters-clear-all-filters": "Clear all filters",
        "rcfilters-search-placeholder": "Filter recent changes (browse or start typing)",
        "rcfilters-invalid-filter": "Invalid filter",
+       "rcfilters-empty-filter": "No active filters. All contributions are shown.",
        "rcfilters-filterlist-title": "Filters",
        "rcfilters-filterlist-noresults": "No filters found",
        "rcfilters-filtergroup-registration": "User registration",
index b699e3c..5eb0d21 100644 (file)
        "searcharticle": "Ek",
        "history": "Historio de paĝo",
        "history_short": "Historio",
+       "history_small": "historio",
        "updatedmarker": "ĝisdatigita de post mia lasta vizito",
        "printableversion": "Presebla versio",
        "permalink": "Konstanta ligilo",
        "botpasswords-label-delete": "Forigi",
        "botpasswords-label-resetpassword": "Rekomencigi la pasvorton",
        "botpasswords-label-grants": "Uzeblaj permesdonoj:",
-       "botpasswords-help-grants": "Rajtigiloj permesas aliron al rajtoj jam provizita al via uzantkonto. Ebligi rajtigilojn ĉi tie ne provizas aliron al ajnaj rajtoj ke via uzantkonto ne alie havus. Vidu la [[Special:MyLanguage/Special:ListGrants|tablo de gratifikoj]] por pli da informo.",
+       "botpasswords-help-grants": "Rajtigiloj permesas aliron al rajtoj jam provizita al via uzantkonto. Ebligi rajtigilojn ĉi tie ne provizas aliron al ajnaj rajtoj ke via uzantkonto ne alie havus. Vidu la [[Special:MyLanguage/Special:ListGrants|tablo de rajtigiloj]] por pli da informo.",
        "botpasswords-label-grants-column": "Permeso donita",
        "botpasswords-bad-appid": "La robota nomo \"$1\" estas malvalida.",
        "botpasswords-insert-failed": "Aldono de la robota nomo \"$1\" ne sukcesis. Ĉu ĝi jam estis aldonita?",
        "rcfilters-invalid-filter": "Nevalida filtrilo",
        "rcfilters-filterlist-title": "Filtriloj",
        "rcfilters-filterlist-noresults": "Neniuj filtriloj troviĝis",
+       "rcfilters-filtergroup-registration": "Registrado de uzanto",
+       "rcfilters-filter-registered-label": "Registrita",
+       "rcfilters-filter-registered-description": "Ensalutitaj redaktantoj.",
+       "rcfilters-filter-unregistered-label": "Neregistrita",
+       "rcfilters-filter-unregistered-description": "Redaktantoj kiuj ne estas ensalutita.",
        "rcfilters-filtergroup-authorship": "Redakta aŭtoreco",
        "rcfilters-filter-editsbyself-label": "Viaj redaktoj",
        "rcfilters-filter-editsbyself-description": "Viaj redaktoj.",
        "rcfilters-filter-editsbyother-label": "Redaktoj de aliuloj",
-       "rcfilters-filter-editsbyother-description": "Redaktoj de la aliaj uzantoj (krom vi)",
-       "rcfilters-filtergroup-userExpLevel": "Uzanta spertonivelo",
+       "rcfilters-filter-editsbyother-description": "Redaktoj kreitaj far aliaj uzantoj (krom vi).",
+       "rcfilters-filtergroup-userExpLevel": "Spertonivelo (nur por registritaj uzantoj)",
        "rcfilters-filter-userExpLevel-newcomer-label": "Novuloj",
-       "rcfilters-filter-userExpLevel-newcomer-description": "Tre novaj redaktantoj: malpli ol 10 redaktoj kaj 4 tagoj da aktiveco",
+       "rcfilters-filter-userExpLevel-newcomer-description": "Malpli ol 10 redaktoj kaj 4 tagoj de aktiveco.",
        "rcfilters-filter-userExpLevel-learner-label": "Lernantoj",
-       "rcfilters-filter-userExpLevel-learner-description": "Pliaj tagoj da aktiveco kaj redaktoj ol 'Novuloj' sed malpli ol 'Spertaj uzantoj.'",
+       "rcfilters-filter-userExpLevel-learner-description": "Pliaj tagoj da aktiveco kaj redaktoj ol \"Novuloj\" sed malpli ol \"Spertaj uzantoj\".",
        "rcfilters-filter-userExpLevel-experienced-label": "Spertaj uzantoj",
        "rcfilters-filter-userExpLevel-experienced-description": "Pli ol 30 tagoj da aktiveco kaj 500 redaktoj.",
+       "rcfilters-filtergroup-automated": "Aŭtomatigitaj kontribuoj",
+       "rcfilters-filter-bots-label": "Roboto",
+       "rcfilters-filter-bots-description": "Redaktoj farita de aŭtomatigitaj iloj.",
+       "rcfilters-filter-humans-label": "Homa (ne robota)",
+       "rcfilters-filter-humans-description": "Redaktoj farita de homaj redaktantoj.",
        "rcnotefrom": "Malsupre estas la {{PLURAL:$5|ŝanĝo|ŝanĝoj}} ekde <strong>$3, $4</strong> (montrante ĝis <strong>$1</strong>).",
        "rclistfrom": "Montri novajn ŝanĝojn ekde \"$3 $2\"",
        "rcshowhideminor": "$1 etajn redaktojn",
index b215ffd..7933b02 100644 (file)
        "exif-compression-6": "JPEG (antiguo)",
        "exif-copyrighted-true": "Con derechos de autor",
        "exif-copyrighted-false": "No se ha definido el estado del copyright",
+       "exif-photometricinterpretation-0": "Blanco y negro (blanco es 0)",
        "exif-photometricinterpretation-1": "Blanco y negro (el negro es 0)",
        "exif-photometricinterpretation-4": "Máscara de transparencia",
        "exif-photometricinterpretation-5": "Separados (Probablemente CMYK)",
index 47584f2..17ecd13 100644 (file)
        "rcfilters-invalid-filter": "Filtro no válido",
        "rcfilters-filterlist-title": "Filtros",
        "rcfilters-filterlist-noresults": "Non se atoparon filtros",
+       "rcfilters-filter-registered-label": "Rexistrado",
+       "rcfilters-filter-unregistered-label": "Non rexistrado",
        "rcfilters-filtergroup-authorship": "Editar autoría",
        "rcfilters-filter-editsbyself-label": "As súas propias edicións",
        "rcfilters-filter-editsbyself-description": "Edicións súas.",
        "rcfilters-filter-userExpLevel-learner-description": "Máis días de actividade e edicións que 'novatos' pero menos que 'usuarios experimentados'.",
        "rcfilters-filter-userExpLevel-experienced-label": "Usuarios experimentados",
        "rcfilters-filter-userExpLevel-experienced-description": "Máis de 30 días de actividade e 500 edicións.",
+       "rcfilters-filter-bots-label": "Bot",
+       "rcfilters-filter-humans-label": "Humano (non bot)",
+       "rcfilters-filter-minor-label": "Edicións menores",
+       "rcfilters-filter-minor-description": "Edicións que o autor etiquetou como menores.",
+       "rcfilters-filtergroup-changetype": "Tipo de cambio",
        "rcnotefrom": "A continuación {{PLURAL:$5|móstrase o cambio feito|móstranse os cambios feitos}} desde o <strong>$3</strong> ás <strong>$4</strong> (móstranse <strong>$1</strong> como máximo).",
        "rclistfrom": "Mostrar os cambios novos desde o $3 ás $2",
        "rcshowhideminor": "$1 as edicións pequenas",
        "uncategorizedcategories": "Categorías sen categorías",
        "uncategorizedimages": "Ficheiros sen categorías",
        "uncategorizedtemplates": "Modelos sen categorías",
+       "uncategorized-categories-exceptionlist": "# Contén unha lista de categorías que non van aparecer en Especial:UncategorizedCategories. Unha por liña, comezando con \"*\". As liñas que comecen con outro carácter (incluíndo espazos en branco) ignóranse. Use \"#\" para  engadir comentarios.",
        "unusedcategories": "Categorías sen uso",
        "unusedimages": "Imaxes sen uso",
        "wantedcategories": "Categorías requiridas",
        "apisandbox-sending-request": "Enviando a petición á API...",
        "apisandbox-loading-results": "Recibindo os resultados da API...",
        "apisandbox-results-error": "Produciuse un erro mentres se cargaba a resposta da petición á API: $1.",
-       "apisandbox-request-params-json": "Parámetros JSON:",
        "apisandbox-request-url-label": "URL da solicitude:",
        "apisandbox-request-time": "Duración da solicitude: {{PLURAL:$1|$1 ms}}",
        "apisandbox-results-fixtoken": "Corrixir o identificador e reenviar",
index dc0221b..a7ee19c 100644 (file)
        "rcfilters-filter-editsbyself-description": "당신의 편집.",
        "rcfilters-filter-editsbyother-label": "다른 사용자의 편집",
        "rcfilters-filter-editsbyother-description": "다른 사용자에 의한 편집. (당신의 편집이 아님)",
-       "rcfilters-filtergroup-userExpLevel": "사용자 경험 수준",
+       "rcfilters-filtergroup-userExpLevel": "경험 수준 (등록된 사용자 전용)",
        "rcfilters-filter-userExpLevel-newcomer-label": "신규 사용자",
        "rcfilters-filter-userExpLevel-newcomer-description": "신규 편집자: 10개 미만의 편집 및 4일 미만의 활동.",
        "rcfilters-filter-userExpLevel-learner-label": "학습자",
index ea2bc9e..30bcfde 100644 (file)
        "changepassword-success": "Vòstre senhal es estat modificat !",
        "changepassword-throttled": "Avètz ensajat un tròp grand nombre de connexions darrièrament.\nEsperatz $1 abans d’ensajar tornarmai.",
        "botpasswords": "Senhals de robòts",
+       "botpasswords-disabled": "Los senhals robòts son desactivats.",
        "botpasswords-no-central-id": "Per intrar lo senhau d'un bot, devètz èsser connectat amb un còmpte globau.",
+       "botpasswords-existing": "Senhals de robòts existents",
        "botpasswords-createnew": "Crear un novèu senhau de bot",
        "botpasswords-editexisting": "Editar un senhau de bot existent",
        "botpasswords-label-appid": "Nom del robòt :",
        "passwordreset-emailelement": "Utilizaire: \n$1\n\nSenhal temporari: \n$2",
        "passwordreset-emailsentemail": "Se aquela adreiça de corrièr electrnic es associat ambé vòstre compte, un corrièr electronic de reïnicializacion de senhal es estat mandat.",
        "passwordreset-emailsentusername": "Se una adreiça de corrier electronic es associada amb aqueu còmpte d'utilizaire, un senhau de reïnicializacion serà mandat.",
+       "passwordreset-nosuchcaller": "L’apelant existís pas : $1",
        "passwordreset-invalidemail": "Adreiça electronica invalida",
        "changeemail": "Cambiar o suprimir l'adreça electronica",
        "changeemail-header": "Cambiar l'adreça electronica del compte",
        "mergehistory-done": "$3 version{{PLURAL:$3||s}} de $1 {{PLURAL:$3|es estada fusionada|son estada fusionadas}} dins [[:$2]].",
        "mergehistory-fail": "Impossible de procedir a la fusion dels istorics. Seleccionatz  tornamai la pagina e mai los paramètres de data.",
        "mergehistory-fail-bad-timestamp": "L’orodatatge es pas valid.",
+       "mergehistory-fail-invalid-source": "La pagina font es pas valida.",
        "mergehistory-fail-invalid-dest": "La pagina de destinacion es invalida",
        "mergehistory-fail-toobig": "Impossible d’efectuar la fusion de l’istoric perque un nombre de {{PLURAL:$1|revisions}} superior al limit de $1 deuriá èsser desplaçat.",
        "mergehistory-no-source": "La pagina d'origina $1 existís pas.",
        "right-sendemail": "Mandar un corrièl als autres utilizaires",
        "right-applychangetags": "Aplicar [[Special:Tags|las balisas]] amb sas pròprias modificacions",
        "grant-generic": "ensemble de dreits « $1 »",
+       "grant-group-page-interaction": "Interagir amb de paginas",
+       "grant-group-file-interaction": "Interagir amb de mèdias",
+       "grant-group-watchlist-interaction": "Interagir amb vòstra lista de seguiment",
        "grant-group-email": "Mandar un corrièr electronic",
        "grant-blockusers": "Blocar e desblocar d'utilizaires",
        "grant-createaccount": "Crear de comptes",
        "grant-uploadfile": "Telecargar un novèu fichier",
        "grant-basic": "Dreits de basa",
        "grant-viewdeleted": "Veire lei fichiers e lei paginas escafats",
+       "grant-viewmywatchlist": "Afichar vòstra lista de seguiment",
        "newuserlogpage": "Istoric de las creacions de comptes",
        "newuserlogpagetext": "Jornal de las creacions de comptes d'utilizaires.",
        "rightslog": "Istoric de las modificacions d'estatut",
        "action-upload_by_url": "importar aqueste fichièr a partir d’una adreça internet",
        "action-writeapi": "utilizar l‘API d’escritura",
        "action-delete": "suprimir aquesta pagina",
-       "action-deleterevision": "suprimir aquesta version",
+       "action-deleterevision": "suprimir las revisions",
        "action-deletelogentry": "Escafar lo jornau deis intradas",
-       "action-deletedhistory": "veire l’istoric suprimit d'aquesta pagina",
+       "action-deletedhistory": "veire l’istoric suprimit d'una pagina",
        "action-browsearchive": "recercar de paginas suprimidas",
-       "action-undelete": "restablir aquesta pagina",
-       "action-suppressrevision": "tornar veire e restablir aquesta version suprimida",
+       "action-undelete": "restablir de paginas",
+       "action-suppressrevision": "visionar e restablir de revisions suprimidas",
        "action-suppressionlog": "veire aqueste jornal privat",
        "action-block": "blocar aqueste utilizaire a l’edicion",
        "action-protect": "modificar los nivèls de proteccion per aquesta pagina",
        "recentchanges-legend-heading": "<strong>Legenda :</strong>",
        "recentchanges-legend-newpage": "{{int:recentchanges-label-newpage}} (veire tanben la [[Special:NewPages|lista de las paginas novèlas]]).",
        "recentchanges-submit": "Afichar",
+       "rcfilters-activefilters": "Filtres actius",
+       "rcfilters-invalid-filter": "Filtre pas valid",
+       "rcfilters-filterlist-title": "Filtres",
+       "rcfilters-filterlist-noresults": "Cap de filtre pas trobat",
+       "rcfilters-filtergroup-registration": "Inscripcion de l'utilizaire",
+       "rcfilters-filter-registered-label": "Enregistrat",
+       "rcfilters-filter-registered-description": "Editors connectats.",
+       "rcfilters-filter-unregistered-label": "Desinscrit",
+       "rcfilters-filter-unregistered-description": "Editors que son pas connectats.",
+       "rcfilters-filtergroup-authorship": "Modificar la paternitat",
+       "rcfilters-filter-editsbyself-label": "Vòstras pròprias modificacions",
+       "rcfilters-filter-editsbyself-description": "Vòstras modificacions.",
+       "rcfilters-filter-editsbyother-label": "Modificacions per d’autres.",
+       "rcfilters-filter-userExpLevel-newcomer-label": "Novèls arribants",
+       "rcfilters-filter-userExpLevel-learner-label": "Aprenents",
+       "rcfilters-filter-userExpLevel-experienced-label": "Utilizaires experimentats",
+       "rcfilters-filtergroup-automated": "Contribucions automatizadas",
+       "rcfilters-filter-bots-label": "Robòt",
+       "rcfilters-filter-humans-label": "Èsser uman (pas robòt)",
+       "rcfilters-filtergroup-significance": "Significacion",
+       "rcfilters-filter-minor-label": "Cambiaments menors",
+       "rcfilters-filter-major-label": "Modificacions pas menoras",
+       "rcfilters-filtergroup-changetype": "Tipe de cambiament",
+       "rcfilters-filter-pageedits-label": "Modificacions de pagina",
+       "rcfilters-filter-newpages-label": "Creacions de pagina",
+       "rcfilters-filter-categorization-label": "Cambiaments de categoria",
+       "rcfilters-filter-logactions-label": "Accions traçadas",
        "rcnotefrom": "Çaijós {{PLURAL:$5|la modificacion efectuada|las modificacions efectuadas}} dempuèi lo <strong>$3, $4</strong> (afichadas fins a <strong>$1</strong>).",
        "rclistfrom": "Afichar las modificacions novèlas dempuèi lo $3 $2",
        "rcshowhideminor": "$1 los cambiaments menors",
        "apisandbox-deprecated-parameters": "Paramètres obsolèts",
        "apisandbox-submit-invalid-fields-title": "De camps son invalides",
        "apisandbox-results": "Resultats",
+       "apisandbox-sending-request": "Mandadís de la requèsta a l'API...",
        "apisandbox-request-url-label": "Requèsta URL :",
        "apisandbox-request-time": "Durada de la demanda : {{PLURAL:$1|$1 ms}}",
        "apisandbox-continue": "Contunhar",
        "apisandbox-continue-clear": "Escafar",
+       "apisandbox-multivalue-all-namespaces": "$1 (totes los espacis de noms)",
+       "apisandbox-multivalue-all-values": "$1 (totas las valors)",
        "booksources": "Obratges de referéncia",
        "booksources-search-legend": "Recercar demest d'obratges de referéncia",
        "booksources-isbn": "ISBN :",
        "watchlistanontext": "Connectatz-vos per visualizar o modificar los elements de vòstra lista de seguiment.",
        "watchnologin": "Vos sètz pas identificat(ada)",
        "addwatch": "Apondre a la lista de seguiment",
-       "addedwatchtext": "La pagina « [[:$1]] » es estada aponduda a vòstra [[Special:Watchlist|lista de seguiment]]. Las modificacions venentas d'aquesta pagina e de la pagina de discussion associada i seràn repertoriadas.",
+       "addedwatchtext": "La pagina « [[:$1]] » e sa pagina de discussion son estadas apondudas a vòstra [[Special:Watchlist|lista de seguiment]].",
        "addedwatchtext-short": "La pagina « $1 » es estada aponduda a vòstra lista de seguiment.",
        "removewatch": "Suprimir de la lista de seguiment",
-       "removedwatchtext": "La pagina « [[:$1]] » es estada levada de vòstra [[Special:Watchlist|lista de seguiment]].",
+       "removedwatchtext": "La pagina « [[:$1]] » e sa pagina de discussion son estadas levadas de vòstra [[Special:Watchlist|lista de seguiment]].",
        "removedwatchtext-short": "La pagina « $1 » es estada suprimida de vòstra lista de seguiment.",
        "watch": "Seguir",
        "watchthispage": "Seguir aquesta pagina",
        "wlshowlast": "Far veire las darrièras $1 oras, los darrièrs $2 jorns",
        "watchlist-hide": "Amagar",
        "watchlist-submit": "Afichar",
+       "wlshowtime": "Periòde afichat :",
        "wlshowhideminor": "cambiaments menors",
        "wlshowhidebots": "Robòts",
        "wlshowhideliu": "utilizaires enregistrats",
        "wlshowhideanons": "utilizaires anonims",
        "wlshowhidepatr": "modificacions repassadas",
        "wlshowhidemine": "mas modificacions",
+       "wlshowhidecategorization": "categorizacion de la pagina",
        "watchlist-options": "Opcions de la lista de seguiment",
        "watching": "Seguit...",
        "unwatching": "Fin del seguit...",
        "sp-contributions-username": "Adreça IP o nom d’utilizaire :",
        "sp-contributions-toponly": "Mostrar sonque las contribucions que son las darrièras dels articles",
        "sp-contributions-newonly": "Afichar unicament las modificacions que son de creacions de pagina",
+       "sp-contributions-hideminor": "Amagar las modificacions menoras",
        "sp-contributions-submit": "Cercar",
        "whatlinkshere": "Paginas ligadas a aquesta",
        "whatlinkshere-title": "Paginas que puntan cap a « $1 »",
        "whatlinkshere-hidelinks": "$1 ligams",
        "whatlinkshere-hideimages": "$1 los ligams cap al fichièr",
        "whatlinkshere-filters": "Filtres",
+       "whatlinkshere-submit": "Validar",
        "autoblockid": "Blocatge automatic #$1",
        "block": "Blocar un utilizaire",
        "unblock": "Desblocar un utilizaire",
        "movenosubpage": "Aquesta pagina a pas cap de sospagina.",
        "movereason": "Motiu :",
        "revertmove": "anullar",
-       "delete_and_move_text": "==Supression requerida==\nL’article de destinacion « [[:$1]] » existís ja.\nLo volètz suprimir per permetre lo cambiament de nom ?",
+       "delete_and_move_text": "La pagina de destinacion « [[:$1]] » existís ja.\nSètz segur{{GENDER:||a|}} que la volètz suprimir pe permetre aqueste cambiament de nom ?",
        "delete_and_move_confirm": "Òc, accèpti de suprimir la pagina de destinacion per permetre lo cambiament de nom.",
        "delete_and_move_reason": "Pagina suprimida per permetre lo cambiament de nom dempuèi « [[$1]] »",
        "selfmove": "Los títols d’origina e de destinacion son los meteisses : impossible de tornar nomenar una pagina sus ela-meteissa.",
        "tooltip-ca-unprotect": "Cambiar la proteccion d'aquesta pagina",
        "tooltip-ca-delete": "Suprimir aquesta pagina",
        "tooltip-ca-undelete": "Restablir aquesta pagina",
-       "tooltip-ca-move": "Tornar nomenar aquesta pagina",
+       "tooltip-ca-move": "Renomenar aquesta pagina",
        "tooltip-ca-watch": "Apondètz aquesta pagina a vòstra lista de seguiment",
        "tooltip-ca-unwatch": "Levatz aquesta pagina de vòstra lista de seguiment",
        "tooltip-search": "Cercar dins {{SITENAME}}",
        "pageinfo-length": "Talha de la pagina (en octets)",
        "pageinfo-article-id": "Numèro de la pagina",
        "pageinfo-language": "Lenga del contengut de la pagina",
+       "pageinfo-language-change": "modificar",
        "pageinfo-content-model": "Modèl de contengut de la pagina",
        "pageinfo-content-model-change": "modificar",
        "pageinfo-robot-policy": "Indexacion per robòts",
        "newimages-legend": "Filtre",
        "newimages-label": "Nom del fichièr (o una partida d'aqueste) :",
        "newimages-showbots": "Afichar los impòrts per de robòts",
+       "newimages-hidepatrolled": "Amagar los telecargaments patrolhats",
        "noimages": "Cap d'imatge d'afichar pas.",
+       "gallery-slideshow-toggle": "Bascular las vinhetas",
        "ilsubmit": "Cercar",
        "bydate": "per data",
        "sp-newimages-showfrom": "Afichar los imatges novèls importats dempuèi lo $2, $1",
        "exif-compression-4": "CCITT Grop 4 encodatge del fax",
        "exif-copyrighted-true": "Somés al dreit d'autor",
        "exif-copyrighted-false": "Estat dels dreits d’autor pas definit",
+       "exif-photometricinterpretation-1": "Blanc e negre (0 pel negre)",
        "exif-unknowndate": "Data desconeguda",
        "exif-orientation-1": "Normala",
        "exif-orientation-2": "Inversada orizontalament",
        "confirmemail_body_set": "Qualqu’un, probablament vos, dempuèi l’adreça IP $1, a modificat l'adreça de corrièr electronic del compte « $2 » amb aquesta sul site {{SITENAME}}.\n\nPer confirmar qu'aqueste compte vos aparten vertadièrament e reactivar las foncions de messatjariá sus {{SITENAME}}, seguissètz lo ligam çaijós dins vòstre navigador :\n\n$3\n\nAqueste còdi de confirmacion expirarà lo $4.\n\nSe s’agís *pas* de vòstre compte, seguissètz aqueste ligam per anullar la confirmacion de l'adreça de corrièr electronic :\n\n$5",
        "confirmemail_invalidated": "Confirmacion de l’adreça de corrièr electronic anullada",
        "invalidateemail": "Anullar la confirmacion del corrièr electronic",
+       "notificationemail_subject_changed": "L'adreça de corrièr electronic enregistrada de {{SITENAME}} es estada cambiada",
+       "notificationemail_subject_removed": "L'adreça de corrièr electronic enregistrada de {{SITENAME}} es estada suprimida",
        "scarytranscludedisabled": "[La transclusion interwiki es desactivada]",
        "scarytranscludefailed": "[La recuperacion de modèl a pas capitat per $1]",
        "scarytranscludefailed-httpstatus": "[Fracàs de la recuperacion del modèl per  $1 : HTTP  $2 ]",
        "logentry-newusers-create2": "Lo compte d'utilizaire $3 {{GENDER:$2|es estat creat}} per $1",
        "logentry-newusers-byemail": "Lo compte d'utilizaire $3 {{GENDER:$2|es estat creat}} per $1 e lo senhal es estat mandat per corrièr electronic",
        "logentry-newusers-autocreate": "Lo compte $1 {{GENDER:$2|es estat creat}} automaticament",
-       "logentry-rights-rights": "$1 {{GENDER:$2|a modificat}} l'apartenéncia al grop per $3 de $4 a $5",
+       "logentry-rights-rights": "$1 a modificat l’apartenéncia al grop per {{GENDER:$6|$3}} de $4 a $5",
        "logentry-rights-rights-legacy": "$1 {{GENDER:$2|a modificat}} l'apartenéncia al grop per $3",
        "logentry-rights-autopromote": "$1 {{GENDER:$2|es estat promolgut}} automaticament de $4 a $5",
        "logentry-upload-upload": "$1 {{GENDER:$2|a mandat}} $3",
        "api-error-emptypage": "Creacion de paginas voidas pas autorizada.",
        "api-error-publishfailed": "Error intèrna: Lo servidor a pas pogut publicar lo fichièr temporari.",
        "api-error-stashfailed": "Error intèrna : lo servidor a pas pogut enregistrar lo fichièr temporari.",
-       "api-error-unknown-warning": "Avertiment desconegut : $1",
+       "api-error-unknown-warning": "Avertiment desconegut : « $1 ».",
        "api-error-unknownerror": "Error desconeguda : « $1 »",
        "duration-seconds": "$1 segonda{{PLURAL:$1||s}}",
        "duration-minutes": "$1 minuta{{PLURAL:$1||s}}",
        "pagelang-language": "Lenga",
        "pagelang-use-default": "Utilizar la lenga per defaut",
        "pagelang-select-lang": "Seleccionar la lenga",
+       "pagelang-reason": "Motiu",
        "pagelang-submit": "Validar",
+       "pagelang-nonexistent-page": "La pagina $1 existís pas.",
        "right-pagelang": "Cambiar la lenga de la pagina",
        "action-pagelang": "cambiar la lenga de la pagina",
        "log-name-pagelang": "Traçar los cambiaments de lenga",
        "special-characters-group-ipa": "API",
        "special-characters-group-symbols": "Simbòls",
        "special-characters-group-greek": "Grèc",
+       "special-characters-group-greekextended": "Grèc espandit",
        "special-characters-group-cyrillic": "Cirillic",
        "special-characters-group-arabic": "Arabi",
        "special-characters-group-arabicextended": "Arabi espandit",
        "special-characters-title-endash": "jonhent anglés",
        "special-characters-title-emdash": "jonhent em",
        "special-characters-title-minus": "signe mens",
+       "mw-widgets-dateinput-no-date": "Cap de data pas seleccionada",
+       "mw-widgets-mediasearch-input-placeholder": "Recercar de mèdias",
        "mw-widgets-mediasearch-noresults": "Ges de resultat trobat",
        "mw-widgets-categoryselector-add-category-placeholder": "Ajustar una categoria...",
        "sessionprovider-generic": "$1 sessions",
        "log-action-filter-patrol-autopatrol": "Patrolha automatica",
        "log-action-filter-protect-protect": "Proteccion",
        "log-action-filter-protect-modify": "Modificacion de proteccion",
+       "log-action-filter-protect-unprotect": "Desproteccion",
+       "log-action-filter-protect-move_prot": "Proteccion de renomenatge",
        "log-action-filter-rights-rights": "Cambiament manuau",
        "log-action-filter-rights-autopromote": "Cambiament automatic",
+       "log-action-filter-suppress-event": "Supression de jornal",
+       "log-action-filter-suppress-revision": "Supression de revision",
        "log-action-filter-suppress-delete": "Supression de pagina",
        "log-action-filter-upload-upload": "Telecargament novèu",
        "log-action-filter-upload-overwrite": "Retelecargament",
        "authprovider-confirmlink-success-line": "$1 : operacion capitada, lei còmptes son estats liats.",
        "authprovider-confirmlink-failed": "La temptativa de liar lei còmptes a pas capitat : $1",
        "authprovider-resetpass-skip-label": "Sautar",
+       "authform-newtoken": "Geton mancant. $1",
+       "authform-notoken": "Geton mancant",
+       "authform-wrongtoken": "Marrit geton",
        "specialpage-securitylevel-not-allowed-title": "Pas autorizat",
        "changecredentials": "Modificar las informacions d’identificacion",
+       "credentialsform-account": "Nom de compte :",
        "linkaccounts": "Liar lei còmptes",
        "linkaccounts-success-text": "Lo còmpte èra estat liat.",
        "linkaccounts-submit": "Liar lei còmptes",
index 6b353a0..73eb495 100644 (file)
        "rcfilters-invalid-filter": "Filtro inválido",
        "rcfilters-filterlist-title": "Filtros",
        "rcfilters-filterlist-noresults": "Nenhum filtro encontrado",
+       "rcfilters-filtergroup-registration": "Registro de usuário",
+       "rcfilters-filter-registered-label": "Registrado",
+       "rcfilters-filter-registered-description": "Editores conectados.",
+       "rcfilters-filter-unregistered-label": "Não registrado",
+       "rcfilters-filter-unregistered-description": "Editores que não estão conectados.",
        "rcfilters-filtergroup-authorship": "Editar autoria",
        "rcfilters-filter-editsbyself-label": "Suas próprias edições",
        "rcfilters-filter-editsbyself-description": "Edições por você.",
        "rcfilters-filter-editsbyother-label": "Edições de outros",
        "rcfilters-filter-editsbyother-description": "Edições criadas por outros usuários (não você.)",
-       "rcfilters-filtergroup-userExpLevel": "Nível de experiência do usuário",
+       "rcfilters-filtergroup-userExpLevel": "Nível de experiência (apenas para usuário registados)",
        "rcfilters-filter-userExpLevel-newcomer-label": "Recém-chegados",
-       "rcfilters-filter-userExpLevel-newcomer-description": "Editores muito novos: menos de 10 edições e 4 dias de atividade.",
+       "rcfilters-filter-userExpLevel-newcomer-description": "Menos de 10 edições e 4 dias de atividade.",
        "rcfilters-filter-userExpLevel-learner-label": "Aprendizes",
        "rcfilters-filter-userExpLevel-learner-description": "Mais dias de atividade e edições do que \"Novatos\", mas menos do que \"Usuários experientes\".",
        "rcfilters-filter-userExpLevel-experienced-label": "Usuários experientes",
        "rcfilters-filter-userExpLevel-experienced-description": "Mais de 30 dias de atividade e 500 edições.",
+       "rcfilters-filtergroup-automated": "Contribuições automatizadas",
+       "rcfilters-filter-bots-label": "Robô",
+       "rcfilters-filter-bots-description": "Edições feitas por ferramentas automatizadas.",
+       "rcfilters-filter-humans-label": "Humano (não bot)",
+       "rcfilters-filter-humans-description": "Edições feitas por editores humanos.",
+       "rcfilters-filtergroup-significance": "Significado",
+       "rcfilters-filter-minor-label": "Edições menores",
+       "rcfilters-filter-minor-description": "Edita o autor rotulado como menor.",
+       "rcfilters-filter-major-label": "Edições não menores",
+       "rcfilters-filter-major-description": "Edições não rotuladas como menores.",
+       "rcfilters-filtergroup-changetype": "Tipo de mudança",
+       "rcfilters-filter-pageedits-label": "Edições da página",
+       "rcfilters-filter-pageedits-description": "Edições para conteúdo wiki, discussões, descrições de categorias ....",
+       "rcfilters-filter-newpages-label": "Criações de páginas",
+       "rcfilters-filter-newpages-description": "Edições que fazem novas páginas.",
+       "rcfilters-filter-categorization-label": "Mudanças de categoria",
+       "rcfilters-filter-categorization-description": "Registros de páginas que estão sendo adicionadas ou removidas de categorias.",
+       "rcfilters-filter-logactions-label": "Acções registadas",
+       "rcfilters-filter-logactions-description": "Ações administrativas, criação de contas, eliminação de páginas, carregamentos ...",
        "rcnotefrom": "Abaixo {{PLURAL:$5|é a mudança|são as mudanças}} desde <strong>$3, $4</strong> (up to <strong>$1</strong> shown).",
        "rclistfrom": "Mostrar as novas alterações a partir das $2 de $3",
        "rcshowhideminor": "$1 edições menores",
        "usercssispublic": "Observação: As subpáginas CSS não devem conter dados confidenciais, pois são visíveis por outros usuários.",
        "restrictionsfield-badip": "Endereço IP ou intervalo inválido: $1",
        "restrictionsfield-label": "Intervalos IP permitidos:",
-       "restrictionsfield-help": "Um endereço IP ou intervalo CIDR por linha. Para ativar tudo, use<br><code>0.0.0.0/0</code><br><code>::/0</code>",
+       "restrictionsfield-help": "Um endereço IP ou intervalo CIDR por linha. Para ativar tudo, use\n<pre>0.0.0.0/0\n::/0</pre>",
        "revid": "revisão $1",
        "pageid": "ID da página $1"
 }
index 1e71b88..2219ef6 100644 (file)
        "recentchanges-legend-plusminus": "{{optional}}\nA plus/minus sign with a number for the legend.",
        "recentchanges-submit": "Label for submit button in [[Special:RecentChanges]]\n{{Identical|Show}}",
        "rcfilters-activefilters": "Title for the filters selection showing the active filters.",
+       "rcfilters-restore-default-filters": "Label for the button that resets filters to defaults",
+       "rcfilters-clear-all-filters": "Title for the button that clears all filters",
        "rcfilters-search-placeholder": "Placeholder for the filter search input.",
        "rcfilters-invalid-filter": "A label for an invalid filter.",
+       "rcfilters-empty-filter": "Placeholder for the filter list when no filters were chosen.",
        "rcfilters-filterlist-title": "Title for the filters list.\n{{Identical|Filter}}",
        "rcfilters-filterlist-noresults": "Message showing no results found for searching a filter.",
        "rcfilters-filtergroup-registration": "Title for the filter group for editor registration type.",
index a972790..d1b7ee6 100644 (file)
        "searcharticle": "Gå till",
        "history": "Sidhistorik",
        "history_short": "Historik",
+       "history_small": "historik",
        "updatedmarker": "uppdaterad sedan senaste besöket",
        "printableversion": "Utskriftsvänlig version",
        "permalink": "Permanent länk",
        "rcfilters-invalid-filter": "Ogiltigt filter",
        "rcfilters-filterlist-title": "Filter",
        "rcfilters-filterlist-noresults": "Inga filter hittades",
+       "rcfilters-filtergroup-registration": "Användarregistrering",
+       "rcfilters-filter-registered-label": "Registrerade",
+       "rcfilters-filter-registered-description": "Inloggade redigerare.",
+       "rcfilters-filter-unregistered-label": "Oregistrerade",
+       "rcfilters-filter-unregistered-description": "Redigerare som inte är inloggade.",
        "rcfilters-filtergroup-authorship": "Redigera författarskap",
        "rcfilters-filter-editsbyself-label": "Dina egna redigeringar",
        "rcfilters-filter-editsbyself-description": "Redigeringar av dig.",
        "rcfilters-filter-editsbyother-label": "Redigeringar av andra",
-       "rcfilters-filter-editsbyother-description": "Redigeringar som har skapats av andra användare (inte dig.)",
-       "rcfilters-filtergroup-userExpLevel": "Erfarenhetsnivå för användare",
+       "rcfilters-filter-editsbyother-description": "Redigeringar som har skapats av andra användare (inte dig).",
+       "rcfilters-filtergroup-userExpLevel": "Erfarenhetsnivå (endast för registrerade användare)",
        "rcfilters-filter-userExpLevel-newcomer-label": "Nykomlingar",
-       "rcfilters-filter-userExpLevel-newcomer-description": "Väldigt nya redigerare: färre än 10 redigeringar och 4 dagars aktivitet.",
+       "rcfilters-filter-userExpLevel-newcomer-description": "Färre än 10 redigeringar och 4 dagars aktivitet.",
        "rcfilters-filter-userExpLevel-learner-label": "Nybörjare",
        "rcfilters-filter-userExpLevel-learner-description": "Fler dagars aktivitet och redigeringar än \"Nybörjare\" men färre än \"Erfarna användare\".",
        "rcfilters-filter-userExpLevel-experienced-label": "Erfarna användare",
        "rcfilters-filter-userExpLevel-experienced-description": "Fler än 30 dagars aktivitet och 500 redigeringar.",
+       "rcfilters-filtergroup-automated": "Automatiserade bidrag",
+       "rcfilters-filter-bots-label": "Bot",
+       "rcfilters-filter-bots-description": "Redigeringar gjorda av automatiserade verktyg.",
+       "rcfilters-filter-humans-label": "Människa (inte bot)",
+       "rcfilters-filter-humans-description": "Redigeringar gjorda av mänskliga redigerare.",
+       "rcfilters-filtergroup-significance": "Betydelse",
+       "rcfilters-filter-minor-label": "Mindre redigeringar",
+       "rcfilters-filter-minor-description": "Redigeringar som är märkta som mindre.",
+       "rcfilters-filter-major-label": "Icke-mindre redigeringar",
+       "rcfilters-filter-major-description": "Redigeringar som inte är märkta som mindre.",
+       "rcfilters-filtergroup-changetype": "Typ av ändring",
+       "rcfilters-filter-pageedits-label": "Sidredigeringar",
+       "rcfilters-filter-pageedits-description": "Redigeringar till wikiinnehåll, diskussioner, kategoribeskrivningar...",
+       "rcfilters-filter-newpages-label": "Sidskapande",
+       "rcfilters-filter-newpages-description": "Redigeringar som skapade nya sidor.",
+       "rcfilters-filter-categorization-label": "Kategoriändringar",
+       "rcfilters-filter-categorization-description": "Poster av sidor som läggs till eller tas bort från kategorier.",
+       "rcfilters-filter-logactions-label": "Loggade åtgärder",
+       "rcfilters-filter-logactions-description": "Administrativa åtgärder, kontoskapande, sidraderingar, uppladdningar....",
        "rcnotefrom": "Nedan visas {{PLURAL:$5|ändringen|ändringar}} sedan <strong>$3, $4</strong> (upp till <strong>$1</strong> ändringar visas).",
        "rclistfrom": "Visa nya ändringar från och med $2 $3",
        "rcshowhideminor": "$1 mindre ändringar",
        "apisandbox-sending-request": "Skickar API-begäran...",
        "apisandbox-loading-results": "Hämtar API-resultat...",
        "apisandbox-results-error": "Ett fel uppstod när API-förfrågans svar lästes in: $1.",
-       "apisandbox-request-params-json": "JSON-parametrar:",
        "apisandbox-request-url-label": "Begärd URL:",
        "apisandbox-request-time": "Tid för begäran: {{PLURAL:$1|$1 ms}}",
        "apisandbox-results-fixtoken": "Korrigera nyckeln och skicka igen",
        "feedback-useragent": "Användaragent:",
        "searchsuggest-search": "Sök på {{SITENAME}}",
        "searchsuggest-containing": "innehåller...",
-       "api-error-autoblocked": "Din IP-adress har blockerats automatiskt eftersom den har använts av en blockerad användare.",
-       "api-error-badaccess-groups": "Du får inte ladda upp filer till denna wiki.",
        "api-error-badtoken": "Internt fel: felaktig nyckel.",
-       "api-error-blocked": "Du har blockerats från att redigera.",
-       "api-error-copyuploaddisabled": "Uppladdning via URL är inaktiverat på den här servern.",
-       "api-error-duplicate": "Det finns redan {{PLURAL:$1|en annan fil|andra filer}} på webbplatsen med samma innehåll.",
-       "api-error-duplicate-archive": "Det fanns redan {{PLURAL:$1|en annan fil|några andra filer}} på webbplatsen med samma innehåll, men {{PLURAL:$1|den har|de har}} raderats.",
-       "api-error-empty-file": "Filen du skickade var tom.",
        "api-error-emptypage": "Det är inte tillåtet att skapa nya, tomma sidor.",
-       "api-error-fetchfileerror": "Internt fel: något gick fel vid hämtningen av filen.",
-       "api-error-fileexists-forbidden": "En fil med namnet \"$1\" finns redan och kan inte skrivas över.",
-       "api-error-fileexists-shared-forbidden": "En fil med namnet \"$1\" finns redan i det delade filarkivet och kan inte skrivas över.",
-       "api-error-file-too-large": "Filen du skickade var för stor.",
-       "api-error-filename-tooshort": "Filnamnet är för kort.",
-       "api-error-filetype-banned": "Denna typ av fil är förbjuden.",
-       "api-error-filetype-banned-type": "$1 är inte {{PLURAL:$4|en tillåten filtyp|tillåtna filtyper}}. {{PLURAL:$3|Tillåten filtyp|Tillåtna filtyper}} är $2.",
-       "api-error-filetype-missing": "Filnamnet saknar en filändelse.",
-       "api-error-hookaborted": "Ändringen du försökte göra avbröts av en extension hook.",
-       "api-error-http": "Internt fel: Det gick inte att ansluta till servern.",
-       "api-error-illegal-filename": "Filnamnet är inte tillåtet.",
-       "api-error-internal-error": "Internt fel: Något gick fel med bearbetningen av din uppladdning på wikin.",
-       "api-error-invalid-file-key": "Internt fel: filen hittades inte i tillfällig lagring.",
-       "api-error-missingparam": "Internt fel: Det saknas parametrar i begäran.",
-       "api-error-missingresult": "Internt fel: Kunde inte avgöra om kopieringen lyckades.",
-       "api-error-mustbeloggedin": "Du måste vara inloggad för att kunna ladda upp filer.",
-       "api-error-mustbeposted": "Det finns en bugg i detta program, det använder inte rätt HTTP-metod.",
-       "api-error-noimageinfo": "Uppladdningen lyckades, men servern gav oss inte någon information om filen.",
-       "api-error-nomodule": "Internt fel: Ingen uppladdningsmodul uppsatt.",
-       "api-error-ok-but-empty": "Internt fel: Inget svar från servern.",
-       "api-error-overwrite": "Det är inte tillåtet att skriva över en befintlig fil.",
-       "api-error-ratelimited": "Du försöker ladda upp fler filer inom en kortare tidsrymd än denna wiki tillåter.\nFörsök igen om några minuter.",
-       "api-error-stashfailed": "Internt fel: servern kunde inte lagra temporär fil.",
        "api-error-publishfailed": "Internt fel: Servern kunde inte publicera temporär fil.",
-       "api-error-stasherror": "Ett fel uppstod under uppladdningen av filen till mellanlagringsfilen.",
-       "api-error-stashedfilenotfound": "Den temporära filen kunde inte hittas när den skulle laddas upp från den temporära lagringsytan.",
-       "api-error-stashpathinvalid": "Den sökväg där den temporära filen skulle ha hittats var ogiltig.",
-       "api-error-stashfilestorage": "Ett fel uppstod under lagringen av filen i den temporära lagringsytan.",
-       "api-error-stashzerolength": "Servern kunde inte lagra filen temporärt eftersom den har noll längd.",
-       "api-error-stashnotloggedin": "Du måste vara inloggad för att spara filer till den temporära ytan för uppladdningar.",
-       "api-error-stashwrongowner": "Filen du försöker komma åt i det temporära lagringsutrymmet tillhör inte dig.",
-       "api-error-stashnosuchfilekey": "Filnyckeln som du försökte komma åt i den temporära lagringsytan existerar inte.",
-       "api-error-timeout": "Servern svarade inte inom förväntad tid.",
-       "api-error-unclassified": "Ett okänt fel uppstod.",
-       "api-error-unknown-code": "Okänt fel: \"$1\".",
-       "api-error-unknown-error": "Internt fel: något gick fel när vi försökte ladda upp din fil.",
+       "api-error-stashfailed": "Internt fel: servern kunde inte lagra temporär fil.",
        "api-error-unknown-warning": "Okänd varning: \"$1\".",
        "api-error-unknownerror": "Okänt fel: \"$1\".",
-       "api-error-uploaddisabled": "Uppladdning är inaktiverad på denna wiki.",
-       "api-error-verification-error": "Denna fil kan vara skadad eller har fel filändelse.",
-       "api-error-was-deleted": "En fil med detta namn har tidigare laddats upp och sedan raderats.",
        "duration-seconds": "$1 {{PLURAL:$1|sekund|sekunder}}",
        "duration-minutes": "$1 {{PLURAL:$1|minut|minuter}}",
        "duration-hours": "$1 {{PLURAL:$1|timme|timmar}}",
        "usercssispublic": "Observera: CSS-undersidor bör inte innehålla konfidentiella uppgifter eftersom de kan ses av andra användare.",
        "restrictionsfield-badip": "Ogiltig IP-adress eller intervall: $1",
        "restrictionsfield-label": "Tillåtna IP-intervall:",
-       "restrictionsfield-help": "En IP-adress eller CIDR-intervall per rad. För att aktivera allting, använd<br><code>0.0.0.0/0</code><br><code>::/0</code>",
+       "restrictionsfield-help": "En IP-adress eller CIDR-intervall per rad. För att aktivera allting, använd<br /><code>0.0.0.0/0</code><br /><code>::/0</code>",
        "revid": "sidversion $1",
        "pageid": "sid-ID $1"
 }
index ea4519d..a1eb2ae 100644 (file)
        "changepassword-success": "เปลี่ยนรหัสผ่านของคุณสำเร็จ!",
        "changepassword-throttled": "ล่าสุดคุณพยายามล็อกอินมากครั้งเกินไป\nกรุณารอ $1 ก่อนลองอีกครั้ง",
        "botpasswords": "รหัสผ่านบอต",
+       "botpasswords-disabled": "รหัสผ่านสำหรับบอตถูกปิดใช้",
+       "botpasswords-no-central-id": "หากต้องการใช้รหัสผ่านบอต คุณต้องล็อกอินในชื่อบัญชีผู้ใช้ที่เป็นกลาง",
+       "botpasswords-existing": "รหัสผ่านบอตที่มีอยู่",
+       "botpasswords-createnew": "สร้างรหัสผ่านบอตใหม่",
+       "botpasswords-editexisting": "แก้ไขรหัสผ่านบอตที่มีอยู่เดิม",
        "botpasswords-label-appid": "ชื่อบอต:",
        "botpasswords-label-create": "สร้าง",
        "botpasswords-label-update": "อัปเดต",
        "botpasswords-label-cancel": "ยกเลิก",
        "botpasswords-label-delete": "ลบ",
        "botpasswords-label-resetpassword": "ตั้งรหัสผ่านใหม่",
+       "botpasswords-label-grants": "การอนุญาตที่นำไปใช้ได้:",
+       "botpasswords-label-grants-column": "อนุญาตแล้ว",
+       "botpasswords-bad-appid": "ชื่อบอต \"$1\" ไม่ถูกต้อง",
+       "botpasswords-insert-failed": "การเพิ่มชื่อบอต \"$1\" ล้มเหลว คุณได้เพิ่มมันไว้แล้วหรือเปล่า?",
+       "botpasswords-update-failed": "การอัปเดตชื่อบอต \"$1\" ล้มเหลว คุณลบมันออกไปหรือเปล่า?",
        "resetpass_forbidden": "ไม่สามารถเปลี่ยนรหัสผ่านได้",
        "resetpass-no-info": "คุณต้องล็อกอินเพื่อเข้าถึงหน้านี้โดยตรง",
        "resetpass-submit-loggedin": "เปลี่ยนรหัสผ่าน",
index 5134a4f..eaa41c2 100644 (file)
        "rcfilters-filter-editsbyself-description": "您的編輯。",
        "rcfilters-filter-editsbyother-label": "其他人的編輯",
        "rcfilters-filter-editsbyother-description": "由其他使用者而非您所作的編輯。",
-       "rcfilters-filtergroup-userExpLevel": "使用者經驗等級",
+       "rcfilters-filtergroup-userExpLevel": "經驗等級 (僅限已註冊的使用者)",
        "rcfilters-filter-userExpLevel-newcomer-label": "新手",
-       "rcfilters-filter-userExpLevel-newcomer-description": "非常新的編輯者:編輯數低於 10 次,活躍低於 4 天。",
+       "rcfilters-filter-userExpLevel-newcomer-description": "編輯數低於 10 次,活躍低於 4 天。",
        "rcfilters-filter-userExpLevel-learner-label": "初學者",
        "rcfilters-filter-userExpLevel-learner-description": "活躍的天數以及編輯數比 '新手' 多,但比 '有經驗的使用者' 少。",
        "rcfilters-filter-userExpLevel-experienced-label": "有經驗的使用者",
index dd5a3af..cb26337 100644 (file)
@@ -8,6 +8,8 @@
  *
  */
 
+$fallback = 'oc';
+
 $namespaceNames = [
        NS_MEDIA            => 'Media',
        NS_SPECIAL          => 'Especial',
@@ -158,6 +160,14 @@ $dateFormats = [
        'ymd both' => 'H:i, Y M j',
 ];
 
+$datePreferences = [
+       'default',
+       'dmy',
+       'ymd',
+       'ISO 8601',
+];
+$defaultDateFormat = 'dmy';
+
 $bookstoreList = [
        'Catàleg Col·lectiu de les Universitats de Catalunya' => 'http://ccuc.cbuc.es/cgi-bin/vtls.web.gateway?searchtype=control+numcard&searcharg=$1',
        'Totselsllibres.com' => 'http://www.totselsllibres.com/tel/publi/busquedaAvanzadaLibros.do?ISBN=$1',
index 1de22bd..1d9e0e5 100644 (file)
@@ -19,6 +19,8 @@
  * @author לערי ריינהארט
  */
 
+$fallback = 'ca';
+
 $bookstoreList = [
        'Amazon.fr' => 'https://www.amazon.fr/exec/obidos/ISBN=$1'
 ];
@@ -57,6 +59,8 @@ $namespaceAliases = [
        'Discussion_Imatge'    => NS_FILE_TALK,
 ];
 
+$namespaceGenderAliases = [];
+
 $specialPageAliases = [
        'Allmessages'               => [ 'Messatge_sistèma', 'Messatge_del_sistèma' ],
        'Allpages'                  => [ 'Totas_las_paginas' ],
index 3ee463e..8130978 100644 (file)
@@ -13,6 +13,8 @@
  * @author לערי ריינהארט
  */
 
+$fallback = 'bs, sr-el, hr';
+
 $namespaceNames = [
        NS_SPECIAL          => 'Posebno',
        NS_TALK             => 'Razgovor',
@@ -30,6 +32,23 @@ $namespaceNames = [
        NS_CATEGORY_TALK    => 'Razgovor_o_kategoriji',
 ];
 
+# Some dummy translations to prevent language fallback for now
+# @TODO: Check whether localising them is appropriate.
+$namespaceGenderAliases = [];
+$defaultDateFormat = 'dmy';
+$datePreferences = [
+       'default',
+       'dmy',
+       'ymd',
+       'ISO 8601',
+];
+$datePreferenceMigrationMap = [
+       'default',
+       'mdy',
+       'dmy',
+       'ymd'
+];
+
 $specialPageAliases = [
        'Activeusers'               => [ 'Aktivni_korisnici' ],
        'Allmessages'               => [ 'Sve_poruke' ],
index bd7f68e..22f109d 100644 (file)
@@ -1747,7 +1747,6 @@ return [
                        'resources/src/mediawiki.rcfilters/mw.rcfilters.init.js',
                ],
                'styles' => [
-                       'resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less',
                        'resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterItemWidget.less',
                        'resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FilterGroupWidget.less',
                        'resources/src/mediawiki.rcfilters/styles/mw.rcfilters.ui.FiltersListWidget.less',
@@ -1756,8 +1755,11 @@ return [
                ],
                'messages' => [
                        'rcfilters-activefilters',
+                       'rcfilters-restore-default-filters',
+                       'rcfilters-clear-all-filters',
                        'rcfilters-search-placeholder',
                        'rcfilters-invalid-filter',
+                       'rcfilters-empty-filter',
                        'rcfilters-filterlist-title',
                        'rcfilters-filterlist-noresults',
                        'rcfilters-filtergroup-registration',
@@ -1800,6 +1802,7 @@ return [
                'dependencies' => [
                        'oojs-ui',
                        'mediawiki.Uri',
+                       'oojs-ui.styles.icons-moderation'
                ],
        ],
        'mediawiki.special' => [
index 63db0ea..5dfb68d 100644 (file)
         * @cfg {string} [group] The group this item belongs to
         * @cfg {string} [label] The label for the filter
         * @cfg {string} [description] The description of the filter
-        * @cfg {boolean} [selected] Filter is selected
+        * @cfg {boolean} [active=true] The filter is active and affecting the result
+        * @cfg {string[]} [excludes=[]] A list of filter names this filter, if
+        *  selected, makes inactive.
+        * @cfg {boolean} [default] The default state of this filter
         */
        mw.rcfilters.dm.FilterItem = function MwRcfiltersDmFilterItem( name, config ) {
                config = config || {};
                this.group = config.group || '';
                this.label = config.label || this.name;
                this.description = config.description;
+               this.default = !!config.default;
 
-               this.selected = !!config.selected;
+               this.active = config.active === undefined ? true : !!config.active;
+               this.excludes = config.excludes || [];
+               this.selected = this.default;
        };
 
        /* Initialization */
                return this.description;
        };
 
+       /**
+        * Get the default value of this filter
+        *
+        * @return {boolean} Filter default
+        */
+       mw.rcfilters.dm.FilterItem.prototype.getDefault = function () {
+               return this.default;
+       };
+
        /**
         * Get the selected state of this filter
         *
                return this.selected;
        };
 
+       /**
+        * Check if this filter is active
+        *
+        * @return {boolean} Filter is active
+        */
+       mw.rcfilters.dm.FilterItem.prototype.isActive = function () {
+               return this.active;
+       };
+
+       /**
+        * Check if this filter has a list of excluded filters
+        *
+        * @return {boolean} Filter has a list of excluded filters
+        */
+       mw.rcfilters.dm.FilterItem.prototype.hasExcludedFilters = function () {
+               return !!this.excludes.length;
+       };
+
+       /**
+        * Get this filter's list of excluded filters
+        *
+        * @return {string[]} Array of excluded filter names
+        */
+       mw.rcfilters.dm.FilterItem.prototype.getExcludedFilters = function () {
+               return this.excludes;
+       };
+
+       /**
+        * Toggle the active state of the item
+        *
+        * @param {boolean} [isActive] Filter is active
+        * @fires update
+        */
+       mw.rcfilters.dm.FilterItem.prototype.toggleActive = function ( isActive ) {
+               isActive = isActive === undefined ? !this.active : isActive;
+
+               if ( this.active !== isActive ) {
+                       this.active = isActive;
+                       this.emit( 'update' );
+               }
+       };
+
        /**
         * Toggle the selected state of the item
         *
index 3217d0d..3f7fa53 100644 (file)
                OO.EmitterList.call( this );
 
                this.groups = {};
+               this.excludedByMap = {};
+               this.defaultParams = {};
+               this.defaultFiltersEmpty = null;
 
                // Events
-               this.aggregate( { update: 'itemUpdate' } );
+               this.aggregate( { update: 'filterItemUpdate' } );
+               this.connect( this, { filterItemUpdate: 'onFilterItemUpdate' } );
        };
 
        /* Initialization */
 
        /* Methods */
 
+       /**
+        * Respond to filter item change.
+        *
+        * @param {mw.rcfilters.dm.FilterItem} item Updated filter
+        * @fires itemUpdate
+        */
+       mw.rcfilters.dm.FiltersViewModel.prototype.onFilterItemUpdate = function ( item ) {
+               // Reapply the active state of filters
+               this.reapplyActiveFilters( item );
+
+               this.emit( 'itemUpdate', item );
+       };
+
+       /**
+        * Calculate the active state of the filters, based on selected filters in the group.
+        *
+        * @param {mw.rcfilters.dm.FilterItem} item Changed item
+        */
+       mw.rcfilters.dm.FiltersViewModel.prototype.reapplyActiveFilters = function ( item ) {
+               var selectedItemsCount,
+                       group = item.getGroup(),
+                       model = this;
+               if (
+                       !this.groups[ group ].exclusionType ||
+                       this.groups[ group ].exclusionType === 'default'
+               ) {
+                       // Default behavior
+                       // If any parameter is selected, but:
+                       // - If there are unselected items in the group, they are inactive
+                       // - If the entire group is selected, all are inactive
+
+                       // Check what's selected in the group
+                       selectedItemsCount = this.groups[ group ].filters.filter( function ( filterItem ) {
+                               return filterItem.isSelected();
+                       } ).length;
+
+                       this.groups[ group ].filters.forEach( function ( filterItem ) {
+                               filterItem.toggleActive(
+                                       selectedItemsCount > 0 ?
+                                               // If some items are selected
+                                               (
+                                                       selectedItemsCount === model.groups[ group ].filters.length ?
+                                                       // If **all** items are selected, they're all inactive
+                                                       false :
+                                                       // If not all are selected, then the selected are active
+                                                       // and the unselected are inactive
+                                                       filterItem.isSelected()
+                                               ) :
+                                               // No item is selected, everything is active
+                                               true
+                               );
+                       } );
+               } else if ( this.groups[ group ].exclusionType === 'explicit' ) {
+                       // Explicit behavior
+                       // - Go over the list of excluded filters to change their
+                       //   active states accordingly
+
+                       // For each item in the list, see if there are other selected
+                       // filters that also exclude it. If it does, it will still be
+                       // inactive.
+
+                       item.getExcludedFilters().forEach( function ( filterName ) {
+                               var filterItem = model.getItemByName( filterName );
+
+                               // Note to reduce confusion:
+                               // - item is the filter whose state changed and should exclude the other filters
+                               //   in its list of exclusions
+                               // - filterItem is the filter that is potentially being excluded by the current item
+                               // - anotherExcludingFilter is any other filter that excludes filterItem; we must check
+                               //   if that filter is selected, because if it is, we should not touch the excluded item
+                               if (
+                                       // Check if there are any filters (other than the current one)
+                                       // that also exclude the filterName
+                                       !model.excludedByMap[ filterName ].some( function ( anotherExcludingFilterName ) {
+                                               var anotherExcludingFilter = model.getItemByName( anotherExcludingFilterName );
+
+                                               return (
+                                                       anotherExcludingFilterName !== item.getName() &&
+                                                       anotherExcludingFilter.isSelected()
+                                               );
+                                       } )
+                               ) {
+                                       // Only change the state for filters that aren't
+                                       // also affected by other excluding selected filters
+                                       filterItem.toggleActive( !item.isSelected() );
+                               }
+                       } );
+               }
+       };
+
        /**
         * Set filters and preserve a group relationship based on
         * the definition given by an object
         * @param {Object} filters Filter group definition
         */
        mw.rcfilters.dm.FiltersViewModel.prototype.initializeFilters = function ( filters ) {
-               var i, filterItem,
+               var i, filterItem, selectedFilterNames, excludedFilters,
                        model = this,
-                       items = [];
+                       items = [],
+                       addToMap = function ( excludedFilters ) {
+                               excludedFilters.forEach( function ( filterName ) {
+                                       model.excludedByMap[ filterName ] = model.excludedByMap[ filterName ] || [];
+                                       model.excludedByMap[ filterName ].push( filterItem.getName() );
+                               } );
+                       };
 
                // Reset
                this.clearItems();
                this.groups = {};
+               this.excludedByMap = {};
 
                $.each( filters, function ( group, data ) {
                        model.groups[ group ] = model.groups[ group ] || {};
                        model.groups[ group ].title = data.title;
                        model.groups[ group ].type = data.type;
                        model.groups[ group ].separator = data.separator || '|';
+                       model.groups[ group ].exclusionType = data.exclusionType || 'default';
 
+                       selectedFilterNames = [];
                        for ( i = 0; i < data.filters.length; i++ ) {
+                               excludedFilters = data.filters[ i ].excludes || [];
+
                                filterItem = new mw.rcfilters.dm.FilterItem( data.filters[ i ].name, {
                                        group: group,
                                        label: data.filters[ i ].label,
                                        description: data.filters[ i ].description,
-                                       selected: data.filters[ i ].selected
+                                       selected: data.filters[ i ].selected,
+                                       excludes: excludedFilters,
+                                       'default': data.filters[ i ].default
                                } );
 
+                               // Map filters and what excludes them
+                               addToMap( excludedFilters );
+
+                               if ( data.type === 'send_unselected_if_any' ) {
+                                       // Store the default parameter state
+                                       // For this group type, parameter values are direct
+                                       model.defaultParams[ data.filters[ i ].name ] = Number( !!data.filters[ i ].default );
+                               } else if (
+                                       data.type === 'string_options' &&
+                                       data.filters[ i ].default
+                               ) {
+                                       selectedFilterNames.push( data.filters[ i ].name );
+                               }
+
                                model.groups[ group ].filters.push( filterItem );
                                items.push( filterItem );
                        }
+
+                       if ( data.type === 'string_options' ) {
+                               // Store the default parameter group state
+                               // For this group, the parameter is group name and value is the names
+                               // of selected items
+                               model.defaultParams[ group ] = model.sanitizeStringOptionGroup( group, selectedFilterNames ).join( model.groups[ group ].separator );
+                       }
                } );
 
                this.addItems( items );
+
                this.emit( 'initialize' );
        };
 
        };
 
        /**
-        * Get the current state of the filters
+        * Get the current state of the filters.
+        *
+        * Checks whether the filter group is active. This means at least one
+        * filter is selected, but not all filters are selected.
+        *
+        * @param {string} groupName Group name
+        * @return {boolean} Filter group is active
+        */
+       mw.rcfilters.dm.FiltersViewModel.prototype.isFilterGroupActive = function ( groupName ) {
+               var count = 0,
+                       filters = this.groups[ groupName ].filters;
+
+               filters.forEach( function ( filterItem ) {
+                       count += Number( filterItem.isSelected() );
+               } );
+
+               return (
+                       count > 0 &&
+                       count < filters.length
+               );
+       };
+
+       /**
+        * Update the representation of the parameters. These are the back-end
+        * parameters representing the filters, but they represent the given
+        * current state regardless of validity.
+        *
+        * This should only run after filters are already set.
+        *
+        * @param {Object} params Parameter state
+        */
+       mw.rcfilters.dm.FiltersViewModel.prototype.updateParameters = function ( params ) {
+               var model = this;
+
+               $.each( params, function ( name, value ) {
+                       // Only store the parameters that exist in the system
+                       if ( model.getItemByName( name ) ) {
+                               model.parameters[ name ] = value;
+                       }
+               } );
+       };
+
+       /**
+        * Get the value of a specific parameter
+        *
+        * @param {string} name Parameter name
+        * @return {number|string} Parameter value
+        */
+       mw.rcfilters.dm.FiltersViewModel.prototype.getParamValue = function ( name ) {
+               return this.parameters[ name ];
+       };
+
+       /**
+        * Get the current selected state of the filters
         *
-        * @return {Object} Filters current state
+        * @return {Object} Filters selected state
         */
-       mw.rcfilters.dm.FiltersViewModel.prototype.getState = function () {
+       mw.rcfilters.dm.FiltersViewModel.prototype.getSelectedState = function () {
                var i,
                        items = this.getItems(),
                        result = {};
                return result;
        };
 
+       /**
+        * Get the current full state of the filters
+        *
+        * @return {Object} Filters full state
+        */
+       mw.rcfilters.dm.FiltersViewModel.prototype.getFullState = function () {
+               var i,
+                       items = this.getItems(),
+                       result = {};
+
+               for ( i = 0; i < items.length; i++ ) {
+                       result[ items[ i ].getName() ] = {
+                               selected: items[ i ].isSelected(),
+                               active: items[ i ].isActive()
+                       };
+               }
+
+               return result;
+       };
+
+       /**
+        * Get the default parameters object
+        *
+        * @return {Object} Default parameter values
+        */
+       mw.rcfilters.dm.FiltersViewModel.prototype.getDefaultParams = function () {
+               return this.defaultParams;
+       };
+
+       /**
+        * Set all filter states to default values
+        */
+       mw.rcfilters.dm.FiltersViewModel.prototype.setFiltersToDefaults = function () {
+               var defaultFilterStates = this.getFiltersFromParameters( this.getDefaultParams() );
+
+               this.updateFilters( defaultFilterStates );
+       };
+
        /**
         * Analyze the groups and their filters and output an object representing
         * the state of the parameters they represent.
         *
+        * @param {Object} [filterGroups] An object defining the filter groups to
+        *  translate to parameters. Its structure must follow that of this.groups
+        *  see #getFilterGroups
         * @return {Object} Parameter state object
         */
-       mw.rcfilters.dm.FiltersViewModel.prototype.getParametersFromFilters = function () {
+       mw.rcfilters.dm.FiltersViewModel.prototype.getParametersFromFilters = function ( filterGroups ) {
                var i, filterItems, anySelected, values,
                        result = {},
-                       groupItems = this.getFilterGroups();
+                       groupItems = filterGroups || this.getFilterGroups();
 
                $.each( groupItems, function ( group, data ) {
                        filterItems = data.filters;
         * Remove duplicates and make sure to only use valid
         * values.
         *
+        * @private
         * @param {string} groupName Group name
         * @param {string[]} valueArray Array of values
         * @return {string[]} Array of valid values
                return result;
        };
 
+       /**
+        * Check whether the current filter state is set to all false.
+        *
+        * @return {boolean} Current filters are all empty
+        */
+       mw.rcfilters.dm.FiltersViewModel.prototype.areCurrentFiltersEmpty = function () {
+               var currFilters = this.getSelectedState();
+
+               return Object.keys( currFilters ).every( function ( filterName ) {
+                       return !currFilters[ filterName ];
+               } );
+       };
+
+       /**
+        * Check whether the default values of the filters are all false.
+        *
+        * @return {boolean} Default filters are all false
+        */
+       mw.rcfilters.dm.FiltersViewModel.prototype.areDefaultFiltersEmpty = function () {
+               var defaultFilters;
+
+               if ( this.defaultFiltersEmpty !== null ) {
+                       // We only need to do this test once,
+                       // because defaults are set once per session
+                       defaultFilters = this.getFiltersFromParameters();
+                       this.defaultFiltersEmpty = Object.keys( defaultFilters ).every( function ( filterName ) {
+                               return !defaultFilters[ filterName ];
+                       } );
+               }
+
+               return this.defaultFiltersEmpty;
+       };
+
        /**
         * This is the opposite of the #getParametersFromFilters method; this goes over
-        * the parameters and translates into a selected/unselected value in the filters.
+        * the given parameters and translates into a selected/unselected value in the filters.
         *
         * @param {Object} params Parameters query object
         * @return {Object} Filter state object
                var i, filterItem,
                        groupMap = {},
                        model = this,
-                       base = this.getParametersFromFilters(),
-                       // Start with current state
-                       result = this.getState();
+                       base = this.getDefaultParams(),
+                       result = {};
 
                params = $.extend( {}, base, params );
 
                } )[ 0 ];
        };
 
+       /**
+        * Set all filters to false or empty/all
+        * This is equivalent to display all.
+        */
+       mw.rcfilters.dm.FiltersViewModel.prototype.emptyAllFilters = function () {
+               var filters = {};
+
+               this.getItems().forEach( function ( filterItem ) {
+                       filters[ filterItem.getName() ] = false;
+               } );
+
+               // Update filters
+               this.updateFilters( filters );
+       };
+
        /**
         * Toggle selected state of items by their names
         *
index ea44b8b..28d9f28 100644 (file)
@@ -6,7 +6,6 @@
         */
        mw.rcfilters.Controller = function MwRcfiltersController( model ) {
                this.model = model;
-
                // TODO: When we are ready, update the URL when a filter is updated
                // this.model.connect( this, { itemUpdate: 'updateURL' } );
        };
        mw.rcfilters.Controller.prototype.initialize = function () {
                var uri = new mw.Uri();
 
+               // Give the model a full parameter state from which to
+               // update the filters
                this.model.updateFilters(
                        // Translate the url params to filter select states
                        this.model.getFiltersFromParameters( uri.query )
                );
        };
 
+       /**
+        * Reset to default filters
+        */
+       mw.rcfilters.Controller.prototype.resetToDefaults = function () {
+               this.model.setFiltersToDefaults();
+       };
+
+       /**
+        * Empty all selected filters
+        */
+       mw.rcfilters.Controller.prototype.emptyFilters = function () {
+               this.model.emptyAllFilters();
+       };
+
        /**
         * Update the state of a filter
         *
index 34df2f5..7b29d4b 100644 (file)
@@ -24,7 +24,7 @@
                                                        description: mw.msg( 'rcfilters-filter-registered-description' )
                                                },
                                                {
-                                                       name: 'hideanon',
+                                                       name: 'hideanons',
                                                        label: mw.msg( 'rcfilters-filter-unregistered-label' ),
                                                        description: mw.msg( 'rcfilters-filter-unregistered-description' )
                                                }
                                                {
                                                        name: 'hidebots',
                                                        label: mw.msg( 'rcfilters-filter-bots-label' ),
-                                                       description: mw.msg( 'rcfilters-filter-bots-description' )
+                                                       description: mw.msg( 'rcfilters-filter-bots-description' ),
+                                                       'default': true
                                                },
                                                {
                                                        name: 'hidehumans',
                                                        label: mw.msg( 'rcfilters-filter-humans-label' ),
-                                                       description: mw.msg( 'rcfilters-filter-humans-description' )
+                                                       description: mw.msg( 'rcfilters-filter-humans-description' ),
+                                                       'default': false
                                                }
                                        ]
                                },
                                                {
                                                        name: 'hidepageedits',
                                                        label: mw.msg( 'rcfilters-filter-pageedits-label' ),
-                                                       description: mw.msg( 'rcfilters-filter-pageedits-description' )
+                                                       description: mw.msg( 'rcfilters-filter-pageedits-description' ),
+                                                       'default': false
                                                },
                                                {
                                                        name: 'hidenewpages',
                                                        label: mw.msg( 'rcfilters-filter-newpages-label' ),
-                                                       description: mw.msg( 'rcfilters-filter-newpages-description' )
+                                                       description: mw.msg( 'rcfilters-filter-newpages-description' ),
+                                                       'default': false
                                                },
                                                {
                                                        name: 'hidecategorization',
                                                        label: mw.msg( 'rcfilters-filter-categorization-label' ),
-                                                       description: mw.msg( 'rcfilters-filter-categorization-description' )
+                                                       description: mw.msg( 'rcfilters-filter-categorization-description' ),
+                                                       'default': true
                                                },
                                                {
                                                        name: 'hidelog',
                                                        label: mw.msg( 'rcfilters-filter-logactions-label' ),
-                                                       description: mw.msg( 'rcfilters-filter-logactions-description' )
+                                                       description: mw.msg( 'rcfilters-filter-logactions-description' ),
+                                                       'default': false
                                                }
                                        ]
                                }
                        // Initialize values
                        controller.initialize();
 
+                       // HACK: Remove old-style filter links for filters handled by the widget
+                       // Ideally the widget would handle all filters and we'd just remove .rcshowhide entirely
+                       $( '.rcshowhide' ).children().each( function () {
+                               // HACK: Interpret the class name to get the filter name
+                               // This should really be set as a data attribute
+                               var i,
+                                       name = null,
+                                       // Some of the older browsers we support don't have .classList,
+                                       // so we have to interpret the class attribute manually.
+                                       classes = this.getAttribute( 'class' ).split( ' ' );
+                               for ( i = 0; i < classes.length; i++ ) {
+                                       if ( classes[ i ].substr( 0, 'rcshow'.length ) === 'rcshow' ) {
+                                               name = classes[ i ].substr( 'rcshow'.length );
+                                               break;
+                                       }
+                               }
+                               if ( name === null ) {
+                                       return;
+                               }
+                               if ( name === 'hidemine' ) {
+                                       // HACK: the span for hidemyself is called hidemine
+                                       name = 'hidemyself';
+                               }
+                               // This span corresponds to a filter that's in our model, so remove it
+                               if ( model.getItemByName( name ) ) {
+                                       // HACK: Remove the text node after the span.
+                                       // If there isn't one, we're at the end, so remove the text node before the span.
+                                       // This would be unnecessary if we added separators with CSS.
+                                       if ( this.nextSibling && this.nextSibling.nodeType === Node.TEXT_NODE ) {
+                                               this.parentNode.removeChild( this.nextSibling );
+                                       } else if ( this.previousSibling && this.previousSibling.nodeType === Node.TEXT_NODE ) {
+                                               this.parentNode.removeChild( this.previousSibling );
+                                       }
+                                       // Remove the span itself
+                                       this.parentNode.removeChild( this );
+                               }
+                       } );
+
                        $( '.rcoptions form' ).submit( function () {
                                var $form = $( this );
 
diff --git a/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less b/resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
deleted file mode 100644 (file)
index 7f71c0c..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-.rcshowhidemine {
-       // HACK: Hide this filter since it already appears in
-       // the new filter drop-down.
-       display: none;
-}
index 4e55add..2ff731c 100644 (file)
@@ -4,6 +4,31 @@
                color: #54595d;
        }
 
+       &-item-inactive {
+               opacity: 0.5;
+       }
+
+       &-emptyFilters {
+               color: #72777d;
+       }
+
+       &-table {
+               display: table;
+               width: 100%;
+       }
+
+       &-row {
+               display: table-row;
+       }
+
+       &-cell {
+               display: table-cell;
+
+               &:last-child {
+                       text-align: right;
+               }
+       }
+
        .oo-ui-capsuleItemWidget {
                color: #222;
                background-color: #fff;
index 70982d4..3723916 100644 (file)
@@ -8,6 +8,12 @@
                color: #555a5d;
        }
 
+       &-active {
+               .mw-rcfilters-ui-filterGroupWidget-title {
+                       font-weight: bold;
+               }
+       }
+
        &-invalid-notice {
                padding: 0.5em;
                font-style: italic;
index ad0b816..912e75c 100644 (file)
@@ -15,4 +15,8 @@
        .oo-ui-fieldLayout.oo-ui-fieldLayout-align-inline {
                margin-bottom: 0 !important;
        }
+
+       &-inactive {
+               opacity: 0.5;
+       }
 }
index a610e8f..f138d7e 100644 (file)
@@ -17,7 +17,7 @@
        &-popup {
                // We have to override OOUI's definition, which is set
                // on the inline style of the popup
-               margin-top: 2em !important;
+               margin-top: 2.4em !important;
                max-width: 650px;
        }
 
index db21542..c498ce9 100644 (file)
@@ -5,15 +5,19 @@
         * @extends OO.ui.CapsuleMultiselectWidget
         *
         * @constructor
+        * @param {mw.rcfilters.Controller} controller RCFilters controller
+        * @param {mw.rcfilters.dm.FiltersViewModel} model RCFilters view model
         * @param {OO.ui.InputWidget} filterInput A filter input that focuses the capsule widget
         * @param {Object} config Configuration object
         */
-       mw.rcfilters.ui.FilterCapsuleMultiselectWidget = function MwRcfiltersUiFilterCapsuleMultiselectWidget( filterInput, config ) {
+       mw.rcfilters.ui.FilterCapsuleMultiselectWidget = function MwRcfiltersUiFilterCapsuleMultiselectWidget( controller, model, filterInput, config ) {
                // Parent
                mw.rcfilters.ui.FilterCapsuleMultiselectWidget.parent.call( this, $.extend( {
                        $autoCloseIgnore: filterInput.$element
                }, config ) );
 
+               this.controller = controller;
+               this.model = model;
                this.filterInput = filterInput;
 
                this.$content.prepend(
                                .text( mw.msg( 'rcfilters-activefilters' ) )
                );
 
+               this.resetButton = new OO.ui.ButtonWidget( {
+                       icon: 'trash',
+                       framed: false,
+                       title: mw.msg( 'rcfilters-clear-all-filters' ),
+                       classes: [ 'mw-rcfilters-ui-filterCapsuleMultiselectWidget-resetButton' ]
+               } );
+
+               this.emptyFilterMessage = new OO.ui.LabelWidget( {
+                       label: mw.msg( 'rcfilters-empty-filter' ),
+                       classes: [ 'mw-rcfilters-ui-filterCapsuleMultiselectWidget-emptyFilters' ]
+               } );
+
                // Events
+               this.resetButton.connect( this, { click: 'onResetButtonClick' } );
+               this.model.connect( this, { itemUpdate: 'onModelItemUpdate' } );
                // Add the filterInput as trigger
                this.filterInput.$input
                        .on( 'focus', this.focus.bind( this ) );
 
+               // Initialize
+               this.$content.append( this.emptyFilterMessage.$element );
+               this.$handle
+                       .append(
+                               // The content and button should appear side by side regardless of how
+                               // wide the button is; the button also changes its width depending
+                               // on language and its state, so the safest way to present both side
+                               // by side is with a table layout
+                               $( '<div>' )
+                                       .addClass( 'mw-rcfilters-ui-filterCapsuleMultiselectWidget-table' )
+                                       .append(
+                                               $( '<div>' )
+                                                       .addClass( 'mw-rcfilters-ui-filterCapsuleMultiselectWidget-row' )
+                                                       .append(
+                                                               $( '<div>' )
+                                                                       .addClass( 'mw-rcfilters-ui-filterCapsuleMultiselectWidget-content' )
+                                                                       .addClass( 'mw-rcfilters-ui-filterCapsuleMultiselectWidget-cell' )
+                                                                       .append( this.$content ),
+                                                               $( '<div>' )
+                                                                       .addClass( 'mw-rcfilters-ui-filterCapsuleMultiselectWidget-cell' )
+                                                                       .append( this.resetButton.$element )
+                                                       )
+                                       )
+                       );
+
                this.$element
                        .addClass( 'mw-rcfilters-ui-filterCapsuleMultiselectWidget' );
+
+               this.reevaluateResetRestoreState();
        };
 
        /* Initialization */
 
        /* Methods */
 
+       mw.rcfilters.ui.FilterCapsuleMultiselectWidget.prototype.onModelItemUpdate = function () {
+               // Re-evaluate reset state
+               this.reevaluateResetRestoreState();
+       };
+
+       /**
+        * Respond to click event on the reset button
+        */
+       mw.rcfilters.ui.FilterCapsuleMultiselectWidget.prototype.onResetButtonClick = function () {
+               if ( this.model.areCurrentFiltersEmpty() ) {
+                       // Reset to default filters
+                       this.controller.resetToDefaults();
+               } else {
+                       // Reset to have no filters
+                       this.controller.emptyFilters();
+               }
+       };
+
+       /**
+        * Reevaluate the restore state for the widget between setting to defaults and clearing all filters
+        */
+       mw.rcfilters.ui.FilterCapsuleMultiselectWidget.prototype.reevaluateResetRestoreState = function () {
+               var defaultsAreEmpty = this.model.areDefaultFiltersEmpty(),
+                       currFiltersAreEmpty = this.model.areCurrentFiltersEmpty(),
+                       hideResetButton = currFiltersAreEmpty && defaultsAreEmpty;
+
+               this.resetButton.setIcon(
+                       currFiltersAreEmpty ? 'history' : 'trash'
+               );
+
+               this.resetButton.setLabel(
+                       currFiltersAreEmpty ? mw.msg( 'rcfilters-restore-default-filters' ) : ''
+               );
+
+               this.resetButton.toggle( !hideResetButton );
+               this.emptyFilterMessage.toggle( currFiltersAreEmpty );
+       };
+
        /**
         * @inheritdoc
         */
index 92ae4d1..2723258 100644 (file)
                return this.name;
        };
 
+       /**
+        * Toggle the active state of this group
+        *
+        * @param {boolean} isActive The group is active
+        */
+       mw.rcfilters.ui.FilterGroupWidget.prototype.toggleActiveState = function ( isActive ) {
+               this.$element.toggleClass( 'mw-rcfilters-ui-filterGroupWidget-active', isActive );
+       };
+
 }( mediaWiki, jQuery ) );
index b77df3b..f353051 100644 (file)
         */
        mw.rcfilters.ui.FilterItemWidget.prototype.onModelUpdate = function () {
                this.checkboxWidget.setSelected( this.model.isSelected() );
+
+               this.$element.toggleClass(
+                       'mw-rcfilters-ui-filterItemWidget-inactive',
+                       !this.model.isActive()
+               );
        };
 
        /**
index 3fcfc47..34cc240 100644 (file)
@@ -37,7 +37,7 @@
                        placeholder: mw.msg( 'rcfilters-search-placeholder' )
                } );
 
-               this.capsule = new mw.rcfilters.ui.FilterCapsuleMultiselectWidget( this.textInput, {
+               this.capsule = new mw.rcfilters.ui.FilterCapsuleMultiselectWidget( controller, this.model, this.textInput, {
                        popup: {
                                $content: this.filterPopup.$element,
                                classes: [ 'mw-rcfilters-ui-filterWrapperWidget-popup' ]
@@ -99,6 +99,7 @@
         */
        mw.rcfilters.ui.FilterWrapperWidget.prototype.onModelInitialize = function () {
                var items,
+                       wrapper = this,
                        filters = this.model.getItems();
 
                // Reset
                } );
 
                this.capsule.getMenu().addItems( items );
+
+               // Add defaults to capsule. We have to do this
+               // after we added to the capsule menu, since that's
+               // how the capsule multiselect widget knows which
+               // object to add
+               filters.forEach( function ( filterItem ) {
+                       if ( filterItem.isSelected() ) {
+                               wrapper.addCapsuleItemFromName( filterItem.getName() );
+                       }
+               } );
        };
 
        /**
         * @param {mw.rcfilters.dm.FilterItem} item Filter item that was updated
         */
        mw.rcfilters.ui.FilterWrapperWidget.prototype.onModelItemUpdate = function ( item ) {
+               var widget = this;
+
                if ( item.isSelected() ) {
-                       this.capsule.addItemsFromData( [ item.getName() ] );
+                       this.addCapsuleItemFromName( item.getName() );
                } else {
                        this.capsule.removeItemsFromData( [ item.getName() ] );
                }
+
+               // Toggle the active state of the group
+               this.filterPopup.getItems().forEach( function ( groupWidget ) {
+                       if ( groupWidget.getName() === item.getGroup() ) {
+                               groupWidget.toggleActiveState( widget.model.isFilterGroupActive( groupWidget.getName() ) );
+                       }
+               } );
+       };
+
+       /**
+        * Add a capsule item by its filter name
+        *
+        * @param {string} itemName Filter name
+        */
+       mw.rcfilters.ui.FilterWrapperWidget.prototype.addCapsuleItemFromName = function ( itemName ) {
+               var item = this.model.getItemByName( itemName );
+
+               this.capsule.addItemsFromData( [ itemName ] );
+
+               // Deal with active/inactive capsule filter items
+               this.capsule.getItemFromData( itemName ).$element
+                       .toggleClass( 'mw-rcfilters-ui-filterCapsuleMultiselectWidget-item-inactive', !item.isActive() );
        };
 }( mediaWiki ) );
index 069fbbf..4930c4f 100644 (file)
@@ -26,7 +26,7 @@
                 * Any warnings returned by the API, including warnings about invalid option names or values,
                 * are ignored. However, do not rely on this behavior.
                 *
-                * If necessary, the options will be saved using several parallel API requests. Only one promise
+                * If necessary, the options will be saved using several sequential API requests. Only one promise
                 * is always returned that will be resolved when all requests complete.
                 *
                 * @param {Object} options Options as a `{ name: value, … }` object
@@ -35,7 +35,7 @@
                saveOptions: function ( options ) {
                        var name, value, bundleable,
                                grouped = [],
-                               deferreds = [];
+                               promise = $.Deferred().resolve();
 
                        for ( name in options ) {
                                value = options[ name ] === null ? null : String( options[ name ] );
                                        }
                                } else {
                                        if ( value !== null ) {
-                                               deferreds.push( this.postWithToken( 'csrf', {
-                                                       formatversion: 2,
-                                                       action: 'options',
-                                                       optionname: name,
-                                                       optionvalue: value
-                                               } ) );
+                                               promise = promise.then( function ( name, value ) {
+                                                       return this.postWithToken( 'csrf', {
+                                                               formatversion: 2,
+                                                               action: 'options',
+                                                               optionname: name,
+                                                               optionvalue: value
+                                                       } );
+                                               }.bind( this, name, value ) );
                                        } else {
                                                // Omitting value resets the option
-                                               deferreds.push( this.postWithToken( 'csrf', {
-                                                       formatversion: 2,
-                                                       action: 'options',
-                                                       optionname: name
-                                               } ) );
+                                               promise = promise.then( function ( name ) {
+                                                       return this.postWithToken( 'csrf', {
+                                                               formatversion: 2,
+                                                               action: 'options',
+                                                               optionname: name
+                                                       } );
+                                               }.bind( this, name ) );
                                        }
                                }
                        }
 
                        if ( grouped.length ) {
-                               deferreds.push( this.postWithToken( 'csrf', {
-                                       formatversion: 2,
-                                       action: 'options',
-                                       change: grouped
-                               } ) );
+                               promise = promise.then( function () {
+                                       return this.postWithToken( 'csrf', {
+                                               formatversion: 2,
+                                               action: 'options',
+                                               change: grouped
+                                       } );
+                               }.bind( this ) );
                        }
 
-                       return $.when.apply( $, deferreds );
+                       return promise;
                }
 
        } );
index 17c1fb8..19469d9 100644 (file)
@@ -34,19 +34,24 @@ return [
         * project. directory_list won't find .inc files so
         * we augment it here.
         */
-       'file_list' => [
-               'maintenance/7zip.inc',
-               'maintenance/backupPrefetch.inc',
-               'maintenance/commandLine.inc',
-               'maintenance/sqlite.inc',
-               'maintenance/userOptions.inc',
-               'maintenance/backup.inc',
-               'maintenance/cleanupTable.inc',
-               'maintenance/importImages.inc',
-               'maintenance/userDupes.inc',
-               'maintenance/language/checkLanguage.inc',
-               'maintenance/language/languages.inc',
-       ],
+       'file_list' => array_merge(
+               function_exists( 'register_postsend_function' ) ? [] : [ 'tests/phan/stubs/hhvm.php' ],
+               function_exists( 'wikidiff2_do_diff' ) ? [] : [ 'tests/phan/stubs/wikidiff.php' ],
+               class_exists( PEAR::class ) ? [] : [ 'tests/phan/stubs/mail.php' ],
+               [
+                       'maintenance/7zip.inc',
+                       'maintenance/backupPrefetch.inc',
+                       'maintenance/commandLine.inc',
+                       'maintenance/sqlite.inc',
+                       'maintenance/userOptions.inc',
+                       'maintenance/backup.inc',
+                       'maintenance/cleanupTable.inc',
+                       'maintenance/importImages.inc',
+                       'maintenance/userDupes.inc',
+                       'maintenance/language/checkLanguage.inc',
+                       'maintenance/language/languages.inc',
+               ]
+       ),
 
        /**
         * A list of directories that should be parsed for class and
@@ -65,7 +70,6 @@ return [
                'resources/',
                'skins/',
                'vendor/',
-               'tests/phan/stubs/',
        ],
 
        /**
@@ -96,7 +100,7 @@ return [
                // External class
                'includes/libs/jsminplus.php',
                // separate repositories
-               'skins/'
+               'skins/',
        ],
 
        /**
@@ -129,7 +133,7 @@ return [
         * ```php
         * <?php
         * function test($arg):int {
-        *      return $arg;
+        *    return $arg;
         * }
         * test("abc");
         * ```
index e906cdb..7cd9016 100644 (file)
@@ -1,11 +1,11 @@
 <?php
 
-// @codingStandardsIgnoreFile
-
 /**
  * Minimal set of classes necessary for UserMailer to be happy. Types
  * taken from documentation at pear.php.net.
+ * @codingStandardsIgnoreFile
  */
+
 class PEAR {
        /**
         * @param mixed $data
index 0e83006..371731b 100644 (file)
@@ -12,6 +12,45 @@ class OutputPageTest extends MediaWikiTestCase {
        const SCREEN_MEDIA_QUERY = 'screen and (min-width: 982px)';
        const SCREEN_ONLY_MEDIA_QUERY = 'only screen and (min-width: 982px)';
 
+       /**
+        * @covers OutputPage::addMeta
+        * @covers OutputPage::getMetaTags
+        * @covers OutputPage::getHeadLinksArray
+        */
+       public function testMetaTags() {
+               $outputPage = $this->newInstance();
+               $outputPage->addMeta( 'http:expires', '0' );
+               $outputPage->addMeta( 'keywords', 'first' );
+               $outputPage->addMeta( 'keywords', 'second' );
+
+               $expected = [
+                       [ 'http:expires', '0' ],
+                       [ 'keywords', 'first' ],
+                       [ 'keywords', 'second' ],
+               ];
+               $this->assertSame( $expected, $outputPage->getMetaTags() );
+
+               $links = $outputPage->getHeadLinksArray();
+               $this->assertContains( '<meta http-equiv="expires" content="0"/>', $links );
+               $this->assertContains( '<meta name="keywords" content="first"/>', $links );
+               $this->assertContains( '<meta name="keywords" content="second"/>', $links );
+               $this->assertArrayNotHasKey( 'meta-robots', $links );
+       }
+
+       /**
+        * @covers OutputPage::setIndexPolicy
+        * @covers OutputPage::setFollowPolicy
+        * @covers OutputPage::getHeadLinksArray
+        */
+       public function testRobotsPolicies() {
+               $outputPage = $this->newInstance();
+               $outputPage->setIndexPolicy( 'noindex' );
+               $outputPage->setFollowPolicy( 'nofollow' );
+
+               $links = $outputPage->getHeadLinksArray();
+               $this->assertContains( '<meta name="robots" content="noindex,nofollow"/>', $links );
+       }
+
        /**
         * Tests a particular case of transformCssMedia, using the given input, globals,
         * expected return, and message
@@ -374,6 +413,29 @@ class OutputPageTest extends MediaWikiTestCase {
                $this->assertEquals( [ 0 => 'Test2' ], $outputPage->getCategories( 'normal' ) );
                $this->assertEquals( [ 0 => 'Test' ], $outputPage->getCategories( 'hidden' ) );
        }
+
+       /**
+        * @return OutputPage
+        */
+       private function newInstance() {
+               $context = new RequestContext();
+
+               $context->setConfig( new HashConfig( [
+                       'AppleTouchIcon' => false,
+                       'DisableLangConversion' => true,
+                       'EnableAPI' => false,
+                       'EnableCanonicalServerLink' => false,
+                       'Favicon' => false,
+                       'Feed' => false,
+                       'LanguageCode' => false,
+                       'ReferrerPolicy' => false,
+                       'RightsPage' => false,
+                       'RightsUrl' => false,
+                       'UniversalEditButton' => false,
+               ] ) );
+
+               return new OutputPage( $context );
+       }
 }
 
 /**
index f69ecaf..d93181c 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 
 class BalancerTest extends MediaWikiTestCase {
-       private $balancer;
 
        /**
         * Anything that needs to happen before your tests should go here.
@@ -11,20 +10,20 @@ class BalancerTest extends MediaWikiTestCase {
                // This makes sure that all the various cleanup and restorations
                // happen as they should (including the restoration for setMwGlobals).
                parent::setUp();
-               $this->balancer = new MediaWiki\Tidy\Balancer( [
-                       'strict' => false, /* not strict */
-                       'allowedHtmlElements' => null, /* no sanitization */
-                       'tidyCompat' => false, /* standard parser */
-                       'allowComments' => true, /* comment parsing */
-               ] );
        }
 
        /**
         * @covers MediaWiki\Tidy\Balancer::balance
         * @dataProvider provideBalancerTests
         */
-       public function testBalancer( $description, $input, $expected ) {
-               $output = $this->balancer->balance( $input );
+       public function testBalancer( $description, $input, $expected, $useTidy ) {
+               $balancer = new MediaWiki\Tidy\Balancer( [
+                       'strict' => false, /* not strict */
+                       'allowedHtmlElements' => null, /* no sanitization */
+                       'tidyCompat' => $useTidy, /* standard parser */
+                       'allowComments' => true, /* comment parsing */
+               ] );
+               $output = $balancer->balance( $input );
 
                // Ignore self-closing tags
                $output = preg_replace( '/\s*\/>/', '>', $output );
@@ -86,7 +85,7 @@ class BalancerTest extends MediaWikiTestCase {
                                        // Skip tests involving unusual doctypes.
                                        continue;
                                }
-                               $literalre = "~ <rdar: | <isindex | < /? (
+                               $literalre = "~ <rdar: | < /? (
                                        html | head | body | frame | frameset | plaintext
                                ) > ~xi";
                                if ( preg_match( $literalre, $case['data'] ) ) {
@@ -146,10 +145,20 @@ class BalancerTest extends MediaWikiTestCase {
                                $tests[] = [
                                        $filename, # use better description?
                                        $data,
-                                       $html
+                                       $html,
+                                       false # strict HTML5 compat mode, no tidy
                                ];
                        }
                }
+
+               # Some additional tests for mediawiki-specific features
+               $tests[] = [
+                       'Round-trip serialization for <pre>/<listing>/<textarea>',
+                       "<pre>\n\na</pre><listing>\n\nb</listing><textarea>\n\nc</textarea>",
+                       "<pre>\n\na</pre><listing>\n\nb</listing><textarea>\n\nc</textarea>",
+                       true # use the tidy-compatible mode
+               ];
+
                return $tests;
        }
 }
index beb3659..2b1c3e8 100644 (file)
         "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": "FOO&#11111111111ZOO",
       "errors": [
         "(1,3): expected-doctype-but-got-chars",
-        "(1,13): illegal-codepoint-for-numeric-entity"
+        "(1,16): numeric-entity-without-semicolon",
+        "(1,16): illegal-codepoint-for-numeric-entity"
       ],
       "document": {
         "props": {
       "data": "FOO&#1111111111ZOO",
       "errors": [
         "(1,3): expected-doctype-but-got-chars",
-        "(1,13): illegal-codepoint-for-numeric-entity"
+        "(1,15): numeric-entity-without-semicolon",
+        "(1,15): illegal-codepoint-for-numeric-entity"
       ],
       "document": {
         "props": {
       "data": "FOO&#111111111111ZOO",
       "errors": [
         "(1,3): expected-doctype-but-got-chars",
-        "(1,13): illegal-codepoint-for-numeric-entity"
+        "(1,17): numeric-entity-without-semicolon",
+        "(1,17): illegal-codepoint-for-numeric-entity"
       ],
       "document": {
         "props": {
     {
       "data": "<plaintext><foo>",
       "errors": [
-        "16: End of file seen and there were open elements.",
-        "11: Unclosed element “plaintext”."
+        "(1,16): expected-closing-tag-but-got-eof"
       ],
       "fragment": {
         "name": "desc",
       "data": "<isindex>",
       "errors": [
         "(1,9): expected-doctype-but-got-start-tag",
-        "(1,9): deprecated-tag"
+        "(1,9): expected-closing-tag-but-got-eof"
       ],
       "document": {
         "props": {
             "html": true,
             "head": true,
             "body": true,
-            "form": true,
-            "hr": true,
-            "label": true,
-            "input": true
+            "isindex": true
           }
         },
         "tree": [
                 "tag": "body",
                 "children": [
                   {
-                    "tag": "form",
-                    "children": [
-                      {
-                        "tag": "hr"
-                      },
-                      {
-                        "tag": "label",
-                        "children": [
-                          {
-                            "text": "This is a searchable index. Enter search keywords: "
-                          },
-                          {
-                            "tag": "input",
-                            "attrs": [
-                              {
-                                "name": "name",
-                                "value": "isindex"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "hr"
-                      }
-                    ]
+                    "tag": "isindex"
                   }
                 ]
               }
             ]
           }
         ],
-        "html": "<html><head></head><body><form><hr><label>This is a searchable index. Enter search keywords: <input name=\"isindex\"></label><hr></form></body></html>",
-        "noQuirksBodyHtml": "<form><hr><label>This is a searchable index. Enter search keywords: <input name=\"isindex\"></label><hr></form>"
+        "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): deprecated-tag"
+        "(1,48): expected-closing-tag-but-got-eof"
       ],
       "document": {
         "props": {
             "html": true,
             "head": true,
             "body": true,
-            "form": true,
-            "hr": true,
-            "label": true,
-            "input": true
+            "isindex": true
           }
         },
         "tree": [
                 "tag": "body",
                 "children": [
                   {
-                    "tag": "form",
+                    "tag": "isindex",
                     "attrs": [
                       {
                         "name": "action",
                         "value": "B"
-                      }
-                    ],
-                    "children": [
+                      },
                       {
-                        "tag": "hr"
+                        "name": "foo",
+                        "value": "D"
                       },
                       {
-                        "tag": "label",
-                        "children": [
-                          {
-                            "text": "C"
-                          },
-                          {
-                            "tag": "input",
-                            "attrs": [
-                              {
-                                "name": "foo",
-                                "value": "D"
-                              },
-                              {
-                                "name": "name",
-                                "value": "isindex"
-                              }
-                            ]
-                          }
-                        ]
+                        "name": "name",
+                        "value": "A"
                       },
                       {
-                        "tag": "hr"
+                        "name": "prompt",
+                        "value": "C"
                       }
                     ]
                   }
             ]
           }
         ],
-        "html": "<html><head></head><body><form action=\"B\"><hr><label>C<input name=\"isindex\" foo=\"D\"></label><hr></form></body></html>",
-        "noQuirksBodyHtml": "<form action=\"B\"><hr><label>C<input name=\"isindex\" foo=\"D\"></label><hr></form>"
+        "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): deprecated-tag",
         "(1,15): expected-closing-tag-but-got-eof"
       ],
       "document": {
             "html": true,
             "head": true,
             "body": true,
-            "form": true
+            "form": true,
+            "isindex": true
           }
         },
         "tree": [
                 "tag": "body",
                 "children": [
                   {
-                    "tag": "form"
+                    "tag": "form",
+                    "children": [
+                      {
+                        "tag": "isindex"
+                      }
+                    ]
                   }
                 ]
               }
             ]
           }
         ],
-        "html": "<html><head></head><body><form></form></body></html>",
-        "noQuirksBodyHtml": "<form></form>"
+        "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"
       }
     }
   ],
       }
     },
     {
-      "data": "<!doctype html><main><p>foo</main>bar",
-      "errors": [],
+      "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,
-            "body": true,
-            "main": true,
-            "p": true
+            "noscript": true,
+            "link": true,
+            "body": true
           },
-          "doctype": true
+          "comment": true
         },
         "tree": [
-          {
-            "doctype": "html"
-          },
           {
             "tag": "html",
             "children": [
               {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
+                "tag": "head",
                 "children": [
                   {
-                    "tag": "main",
+                    "tag": "noscript",
                     "children": [
                       {
-                        "tag": "p",
-                        "children": [
-                          {
-                            "text": "foo"
-                          }
-                        ]
+                        "tag": "link"
+                      },
+                      {
+                        "comment": "foo"
                       }
                     ]
-                  },
-                  {
-                    "text": "bar"
                   }
                 ]
+              },
+              {
+                "tag": "body"
               }
             ]
           }
         ],
-        "html": "<!DOCTYPE html><html><head></head><body><main><p>foo</p></main>bar</body></html>",
-        "noQuirksBodyHtml": "<main><p>foo</p></main>bar"
+        "html": "<html><head><noscript><link><!--foo--></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><link><!--foo--></noscript>"
       }
     },
     {
-      "data": "<!DOCTYPE html>xxx<svg><x><g><a><main><b>",
+      "data": "<head><noscript><meta><!--foo--></noscript>",
       "errors": [
-        " * (1,42) unexpected HTML-like start tag token in foreign content",
-        " * (1,42) unexpected end of file"
+        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE."
       ],
+      "script": "off",
       "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
+            "noscript": true,
+            "meta": true,
+            "body": true
           },
-          "doctype": true
+          "comment": true
         },
         "tree": [
-          {
-            "doctype": "html"
-          },
           {
             "tag": "html",
             "children": [
               {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
+                "tag": "head",
                 "children": [
                   {
-                    "text": "xxx"
-                  },
-                  {
-                    "tag": "svg",
-                    "ns": "http://www.w3.org/2000/svg",
+                    "tag": "noscript",
                     "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": "meta"
+                      },
+                      {
+                        "comment": "foo"
                       }
                     ]
-                  },
-                  {
-                    "tag": "b"
                   }
                 ]
+              },
+              {
+                "tag": "body"
               }
             ]
           }
         ],
-        "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>"
+        "html": "<html><head><noscript><meta><!--foo--></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><meta><!--foo--></noscript>"
       }
-    }
-  ],
-  "math.dat": [
+    },
     {
-      "data": "<math><tr><td><mo><tr>",
-      "errors": [],
-      "fragment": {
-        "name": "td"
-      },
+      "data": "<head><noscript><noframes>XXX</noscript></noframes></noscript>",
+      "errors": [
+        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE."
+      ],
+      "script": "off",
       "document": {
         "props": {
           "tags": {
-            "math math": true,
-            "math tr": true,
-            "math td": true,
-            "math mo": true
-          }
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "noframes": true,
+            "body": true
+          },
+          "no_escape": true
         },
         "tree": [
           {
-            "tag": "math",
-            "ns": "http://www.w3.org/1998/Math/MathML",
+            "tag": "html",
             "children": [
               {
-                "tag": "tr",
-                "ns": "http://www.w3.org/1998/Math/MathML",
+                "tag": "head",
                 "children": [
                   {
-                    "tag": "td",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "tag": "noscript",
                     "children": [
                       {
-                        "tag": "mo",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
+                        "tag": "noframes",
+                        "children": [
+                          {
+                            "text": "XXX</noscript>",
+                            "no_escape": true
+                          }
+                        ]
                       }
                     ]
                   }
                 ]
+              },
+              {
+                "tag": "body"
               }
             ]
           }
         ],
-        "html": "<math><tr><td><mo></mo></td></tr></math>",
-        "noQuirksBodyHtml": "<math><tr><td><mo></mo></td></tr></math>"
+        "html": "<html><head><noscript><noframes>XXX</noscript></noframes></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><noframes>XXX</noscript></noframes></noscript>"
       }
     },
     {
-      "data": "<math><tr><td><mo><tr>",
-      "errors": [],
-      "fragment": {
-        "name": "tr"
-      },
+      "data": "<head><noscript><style>XXX</style></noscript>",
+      "errors": [
+        "Line: 1 Col: 6 Unexpected start tag (head). Expected DOCTYPE."
+      ],
+      "script": "off",
       "document": {
         "props": {
           "tags": {
-            "math math": true,
-            "math tr": true,
-            "math td": true,
-            "math mo": true
-          }
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "style": true,
+            "body": true
+          },
+          "no_escape": true
         },
         "tree": [
           {
-            "tag": "math",
-            "ns": "http://www.w3.org/1998/Math/MathML",
+            "tag": "html",
             "children": [
               {
-                "tag": "tr",
-                "ns": "http://www.w3.org/1998/Math/MathML",
+                "tag": "head",
                 "children": [
                   {
-                    "tag": "td",
-                    "ns": "http://www.w3.org/1998/Math/MathML",
+                    "tag": "noscript",
                     "children": [
                       {
-                        "tag": "mo",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
+                        "tag": "style",
+                        "children": [
+                          {
+                            "text": "XXX",
+                            "no_escape": true
+                          }
+                        ]
                       }
                     ]
                   }
                 ]
+              },
+              {
+                "tag": "body"
               }
             ]
           }
         ],
-        "html": "<math><tr><td><mo></mo></td></tr></math>",
-        "noQuirksBodyHtml": "<math><tr><td><mo></mo></td></tr></math>"
+        "html": "<html><head><noscript><style>XXX</style></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><style>XXX</style></noscript>"
       }
     },
     {
-      "data": "<math><thead><mo><tbody>",
-      "errors": [],
-      "fragment": {
-        "name": "thead"
-      },
+      "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": {
-            "math math": true,
-            "math thead": true,
-            "math mo": true
-          }
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true,
+            "br": true
+          },
+          "comment": true
         },
         "tree": [
           {
-            "tag": "math",
-            "ns": "http://www.w3.org/1998/Math/MathML",
+            "tag": "html",
             "children": [
               {
-                "tag": "thead",
-                "ns": "http://www.w3.org/1998/Math/MathML",
+                "tag": "head",
                 "children": [
                   {
-                    "tag": "mo",
-                    "ns": "http://www.w3.org/1998/Math/MathML"
+                    "tag": "noscript"
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "br"
+                  },
+                  {
+                    "comment": "foo"
                   }
                 ]
               }
             ]
           }
         ],
-        "html": "<math><thead><mo></mo></thead></math>",
-        "noQuirksBodyHtml": "<math><thead><mo></mo></thead></math>"
+        "html": "<html><head><noscript></noscript></head><body><br><!--foo--></body></html>",
+        "noQuirksBodyHtml": "<noscript><br><!--foo--></noscript>"
       }
     },
     {
-      "data": "<math><tfoot><mo><tbody>",
-      "errors": [],
-      "fragment": {
-        "name": "tfoot"
-      },
+      "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": {
-            "math math": true,
-            "math tfoot": true,
-            "math mo": true
-          }
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "comment": true
         },
         "tree": [
           {
-            "tag": "math",
-            "ns": "http://www.w3.org/1998/Math/MathML",
+            "tag": "html",
             "children": [
               {
-                "tag": "tfoot",
-                "ns": "http://www.w3.org/1998/Math/MathML",
+                "tag": "head",
                 "children": [
                   {
-                    "tag": "mo",
-                    "ns": "http://www.w3.org/1998/Math/MathML"
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "comment": "foo"
+                      }
+                    ]
                   }
                 ]
+              },
+              {
+                "tag": "body"
               }
             ]
           }
         ],
-        "html": "<math><tfoot><mo></mo></tfoot></math>",
-        "noQuirksBodyHtml": "<math><tfoot><mo></mo></tfoot></math>"
+        "html": "<html><head><noscript><!--foo--></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><!--foo--></noscript>"
       }
     },
     {
-      "data": "<math><tbody><mo><tfoot>",
-      "errors": [],
-      "fragment": {
-        "name": "tbody"
-      },
+      "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": {
-            "math math": true,
-            "math tbody": true,
-            "math mo": true
-          }
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "comment": true
         },
         "tree": [
           {
-            "tag": "math",
-            "ns": "http://www.w3.org/1998/Math/MathML",
+            "tag": "html",
             "children": [
               {
-                "tag": "tbody",
-                "ns": "http://www.w3.org/1998/Math/MathML",
+                "tag": "head",
                 "children": [
                   {
-                    "tag": "mo",
-                    "ns": "http://www.w3.org/1998/Math/MathML"
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "comment": "foo"
+                      }
+                    ]
                   }
                 ]
+              },
+              {
+                "tag": "body"
               }
             ]
           }
         ],
-        "html": "<math><tbody><mo></mo></tbody></math>",
-        "noQuirksBodyHtml": "<math><tbody><mo></mo></tbody></math>"
+        "html": "<html><head><noscript><!--foo--></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><noscript class=\"foo\"><!--foo--></noscript></noscript>"
       }
     },
     {
-      "data": "<math><tbody><mo></table>",
-      "errors": [],
-      "fragment": {
-        "name": "tbody"
-      },
+      "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": {
-            "math math": true,
-            "math tbody": true,
-            "math mo": true
-          }
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "comment": true
         },
         "tree": [
           {
-            "tag": "math",
-            "ns": "http://www.w3.org/1998/Math/MathML",
+            "tag": "html",
             "children": [
               {
-                "tag": "tbody",
-                "ns": "http://www.w3.org/1998/Math/MathML",
+                "tag": "head",
                 "children": [
                   {
-                    "tag": "mo",
-                    "ns": "http://www.w3.org/1998/Math/MathML"
+                    "tag": "noscript",
+                    "children": [
+                      {
+                        "comment": "foo"
+                      }
+                    ]
                   }
                 ]
+              },
+              {
+                "tag": "body"
               }
             ]
           }
         ],
-        "html": "<math><tbody><mo></mo></tbody></math>",
-        "noQuirksBodyHtml": "<math><tbody><mo></mo></tbody></math>"
+        "html": "<html><head><noscript><!--foo--></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript><p></p><!--foo--></noscript>"
       }
     },
     {
-      "data": "<math><thead><mo></table>",
-      "errors": [],
-      "fragment": {
-        "name": "tbody"
-      },
+      "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": {
-            "math math": true,
-            "math thead": true,
-            "math mo": true
-          }
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true,
+            "p": true
+          },
+          "comment": true
         },
         "tree": [
           {
-            "tag": "math",
-            "ns": "http://www.w3.org/1998/Math/MathML",
+            "tag": "html",
             "children": [
               {
-                "tag": "thead",
-                "ns": "http://www.w3.org/1998/Math/MathML",
+                "tag": "head",
                 "children": [
                   {
-                    "tag": "mo",
-                    "ns": "http://www.w3.org/1998/Math/MathML"
+                    "tag": "noscript"
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "tag": "p",
+                    "children": [
+                      {
+                        "comment": "foo"
+                      }
+                    ]
                   }
                 ]
               }
             ]
           }
         ],
-        "html": "<math><thead><mo></mo></thead></math>",
-        "noQuirksBodyHtml": "<math><thead><mo></mo></thead></math>"
+        "html": "<html><head><noscript></noscript></head><body><p><!--foo--></p></body></html>",
+        "noQuirksBodyHtml": "<noscript><p><!--foo--></p></noscript>"
       }
     },
     {
-      "data": "<math><tfoot><mo></table>",
-      "errors": [],
-      "fragment": {
-        "name": "tbody"
-      },
+      "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": {
-            "math math": true,
-            "math tfoot": true,
-            "math mo": true
-          }
+            "html": true,
+            "head": true,
+            "noscript": true,
+            "body": true
+          },
+          "comment": true
         },
         "tree": [
           {
-            "tag": "math",
-            "ns": "http://www.w3.org/1998/Math/MathML",
+            "tag": "html",
             "children": [
               {
-                "tag": "tfoot",
-                "ns": "http://www.w3.org/1998/Math/MathML",
+                "tag": "head",
                 "children": [
                   {
-                    "tag": "mo",
-                    "ns": "http://www.w3.org/1998/Math/MathML"
+                    "tag": "noscript"
+                  }
+                ]
+              },
+              {
+                "tag": "body",
+                "children": [
+                  {
+                    "text": "XXX"
+                  },
+                  {
+                    "comment": "foo"
                   }
                 ]
               }
             ]
           }
         ],
-        "html": "<math><tfoot><mo></mo></tfoot></math>",
-        "noQuirksBodyHtml": "<math><tfoot><mo></mo></tfoot></math>"
+        "html": "<html><head><noscript></noscript></head><body>XXX<!--foo--></body></html>",
+        "noQuirksBodyHtml": "<noscript>XXX<!--foo--></noscript>"
       }
-    }
-  ],
-  "namespace-sensitivity.dat": [
+    },
     {
-      "data": "<body><table><tr><td><svg><td><foreignObject><span></td>Foo",
-      "errors": [],
+      "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,
-            "body": true,
-            "table": true,
-            "tbody": true,
-            "tr": true,
-            "td": true,
-            "svg svg": true,
-            "svg td": true,
-            "svg foreignObject": true,
-            "span": true
+            "noscript": true,
+            "body": true
           }
         },
         "tree": [
             "tag": "html",
             "children": [
               {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
+                "tag": "head",
                 "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"
-                                              }
-                                            ]
-                                          }
-                                        ]
-                                      }
-                                    ]
-                                  }
-                                ]
-                              }
-                            ]
-                          }
-                        ]
-                      }
-                    ]
+                    "tag": "noscript"
                   }
                 ]
+              },
+              {
+                "tag": "body"
               }
             ]
           }
         ],
-        "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>"
+        "html": "<html><head><noscript></noscript></head><body></body></html>",
+        "noQuirksBodyHtml": "<noscript></noscript>"
       }
     }
   ],
             "body": true,
             "pre": true
           },
-          "doctype": true,
-          "extraNL": true
+          "doctype": true
         },
         "tree": [
           {
                     "tag": "pre",
                     "children": [
                       {
-                        "text": "\nA",
-                        "extraNL": true
+                        "text": "\nA"
                       }
                     ]
                   }
             ]
           }
         ],
-        "html": "<!DOCTYPE html><html><head></head><body><pre>\n\nA</pre></body></html>",
-        "noQuirksBodyHtml": "<pre>\n\nA</pre>"
+        "html": "<!DOCTYPE html><html><head></head><body><pre>\nA</pre></body></html>",
+        "noQuirksBodyHtml": "<pre>\nA</pre>"
       }
     },
     {
             "body": true,
             "pre": true
           },
-          "doctype": true,
-          "extraNL": true
+          "doctype": true
         },
         "tree": [
           {
                     "tag": "pre",
                     "children": [
                       {
-                        "text": "\nA",
-                        "extraNL": true
+                        "text": "\nA"
                       }
                     ]
                   }
             ]
           }
         ],
-        "html": "<!DOCTYPE html><html><head></head><body><pre>\n\nA</pre></body></html>",
-        "noQuirksBodyHtml": "<pre>\n\nA</pre>"
+        "html": "<!DOCTYPE html><html><head></head><body><pre>\nA</pre></body></html>",
+        "noQuirksBodyHtml": "<pre>\nA</pre>"
       }
     },
     {
     {
       "data": "<html><ruby>a<rb>b<span></ruby></html>",
       "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,31): unexpected-end-tag"
       ],
       "document": {
         "props": {
     {
       "data": "<html><ruby>a<rt>b<span></ruby></html>",
       "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,31): unexpected-end-tag"
       ],
       "document": {
         "props": {
     {
       "data": "<html><ruby>a<rp>b<span></ruby></html>",
       "errors": [
-        "(1,6): expected-doctype-but-got-start-tag"
+        "(1,6): expected-doctype-but-got-start-tag",
+        "(1,31): unexpected-end-tag"
       ],
       "document": {
         "props": {
         "(1,11): unexpected-start-tag-in-select",
         "(1,27): unexpected-select-in-select",
         "(1,39): unexpected-end-tag",
-        "(1,48): unexpected-end-tag",
-        "(1,49): expected-closing-tag-but-got-eof"
+        "(1,48): unexpected-end-tag"
       ],
       "document": {
         "props": {
         "(1,11): unexpected-start-tag-in-select",
         "(1,27): unexpected-select-in-select",
         "(1,39): unexpected-end-tag",
-        "(1,48): unexpected-end-tag",
-        "(1,48): expected-closing-tag-but-got-eof"
+        "(1,48): unexpected-end-tag"
       ],
       "document": {
         "props": {
         "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": [],
     {
       "data": "<!doctype html><script><!",
       "errors": [
+        "(1,25): expected-script-data-but-got-eof",
         "(1,25): expected-named-closing-tag-but-got-eof"
       ],
       "document": {
           }
         ],
         "html": "<!DOCTYPE html><html><head><noscript><!--<noscript></noscript></head><body>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<noscript>&lt;!--&lt;noscript&gt;</noscript>--&gt;"
+        "noQuirksBodyHtml": "<noscript><!--<noscript></noscript>--></noscript>"
       }
     },
     {
           }
         ],
         "html": "<!DOCTYPE html><html><head><noscript><!--<noscript></noscript>--></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript>&lt;!--&lt;noscript&gt;</noscript>--&gt;"
+        "noQuirksBodyHtml": "<noscript><!--<noscript></noscript>--></noscript>"
       }
     },
     {
           }
         ],
         "html": "<!DOCTYPE html><html><head><noscript><!--</noscript></head><body>X<noscript>--></noscript></body></html>",
-        "noQuirksBodyHtml": "<noscript>&lt;!--</noscript>X<noscript>--&gt;</noscript>"
+        "noQuirksBodyHtml": "<noscript><!--</noscript>X<noscript>--></noscript>"
       }
     },
     {
           }
         ],
         "html": "<!DOCTYPE html><html><head><noscript><!--</noscript>X<noscript>--></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript>&lt;!--</noscript>X<noscript>--&gt;</noscript>"
+        "noQuirksBodyHtml": "<noscript><!--</noscript>X<noscript>--></noscript>"
       }
     },
     {
           }
         ],
         "html": "<!DOCTYPE html><html><head><noscript><iframe></noscript></head><body>X</body></html>",
-        "noQuirksBodyHtml": "<noscript>&lt;iframe&gt;</noscript>X"
+        "noQuirksBodyHtml": "<noscript><iframe></noscript>X</iframe></noscript>"
       }
     },
     {
           }
         ],
         "html": "<!DOCTYPE html><html><head><noscript></noscript></head><body><iframe></noscript>X</iframe></body></html>",
-        "noQuirksBodyHtml": "<noscript>&lt;iframe&gt;</noscript>X"
+        "noQuirksBodyHtml": "<noscript><iframe></noscript>X</iframe></noscript>"
       }
     },
     {
       "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": {
           }
         ],
         "html": "<html><head><noscript><!--<noscript></noscript></head><body>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<noscript>&lt;!--&lt;noscript&gt;</noscript>--&gt;"
+        "noQuirksBodyHtml": "<noscript><!--<noscript></noscript>--></noscript>"
       }
     },
     {
           }
         ],
         "html": "<html><head><noscript><!--<noscript></noscript>--></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript>&lt;!--&lt;noscript&gt;</noscript>--&gt;"
+        "noQuirksBodyHtml": "<noscript><!--<noscript></noscript>--></noscript>"
       }
     },
     {
           }
         ],
         "html": "<html><head><noscript><!--</noscript></head><body>X<noscript>--></noscript></body></html>",
-        "noQuirksBodyHtml": "<noscript>&lt;!--</noscript>X<noscript>--&gt;</noscript>"
+        "noQuirksBodyHtml": "<noscript><!--</noscript>X<noscript>--></noscript>"
       }
     },
     {
           }
         ],
         "html": "<html><head><noscript><!--</noscript>X<noscript>--></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript>&lt;!--</noscript>X<noscript>--&gt;</noscript>"
+        "noQuirksBodyHtml": "<noscript><!--</noscript>X<noscript>--></noscript>"
       }
     },
     {
           }
         ],
         "html": "<html><head><noscript><iframe></noscript></head><body>X</body></html>",
-        "noQuirksBodyHtml": "<noscript>&lt;iframe&gt;</noscript>X"
+        "noQuirksBodyHtml": "<noscript><iframe></noscript>X</iframe></noscript>"
       }
     },
     {
           }
         ],
         "html": "<html><head><noscript></noscript></head><body><iframe></noscript>X</iframe></body></html>",
-        "noQuirksBodyHtml": "<noscript>&lt;iframe&gt;</noscript>X"
+        "noQuirksBodyHtml": "<noscript><iframe></noscript>X</iframe></noscript>"
       }
     },
     {
         "noQuirksBodyHtml": "<p></p><h1></h1>"
       }
     },
-    {
-      "data": "<!doctype html><form><isindex>",
-      "errors": [
-        "(1,30): deprecated-tag",
-        "(1,30): expected-closing-tag-but-got-eof"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "form": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "form"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><form></form></body></html>",
-        "noQuirksBodyHtml": "<form></form>"
-      }
-    },
-    {
-      "data": "<!doctype html><isindex action=\"POST\">",
-      "errors": [
-        "(1,38): deprecated-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "form": true,
-            "hr": true,
-            "label": true,
-            "input": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "form",
-                    "attrs": [
-                      {
-                        "name": "action",
-                        "value": "POST"
-                      }
-                    ],
-                    "children": [
-                      {
-                        "tag": "hr"
-                      },
-                      {
-                        "tag": "label",
-                        "children": [
-                          {
-                            "text": "This is a searchable index. Enter search keywords: "
-                          },
-                          {
-                            "tag": "input",
-                            "attrs": [
-                              {
-                                "name": "name",
-                                "value": "isindex"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "hr"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><form action=\"POST\"><hr><label>This is a searchable index. Enter search keywords: <input name=\"isindex\"></label><hr></form></body></html>",
-        "noQuirksBodyHtml": "<form action=\"POST\"><hr><label>This is a searchable index. Enter search keywords: <input name=\"isindex\"></label><hr></form>"
-      }
-    },
-    {
-      "data": "<!doctype html><isindex prompt=\"this is isindex\">",
-      "errors": [
-        "(1,49): deprecated-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "form": true,
-            "hr": true,
-            "label": true,
-            "input": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "form",
-                    "children": [
-                      {
-                        "tag": "hr"
-                      },
-                      {
-                        "tag": "label",
-                        "children": [
-                          {
-                            "text": "this is isindex"
-                          },
-                          {
-                            "tag": "input",
-                            "attrs": [
-                              {
-                                "name": "name",
-                                "value": "isindex"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "hr"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><form><hr><label>this is isindex<input name=\"isindex\"></label><hr></form></body></html>",
-        "noQuirksBodyHtml": "<form><hr><label>this is isindex<input name=\"isindex\"></label><hr></form>"
-      }
-    },
     {
       "data": "<!doctype html><isindex type=\"hidden\">",
       "errors": [
-        "(1,38): deprecated-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "form": true,
-            "hr": true,
-            "label": true,
-            "input": true
-          },
-          "doctype": true
-        },
-        "tree": [
-          {
-            "doctype": "html"
-          },
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "form",
-                    "children": [
-                      {
-                        "tag": "hr"
-                      },
-                      {
-                        "tag": "label",
-                        "children": [
-                          {
-                            "text": "This is a searchable index. Enter search keywords: "
-                          },
-                          {
-                            "tag": "input",
-                            "attrs": [
-                              {
-                                "name": "name",
-                                "value": "isindex"
-                              },
-                              {
-                                "name": "type",
-                                "value": "hidden"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "hr"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><form><hr><label>This is a searchable index. Enter search keywords: <input name=\"isindex\" type=\"hidden\"></label><hr></form></body></html>",
-        "noQuirksBodyHtml": "<form><hr><label>This is a searchable index. Enter search keywords: <input name=\"isindex\" type=\"hidden\"></label><hr></form>"
-      }
-    },
-    {
-      "data": "<!doctype html><isindex name=\"foo\">",
-      "errors": [
-        "(1,35): deprecated-tag"
+        "(1,38): expected-closing-tag-but-got-eof"
       ],
       "document": {
         "props": {
             "html": true,
             "head": true,
             "body": true,
-            "form": true,
-            "hr": true,
-            "label": true,
-            "input": true
+            "isindex": true
           },
           "doctype": true
         },
                 "tag": "body",
                 "children": [
                   {
-                    "tag": "form",
-                    "children": [
-                      {
-                        "tag": "hr"
-                      },
-                      {
-                        "tag": "label",
-                        "children": [
-                          {
-                            "text": "This is a searchable index. Enter search keywords: "
-                          },
-                          {
-                            "tag": "input",
-                            "attrs": [
-                              {
-                                "name": "name",
-                                "value": "isindex"
-                              }
-                            ]
-                          }
-                        ]
-                      },
+                    "tag": "isindex",
+                    "attrs": [
                       {
-                        "tag": "hr"
+                        "name": "type",
+                        "value": "hidden"
                       }
                     ]
                   }
             ]
           }
         ],
-        "html": "<!DOCTYPE html><html><head></head><body><form><hr><label>This is a searchable index. Enter search keywords: <input name=\"isindex\"></label><hr></form></body></html>",
-        "noQuirksBodyHtml": "<form><hr><label>This is a searchable index. Enter search keywords: <input name=\"isindex\"></label><hr></form>"
+        "html": "<!DOCTYPE html><html><head></head><body><isindex type=\"hidden\"></isindex></body></html>",
+        "noQuirksBodyHtml": "<isindex type=\"hidden\"></isindex>"
       }
     },
     {
     {
       "data": "<!DOCTYPE html><select><optgroup><option></optgroup><option><select><option>",
       "errors": [
-        "(1,68): unexpected-select-in-select",
-        "(1,76): expected-closing-tag-but-got-eof"
+        "(1,68): unexpected-select-in-select"
       ],
       "document": {
         "props": {
         "noQuirksBodyHtml": "<!-- XXX - XXX - XXX -->"
       }
     },
-    {
-      "data": "<isindex test=x name=x>",
-      "errors": [
-        "(1,23): expected-doctype-but-got-start-tag",
-        "(1,23): deprecated-tag"
-      ],
-      "document": {
-        "props": {
-          "tags": {
-            "html": true,
-            "head": true,
-            "body": true,
-            "form": true,
-            "hr": true,
-            "label": true,
-            "input": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "html",
-            "children": [
-              {
-                "tag": "head"
-              },
-              {
-                "tag": "body",
-                "children": [
-                  {
-                    "tag": "form",
-                    "children": [
-                      {
-                        "tag": "hr"
-                      },
-                      {
-                        "tag": "label",
-                        "children": [
-                          {
-                            "text": "This is a searchable index. Enter search keywords: "
-                          },
-                          {
-                            "tag": "input",
-                            "attrs": [
-                              {
-                                "name": "name",
-                                "value": "isindex"
-                              },
-                              {
-                                "name": "test",
-                                "value": "x"
-                              }
-                            ]
-                          }
-                        ]
-                      },
-                      {
-                        "tag": "hr"
-                      }
-                    ]
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<html><head></head><body><form><hr><label>This is a searchable index. Enter search keywords: <input name=\"isindex\" test=\"x\"></label><hr></form></body></html>",
-        "noQuirksBodyHtml": "<form><hr><label>This is a searchable index. Enter search keywords: <input name=\"isindex\" test=\"x\"></label><hr></form>"
-      }
-    },
     {
       "data": "test\ntest",
       "errors": [
     {
       "data": "<option><option>",
       "errors": [
-        "(1,8): expected-doctype-but-got-start-tag",
-        "(1,16): expected-closing-tag-but-got-eof"
+        "(1,8): expected-doctype-but-got-start-tag"
       ],
       "document": {
         "props": {
                     "children": [
                       {
                         "tag": "annotation-xml",
-                        "ns": "http://www.w3.org/1998/Math/MathML"
+                        "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"
+                          }
+                        ]
                       }
                     ]
-                  },
-                  {
-                    "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>"
+        "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=\"application/svg+xml\"><div>",
+      "data": "<math><annotation-xml encoding=\"Text/htmL\"><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"
+        "(1,48): expected-closing-tag-but-got-eof"
       ],
       "document": {
         "props": {
                         "attrs": [
                           {
                             "name": "encoding",
-                            "value": "application/svg+xml"
+                            "value": "Text/htmL"
+                          }
+                        ],
+                        "children": [
+                          {
+                            "tag": "div"
                           }
                         ]
                       }
                     ]
-                  },
-                  {
-                    "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>"
+        "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=\"application/xhtml+xml\"><div>",
+      "data": "<math><annotation-xml encoding=\" text/html \"><div>",
       "errors": [
         "(1,6): expected-doctype-but-got-start-tag",
-        "(1,60): expected-closing-tag-but-got-eof"
+        "(1,50): unexpected-html-element-in-foreign-content",
+        "(1,50): expected-closing-tag-but-got-eof"
       ],
       "document": {
         "props": {
                         "attrs": [
                           {
                             "name": "encoding",
-                            "value": "application/xhtml+xml"
-                          }
-                        ],
-                        "children": [
-                          {
-                            "tag": "div"
+                            "value": " text/html "
                           }
                         ]
                       }
                     ]
+                  },
+                  {
+                    "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>"
+        "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 encoding=\"aPPlication/xhtmL+xMl\"><div>",
+      "data": "<math><annotation-xml> </annotation-xml>",
       "errors": [
         "(1,6): expected-doctype-but-got-start-tag",
-        "(1,60): expected-closing-tag-but-got-eof"
+        "(1,40): expected-closing-tag-but-got-eof"
       ],
       "document": {
         "props": {
             "head": true,
             "body": true,
             "math math": true,
-            "math annotation-xml": true,
-            "div": true
+            "math annotation-xml": true
           }
         },
         "tree": [
                       {
                         "tag": "annotation-xml",
                         "ns": "http://www.w3.org/1998/Math/MathML",
-                        "attrs": [
-                          {
-                            "name": "encoding",
-                            "value": "aPPlication/xhtmL+xMl"
-                          }
-                        ],
                         "children": [
                           {
-                            "tag": "div"
+                            "text": " "
                           }
                         ]
                       }
             ]
           }
         ],
-        "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>"
+        "html": "<html><head></head><body><math><annotation-xml</annotation-xml></math></body></html>",
+        "noQuirksBodyHtml": "<math><annotation-xml</annotation-xml></math>"
       }
     },
     {
-      "data": "<math><annotation-xml encoding=\"text/html\"><div>",
+      "data": "<math><annotation-xml>c</annotation-xml>",
       "errors": [
         "(1,6): expected-doctype-but-got-start-tag",
-        "(1,48): expected-closing-tag-but-got-eof"
+        "(1,40): expected-closing-tag-but-got-eof"
       ],
       "document": {
         "props": {
             "head": true,
             "body": true,
             "math math": true,
-            "math annotation-xml": true,
-            "div": true
+            "math annotation-xml": true
           }
         },
         "tree": [
                       {
                         "tag": "annotation-xml",
                         "ns": "http://www.w3.org/1998/Math/MathML",
-                        "attrs": [
+                        "children": [
                           {
-                            "name": "encoding",
-                            "value": "text/html"
+                            "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": [
                           {
-                            "tag": "div"
+                            "comment": "foo"
                           }
                         ]
                       }
             ]
           }
         ],
-        "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>"
+        "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 encoding=\"Text/htmL\"><div>",
+      "data": "<math><annotation-xml></svg>x",
       "errors": [
         "(1,6): expected-doctype-but-got-start-tag",
-        "(1,48): expected-closing-tag-but-got-eof"
+        "(1,28): unexpected-end-tag",
+        "(1,29): expected-closing-tag-but-got-eof"
       ],
       "document": {
         "props": {
             "head": true,
             "body": true,
             "math math": true,
-            "math annotation-xml": true,
-            "div": true
+            "math annotation-xml": true
           }
         },
         "tree": [
                       {
                         "tag": "annotation-xml",
                         "ns": "http://www.w3.org/1998/Math/MathML",
-                        "attrs": [
-                          {
-                            "name": "encoding",
-                            "value": "Text/htmL"
-                          }
-                        ],
                         "children": [
                           {
-                            "tag": "div"
+                            "text": "x"
                           }
                         ]
                       }
             ]
           }
         ],
-        "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>"
+        "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 encoding=\" text/html \"><div>",
+      "data": "<math><annotation-xml><svg>x",
       "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"
+        "(1,28): expected-closing-tag-but-got-eof"
       ],
       "document": {
         "props": {
             "body": true,
             "math math": true,
             "math annotation-xml": true,
-            "div": true
+            "svg svg": true
           }
         },
         "tree": [
                       {
                         "tag": "annotation-xml",
                         "ns": "http://www.w3.org/1998/Math/MathML",
-                        "attrs": [
+                        "children": [
                           {
-                            "name": "encoding",
-                            "value": " text/html "
+                            "tag": "svg",
+                            "ns": "http://www.w3.org/2000/svg",
+                            "children": [
+                              {
+                                "text": "x"
+                              }
+                            ]
                           }
                         ]
                       }
                     ]
-                  },
-                  {
-                    "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>"
+        "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>"
       }
     }
   ],
         "noQuirksBodyHtml": "<command>A</command>"
       }
     },
-    {
-      "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"
-                  },
-                  {
-                    "text": "A"
-                  }
-                ]
-              }
-            ]
-          }
-        ],
-        "html": "<!DOCTYPE html><html><head></head><body><menuitem>A</body></html>",
-        "noQuirksBodyHtml": "<menuitem>A"
-      }
-    },
     {
       "data": "<!DOCTYPE html><body><embed>A",
       "errors": [],
             "body": true,
             "pre": true
           },
-          "doctype": true,
-          "extraNL": true
+          "doctype": true
         },
         "tree": [
           {
                     "tag": "pre",
                     "children": [
                       {
-                        "text": "\nfoo",
-                        "extraNL": true
+                        "text": "\nfoo"
                       }
                     ]
                   }
             ]
           }
         ],
-        "html": "<!DOCTYPE html><html><head></head><body><pre>\n\nfoo</pre></body></html>",
-        "noQuirksBodyHtml": "<pre>\n\nfoo</pre>"
+        "html": "<!DOCTYPE html><html><head></head><body><pre>\nfoo</pre></body></html>",
+        "noQuirksBodyHtml": "<pre>\nfoo</pre>"
       }
     },
     {
             "body": true,
             "pre": true
           },
-          "doctype": true,
-          "extraNL": true
+          "doctype": true
         },
         "tree": [
           {
                     "tag": "pre",
                     "children": [
                       {
-                        "text": "\nA",
-                        "extraNL": true
+                        "text": "\nA"
                       }
                     ]
                   }
             ]
           }
         ],
-        "html": "<!DOCTYPE html><html><head></head><body><pre>\n\nA</pre></body></html>",
-        "noQuirksBodyHtml": "<pre>\n\nA</pre>"
+        "html": "<!DOCTYPE html><html><head></head><body><pre>\nA</pre></body></html>",
+        "noQuirksBodyHtml": "<pre>\nA</pre>"
       }
     },
     {
             "body": true,
             "textarea": true
           },
-          "doctype": true,
-          "extraNL": true
+          "doctype": true
         },
         "tree": [
           {
                     "tag": "textarea",
                     "children": [
                       {
-                        "text": "\nfoo",
-                        "extraNL": true
+                        "text": "\nfoo"
                       }
                     ]
                   }
             ]
           }
         ],
-        "html": "<!DOCTYPE html><html><head></head><body><textarea>\n\nfoo</textarea></body></html>",
-        "noQuirksBodyHtml": "<textarea>\n\nfoo</textarea>"
+        "html": "<!DOCTYPE html><html><head></head><body><textarea>\nfoo</textarea></body></html>",
+        "noQuirksBodyHtml": "<textarea>\nfoo</textarea>"
       }
     },
     {
           }
         ],
         "html": "<html><head><noscript><!--</noscript></head><body>--&gt;</body></html>",
-        "noQuirksBodyHtml": "<noscript>&lt;!--</noscript>--&gt;"
+        "noQuirksBodyHtml": "<noscript><!--</noscript>--></noscript>"
       }
     },
     {
           }
         ],
         "html": "<html><head><noscript><!--</noscript>--></noscript></head><body></body></html>",
-        "noQuirksBodyHtml": "<noscript>&lt;!--</noscript>--&gt;"
+        "noQuirksBodyHtml": "<noscript><!--</noscript>--></noscript>"
       }
     }
   ],
         "(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": {
     {
       "data": "</select><option>",
       "errors": [
-        "(1,9): XXX-undefined-error",
-        "(1,17): eof-in-select"
+        "(1,9): XXX-undefined-error"
       ],
       "fragment": {
         "name": "select"
     {
       "data": "<input><option>",
       "errors": [
-        "(1,7): unexpected-input-in-select",
-        "(1,15): eof-in-select"
+        "(1,7): unexpected-input-in-select"
       ],
       "fragment": {
         "name": "select"
     {
       "data": "<keygen><option>",
       "errors": [
-        "(1,8): unexpected-input-in-select",
-        "(1,16): eof-in-select"
+        "(1,8): unexpected-input-in-select"
       ],
       "fragment": {
         "name": "select"
     {
       "data": "<textarea><option>",
       "errors": [
-        "(1,10): unexpected-input-in-select",
-        "(1,18): eof-in-select"
+        "(1,10): unexpected-input-in-select"
       ],
       "fragment": {
         "name": "select"
         "(1,25): unexpected-select-in-select",
         "(1,59): unexpected-select-in-select",
         "(1,93): unexpected-select-in-select",
-        "(1,127): unexpected-select-in-select",
-        "(1,127): expected-closing-tag-but-got-eof"
+        "(1,127): unexpected-select-in-select"
       ],
       "document": {
         "props": {
           }
         ],
         "html": "<html><head></head><body><p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p></body></html>",
-        "noQuirksBodyHtml": "<p id=\"status\"><noscript>&lt;strong&gt;A&lt;/strong&gt;</noscript><span>B</span></p>"
+        "noQuirksBodyHtml": "<p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p>"
       }
     },
     {
           }
         ],
         "html": "<html><head></head><body><p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p></body></html>",
-        "noQuirksBodyHtml": "<p id=\"status\"><noscript>&lt;strong&gt;A&lt;/strong&gt;</noscript><span>B</span></p>"
+        "noQuirksBodyHtml": "<p id=\"status\"><noscript><strong>A</strong></noscript><span>B</span></p>"
       }
     },
     {
         "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": "<isindex action=\"x\">",
-      "errors": [],
-      "fragment": {
-        "name": "table"
-      },
-      "document": {
-        "props": {
-          "tags": {
-            "form": true,
-            "hr": true,
-            "label": true,
-            "input": true
-          }
-        },
-        "tree": [
-          {
-            "tag": "form",
-            "attrs": [
-              {
-                "name": "action",
-                "value": "x"
-              }
-            ],
-            "children": [
-              {
-                "tag": "hr"
-              },
-              {
-                "tag": "label",
-                "children": [
-                  {
-                    "text": "This is a searchable index. Enter search keywords: "
-                  },
-                  {
-                    "tag": "input",
-                    "attrs": [
-                      {
-                        "name": "name",
-                        "value": "isindex"
-                      }
-                    ]
-                  }
-                ]
-              },
-              {
-                "tag": "hr"
-              }
-            ]
-          }
-        ],
-        "html": "<form action=\"x\"><hr><label>This is a searchable index. Enter search keywords: <input name=\"isindex\"></label><hr></form>",
-        "noQuirksBodyHtml": "<form action=\"x\"><hr><label>This is a searchable index. Enter search keywords: <input name=\"isindex\"></label><hr></form>"
-      }
-    },
     {
       "data": "<option><XH<optgroup></optgroup>",
       "errors": [],
       }
     }
   ]
-}
+}
\ No newline at end of file
index b2857d9..62d247a 100644 (file)
@@ -67,7 +67,7 @@
                );
 
                assert.deepEqual(
-                       model.getState(),
+                       model.getSelectedState(),
                        {
                                group1filter1: false,
                                group1filter2: false,
@@ -85,7 +85,7 @@
                        group3filter1: true
                } );
                assert.deepEqual(
-                       model.getState(),
+                       model.getSelectedState(),
                        {
                                group1filter1: true,
                                group1filter2: false,
                                                {
                                                        name: 'hidefilter1',
                                                        label: 'Show filter 1',
-                                                       description: 'Description of Filter 1 in Group 1'
+                                                       description: 'Description of Filter 1 in Group 1',
+                                                       default: true
                                                },
                                                {
                                                        name: 'hidefilter2',
                                                {
                                                        name: 'hidefilter3',
                                                        label: 'Show filter 3',
-                                                       description: 'Description of Filter 3 in Group 1'
+                                                       description: 'Description of Filter 3 in Group 1',
+                                                       default: true
                                                }
                                        ]
                                },
                                                {
                                                        name: 'hidefilter5',
                                                        label: 'Show filter 5',
-                                                       description: 'Description of Filter 2 in Group 2'
+                                                       description: 'Description of Filter 2 in Group 2',
+                                                       default: true
                                                },
                                                {
                                                        name: 'hidefilter6',
                                                {
                                                        name: 'filter8',
                                                        label: 'Group 3: Filter 2',
-                                                       description: 'Description of Filter 2 in Group 3'
+                                                       description: 'Description of Filter 2 in Group 3',
+                                                       default: true
                                                },
                                                {
                                                        name: 'filter9',
                                        ]
                                }
                        },
+                       defaultFilterRepresentation = {
+                               // Group 1 and 2, "send_unselected_if_any", the values of the filters are "flipped" from the values of the parameters
+                               hidefilter1: false,
+                               hidefilter2: true,
+                               hidefilter3: false,
+                               hidefilter4: true,
+                               hidefilter5: false,
+                               hidefilter6: true,
+                               // Group 3, "string_options", default values correspond to parameters and filters
+                               filter7: false,
+                               filter8: true,
+                               filter9: false
+                       },
                        model = new mw.rcfilters.dm.FiltersViewModel();
 
                model.initializeFilters( definition );
 
-               // Empty query = empty filter definition
+               // Empty query = only default values
                assert.deepEqual(
                        model.getFiltersFromParameters( {} ),
-                       {
-                               hidefilter1: false, // The text is "show filter 1"
-                               hidefilter2: false, // The text is "show filter 2"
-                               hidefilter3: false, // The text is "show filter 3"
-                               hidefilter4: false, // The text is "show filter 4"
-                               hidefilter5: false, // The text is "show filter 5"
-                               hidefilter6: false, // The text is "show filter 6"
-                               filter7: false,
-                               filter8: false,
-                               filter9: false
-                       },
-                       'Empty parameter query results in filters in initial state'
+                       defaultFilterRepresentation,
+                       'Empty parameter query results in filters in initial default state'
                );
 
                assert.deepEqual(
                        model.getFiltersFromParameters( {
-                               hidefilter1: '1'
-                       } ),
-                       {
-                               hidefilter1: false, // The text is "show filter 1"
-                               hidefilter2: true, // The text is "show filter 2"
-                               hidefilter3: true, // The text is "show filter 3"
-                               hidefilter4: false, // The text is "show filter 4"
-                               hidefilter5: false, // The text is "show filter 5"
-                               hidefilter6: false, // The text is "show filter 6"
-                               filter7: false,
-                               filter8: false,
-                               filter9: false
-                       },
-                       'One falsey parameter in a group makes the rest of the filters in the group truthy (checked) in the interface'
-               );
-
-               assert.deepEqual(
-                       model.getFiltersFromParameters( {
-                               hidefilter1: '1',
                                hidefilter2: '1'
                        } ),
-                       {
+                       $.extend( {}, defaultFilterRepresentation, {
                                hidefilter1: false, // The text is "show filter 1"
                                hidefilter2: false, // The text is "show filter 2"
-                               hidefilter3: true, // The text is "show filter 3"
-                               hidefilter4: false, // The text is "show filter 4"
-                               hidefilter5: false, // The text is "show filter 5"
-                               hidefilter6: false, // The text is "show filter 6"
-                               filter7: false,
-                               filter8: false,
-                               filter9: false
-                       },
-                       'Two falsey parameters in a \'send_unselected_if_any\' group makes the rest of the filters in the group truthy (checked) in the interface'
+                               hidefilter3: false // The text is "show filter 3"
+                       } ),
+                       'One truthy parameter in a group whose other parameters are true by default makes the rest of the filters in the group false (unchecked)'
                );
 
                assert.deepEqual(
                                hidefilter2: '1',
                                hidefilter3: '1'
                        } ),
-                       {
-                               // TODO: This will have to be represented as a different state, though.
+                       $.extend( {}, defaultFilterRepresentation, {
                                hidefilter1: false, // The text is "show filter 1"
                                hidefilter2: false, // The text is "show filter 2"
-                               hidefilter3: false, // The text is "show filter 3"
-                               hidefilter4: false, // The text is "show filter 4"
-                               hidefilter5: false, // The text is "show filter 5"
-                               hidefilter6: false, // The text is "show filter 6"
-                               filter7: false,
-                               filter8: false,
-                               filter9: false
-                       },
+                               hidefilter3: false // The text is "show filter 3"
+                       } ),
                        'All paremeters in the same \'send_unselected_if_any\' group false is equivalent to none are truthy (checked) in the interface'
                );
 
                // The ones above don't update the model, so we have a clean state.
-
+               // getFiltersFromParameters is stateless; any change is unaffected by the current state
+               // This test is demonstrating wrong usage of the method;
+               // We should be aware that getFiltersFromParameters is stateless,
+               // so each call gives us a filter state that only reflects the query given.
+               // This means that the two calls to updateFilters() below collide.
+               // The result of the first is overridden by the result of the second,
+               // since both get a full state object from getFiltersFromParameters that **only** relates
+               // to the input it receives.
                model.updateFilters(
                        model.getFiltersFromParameters( {
                                hidefilter1: '1'
 
                model.updateFilters(
                        model.getFiltersFromParameters( {
-                               hidefilter3: '1'
+                               hidefilter6: '1'
                        } )
                );
 
-               // 1 and 3 are separately unchecked via hide parameters, 2 should still be
-               // checked.
-               // This can simulate separate filters in the same group being hidden different
-               // ways (e.g. preferences and URL).
+               // The result here is ignoring the first updateFilters call
+               // We should receive default values + hidefilter6 as false
                assert.deepEqual(
-                       model.getState(),
-                       {
-                               hidefilter1: false, // The text is "show filter 1"
-                               hidefilter2: true, // The text is "show filter 2"
-                               hidefilter3: false, // The text is "show filter 3"
-                               hidefilter4: false, // The text is "show filter 4"
-                               hidefilter5: false, // The text is "show filter 5"
-                               hidefilter6: false, // The text is "show filter 6"
-                               filter7: false,
-                               filter8: false,
-                               filter9: false
-                       },
-                       'After unchecking 2 of 3 \'send_unselected_if_any\' filters via separate updateFilters calls, only the remaining one is still checked.'
+                       model.getSelectedState(),
+                       $.extend( {}, defaultFilterRepresentation, {
+                               hidefilter5: false,
+                               hidefilter6: false
+                       } ),
+                       'getFiltersFromParameters does not care about previous or existing state.'
                );
 
                // Reset
 
                model.updateFilters(
                        model.getFiltersFromParameters( {
-                               hidefilter1: '1'
+                               hidefilter1: '0'
                        } )
                );
                model.updateFilters(
                        model.getFiltersFromParameters( {
-                               hidefilter1: '0'
+                               hidefilter1: '1'
                        } )
                );
 
                // Simulates minor edits being hidden in preferences, then unhidden via URL
                // override.
                assert.deepEqual(
-                       model.getState(),
-                       {
-                               hidefilter1: false, // The text is "show filter 1"
-                               hidefilter2: false, // The text is "show filter 2"
-                               hidefilter3: false, // The text is "show filter 3"
-                               hidefilter4: false, // The text is "show filter 4"
-                               hidefilter5: false, // The text is "show filter 5"
-                               hidefilter6: false, // The text is "show filter 6"
-                               filter7: false,
-                               filter8: false,
-                               filter9: false
-                       },
-                       'After unchecking then checking a \'send_unselected_if_any\' filter (without touching other filters in that group), all are checked'
+                       model.getSelectedState(),
+                       defaultFilterRepresentation,
+                       'After checking and then unchecking a \'send_unselected_if_any\' filter (without touching other filters in that group), results are default'
                );
 
                model.updateFilters(
                        } )
                );
                assert.deepEqual(
-                       model.getState(),
-                       {
-                               hidefilter1: false, // The text is "show filter 1"
-                               hidefilter2: false, // The text is "show filter 2"
-                               hidefilter3: false, // The text is "show filter 3"
-                               hidefilter4: false, // The text is "show filter 4"
-                               hidefilter5: false, // The text is "show filter 5"
-                               hidefilter6: false, // The text is "show filter 6"
+                       model.getSelectedState(),
+                       $.extend( {}, defaultFilterRepresentation, {
                                filter7: true,
                                filter8: false,
                                filter9: false
-                       },
+                       } ),
                        'A \'string_options\' parameter containing 1 value, results in the corresponding filter as checked'
                );
 
                        } )
                );
                assert.deepEqual(
-                       model.getState(),
-                       {
-                               hidefilter1: false, // The text is "show filter 1"
-                               hidefilter2: false, // The text is "show filter 2"
-                               hidefilter3: false, // The text is "show filter 3"
-                               hidefilter4: false, // The text is "show filter 4"
-                               hidefilter5: false, // The text is "show filter 5"
-                               hidefilter6: false, // The text is "show filter 6"
+                       model.getSelectedState(),
+                       $.extend( {}, defaultFilterRepresentation, {
                                filter7: true,
                                filter8: true,
                                filter9: false
-                       },
+                       } ),
                        'A \'string_options\' parameter containing 2 values, results in both corresponding filters as checked'
                );
 
                        } )
                );
                assert.deepEqual(
-                       model.getState(),
-                       {
-                               hidefilter1: false, // The text is "show filter 1"
-                               hidefilter2: false, // The text is "show filter 2"
-                               hidefilter3: false, // The text is "show filter 3"
-                               hidefilter4: false, // The text is "show filter 4"
-                               hidefilter5: false, // The text is "show filter 5"
-                               hidefilter6: false, // The text is "show filter 6"
+                       model.getSelectedState(),
+                       $.extend( {}, defaultFilterRepresentation, {
                                filter7: false,
                                filter8: false,
                                filter9: false
-                       },
+                       } ),
                        'A \'string_options\' parameter containing all values, results in all filters of the group as unchecked.'
                );
 
                model.updateFilters(
                        model.getFiltersFromParameters( {
-                               group3: 'filter7,filter8,filter9'
+                               group3: 'filter7,all,filter9'
                        } )
                );
                assert.deepEqual(
-                       model.getState(),
-                       {
-                               hidefilter1: false, // The text is "show filter 1"
-                               hidefilter2: false, // The text is "show filter 2"
-                               hidefilter3: false, // The text is "show filter 3"
-                               hidefilter4: false, // The text is "show filter 4"
-                               hidefilter5: false, // The text is "show filter 5"
-                               hidefilter6: false, // The text is "show filter 6"
+                       model.getSelectedState(),
+                       $.extend( {}, defaultFilterRepresentation, {
                                filter7: false,
                                filter8: false,
                                filter9: false
-                       },
+                       } ),
                        'A \'string_options\' parameter containing the value \'all\', results in all filters of the group as unchecked.'
                );
 
                        } )
                );
                assert.deepEqual(
-                       model.getState(),
-                       {
-                               hidefilter1: false, // The text is "show filter 1"
-                               hidefilter2: false, // The text is "show filter 2"
-                               hidefilter3: false, // The text is "show filter 3"
-                               hidefilter4: false, // The text is "show filter 4"
-                               hidefilter5: false, // The text is "show filter 5"
-                               hidefilter6: false, // The text is "show filter 6"
+                       model.getSelectedState(),
+                       $.extend( {}, defaultFilterRepresentation, {
                                filter7: true,
                                filter8: false,
                                filter9: true
-                       },
+                       } ),
                        'A \'string_options\' parameter containing an invalid value, results in the invalid value ignored and the valid corresponding filters checked.'
                );
        } );
                        'If any value is "all", the only value is "all".'
                );
        } );
+
+       QUnit.test( 'setFiltersToDefaults', function ( assert ) {
+               var definition = {
+                               group1: {
+                                       title: 'Group 1',
+                                       type: 'send_unselected_if_any',
+                                       exclusionType: 'default',
+                                       filters: [
+                                               {
+                                                       name: 'hidefilter1',
+                                                       label: 'Show filter 1',
+                                                       description: 'Description of Filter 1 in Group 1',
+                                                       default: true
+                                               },
+                                               {
+                                                       name: 'hidefilter2',
+                                                       label: 'Show filter 2',
+                                                       description: 'Description of Filter 2 in Group 1'
+                                               },
+                                               {
+                                                       name: 'hidefilter3',
+                                                       label: 'Show filter 3',
+                                                       description: 'Description of Filter 3 in Group 1',
+                                                       default: true
+                                               }
+                                       ]
+                               },
+                               group2: {
+                                       title: 'Group 2',
+                                       type: 'send_unselected_if_any',
+                                       filters: [
+                                               {
+                                                       name: 'hidefilter4',
+                                                       label: 'Show filter 4',
+                                                       description: 'Description of Filter 1 in Group 2'
+                                               },
+                                               {
+                                                       name: 'hidefilter5',
+                                                       label: 'Show filter 5',
+                                                       description: 'Description of Filter 2 in Group 2',
+                                                       default: true
+                                               },
+                                               {
+                                                       name: 'hidefilter6',
+                                                       label: 'Show filter 6',
+                                                       description: 'Description of Filter 3 in Group 2'
+                                               }
+                                       ]
+                               }
+                       },
+                       model = new mw.rcfilters.dm.FiltersViewModel();
+
+               model.initializeFilters( definition );
+
+               assert.deepEqual(
+                       model.getFullState(),
+                       {
+                               // Group 1
+                               hidefilter1: { selected: true, active: true },
+                               hidefilter2: { selected: false, active: true },
+                               hidefilter3: { selected: true, active: true },
+                               // Group 2
+                               hidefilter4: { selected: false, active: true },
+                               hidefilter5: { selected: true, active: true },
+                               hidefilter6: { selected: false, active: true },
+                       },
+                       'Initial state: all filters are active, and select states are default.'
+               );
+
+               // Default behavior for 'exclusion' type with only 1 item selected, means that:
+               // - The items in the same group that are *not* selected are *not* active
+               // - Items in other groups are unaffected (all active)
+               model.updateFilters( {
+                       hidefilter1: false,
+                       hidefilter2: false,
+                       hidefilter3: false,
+                       hidefilter4: false,
+                       hidefilter5: false,
+                       hidefilter6: true
+               } );
+               assert.deepEqual(
+                       model.getFullState(),
+                       {
+                               // Group 1: not affected
+                               hidefilter1: { selected: false, active: true },
+                               hidefilter2: { selected: false, active: true },
+                               hidefilter3: { selected: false, active: true },
+                               // Group 2: affected
+                               hidefilter4: { selected: false, active: false },
+                               hidefilter5: { selected: false, active: false },
+                               hidefilter6: { selected: true, active: true },
+                       },
+                       'Default exclusion behavior with 1 item selected in the group.'
+               );
+
+               // Default behavior for 'exclusion' type with multiple items selected, but not all, means that:
+               // - The items in the same group that are *not* selected are *not* active
+               // - Items in other groups are unaffected (all active)
+               model.updateFilters( {
+                       // Literally updating filters to create a clean state
+                       hidefilter1: false,
+                       hidefilter2: false,
+                       hidefilter3: false,
+                       hidefilter4: false,
+                       hidefilter5: true,
+                       hidefilter6: true
+               } );
+               assert.deepEqual(
+                       model.getFullState(),
+                       {
+                               // Group 1: not affected
+                               hidefilter1: { selected: false, active: true },
+                               hidefilter2: { selected: false, active: true },
+                               hidefilter3: { selected: false, active: true },
+                               // Group 2: affected
+                               hidefilter4: { selected: false, active: false },
+                               hidefilter5: { selected: true, active: true },
+                               hidefilter6: { selected: true, active: true },
+                       },
+                       'Default exclusion behavior with multiple items (but not all) selected in the group.'
+               );
+
+               // Default behavior for 'exclusion' type with all items in the group selected, means that:
+               // - All items in the group are NOT active
+               // - Items in other groups are unaffected (all active)
+               model.updateFilters( {
+                       // Literally updating filters to create a clean state
+                       hidefilter1: false,
+                       hidefilter2: false,
+                       hidefilter3: false,
+                       hidefilter4: true,
+                       hidefilter5: true,
+                       hidefilter6: true
+               } );
+               assert.deepEqual(
+                       model.getFullState(),
+                       {
+                               // Group 1: not affected
+                               hidefilter1: { selected: false, active: true },
+                               hidefilter2: { selected: false, active: true },
+                               hidefilter3: { selected: false, active: true },
+                               // Group 2: affected
+                               hidefilter4: { selected: true, active: false },
+                               hidefilter5: { selected: true, active: false },
+                               hidefilter6: { selected: true, active: false },
+                       },
+                       'Default exclusion behavior with all items in the group.'
+               );
+       } );
+
+       QUnit.test( 'reapplyActiveFilters - "explicit" exclusion rules', function ( assert ) {
+               var definition = {
+                               group1: {
+                                       title: 'Group 1',
+                                       type: 'send_unselected_if_any',
+                                       exclusionType: 'explicit',
+                                       filters: [
+                                               {
+                                                       name: 'filter1',
+                                                       excludes: [ 'filter2', 'filter3' ],
+                                                       label: 'Show filter 1',
+                                                       description: 'Description of Filter 1 in Group 1'
+                                               },
+                                               {
+                                                       name: 'filter2',
+                                                       excludes: [ 'filter3' ],
+                                                       label: 'Show filter 2',
+                                                       description: 'Description of Filter 2 in Group 1'
+                                               },
+                                               {
+                                                       name: 'filter3',
+                                                       label: 'Show filter 3',
+                                                       excludes: [ 'filter1' ],
+                                                       description: 'Description of Filter 3 in Group 1'
+                                               },
+                                               {
+                                                       name: 'filter4',
+                                                       label: 'Show filter 4',
+                                                       description: 'Description of Filter 4 in Group 1'
+                                               }
+                                       ]
+                               }
+                       },
+                       defaultFilterRepresentation = {
+                               // Group 1 and 2, "send_unselected_if_any", the values of the filters are "flipped" from the values of the parameters
+                               hidefilter1: false,
+                               hidefilter2: true,
+                               hidefilter3: false,
+                               hidefilter4: true,
+                               hidefilter5: false,
+                               hidefilter6: true,
+                               // Group 3, "string_options", default values correspond to parameters and filters
+                               filter7: false,
+                               filter8: true,
+                               filter9: false
+                       },
+                       model = new mw.rcfilters.dm.FiltersViewModel();
+
+               model.initializeFilters( definition );
+
+               assert.deepEqual(
+                       model.getFullState(),
+                       {
+                               filter1: { selected: false, active: true },
+                               filter2: { selected: false, active: true },
+                               filter3: { selected: false, active: true },
+                               filter4: { selected: false, active: true }
+                       },
+                       'Initial state: all filters are active.'
+               );
+
+               // "Explicit" behavior for 'exclusion' with one item checked:
+               // - Items in the 'excluded' list of the selected filter are inactive
+               model.updateFilters( {
+                       // Literally updating filters to create a clean state
+                       filter1: true, // Excludes 'hidefilter2', 'hidefilter3'
+                       filter2: false, // Excludes 'hidefilter3'
+                       filter3: false, // Excludes 'hidefilter1'
+                       filter4: false // No exclusion list
+               } );
+               assert.deepEqual(
+                       model.getFullState(),
+                       {
+                               filter1: { selected: true, active: true },
+                               filter2: { selected: false, active: false },
+                               filter3: { selected: false, active: false },
+                               filter4: { selected: false, active: true }
+                       },
+                       '"Explicit" exclusion behavior with one item selected that has an exclusion list.'
+               );
+
+               // "Explicit" behavior for 'exclusion' with two item checked:
+               // - Items in the 'excluded' list of each of the selected filter are inactive
+               model.updateFilters( {
+                       // Literally updating filters to create a clean state
+                       filter1: true, // Excludes 'hidefilter2', 'hidefilter3'
+                       filter2: false, // Excludes 'hidefilter3'
+                       filter3: true, // Excludes 'hidefilter1'
+                       filter4: false // No exclusion list
+               } );
+               assert.deepEqual(
+                       model.getFullState(),
+                       {
+                               filter1: { selected: true, active: false },
+                               filter2: { selected: false, active: false },
+                               filter3: { selected: true, active: false },
+                               filter4: { selected: false, active: true }
+                       },
+                       '"Explicit" exclusion behavior with two selected items that both have an exclusion list.'
+               );
+
+               // "Explicit behavior" with two filters that exclude the same item
+
+               // Two filters selected, both exclude 'hidefilter3'
+               model.updateFilters( {
+                       // Literally updating filters to create a clean state
+                       filter1: true, // Excludes 'hidefilter2', 'hidefilter3'
+                       filter2: true, // Excludes 'hidefilter3'
+                       filter3: false, // Excludes 'hidefilter1'
+                       filter4: false // No exclusion list
+               } );
+               assert.deepEqual(
+                       model.getFullState(),
+                       {
+                               filter1: { selected: true, active: true },
+                               filter2: { selected: true, active: false }, // Excluded by filter1
+                               filter3: { selected: false, active: false }, // Excluded by both filter1 and filter2
+                               filter4: { selected: false, active: true }
+                       },
+                       '"Explicit" exclusion behavior with two selected items that both exclude another item.'
+               );
+
+               // Unselect filter2: filter3 should still be excluded, because filter1 excludes it and is selected
+               model.updateFilters( {
+                       filter2: false, // Excludes 'hidefilter3'
+               } );
+               assert.deepEqual(
+                       model.getFullState(),
+                       {
+                               filter1: { selected: true, active: true },
+                               filter2: { selected: false, active: false }, // Excluded by filter1
+                               filter3: { selected: false, active: false }, // Still excluded by filter1
+                               filter4: { selected: false, active: true }
+                       },
+                       '"Explicit" exclusion behavior unselecting one item that excludes another item, that is being excluded by a third active item.'
+               );
+
+               // Unselect filter1: filter3 should now be active, since both filters that exclude it are unselected
+               model.updateFilters( {
+                       filter1: false, // Excludes 'hidefilter3' and 'hidefilter2'
+               } );
+               assert.deepEqual(
+                       model.getFullState(),
+                       {
+                               filter1: { selected: false, active: true },
+                               filter2: { selected: false, active: true }, // No longer excluded by filter1
+                               filter3: { selected: false, active: true }, // No longer excluded by either filter1 nor filter2
+                               filter4: { selected: false, active: true }
+                       },
+                       '"Explicit" exclusion behavior unselecting both items that excluded the same third item.'
+               );
+
+       } );
 }( mediaWiki, jQuery ) );