Merge "refreshLinks.php: allow refreshing by categories, tracking or not"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 26 Jan 2017 03:33:30 +0000 (03:33 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 26 Jan 2017 03:33:31 +0000 (03:33 +0000)
53 files changed:
includes/Sanitizer.php
includes/Setup.php
includes/cache/MessageCache.php
includes/installer/Installer.php
includes/installer/i18n/en.json
includes/installer/i18n/qqq.json
includes/skins/SkinTemplate.php
includes/specials/SpecialUserrights.php
includes/tidy/Balancer.php
includes/upload/UploadBase.php
languages/i18n/ar.json
languages/i18n/be-tarask.json
languages/i18n/bs.json
languages/i18n/da.json
languages/i18n/de.json
languages/i18n/en.json
languages/i18n/es.json
languages/i18n/eu.json
languages/i18n/fr.json
languages/i18n/hr.json
languages/i18n/io.json
languages/i18n/it.json
languages/i18n/ko.json
languages/i18n/lfn.json
languages/i18n/mk.json
languages/i18n/my.json
languages/i18n/qqq.json
languages/i18n/ru.json
languages/i18n/sh.json
languages/i18n/sl.json
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.skinning/content.css
resources/src/mediawiki/api/options.js
tests/parser/ParserTestRunner.php
tests/parser/parserTests.txt
tests/phpunit/includes/OutputPageTest.php
tests/phpunit/includes/cache/MessageCacheTest.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 6779189..42b166d 100644 (file)
@@ -1119,6 +1119,7 @@ class Sanitizer {
                        '>'    => '&gt;',   // we've received invalid input
                        '"'    => '&quot;', // which should have been escaped.
                        '{'    => '&#123;',
+                       '}'    => '&#125;', // prevent unpaired language conversion syntax
                        '['    => '&#91;',
                        "''"   => '&#39;&#39;',
                        'ISBN' => '&#73;SBN',
index ecd164d..01ba1e8 100644 (file)
@@ -244,7 +244,7 @@ if ( $wgUseInstantCommons ) {
                'transformVia404' => true,
                'fetchDescription' => true,
                'descriptionCacheExpiry' => 43200,
-               'apiThumbCacheExpiry' => 86400,
+               'apiThumbCacheExpiry' => 0,
        ];
 }
 /*
index 352a94c..9bf0840 100644 (file)
@@ -89,10 +89,12 @@ class MessageCache {
         */
        protected $mInParser = false;
 
-       /** @var BagOStuff */
-       protected $mMemc;
        /** @var WANObjectCache */
        protected $wanCache;
+       /** @var BagOStuff */
+       protected $clusterCache;
+       /** @var BagOStuff */
+       protected $srvCache;
 
        /**
         * Singleton instance
@@ -109,9 +111,13 @@ class MessageCache {
         */
        public static function singleton() {
                if ( self::$instance === null ) {
-                       global $wgUseDatabaseMessages, $wgMsgCacheExpiry;
+                       global $wgUseDatabaseMessages, $wgMsgCacheExpiry, $wgUseLocalMessageCache;
                        self::$instance = new self(
+                               MediaWikiServices::getInstance()->getMainWANObjectCache(),
                                wfGetMessageCacheStorage(),
+                               $wgUseLocalMessageCache
+                                       ? MediaWikiServices::getInstance()->getLocalServerObjectCache()
+                                       : new EmptyBagOStuff(),
                                $wgUseDatabaseMessages,
                                $wgMsgCacheExpiry
                        );
@@ -149,24 +155,25 @@ class MessageCache {
        }
 
        /**
-        * @param BagOStuff $memCached A cache instance. If none, fall back to CACHE_NONE.
-        * @param bool $useDB
+        * @param WANObjectCache $wanCache WAN cache instance
+        * @param BagOStuff $clusterCache Cluster cache instance
+        * @param BagOStuff $srvCache Server cache instance
+        * @param bool $useDB Whether to look for message overrides (e.g. MediaWiki: pages)
         * @param int $expiry Lifetime for cache. @see $mExpiry.
         */
-       function __construct( BagOStuff $memCached, $useDB, $expiry ) {
-               global $wgUseLocalMessageCache;
+       public function __construct(
+               WANObjectCache $wanCache,
+               BagOStuff $clusterCache,
+               BagOStuff $srvCache,
+               $useDB,
+               $expiry
+       ) {
+               $this->wanCache = $wanCache;
+               $this->clusterCache = $clusterCache;
+               $this->srvCache = $srvCache;
 
-               $this->mMemc = $memCached;
                $this->mDisable = !$useDB;
                $this->mExpiry = $expiry;
-
-               if ( $wgUseLocalMessageCache ) {
-                       $this->localCache = MediaWikiServices::getInstance()->getLocalServerObjectCache();
-               } else {
-                       $this->localCache = new EmptyBagOStuff();
-               }
-
-               $this->wanCache = ObjectCache::getMainWANInstance();
        }
 
        /**
@@ -203,7 +210,7 @@ class MessageCache {
        protected function getLocalCache( $code ) {
                $cacheKey = wfMemcKey( __CLASS__, $code );
 
-               return $this->localCache->get( $cacheKey );
+               return $this->srvCache->get( $cacheKey );
        }
 
        /**
@@ -214,7 +221,7 @@ class MessageCache {
         */
        protected function saveToLocalCache( $code, $cache ) {
                $cacheKey = wfMemcKey( __CLASS__, $code );
-               $this->localCache->set( $cacheKey, $cache );
+               $this->srvCache->set( $cacheKey, $cache );
        }
 
        /**
@@ -300,7 +307,7 @@ class MessageCache {
                                        # below, and use the local stale value if it was not acquired.
                                        $where[] = 'global cache is presumed expired';
                                } else {
-                                       $cache = $this->mMemc->get( $cacheKey );
+                                       $cache = $this->clusterCache->get( $cacheKey );
                                        if ( !$cache ) {
                                                $where[] = 'global cache is empty';
                                        } elseif ( $this->isCacheExpired( $cache ) ) {
@@ -381,12 +388,10 @@ class MessageCache {
         * @return bool|string True on success or one of ("cantacquire", "disabled")
         */
        protected function loadFromDBWithLock( $code, array &$where, $mode = null ) {
-               global $wgUseLocalMessageCache;
-
                # If cache updates on all levels fail, give up on message overrides.
                # This is to avoid easy site outages; see $saveSuccess comments below.
                $statusKey = wfMemcKey( 'messages', $code, 'status' );
-               $status = $this->mMemc->get( $statusKey );
+               $status = $this->clusterCache->get( $statusKey );
                if ( $status === 'error' ) {
                        $where[] = "could not load; method is still globally disabled";
                        return 'disabled';
@@ -424,8 +429,8 @@ class MessageCache {
                         * incurring a loadFromDB() overhead on every request, and thus saves the
                         * wiki from complete downtime under moderate traffic conditions.
                         */
-                       if ( !$wgUseLocalMessageCache ) {
-                               $this->mMemc->set( $statusKey, 'error', 60 * 5 );
+                       if ( $this->srvCache instanceof EmptyBagOStuff ) {
+                               $this->clusterCache->set( $statusKey, 'error', 60 * 5 );
                                $where[] = 'could not save cache, disabled globally for 5 minutes';
                        } else {
                                $where[] = "could not save global cache";
@@ -444,7 +449,7 @@ class MessageCache {
         * @param integer $mode Use MessageCache::FOR_UPDATE to skip process cache
         * @return array Loaded messages for storing in caches
         */
-       function loadFromDB( $code, $mode = null ) {
+       protected function loadFromDB( $code, $mode = null ) {
                global $wgMaxMsgCacheEntrySize, $wgLanguageCode, $wgAdaptiveMessageCache;
 
                $dbr = wfGetDB( ( $mode == self::FOR_UPDATE ) ? DB_MASTER : DB_REPLICA );
@@ -518,7 +523,7 @@ class MessageCache {
                                wfDebugLog(
                                        'MessageCache',
                                        __METHOD__
-                                               . ": failed to load message page text for {$row->page_title} ($code)"
+                                       . ": failed to load message page text for {$row->page_title} ($code)"
                                );
                        } else {
                                $entry = ' ' . $text;
@@ -541,11 +546,11 @@ class MessageCache {
        /**
         * Updates cache as necessary when message page is changed
         *
-        * @param string|bool $title Name of the page changed (false if deleted)
+        * @param string $title Message cache key with initial uppercase letter.
         * @param string|bool $text New contents of the page (false if deleted)
         */
        public function replace( $title, $text ) {
-               global $wgMaxMsgCacheEntrySize, $wgContLang, $wgLanguageCode;
+               global $wgLanguageCode;
 
                if ( $this->mDisable ) {
                        return;
@@ -557,63 +562,75 @@ class MessageCache {
                        return;
                }
 
-               // Note that if the cache is volatile, load() may trigger a DB fetch.
-               // In that case we reenter/reuse the existing cache key lock to avoid
-               // a self-deadlock. This is safe as no reads happen *directly* in this
-               // method between getReentrantScopedLock() and load() below. There is
-               // no risk of data "changing under our feet" for replace().
-               $scopedLock = $this->getReentrantScopedLock( wfMemcKey( 'messages', $code ) );
-               // Load the messages from the master DB to avoid race conditions
-               $this->load( $code, self::FOR_UPDATE );
-
-               // Load the new value into the process cache...
+               // (a) Update the process cache with the new message text
                if ( $text === false ) {
+                       // Page deleted
                        $this->mCache[$code][$title] = '!NONEXISTENT';
-               } elseif ( strlen( $text ) > $wgMaxMsgCacheEntrySize ) {
-                       $this->mCache[$code][$title] = '!TOO BIG';
-                       // Pre-fill the individual key cache with the known latest message text
-                       $key = $this->wanCache->makeKey( 'messages-big', $this->mCache[$code]['HASH'], $title );
-                       $this->wanCache->set( $key, " $text", $this->mExpiry );
                } else {
+                       // Ignore $wgMaxMsgCacheEntrySize so the process cache is up to date
                        $this->mCache[$code][$title] = ' ' . $text;
                }
-               // Mark this cache as definitely being "latest" (non-volatile) so
-               // load() calls do not try to refresh the cache with replica DB data
-               $this->mCache[$code]['LATEST'] = time();
 
-               // Update caches if the lock was acquired
-               if ( $scopedLock ) {
-                       $this->saveToCaches( $this->mCache[$code], 'all', $code );
-               } else {
-                       LoggerFactory::getInstance( 'MessageCache' )->error(
-                               __METHOD__ . ': could not acquire lock to update {title} ({code})',
-                               [ 'title' => $title, 'code' => $code ] );
-               }
-
-               ScopedCallback::consume( $scopedLock );
-               // Relay the purge. Touching this check key expires cache contents
-               // and local cache (APC) validation hash across all datacenters.
-               $this->wanCache->touchCheckKey( wfMemcKey( 'messages', $code ) );
-
-               // Also delete cached sidebar... just in case it is affected
-               $codes = [ $code ];
-               if ( $code === 'en' ) {
-                       // Delete all sidebars, like for example on action=purge on the
-                       // sidebar messages
-                       $codes = array_keys( Language::fetchLanguageNames() );
-               }
-
-               foreach ( $codes as $code ) {
-                       $sidebarKey = wfMemcKey( 'sidebar', $code );
-                       $this->wanCache->delete( $sidebarKey );
-               }
+               // (b) Update the shared caches in a deferred update with a fresh DB snapshot
+               DeferredUpdates::addCallableUpdate(
+                       function () use ( $title, $msg, $code ) {
+                               global $wgContLang, $wgMaxMsgCacheEntrySize;
+                               // Allow one caller at a time to avoid race conditions
+                               $scopedLock = $this->getReentrantScopedLock( wfMemcKey( 'messages', $code ) );
+                               if ( !$scopedLock ) {
+                                       LoggerFactory::getInstance( 'MessageCache' )->error(
+                                               __METHOD__ . ': could not acquire lock to update {title} ({code})',
+                                               [ 'title' => $title, 'code' => $code ] );
+                                       return;
+                               }
+                               // Load the messages from the master DB to avoid race conditions
+                               $this->loadFromDB( $code, self::FOR_UPDATE );
+                               // Load the process cache values and set the per-title cache keys
+                               $page = WikiPage::factory( Title::makeTitle( NS_MEDIAWIKI, $title ) );
+                               $page->loadPageData( $page::READ_LATEST );
+                               $text = $this->getMessageTextFromContent( $page->getContent() );
+                               // Check if an individual cache key should exist and update cache accordingly
+                               $titleKey = $this->wanCache->makeKey(
+                                       'messages-big', $this->mCache[$code]['HASH'], $title );
+                               if ( is_string( $text ) && strlen( $text ) > $wgMaxMsgCacheEntrySize ) {
+                                       $this->wanCache->set( $titleKey, ' ' . $text, $this->mExpiry );
+                               }
+                               // Mark this cache as definitely being "latest" (non-volatile) so
+                               // load() calls do try to refresh the cache with replica DB data
+                               $this->mCache[$code]['LATEST'] = time();
+                               // Pre-emptively update the local datacenter cache so things like edit filter and
+                               // blacklist changes are reflect immediately, as these often use MediaWiki: pages.
+                               // The datacenter handling replace() calls should be the same one handling edits
+                               // as they require HTTP POST.
+                               $this->saveToCaches( $this->mCache[$code], 'all', $code );
+                               // Release the lock now that the cache is saved
+                               ScopedCallback::consume( $scopedLock );
+
+                               // Relay the purge. Touching this check key expires cache contents
+                               // and local cache (APC) validation hash across all datacenters.
+                               $this->wanCache->touchCheckKey( wfMemcKey( 'messages', $code ) );
+                               // Also delete cached sidebar... just in case it is affected
+                               // @TODO: shouldn't this be $code === $wgLanguageCode?
+                               if ( $code === 'en' ) {
+                                       // Purge all language sidebars, e.g. on ?action=purge to the sidebar messages
+                                       $codes = array_keys( Language::fetchLanguageNames() );
+                               } else {
+                                       // Purge only the sidebar for this language
+                                       $codes = [ $code ];
+                               }
+                               foreach ( $codes as $code ) {
+                                       $this->wanCache->delete( wfMemcKey( 'sidebar', $code ) );
+                               }
 
-               // Update the message in the message blob store
-               $resourceloader = RequestContext::getMain()->getOutput()->getResourceLoader();
-               $blobStore = $resourceloader->getMessageBlobStore();
-               $blobStore->updateMessage( $wgContLang->lcfirst( $msg ) );
+                               // Purge the message in the message blob store
+                               $resourceloader = RequestContext::getMain()->getOutput()->getResourceLoader();
+                               $blobStore = $resourceloader->getMessageBlobStore();
+                               $blobStore->updateMessage( $wgContLang->lcfirst( $msg ) );
 
-               Hooks::run( 'MessageCacheReplace', [ $title, $text ] );
+                               Hooks::run( 'MessageCacheReplace', [ $title, $text ] );
+                       },
+                       DeferredUpdates::PRESEND
+               );
        }
 
        /**
@@ -648,7 +665,7 @@ class MessageCache {
        protected function saveToCaches( array $cache, $dest, $code = false ) {
                if ( $dest === 'all' ) {
                        $cacheKey = wfMemcKey( 'messages', $code );
-                       $success = $this->mMemc->set( $cacheKey, $cache );
+                       $success = $this->clusterCache->set( $cacheKey, $cache );
                        $this->setValidationHash( $code, $cache );
                } else {
                        $success = true;
@@ -720,7 +737,7 @@ class MessageCache {
         * @return null|ScopedCallback
         */
        protected function getReentrantScopedLock( $key, $timeout = self::WAIT_SEC ) {
-               return $this->mMemc->getScopedLock( $key, $timeout, self::LOCK_TTL, __METHOD__ );
+               return $this->clusterCache->getScopedLock( $key, $timeout, self::LOCK_TTL, __METHOD__ );
        }
 
        /**
@@ -845,7 +862,7 @@ class MessageCache {
 
                $alreadyTried = [];
 
-                // First try the requested language.
+               // First try the requested language.
                $message = $this->getMessageForLang( $lang, $lckey, $useDB, $alreadyTried );
                if ( $message !== false ) {
                        return $message;
@@ -950,6 +967,7 @@ class MessageCache {
         */
        public function getMsgFromNamespace( $title, $code ) {
                $this->load( $code );
+
                if ( isset( $this->mCache[$code][$title] ) ) {
                        $entry = $this->mCache[$code][$title];
                        if ( substr( $entry, 0, 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.",
index 575a9ac..bf260aa 100644 (file)
@@ -1322,11 +1322,11 @@ class SkinTemplate extends Skin {
                        if ( !$user->isAnon() ) {
                                $sur = new UserrightsPage;
                                $sur->setContext( $this->getContext() );
-                               $canChange = $sur->userCanChangeRights( $this->getUser(), false );
+                               $canChange = $sur->userCanChangeRights( $user );
                                $nav_urls['userrights'] = [
                                        'text' => $this->msg(
                                                $canChange ? 'tool-link-userrights' : 'tool-link-userrights-readonly',
-                                               $this->getUser()->getName()
+                                               $rootUser
                                        )->text(),
                                        'href' => self::makeSpecialUrlSubpage( 'Userrights', $rootUser )
                                ];
index 4db2198..b1f8a17 100644 (file)
@@ -49,19 +49,25 @@ class UserrightsPage extends SpecialPage {
        }
 
        /**
-        * @param User $user
-        * @param bool $checkIfSelf
+        * Check whether the current user (from context) can change the target user's rights.
+        *
+        * @param User $targetUser User whose rights are being changed
+        * @param bool $checkIfSelf If false, assume that the current user can add/remove groups defined
+        *   in $wgGroupsAddToSelf / $wgGroupsRemoveFromSelf, without checking if it's the same as target
+        *   user
         * @return bool
         */
-       public function userCanChangeRights( $user, $checkIfSelf = true ) {
+       public function userCanChangeRights( $targetUser, $checkIfSelf = true ) {
+               $isself = $this->getUser()->equals( $targetUser );
+
                $available = $this->changeableGroups();
-               if ( $user->getId() == 0 ) {
+               if ( $targetUser->getId() == 0 ) {
                        return false;
                }
 
                return !empty( $available['add'] )
                        || !empty( $available['remove'] )
-                       || ( ( $this->isself || !$checkIfSelf ) &&
+                       || ( ( $isself || !$checkIfSelf ) &&
                                ( !empty( $available['add-self'] )
                                        || !empty( $available['remove-self'] ) ) );
        }
@@ -465,29 +471,6 @@ class UserrightsPage extends SpecialPage {
                );
        }
 
-       /**
-        * Go through used and available groups and return the ones that this
-        * form will be able to manipulate based on the current user's system
-        * permissions.
-        *
-        * @param array $groups List of groups the given user is in
-        * @return array Tuple of addable, then removable groups
-        */
-       protected function splitGroups( $groups ) {
-               list( $addable, $removable, $addself, $removeself ) = array_values( $this->changeableGroups() );
-
-               $removable = array_intersect(
-                       array_merge( $this->isself ? $removeself : [], $removable ),
-                       $groups
-               ); // Can't remove groups the user doesn't have
-               $addable = array_diff(
-                       array_merge( $this->isself ? $addself : [], $addable ),
-                       $groups
-               ); // Can't add groups the user does have
-
-               return [ $addable, $removable ];
-       }
-
        /**
         * Show the form to edit group memberships.
         *
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 96f8638..79166ef 100644 (file)
@@ -1440,6 +1440,7 @@ abstract class UploadBase {
                        'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
                        'http://www.w3.org/2000/svg',
                        'http://www.w3.org/tr/rec-rdf-syntax/',
+                       'http://www.w3.org/2000/01/rdf-schema#',
                ];
 
                // Inkscape mangles namespace definitions created by Adobe Illustrator.
index 0376f42..156efdb 100644 (file)
        "recentchanges-legend-newpage": "{{int:recentchanges-label-newpage}} (راجع أيضا [[Special:NewPages|قائمة الصفحات الجديدة]])",
        "recentchanges-submit": "أظهر",
        "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": "تسجيل المستخدم",
+       "rcfilters-filter-registered-label": "مسجل",
+       "rcfilters-filter-registered-description": "المحررون مسجلو الدخول.",
+       "rcfilters-filter-unregistered-label": "غير مسجل",
+       "rcfilters-filter-unregistered-description": "المحررون غير مسجلي الدخول.",
        "rcfilters-filtergroup-authorship": "ملكية التعديلات",
        "rcfilters-filter-editsbyself-label": "تعديلاتك الشخصية",
        "rcfilters-filter-editsbyself-description": "التعديلات بواسطتك.",
        "rcfilters-filter-editsbyother-label": "التعديلات بواسطة الآخرين",
-       "rcfilters-filter-editsbyother-description": "التعديلات المنشأة بواسطة المستخدمين الآخرين (ليس أنت.)",
-       "rcfilters-filtergroup-userExpLevel": "Ù\85ستÙ\88Ù\89 Ø®Ø¨Ø±Ø© Ø§Ù\84Ù\85ستخدÙ\85",
+       "rcfilters-filter-editsbyother-description": "التعديلات المنشأة بواسطة المستخدمين الآخرين (ليس أنت).",
+       "rcfilters-filtergroup-userExpLevel": "Ù\85ستÙ\88Ù\89 Ø§Ù\84خبرة (Ù\84Ù\84Ù\85ستخدÙ\85Ù\8aÙ\86 Ø§Ù\84Ù\85سجÙ\84Ù\8aÙ\86 Ù\81Ù\82Ø·)",
        "rcfilters-filter-userExpLevel-newcomer-label": "القادمون الجدد",
-       "rcfilters-filter-userExpLevel-newcomer-description": "اÙ\84Ù\85ستخدÙ\85Ù\88Ù\86 Ø§Ù\84جدد Ø¬Ø¯Ø§: Ø£Ù\82Ù\84 Ù\85Ù\86 10 ØªØ¹Ø¯Ù\8aÙ\84ات Ù\884 Ø£Ù\8aاÙ\85 Ù\85Ù\86 Ø§Ù\84Ù\86شاط.",
+       "rcfilters-filter-userExpLevel-newcomer-description": "أقل من 10 تعديلات و4 أيام من النشاط.",
        "rcfilters-filter-userExpLevel-learner-label": "المتعلمون",
-       "rcfilters-filter-userExpLevel-learner-description": "المزيد من أيام النشاط والتعديلات أكثر من 'القادمين الجدد' ولكن أقل من 'المستخدمين ذوي الخبرة.'",
+       "rcfilters-filter-userExpLevel-learner-description": "المزيد من أيام النشاط والتعديلات أكثر من \"القادمين الجدد\" ولكن أقل من \"المستخدمين ذوي الخبرة\".",
        "rcfilters-filter-userExpLevel-experienced-label": "المستخدمون ذوو الخبرة",
        "rcfilters-filter-userExpLevel-experienced-description": "أكثر من 30 يوما من النشاط و500 تعديل.",
+       "rcfilters-filtergroup-automated": "المساهمات الأوتوماتيكية",
+       "rcfilters-filter-bots-label": "بوت",
+       "rcfilters-filter-bots-description": "التعديلات بواسطة الأدوات الأوتوماتيكية.",
+       "rcfilters-filter-humans-label": "بشري (ليس بوت)",
+       "rcfilters-filter-humans-description": "التعديلات بواسطة المحررين البشريين.",
+       "rcfilters-filtergroup-significance": "الأهمية",
+       "rcfilters-filter-minor-label": "تعديلات طفيفة",
+       "rcfilters-filter-minor-description": "التعديلات التي علم عليها المستخدم كطفيفة.",
+       "rcfilters-filter-major-label": "التعديلات غير الطفيفة",
+       "rcfilters-filter-major-description": "التعديلات غير المعلم عليها كطفيفة.",
+       "rcfilters-filtergroup-changetype": "نوع التغيير",
+       "rcfilters-filter-pageedits-label": "تعديلات الصفحة",
+       "rcfilters-filter-pageedits-description": "التعديلات لمحتوى الويكي، النقاشات، وصوفات التصنيفات....",
+       "rcfilters-filter-newpages-label": "إنشاء الصفحات",
+       "rcfilters-filter-newpages-description": "التعديلات التي تصنع صفحات جديدة.",
+       "rcfilters-filter-categorization-label": "تغييرات التصنيفات",
+       "rcfilters-filter-categorization-description": "سجلات إضافة أو إزالة الصفحات من التصنيفات.",
+       "rcfilters-filter-logactions-label": "الأفعال المسجلة",
+       "rcfilters-filter-logactions-description": "الأفعال الإدارية، إنشاء الحسابات، حذف الصفحات، عمليات الرفع....",
        "rcnotefrom": "بالأسفل {{PLURAL:$5|التغيير|التغييرات}} منذ <strong>$2</strong> (إلى <strong>$1</strong> معروضة).",
        "rclistfrom": "أظهر التغييرات بدء من $3 $2",
        "rcshowhideminor": "$1 التعديلات الطفيفة",
        "apisandbox-sending-request": "إرسال طلب API ...",
        "apisandbox-loading-results": "استقبال طلبات API ...",
        "apisandbox-results-error": "حدث خطأ أثناء تحميل رد استعدلام الAPI: $1.",
-       "apisandbox-request-params-json": "معاملات JSON:",
        "apisandbox-request-url-label": "مسار الطلب:",
        "apisandbox-request-time": "وقت الطلب: {{PLURAL:$1|$1 ms}}",
        "apisandbox-results-fixtoken": "رمز الصحيح وإعادة الموافقة",
        "usercssispublic": "من فضل لاحظ: صفحات الCSS الفرعية لا ينبغي أن تحتوي على بيانات سرية بما أنها يمكن رؤيتها بواسطة المستخدمين الآخرين.",
        "restrictionsfield-badip": "عنوان أيبي أو نطاق غير صحيح: $1",
        "restrictionsfield-label": "نطاقات الأيبي المسموح بها:",
-       "restrictionsfield-help": "عنوان أيبي أو نطاق CIDR واحد لكل سطر. لتفعيل كل شيء، استخدم<br><code>0.0.0.0/0</code><br><code>::/0</code>",
+       "restrictionsfield-help": "عنوان أيبي أو نطاق CIDR واحد لكل سطر. لتفعيل كل شيء، استخدم:\n<pre>0.0.0.0/0\n::/0</pre>",
        "revid": "المراجعة $1",
        "pageid": "معرف الصفحة $1"
 }
index b7c3b18..1aa6e36 100644 (file)
        "undo-norev": "Рэдагаваньне ня можа быць адмененае, таму што яно не існуе альбо было выдаленае.",
        "undo-nochange": "Выглядае, што праўка ўжо была адмененая.",
        "undo-summary": "Скасаваньне праўкі $1 {{GENDER:$2|удзельніка|удзельніцы}} [[Special:Contributions/$2|$2]] ([[User talk:$2|гутаркі]])",
-       "undo-summary-username-hidden": "Ð\92Ñ\8dÑ\80Ñ\81Ñ\96Ñ\8f $1 Ñ\81каÑ\81аванаÑ\8f Ñ\81Ñ\85аванÑ\8bм Ñ\83дзелÑ\8cнÑ\96кам",
+       "undo-summary-username-hidden": "СкаÑ\81аванÑ\8cне Ð²Ñ\8dÑ\80Ñ\81Ñ\96Ñ\96 $1 Ñ\81Ñ\85аванага Ñ\9eдзелÑ\8cнÑ\96ка",
        "cantcreateaccount-text": "Стварэньне рахункаў з гэтага IP-адрасу ('''$1''') было заблякаванае [[User:$3|$3]].\n\nПрычына блякаваньня пададзеная $3: ''$2''",
        "cantcreateaccount-range-text": "Стварэньне рахункаў з IP-адрасоў у дыяпазоне <strong>$1</strong>, у які ўваходзіць ваш IP-адрас (<strong>$4</strong>), было забароненае {{GENDER:$3|ўдзельнікам|ўдзельніцай}} [[User:$3|$3]].\n\n{{GENDER:$3|Удзельнікам|Удзельніцай}} $3 была пададзеная наступная прычына: <em>$2</em>.",
        "viewpagelogs": "Паказаць журналы падзеяў для гэтай старонкі",
        "recentchanges-legend-newpage": "{{int:recentchanges-label-newpage}} (глядзіце таксама [[Special:NewPages|сьпіс новых старонак]])",
        "recentchanges-submit": "Паказаць",
        "rcfilters-activefilters": "Актыўныя фільтры",
+       "rcfilters-restore-default-filters": "Аднавіць фільтры па змоўчаньні",
        "rcfilters-search-placeholder": "Фільтар апошніх зьменаў (праглядзець або пачніце друкаваць)",
        "rcfilters-invalid-filter": "Няслушны фільтар",
        "rcfilters-filterlist-title": "Фільтры",
        "rcfilters-filter-userExpLevel-experienced-description": "Больш за 30 дзён актыўнасьці і 500 правак.",
        "rcfilters-filtergroup-automated": "Аўтаматычны ўнёсак",
        "rcfilters-filter-bots-label": "Робат",
+       "rcfilters-filter-bots-description": "Праўкі, зробленыя з дапамогай аўтаматызаваных інструмэнтаў.",
+       "rcfilters-filter-humans-label": "Чалавек (ня робат)",
        "rcnotefrom": "Ніжэй {{PLURAL:$5|знаходзіцца зьмена|знаходзяцца зьмены}} з <strong>$4 $3</strong> (да <strong>$1</strong> на старонку).",
        "rclistfrom": "Паказаць зьмены з $2 $3",
        "rcshowhideminor": "$1 дробныя праўкі",
index f6db0a0..2a17f15 100644 (file)
        "badsig": "Loš sirovi potpis.\nProvjerite HTML tagove.",
        "badsiglength": "Vaš potpis je predug.\nMora biti manji od $1 {{PLURAL:$1|znaka|znaka|znakova}}.",
        "yourgender": "Kako želite da se predstavite?",
-       "gender-unknown": "Kad vas spominje, softver će pokušati koristiti srednji rod kad god je to moguće",
+       "gender-unknown": "Kad Vas spominje, softver će pokušati izbjegavati rod kad god je to moguće",
        "gender-male": "On uređuje wiki stranice",
        "gender-female": "Ona uređuje wiki stranice",
        "prefs-help-gender": "Postavljanje ovih podešavanja nije obavezno.\nSoftver koristi ove vrijednosti za vaše naslovljanje i ispravke gramatičkog roda u porukama softvera. Ova će informacija biti javna.",
index 2a44a8b..c72b598 100644 (file)
        "patrol-log-header": "Patruljerede versioner.",
        "log-show-hide-patrol": "$1 patruljeringslog",
        "confirm-markpatrolled-button": "OK",
+       "confirm-markpatrolled-top": "Marker version $3 af $2 som patruljeret?",
        "deletedrevision": "Slettede gammel version $1",
        "filedeleteerror-short": "Fejl under sletning af fil: $1",
        "filedeleteerror-long": "Der opstod en fejl under sletningen af filen:\n\n$1",
index ec5969d..ec0313e 100644 (file)
        "recentchanges-legend-plusminus": "''(±123)''",
        "recentchanges-submit": "Anzeigen",
        "rcfilters-activefilters": "Aktive Filter",
+       "rcfilters-restore-default-filters": "Standardfilter wiederherstellen",
+       "rcfilters-clear-all-filters": "Alle Filter löschen",
        "rcfilters-search-placeholder": "Letzte Änderungen filtern (durchsuchen oder beginne mit der Eingabe)",
        "rcfilters-invalid-filter": "Ungültiger Filter",
+       "rcfilters-empty-filter": "Keine aktiven Filter. Es werden alle Beiträge angezeigt.",
        "rcfilters-filterlist-title": "Filter",
        "rcfilters-filterlist-noresults": "Keine Filter gefunden",
        "rcfilters-filtergroup-registration": "Benutzerregistrierung",
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 7933b02..7b76946 100644 (file)
        "recentchanges-legend-newpage": "{{int:recentchanges-label-newpage}} (véase también la [[Special:NewPages|lista de páginas nuevas]])",
        "recentchanges-submit": "Mostrar",
        "rcfilters-activefilters": "Filtros activos",
+       "rcfilters-restore-default-filters": "Restaurar filtros predeterminados",
+       "rcfilters-clear-all-filters": "Borrar todos los filtros",
        "rcfilters-search-placeholder": "Filtrar cambios recientes (navega o empieza a escribir)",
        "rcfilters-invalid-filter": "Filtro no válido",
+       "rcfilters-empty-filter": "No hay filtros activos. Se muestran todas las contribuciones.",
        "rcfilters-filterlist-title": "Filtros",
        "rcfilters-filterlist-noresults": "No se encontraron filtros",
        "rcfilters-filtergroup-registration": "Registro de usuario",
index b14ceec..aba144a 100644 (file)
        "subcategories": "Azpikategoriak",
        "category-media-header": "Media \"$1\" kategorian",
        "category-empty": "''Kategoria honek ez dauka artikulurik uneotan.''",
-       "hidden-categories": "{{PLURAL:$1|Izkutuko kategoria|Izkutuko kategoriak}}",
+       "hidden-categories": "{{PLURAL:$1|Ezkutuko kategoria|Ezkutuko kategoriak}}",
        "hidden-category-category": "Kategoria ezkutuak",
        "category-subcat-count": "{{PLURAL:$2|Kategoria honek beste honako azpikategoria baino ez du.|Kategoria honek honako {{PLURAL:$1|azpikategoria du|$1 azpikategoriak ditu}}, guztira dauden $2tik.}}",
        "category-subcat-count-limited": "Kategoria honek {{PLURAL:$1|azpikategoria hau du|$1 azpikategoria hauek ditu}}.",
index 216969e..df0c8a7 100644 (file)
        "recentchanges-legend-plusminus": "(''±123'')",
        "recentchanges-submit": "Lister",
        "rcfilters-activefilters": "Filtres actifs",
+       "rcfilters-restore-default-filters": "Rétablir les filtres par défaut",
+       "rcfilters-clear-all-filters": "Effacer tous les filtres",
        "rcfilters-search-placeholder": "Modifications récentes de filtres (naviguer ou commencer à saisir)",
        "rcfilters-invalid-filter": "Filtre non valide",
+       "rcfilters-empty-filter": "Aucun filtre actif. Toutes les contributions sont affichées.",
        "rcfilters-filterlist-title": "Filtres",
        "rcfilters-filterlist-noresults": "Aucun filtre trouvé",
        "rcfilters-filtergroup-registration": "Inscription de l’utilisateur",
index e345969..1d22515 100644 (file)
        "statistics-users": "Prijavljeni [[Special:ListUsers|suradnici]]",
        "statistics-users-active": "Aktivni suradnici",
        "statistics-users-active-desc": "Suradnici koji su napravili neku od radnji u posljednjih {{PLURAL:$1|dan|$1 dana}}",
-       "pageswithprop": "Stranice sa osobinom stranice",
-       "pageswithprop-legend": "Stranice sa osobinom stranice",
+       "pageswithprop": "Stranice s određenim osobinama",
+       "pageswithprop-legend": "Stranice s određenim osobinama",
+       "pageswithprop-text": "Ovo je popis stranica koje koriste određene osobine stranica.",
        "pageswithprop-prop": "Ime osobine:",
        "pageswithprop-submit": "Idi",
        "doubleredirects": "Dvostruka preusmjeravanja",
        "booksources-search": "Traži",
        "booksources-text": "Ovdje je popis vanjskih poveznica na internetskim stranicama koje prodaju nove i rabljene knjige, ali mogu sadržavati i ostale podatke o knjigama koje tražite:",
        "booksources-invalid-isbn": "Čini se da dani ISBN nije valjan; provjerite greške kopirajući iz izvornika.",
+       "magiclink-tracking-rfc": "Stranice s čarobnim RFC poveznicama",
+       "magiclink-tracking-rfc-desc": "Ova stranica rabi čarobne RFC poveznice. Za njihovu migraciju vidi [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Magic_links mediawiki.org].",
+       "magiclink-tracking-pmid": "Stranice s čarobnim PMID poveznicama",
+       "magiclink-tracking-pmid-desc": "Ova stranica rabi čarobne PMID poveznice. Za njihovu migraciju vidi [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Magic_links mediawiki.org].",
        "magiclink-tracking-isbn": "Stranice s čarobnim ISBN poveznicama",
        "magiclink-tracking-isbn-desc": "Ova stranica rabi čarobne ISBN poveznice. Za njihovu migraciju vidi [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Magic_links mediawiki.org].",
        "specialloguserlabel": "Suradnik:",
        "listgrants-summary": "Slijedi popis dozvola s pridruženim pristupom suradničkim pravima. Suradnici mogu omogućiti aplikacijama uporabu svojih računa, ali s ograničenim ovlastima na temelju dozvola koje je suradnik dodijelio aplikaciji. Aplikacija koja djeluje u ime suradnika međutim ne može rabiti prava koje suradnik nema.\nMoguće su [[{{MediaWiki:Listgrouprights-helppage}}|dodatne informacije]] o pojedinim pravima.",
        "listgrants-grant": "Dozvola",
        "listgrants-rights": "Prava",
+       "trackingcategories": "Kategorije za praćenje",
+       "trackingcategories-msg": "Praćene kategorije",
+       "trackingcategories-name": "Naziv poruke",
+       "trackingcategories-desc": "Kriteriji za uključenje u kategoriju",
        "restricted-displaytitle-ignored": "Stranice sa zanemarenim naslovima za prikaz",
+       "restricted-displaytitle-ignored-desc": "Na stranici je zanemaren <code><nowiki>{{DISPLAYTITLE}}</nowiki></code> jer ne odgovara trenutačnom naslovu stranice.",
        "trackingcategories-nodesc": "Opis nije dostupan.",
+       "trackingcategories-disabled": "Kategorija onemogućena",
        "mailnologin": "Nema adrese pošiljatelja",
        "mailnologintext": "Morate biti [[Special:UserLogin|prijavljeni]]\ni imati valjanu adresu e-pošte u svojim [[Special:Preferences|postavkama]]\nda bi mogli slati poštu drugim suradnicima.",
        "emailuser": "Pošalji mu e-poruku",
index 40989e6..c9fc595 100644 (file)
        "resetpass-recycled": "Voluntez chanjar vua pasovorto ad ulo diferanta de vua aktuala pasovorto.",
        "resetpass-temp-emailed": "Vu eniris uzante provizora pasovorto.\nPor parkompletigar enirado, vu mustas krear nova pasovorto hike:",
        "resetpass-temp-password": "Provizora pasovorto:",
+       "passwordreset": "Sendez nova pasovorto per e-posto",
        "passwordreset-username": "Uzantonomo:",
        "passwordreset-invalidemail": "Ne-valida e-posto-adreso",
        "passwordreset-nodata": "Nek uzeronomo nek e-posto-adreso esis provizita",
        "accmailtext": "Hazarde genitita pasovorto por [[User talk:$1|$1]] sendesis ad $2.\n\nLa pasovorto por ica nova konto povas chanjesar che la ''[[Special:ChangePassword|chanjar pasovorto]]'' pagino pos on eniras.",
        "newarticle": "(nova)",
        "newarticletext": "Vu sequis ligilo a pagino qua ne existas ankore.\nPor krear ica pagino, voluntez startar skribar en la infra buxo.\n(regardez la [$1 helpo] por plusa informo).\nSe vu esas hike erore, kliktez sur la butono por retrovenar en vua navigilo.",
-       "noarticletext": "Prezente, ne esas texto en ica pagino.\nVu povas [[Special:Search/{{PAGENAME}}|serchar ica titulo]] en altra pagini,\n<span class=\"plainlinks\">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} serchar en la relata registri],\no [{{fullurl:{{FULLPAGENAME}}|action=edit}} redaktar ica pagino]</span>.",
+       "noarticletext": "Til nun ne existas texto en ica pagino.\nVu povas [[Specala:Search/{{PAGENAME}}|serchar ica titulo]] en altra pagini,\n<span class=\"plainlinks\">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} serchar en la relata registri],\no [{{fullurl:{{FULLPAGENAME}}|action=edit}} redaktar ica pagino]</span>.",
        "userpage-userdoesnotexist": "Uzeronomo \"$1\" no registragesis.\nVoluntez konfirmez se vu volas krear/redaktar ica pagino.",
        "userpage-userdoesnotexist-view": "Uzeronomo \"$1\" no registragesis.",
        "clearyourcache": "'''Atencez: Pos registragar, vu probable mustas renovigar la tempala-magazino di vua navigilo por vidar la chanji.'''\n'''Mozilla / Firefox / Safari:''' tenez ''Shift'' kliktante ''Reload'', o presez sive  ''Ctrl-F5'' sive ''Ctrl-R'' (''Command-R'' ye Mac);\n'''Konqueror''': kliktez ''Reload'' o presez ''F5'';\n'''Opera:''' vakuigez la tempala-magazino en ''Tools → Preferences'';\n'''Internet Explorer:''' tenez ''Ctrl'' kliktante ''Refresh,'' o presez ''Ctrl-F5''.",
        "mergehistory-reason": "Motivo:",
        "revertmerge": "Desmixar",
        "history-title": "Version-historio di \"$1\"",
+       "difference-title": "Diferi inter la revizi di $1",
        "lineno": "Lineo $1:",
        "compareselectedversions": "Komparar selektita versioni",
        "editundo": "des-facez",
+       "diff-multi-sameuser": "(ne montresas {{PLURAL:$1|1 meza revizo|$1 meza revizi}} facita da la sama uzero)",
        "searchresults": "Rezultaji dil sercho",
        "searchresults-title": "Sercho-rezultaji por \"$1\"",
        "titlematches": "Koincidi de titulo di artiklo",
        "searchprofile-articles-tooltip": "Serchez en $1",
        "searchprofile-images-tooltip": "Serchez arkivi",
        "search-result-size": "$1 ({{PLURAL:$2|1 vorto|$2 vorti}})",
-       "search-redirect": "(ridirektilo $1)",
+       "search-redirect": "(Ridirektita de $1)",
        "search-section": "(seciono $1)",
        "search-suggest": "Ka vu volis dicar: $1",
        "search-interwiki-caption": "Altra projekti",
        "search-interwiki-more": "(plusa)",
        "searchall": "omna",
        "showingresults": "Montrante infre {{PLURAL:$1|'''1''' rezulto|'''$1''' rezulti}}, qui komencas kun numero #'''$2'''.",
+       "search-nonefound": "Nula rezulto trovesis por lua serchado.",
        "powersearch-legend": "Avancita sercho",
        "powersearch-ns": "Serchez en nomari:",
        "powersearch-toggleall": "Omna",
        "action-upload": "adkargar ca arkivo",
        "action-browsearchive": "serchar pagini efacita",
        "nchanges": "$1 {{PLURAL:$1|chanjo|chanji}}",
+       "enhancedrc-history": "Versionaro",
        "recentchanges": "Recenta chanji",
        "recentchanges-legend": "Recenta chanji preferaji",
        "recentchanges-summary": "Regardez la maxim recenta chanji en Wiki per ica pagino.",
        "recentchanges-label-newpage": "Ca redaktajo kreis nova pagino",
        "recentchanges-label-minor": "Ica es mikra redaktajo",
        "recentchanges-label-bot": "Ta chanjo facita da bot",
+       "recentchanges-label-unpatrolled": "Ica modifiko ne patroliesas ankore.",
+       "recentchanges-label-plusminus": "La pagino modifikesis segun ica quanto di *bicoki",
        "recentchanges-legend-newpage": "$1 - nova pagino",
        "rcfilters-filter-userExpLevel-experienced-description": "Plu kam 30 dii di agemeso e 500 redakti.",
        "rcnotefrom": "Infre esas la lasta chanji depos '''$2''' (montrita til '''$1''').",
        "rclistfrom": "Montrar nova chanji startante de $3 $2",
        "rcshowhideminor": "$1 mikra redakti",
+       "rcshowhideminor-show": "Montrar",
+       "rcshowhideminor-hide": "Celar",
        "rcshowhidebots": "$1 roboti",
+       "rcshowhidebots-show": "Montrar",
+       "rcshowhidebots-hide": "Celar",
        "rcshowhideliu": "$1 enrejistrita uzeri",
+       "rcshowhideliu-hide": "Celar",
        "rcshowhideanons": "$1 anonima uzanti",
+       "rcshowhideanons-show": "Montrar",
+       "rcshowhideanons-hide": "Celar",
        "rcshowhidemine": "$1 mea redakti",
+       "rcshowhidemine-show": "Montrar",
+       "rcshowhidemine-hide": "Celar",
        "rclinks": "Montrar la lasta $1 chanji dum la lasta $2 dii<br />$3",
        "diff": "dif",
        "hist": "vers",
        "newpageletter": "N",
        "boteditletter": "r",
        "rc_categories_any": "Irga selektita",
+       "rc-change-size-new": "$1 {{PLURAL:$1|bicoko|bicoki}} pos la modifiki",
        "newsectionsummary": "/* $1 */ nova seciono",
        "rc-enhanced-expand": "Montrez detali",
        "rc-enhanced-hide": "Celar detali",
        "linkstoimage": "La {{PLURAL:$1|pagino|$1 pagini}} infre ligas a ca arkivo:",
        "nolinkstoimage": "Nula pagino ligas a ca pagino.",
        "sharedupload": "Ca arkivo esas de $1 e posible esas uzata da altra projekti.",
+       "sharedupload-desc-here": "Ca arkivo jacas en $1, e povas uzesar en altra projeti.\nLa deskriptado en lua [$2 pagino di deskriptado] montresas infre.",
        "uploadnewversion-linktext": "Adkargez nova versiono dil arkivo",
        "shared-repo-from": "ek $1",
+       "upload-disallowed-here": "Vu ne povas modifikar ica arkivo.",
        "filerevert-comment": "Motivo:",
        "filedelete": "Efacar $1",
        "filedelete-legend": "Efacar arkivo",
        "apisandbox-loading": "Charjas informo pri modulo « $1 » di API...",
        "booksources": "Fonti di libri",
        "booksources-search-legend": "Serchez librala fonti",
+       "booksources-search": "Serchar",
        "specialloguserlabel": "Agero:",
        "speciallogtitlelabel": "Skopo (titulo od {{ns:user}}:uzernomo por uzero):",
        "log": "Registrari",
        "deletereason-dropdown": "*Ordinara motivi por efacado\n** \"Spam\" nedezirata mesaji\n** Vandalismo\n** Kopiyuro Violaco\n** Demandita da autoro\n** Nefuncionanta ligilo",
        "rollback": "Retrorulez redakti",
        "rollbacklink": "retrorulez",
+       "rollbacklinkcount": "nuligar $1 {{PLURAL:$1|modifiko|modifiki}}",
        "rollbackfailed": "Retrorular ne sucesis",
        "cantrollback": "Ne esas posibla retrorular. La lasta kontributanto esas la nura autoro di ica pagino.",
        "alreadyrolled": "Vu ne povas retrorular la lasta chanjo di [[:$1]] da [[User:$2|$2]] ([[User talk:$2|Diskutez]]{{int:pipe-separator}}[[Special:Contributions/$2|{{int:contribslink}}]]);\nulu pluse ja redaktis o retrorulis ica pagino.\n\nLa lasta chanjo a la pagino esis da [[User:$3|$3]] ([[User talk:$3|Diskutez]]{{int:pipe-separator}}[[Special:Contributions/$3|{{int:contribslink}}]]).",
        "contributions": "Kontributadi dil {{GENDER:$1|uzero}}",
        "contributions-title": "Uzero-kontributadi di $1",
        "mycontris": "Kontributadi",
+       "anoncontribs": "Kontributadi",
        "contribsub2": "Pro $1 ($2)",
        "nocontribs": "Ne trovesis chanji qui fitez ita kriterii.",
        "uctop": "(aktuala)",
        "tooltip-pt-mycontris": "Listo di {{GENDER:|vua}} kontributaji",
        "tooltip-pt-login": "Vu darfas enirar uzante vua pas-vorto, ma lo ne esas preskriptata.",
        "tooltip-pt-logout": "Ekirar",
+       "tooltip-pt-createaccount": "Vu stimulesas a krear konto e facar \"log in\". Tamen, to ne esas obliganta",
        "tooltip-ca-talk": "Diskuto pri la pagino di kontenajo",
        "tooltip-ca-edit": "Redaktar ita pagino",
        "tooltip-ca-addsection": "Komencar nova seciono",
        "others": "altra",
        "siteusers": "{{PLURAL:$2|{{GENDER:$1|uzero}}|uzeri}} $1 di {{SITENAME}}",
        "spamprotectiontitle": "Filtrilo kontre spamo",
+       "simpleantispam-label": "Surveyo kontre \"spam\".\n<strong>NE SKRIBEZ</strong> hike!",
        "pageinfo-toolboxlink": "Informo di ca pagino",
        "previousdiff": "← Plu anciena versiono",
        "nextdiff": "Plu recenta versiono →",
        "widthheightpage": "$1 × $2, $3 {{PLURAL:$3|pagino|pagini}}",
        "file-nohires": "Ne existas grandeso plu granda.",
+       "svg-long-desc": "arkivo SVG, nominale $1 x $2 \"pixels\", kun $3",
        "show-big-image": "Arkivo originala",
+       "show-big-image-size": "$1 x $2 pixels",
        "newimages": "Galerio di nova arkivi",
        "imagelisttext": "Infre esas listo di '''$1''' {{PLURAL:$1|arkivo|arkivi}} rangizita $2.",
        "newimages-legend": "Filtrilo",
        "ilsubmit": "Serchar",
        "bydate": "per dato",
        "metadata": "Metadonaji",
+       "metadata-help": "Ca arkivo kontenas plusa informo, probable furnisita per la kamero elektronikala o per la \"scanner\" uzata por krear o kopiar l'imajo.\nSe l'arkivo modifikesos de lua originala stando, kelka detali povos ne reprezentar exakte l'arkivo modifikata.",
+       "metadata-fields": "Image metadata fields listed in this message will be included on image page display when the metadata table is collapsed.\nOthers will be hidden by default.\n* make\n* model\n* datetimeoriginal\n* exposuretime\n* fnumber\n* isospeedratings\n* focallength\n* artist\n* copyright\n* imagedescription\n* gpslatitude\n* gpslongitude\n* gpsaltitude",
        "exif-imagewidth": "Larjeso",
        "exif-imagelength": "Alteso",
+       "exif-orientation": "Orientizo",
+       "exif-xresolution": "Horizontala distingivo",
+       "exif-yresolution": "Vertikala distingivo",
+       "exif-datetime": "Dio e horo di la modifiko dil arkivo",
+       "exif-make": "Fabrikanto di la fotografilo",
+       "exif-model": "Fotografilo uzita",
+       "exif-software": "*Komputeroprogramo uzata",
        "exif-artist": "Autoro",
+       "exif-exifversion": "versiono Exif",
+       "exif-datetimeoriginal": "Dio e horo di produktado di la datumaro",
+       "exif-datetimedigitized": "Dio e horo di la kopio kun \"scanner\"",
        "exif-exposuretime-format": "$1 sek ($2)",
        "exif-gpslatitude": "Latitudo",
        "exif-gpslongitude": "Longitudo",
        "watchlisttools-view": "Vidar relatanta chanji",
        "watchlisttools-edit": "Vidar e redaktar surveyo-listo",
        "watchlisttools-raw": "Redaktar texto di surveyo-listo",
+       "signature": "[[{{ns:user}}:$1|$2]] ([[{{ns:user_talk}}:$1|diskuto]])",
        "version": "Versiono",
        "version-specialpages": "Specala pagini",
        "version-other": "Altra",
        "specialpages-group-redirects": "Specala pagini di ridirektili",
        "blankpage": "Pagino sen-skribura",
        "tag-filter-submit": "Filtrez",
+       "tag-list-wrapper": "([[Special:Tags|{{PLURAL:$1|Etikedo|Etikedi}}]]: $2)",
        "tags-edit": "redaktar",
        "tags-hitcount": "$1 {{PLURAL:$1|chanjo|chanji}}",
        "htmlform-reset": "Desfacar chanji",
        "htmlform-selectorother-other": "Altra",
        "htmlform-cloner-create": "Adjuntar plue",
+       "logentry-move-move": "$1 {{GENDER:$2|movis}} la pagino $3 a $4",
+       "logentry-newusers-create": "La konto dil uzero $1 kreesis.",
+       "logentry-upload-upload": "$1 {{GENDER:$2|uploaded}} $3",
        "rightsnone": "(nula)",
        "revdelete-summary": "redakto-rezumo",
        "searchsuggest-search": "Serchez en {{SITENAME}}",
index 2cd84d3..ce3d5e7 100644 (file)
        "recentchanges-legend-plusminus": "(''±123'')",
        "recentchanges-submit": "Mostra",
        "rcfilters-activefilters": "Filtri attivi",
+       "rcfilters-restore-default-filters": "Ripristina i filtri predefiniti",
+       "rcfilters-clear-all-filters": "Pulisci tutti i filtri",
        "rcfilters-search-placeholder": "Filtra le ultime modifiche (naviga o inizia a digitare)",
        "rcfilters-invalid-filter": "Filtro non valido",
+       "rcfilters-empty-filter": "Nessun filtro attivo. Sono mostrati tutti i contributi.",
        "rcfilters-filterlist-title": "Filtri",
        "rcfilters-filterlist-noresults": "Nessun filtro trovato",
        "rcfilters-filtergroup-registration": "Registrazione utente",
index a7ee19c..3f45d64 100644 (file)
        "recentchanges-legend-plusminus": "(<em>±123</em>)",
        "recentchanges-submit": "보기",
        "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": "사용자 등록",
+       "rcfilters-filter-registered-label": "등록됨",
+       "rcfilters-filter-registered-description": "로그인된 편집자.",
+       "rcfilters-filter-unregistered-label": "등록 안됨",
+       "rcfilters-filter-unregistered-description": "로그인 하지 않은 편집자.",
        "rcfilters-filtergroup-authorship": "원작자 편집",
        "rcfilters-filter-editsbyself-label": "자신의 편집",
        "rcfilters-filter-editsbyself-description": "당신의 편집.",
        "rcfilters-filter-editsbyother-label": "다른 사용자의 편집",
-       "rcfilters-filter-editsbyother-description": "다른 사용자에 의한 편집. (당신의 편집이 아님)",
+       "rcfilters-filter-editsbyother-description": "다른 사용자에 의한 편집 (당신의 편집이 아님).",
        "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-learner-description": "\"신규 사용자\" 보다 활동일 및 편집 수가 더 많지만 \"능숙한 사용자\" 보다는 적습니다.",
        "rcfilters-filter-userExpLevel-experienced-label": "능숙한 사용자",
        "rcfilters-filter-userExpLevel-experienced-description": "30일 이상의 활동 및 500개 이상의 편집.",
+       "rcfilters-filtergroup-automated": "자동으로 된 기여",
        "rcfilters-filter-bots-label": "봇",
+       "rcfilters-filter-bots-description": "자동 도구를 이용한 편집.",
        "rcfilters-filter-humans-label": "사람 (봇이 아님)",
+       "rcfilters-filter-humans-description": "수동으로 한 편집.",
        "rcfilters-filter-minor-label": "사소한 편집",
        "rcfilters-filter-major-label": "사소하지 않은 편집",
+       "rcfilters-filter-major-description": "사소한 편집으로 표시되지 않은 편집.",
+       "rcfilters-filtergroup-changetype": "차이 종류",
        "rcfilters-filter-pageedits-label": "문서 편집",
+       "rcfilters-filter-newpages-label": "문서 생성",
+       "rcfilters-filter-newpages-description": "새 문서를 만드는 편집.",
+       "rcfilters-filter-categorization-label": "분류 차이",
        "rcnotefrom": "아래는 <strong>$3, $4</strong>부터 시작하는 {{PLURAL:$5|바뀜이 있습니다}}. (최대 <strong>$1</strong>개가 표시됨)",
        "rclistfrom": "$3 $2부터 시작하는 새로 바뀐 문서 보기",
        "rcshowhideminor": "사소한 편집 $1",
index 2f0a797..1d786c2 100644 (file)
@@ -7,7 +7,8 @@
                        "Reedy",
                        "Urhixidur",
                        "아라",
-                       "Katxis"
+                       "Katxis",
+                       "Chabi"
                ]
        },
        "tog-underline": "Sulinia lias:",
        "disclaimers": "Negas de respondablia",
        "disclaimerpage": "Project:Nega jeneral de respondablia",
        "edithelp": "Aida con edita",
+       "helppage-top-gethelp": "Aida",
        "mainpage": "Paje Prima",
        "mainpage-description": "Paje Prima",
        "policy-url": "Project:Politica",
        "toc": "Contenida",
        "showtoc": "mostra",
        "hidetoc": "asconde",
+       "collapsible-collapse": "Colasa",
+       "collapsible-expand": "Estende",
+       "confirmable-confirm": "Esce {{GENDER:$1|tu}} es serta?",
+       "confirmable-yes": "Si",
+       "confirmable-no": "No",
        "viewdeleted": "Vide $1?",
        "feedlinks": "Flue:",
        "site-rss-feed": "$1 RSS Flue",
        "badtitletext": "La titulo de la paje tu ia desira ia es nonlegal, es vacua, o es un titulo intervici o interlingual no liada coreta. Es posable ce es un o plu simboles ce no pote es usada en titulos.",
        "viewsource": "Vide la orijin",
        "viewsourcetext": "Tu pote vide e copia la orijin de esta paje:",
+       "mycustomcssprotected": "Tu no ave permete per edita esta paje CSS.",
+       "mycustomjsprotected": "Tu no ave permete per edita esta paje JavaScript.",
+       "myprivateinfoprotected": "Tu no ave permete per edita tua informa privata.",
+       "mypreferencesprotected": "Tu no ave permete per edita tua preferes.",
+       "ns-specialprotected": "La pajes spesial no pote es editada.",
+       "welcomeuser": "Bonveni, $1!",
        "yourname": "Nom de usor:",
        "userlogin-yourname": "Nom de usor",
        "userlogin-yourname-ph": "Entra tua nom de usor",
        "gotaccountlink": "Sinia per entra",
        "userlogin-resetpassword-link": "Tu ia oblida tua sinia secreta?",
        "userlogin-helplink2": "Aida me per identifia me",
+       "createacct-emailrequired": "Adirije de e-posta",
        "createacct-emailoptional": "Adirije de e-posta (elejable)",
        "createacct-email-ph": "Entra tua adirije de e-posta",
+       "createacct-another-email-ph": "Entra tua adirije de e-posta",
+       "createaccountreason": "Razona:",
+       "createacct-reason": "Razona:",
        "createacct-submit": "Crea tua conta",
+       "createacct-another-submit": "Crea un conta",
        "createacct-benefit-heading": "{{SITENAME}} es fabricada par persones como tu.",
        "createacct-benefit-body1": "{{PLURAL:$1|edita|editas}}",
        "createacct-benefit-body2": "{{PLURAL:$1|paje|pajes}}",
        "createacct-benefit-body3": "{{PLURAL:$1|contribuor|contribuores}}",
        "loginerror": "Era de entra",
-       "loginsuccesstitle": "Entra susedente",
+       "loginsuccesstitle": "Tu ia entra",
        "loginsuccess": "'''Tu ia entrada aora a {{SITENAME}} como \"$1\".'''",
-       "nosuchuser": "Es no usor con la nom \"$1\".\nEsamina la spele, o [[Special:CreateAccount|crea un conta nova]].",
+       "nosuchuser": "On no ave un usor con la nom \"$1\".\nOn distingui entre leteras major e minor per nomes de usores.\nEsamina la spele, o [[Special:CreateAccount|crea un conta nova]].",
        "nosuchusershort": "Es no usor con esta nom \"$1\". Esamina la spele.",
        "nouserspecified": "Tu debe indica un nom de usor.",
        "wrongpassword": "La sinia de entra no es coreta. Per favore, atenta ancora.",
        "wrongpasswordempty": "La sinia de entra es vacua. Per favore, atenta ancora.",
-       "passwordtooshort": "Tu sinia secreta no es legal o es tro corta.\nEl debe ave a min {{PLURAL:$1|1 simbol|$1 simboles}} e debe difere de tu nom de usor.",
-       "mailmypassword": "Envia la sinia secreta nova par eposta",
+       "passwordtooshort": "Sinias secreta debe ave minima {{PLURAL:$1|1 simbol|$1 simboles}}.",
+       "passwordtoolong": "Sinias secreta no pote ave plu ca {{PLURAL:$1|1 simbol|$1 simboles}}.",
+       "passwordtoopopular": "Sinias secreta comun debe no es usada. Per favore, eleje un sinia plu unica.",
+       "mailmypassword": "Cambia tua sinia secreta",
        "passwordremindertitle": "Sinia secreta temporer nova per {{SITENAME}}",
-       "passwordremindertext": "Algun (tu, probable, de adirije IP $1)\nia demanda ce nos envia a tu un sinia secreta nova per {{SITENAME}} ($4).\nLa sinia secreta per usor \"$2\" es aora \"$3\".\nTu debe sinia per entra e cambia tu sinia secreta aora.\n\nSi algun otra ce tu ia envia esta demanda a nos, o si tu ia recorda tu sinia secreta e no vole cambia el aora, tu pote iniora esta mesaje e continua usa tu sinia secreta vea.",
+       "passwordremindertext": "Algun (tu, probable, de adirije IP $1)\nia demanda un sinia secreta nova per {{SITENAME}} ($4).\nLa sinia secreta tempora per usor \"$2\" es aora \"$3\". Si esta ia es tua intende, tu debe identifia tu denova per entra e eleje tua sinia nova aora.\nTua sinia tempora va desvalidi en {{PLURAL:$5|un dia|$5 dias}}.\n\nSi algun otra ca tu ia envia esta demanda a nos, o si tu ia recorda tua sinia secreta e no vole cambia lo aora, tu pote iniora esta mesaje e continua usa tua sinia secreta vea.",
        "noemail": "No es un adirije de eposta per usor \"$1\".",
        "passwordsent": "Un sinia secreta ia es enviada a la adirije de eposta per \"$1\".\nPer favore, sinia per entra ancora pos tu ia reseta el.",
-       "eauthentsent": "Un eposta de serti ia es enviada a la adirije de eposta proposada.\nAnte alga otra eposta es enviada a la conta, tu va nesesa segue la instruis en la eposta, per serti ce la conta es vera de tu.",
+       "eauthentsent": "Un eposta de serti ia es enviada a la adirije de eposta spesifada.\nAnte cualce otra epostas es enviada a tua conta, tu va nesesa segue la instruis en la eposta, per serti ce la conta es vera la tua.",
        "emailconfirmlink": "Aproba tu adirije de eposta",
+       "accountcreated": "Conta es creada",
        "loginlanguagelabel": "Lingua: $1",
        "pt-login": "Identifia se",
        "pt-login-button": "Identifia tua",
        "resetpass-submit-loggedin": "Cambia la sinia secreta",
        "resetpass-temp-password": "Sinia secreta tempora:",
        "passwordreset": "Reinisia sinia secreta",
+       "passwordreset-username": "Nom de usor:",
+       "passwordreset-domain": "Domina:",
+       "passwordreset-email": "Adirije de e-posta",
+       "passwordreset-invalidemail": "Adirije de e-posta no es valida",
+       "changeemail-submit": "Cambia e-posta",
        "bold_sample": "Testo en leteras forte",
        "bold_tip": "Testo en leteras forte",
        "italic_sample": "Testo en leteras italica",
        "sig_tip": "Tu sinia con la primi de la ora",
        "hr_tip": "Linia orizonal (usa nonfrecuente)",
        "summary": "Soma:",
-       "subject": "Sujeto/titulo:",
+       "subject": "Sujeto:",
        "minoredit": "Esta es un cambia minor",
        "watchthis": "Oserva esta paje",
        "savearticle": "Fisa paje",
+       "publishpage": "Publici paje",
+       "publishchanges": "Publica la cambias",
        "preview": "Previde",
        "showpreview": "Mostra previde",
        "showdiff": "Mostra diferes",
        "summary-preview": "Previde soma:",
        "blockedtitle": "Usor es impedida",
        "blockedtext": "'''Tu nom de usor o adirije de IP ia es impedida.'''\n\nLa impedi ia es fada par $1.\nLa razon donada es ''$2''.\n\n* Comensa de impedi: $8\n* Fini de impedi: $6\n* Ci algun intende impedi: $7\n\nTu pote contata $1 o un otra [[{{MediaWiki:Grouppage-sysop}}|dirijor]] per discute esta impedi.\nTu no pote usa la 'envia un eposta a esta usor' sin un adirije de eposta legal es indicada en tu\n[[Special:Preferences|preferis de conta]] e tu no es impedida de usa el.\nTu adirije de IP es aora $3, e la identia de la impedi es #$5.\nPer favore inclui tota esta detales en tu demandas.",
+       "loginreqtitle": "Entra de identia nesesada",
        "loginreqlink": "Identifia se",
        "newarticle": "(Nova)",
        "newarticletext": "Tu ia segue un lia a un paje ce no esista ja.\nPer crea la paje, comensa scrive en la caxa a su\n(vide la [$1 paje de aida] per plu).\nSi tu es asi par era, clica a la boton '''retro''' de tu surfador.",
        "hiddencategories": "Esta paje es un membro de {{PLURAL:$1|1 categoria ascondeda|$1 categorias ascondeda}}:",
        "nocreatetext": "{{SITENAME}} ave un restringe a la capas per crea pajes nova.\nTu pote vade a retro e edita un paje esistente, o  [[Special:UserLogin|sinia per entra o crea un conta]].",
        "permissionserrorstext-withaction": "Tua no es permeteda per $2, per la {{PLURAL:$1|razona|razonas}} seguente:",
-       "recreate-moveddeleted-warn": "'''Avisa: Tu es recrea un paje ce ia es sutraed en la pasada.'''\nTu debe pensa ce es bon continua edita esta paje.\nLa arcivo de sutraes per esta paje es asi per conveni:",
+       "recreate-moveddeleted-warn": "<strong>Avisa: Tu es recreante un paje cual ia es sutraeda a ante.</strong>\nTu debe pensa si la continua de edita de esta paje conveni.\nLa arcivo de sutraes e moves per esta paje es asi per tua conveni:",
        "moveddeleted-notice": "Esta paje ia es sutraeda.\nLa arcivo de sutraes e moves per la paje es furnida a su per refere.",
        "viewpagelogs": "Vide la arcivo de esta paje",
        "currentrev": "Cambia presente",
        "page_last": "final",
        "histlegend": "Diferente eleje: Marca la caxas de radio de esta varias per compare e clica entra o la boton a la funda.<br />\n(presente) = difere de la varia presente,\n(presedente) = difere con varia presedente, M = edita minor.",
        "history-fieldset-title": "Surfa istoria",
-       "histfirst": "Prima",
-       "histlast": "Ultima",
+       "histfirst": "La plu vea",
+       "histlast": "La plu nova",
        "historysize": "({{PLURAL:$1|1 otuple|$1 otuples}})",
        "historyempty": "(vacua)",
        "history-feed-title": "Istoria de revises",
        "history-feed-item-nocomment": "$1 a $2",
        "rev-delundel": "mostra/asconde",
+       "rev-showdeleted": "mostra",
+       "revdelete-show-file-submit": "Si",
+       "revdelete-radio-set": "Ascondeda",
+       "revdelete-radio-unset": "Vidable",
+       "pagehist": "Istoria de paje",
+       "deletedhist": "Istoria sutraeda",
        "history-title": "Istoria de cambias de \"$1\"",
        "difference-title": "Difere entre revisas de \"$1\"",
        "lineno": "Linia $1:",
        "searchall": "tota",
        "search-showingresults": "{{PLURAL:$4|Resulta <strong>$1</strong> de <strong>$3</strong>|Resultas <strong>$1 - $2</strong> de <strong>$3</strong>}}",
        "search-nonefound": "On ave no resultas cual conforma con la demanda.",
+       "powersearch-toggleall": "Tota",
+       "powersearch-togglenone": "Zero",
        "preferences": "Preferis",
        "mypreferences": "Preferis",
        "skin-preview": "Previde",
        "timezoneregion-pacific": "Mar Pasifica",
        "prefs-files": "Fixes",
        "youremail": "Eposta:",
-       "username": "Nom de usor:",
-       "prefs-memberingroups": "Membro de la {{PLURAL:$1|grupo|grupos}}:",
+       "username": "{{GENDER:$1|Nom de usor}}:",
+       "prefs-memberingroups": "{{GENDER:$2|Membro}} de {{PLURAL:$1|grupo|grupos}}:",
        "yourrealname": "Nom vera:",
        "yourlanguage": "Lingua:",
        "yournick": "Suscrive:",
-       "yourgender": "Seso:",
-       "gender-male": "Mas",
-       "gender-female": "Fema",
+       "yourgender": "Como tu prefere ce tu es descriveda?",
+       "gender-male": "El edita pajes de wiki",
+       "gender-female": "El edita pajes de wiki",
        "email": "Eposta",
-       "prefs-help-realname": "Tu nom vera no es obligada, ma si tu vole dona tu nom vera, el va es usada per onora tu per tu labora.",
+       "prefs-help-realname": "Tu nom vera no es obligada, ma si tu vole dona tu nom vera, el va es usada per onora tu per tu labora.\n\nTu no debe entra tua nom vera. Ma si tu entra tua noma vera, lo pote es usada per atribui tua laboras a tu.",
        "prefs-signature": "Suscrive",
        "userrights": "Dirije de la diretos de usores",
        "saveusergroups": "Fisa la grupo de usores",
        "group-user": "Usores",
        "group-sysop": "Dirijores",
        "group-all": "(tota)",
-       "group-user-member": "Usor",
+       "group-user-member": "{{GENDER:$1|usor}}",
        "grouppage-user": "{{ns:project}}:Usores",
        "grouppage-sysop": "{{ns:project}}:Dirijores",
        "right-writeapi": "Usa de la API de scrive",
        "minoreditletter": "m",
        "newpageletter": "N",
        "boteditletter": "b",
-       "rc_categories_any": "Cualce",
+       "rc_categories_any": "Cualce de la elejeda",
        "rc-change-size-new": "$1 {{PLURAL:$1|bait|baites}}  pos cambia",
        "rc-enhanced-expand": "Mostra detalias",
        "rc-enhanced-hide": "Asconde detalias",
        "wantedpages": "Pajes desirada",
        "mostlinked": "Pajes la plu liada",
        "mostlinkedcategories": "Categorias a ce es la plu lias",
-       "mostlinkedtemplates": "Modeles a ce es la plu lias",
+       "mostlinkedtemplates": "Pajes la plu liada",
        "mostcategories": "Pajes con la plu categorias",
        "mostimages": "Fixes a ce es la plu lias",
        "mostrevisions": "Pajes con la plu revisas",
        "longpages": "Pajes longa",
        "deadendpages": "Pajes sin sorti",
        "protectedpages": "Pajes protejeda",
+       "protectedpages-page": "Paje",
+       "protectedpages-expiry": "Desvalidi",
        "listusers": "Lista de usores",
        "newpages": "Pajes nova",
        "ancientpages": "Pajes la plu vea",
        "listgrouprights-group": "Grupo",
        "listgrouprights-members": "(lista de membros)",
        "emailuser": "Envia un eposta a esta usor",
-       "emailfrom": "De",
-       "emailto": "Per",
-       "watchlist": "Pajes oservada",
+       "emailfrom": "De:",
+       "emailto": "A:",
+       "emailsubject": "Sujeto:",
+       "emailmessage": "Mesaje:",
+       "emailsend": "Envia",
+       "emailsent": "E-posta ia es enviada",
+       "watchlist": "Lista de pajes oservada",
        "mywatchlist": "Lista de pajes oservada",
+       "watchlistfor2": "Per $1 $2",
        "nowatchlist": "Tu ave no cosas en tu lista oservada",
        "addedwatchtext": "La paje \"[[:$1]]\" ia es juntada a tu [[Special:Watchlist|lista de pajes oservada]].\nCambias future a esta paje e se paje de discutes va es listada ala, e la paje va apera en leteras '''forte''' en la [[Special:RecentChanges|lista de cambias resente]] per es plu fasil oservada.\n\nSi tu vole sutrae la paje de tu lista de pajes oservada en la futur, clica a \"no oserva\" en la bara a la lado.",
        "removedwatchtext": "La paje \"[[:$1]]\" ia es sutraeda de [[Special:Watchlist|tu lista de pajes oservada]].",
        "move-page-legend": "Move paje",
        "movepagetext": "Usa la forma a su va cambia la nom de un paje, e va move tota se istoria a la nom nova.\nLa titulo vea va deveni un paje de redirije a la titulo nova.\nLias a la titulo de la paje vea no va es cambiada;\nTu debe vide serta ce es redirijes duple o rompeda.\nTu es respondable per es serta ce la lias va continua vade a la locas intendeda.\n\nNota ce la paje '''no''' va es moveda si es ja un paje a la titulo nova, sin el es vacua o un redirije e no ave un istoria de editas presedente.\nEsta sinifia ce tu pote cambia la nom de un paje a la loca presedente si tu era, e tu no pote scrive supra un paje ce esiste ja.\n\n'''AVISA!'''\nEsta pote es un cambia dramos e nonespetada per un paje poplal;\nper favore, es serta ce tu comprende la resulta de esta ata ante tu continua.",
        "movepagetalktext": "La paje de discuta de esta paje va es moveda automatica con el '''eseta si:'''\n*Un paje de discuta ce no es vacua esiste ja su la nom nova, o\n*Tu cambia la indica en la caxa su.\n\nEn esta casos, tu va nesesa move o fusa la paje per mano, si desirada.",
-       "newtitle": "A titulo nova:",
+       "newtitle": "Titulo nova:",
        "move-watch": "Oserva esta paje",
        "movepagebtn": "Move paje",
        "pagemovedsub": "La move ia susede",
index 75ed4c2..3e1e0dc 100644 (file)
        "recentchanges-legend-plusminus": "(''±123'')",
        "recentchanges-submit": "Прикажи",
        "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": "Регистрација на корисници",
index 50abf54..802933e 100644 (file)
        "revdelete-unrestricted": "အက်ဒမင်များအတွက် ကန့်သတ်ချက်များကို ဖယ်ရှားရန်",
        "logentry-suppress-block": "{{GENDER:$4|$3}} အား $5 ကြာအောင် $1 က {{GENDER:$2|ပိတ်ပင်ခဲ့သည်}} $6",
        "logentry-move-move": "$3 စာမျက်နှာကို $4 သို့ $1က {{GENDER:$2|ရွှေ့ခဲ့သည်}}",
-       "logentry-move-move-noredirect": "$3 á\80\99á\80¾ $4 á\80\9eá\80­á\80¯á\80· á\80\85á\80¬á\80\99á\80»á\80\80á\80ºá\80\94á\80¾á\80¬á\80\80á\80­á\80¯ á\80\95á\80¼á\80\94á\80ºá\80\8aá\80½á\80¾á\80\94á\80ºá\80¸á\80\81á\80»á\80\94á\80ºá\80\99á\80\91á\80¬á\80¸á\80\95ဲ $1 {{GENDER:$2|က ရွှေ့ခဲ့သည်}}",
+       "logentry-move-move-noredirect": "$3 á\80\99á\80¾ $4 á\80\9eá\80­á\80¯á\80· á\80\85á\80¬á\80\99á\80»á\80\80á\80ºá\80\94á\80¾á\80¬á\80\80á\80­á\80¯ á\80\95á\80¼á\80\94á\80ºá\80\8aá\80½á\80¾á\80\94á\80ºá\80¸á\80\81á\80»á\80\94á\80ºá\80\99á\80\91á\80¬á\80¸á\80\98ဲ $1 {{GENDER:$2|က ရွှေ့ခဲ့သည်}}",
        "logentry-move-move_redir": "$3 စာမျက်နှာကို $4 သို့ ပြန်ညွှန်းပေါ်ထပ်၍ $1 က {{GENDER:$2|ရွှေ့ခဲ့သည်}}",
+       "logentry-move-move_redir-noredirect": "$3 မှ $4 သို့ ပြန်ညွှန်ပေါ်ထပ်အုပ်ကာ ပြန်ညွှန်းချန်မထားဘဲ $1 က {{GENDER:$2|ရွှေ့ခဲ့သည်}}",
        "logentry-newusers-create": "အသုံးပြုသူအကောင့် $1 ကို {{GENDER:$2|ဖန်တီးခဲ့သည်}}",
        "logentry-newusers-autocreate": "အသုံးပြုသူအကောင့် $1 ကို အလိုအလျောက် {{GENDER:$2|ဖန်တီးခဲ့သည်}}",
        "logentry-upload-upload": "$1 သည် $3 ကို {{GENDER:$2|upload တင်ခဲ့သည်}}",
index 1e71b88..8c2eef7 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.",
        "rcfilters-filter-bots-label": "Label for the filter for showing edits made by automated tools.\n{{Identical|Bot}}",
        "rcfilters-filter-bots-description": "Description for the filter for showing edits made by automated tools.",
        "rcfilters-filter-humans-label": "Label for the filter for showing edits made by human editors.",
-       "rcfilters-filter-humans-description": " Description for the filter for showing edits made by human editors.",
+       "rcfilters-filter-humans-description": "Description for the filter for showing edits made by human editors.",
        "rcfilters-filtergroup-significance": "Title for the filter group for edit significance.\n{{Identical|Significance}}",
        "rcfilters-filter-minor-label": "Label for the filter for showing edits marked as minor.",
        "rcfilters-filter-minor-description": "Description for the filter for showing edits marked as minor.",
index ce1e7e2..6011dfb 100644 (file)
        "recentchanges-legend-plusminus": "(''±123'')",
        "recentchanges-submit": "Показать",
        "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": "Регистрация участников",
index 259bbe2..389398d 100644 (file)
        "badsig": "Loš sirovi potpis.\nProvjerite HTML tagove.",
        "badsiglength": "Vaš potpis je predug.\nMora biti manji od $1 {{PLURAL:$1|znaka|znaka|znakova}}.",
        "yourgender": "Kako želite da se predstavite?",
-       "gender-unknown": "Kad vas spominje, softver će pokušati koristiti srednji rod kad god je to moguće",
+       "gender-unknown": "Kad Vas spominje, softver će pokušati izbjegavati rod kad god je to moguće",
        "gender-male": "On uređuje wiki stranice",
        "gender-female": "Ona uređuje wiki stranice",
        "prefs-help-gender": "Postavljanje ove preferencije nije obavezno.\nSoftver koristi ovu vrijednost kako bi vam se obratio i spomenuo vas drugima koristeći vaš gramatički rod.\nOva informacija će biti javna.",
index bf31c91..fae2cb6 100644 (file)
        "recentchanges-legend-newpage": "{{int:recentchanges-label-newpage}} (glej tudi [[Special:NewPages|seznam novih strani]])",
        "recentchanges-submit": "Prikaži",
        "rcfilters-activefilters": "Dejavni filtri",
+       "rcfilters-restore-default-filters": "Obnovi privzete filtre",
+       "rcfilters-clear-all-filters": "Počisti vse filtre",
        "rcfilters-search-placeholder": "Zadnje spremembe filtrov (prebrskajte ali začnite vnašati)",
        "rcfilters-invalid-filter": "Neveljaven filter",
+       "rcfilters-empty-filter": "Ni dejavnih filtrov. Prikazani so vsi prispevki.",
        "rcfilters-filterlist-title": "Filtri",
        "rcfilters-filterlist-noresults": "Nismo našli nobenega filtra",
        "rcfilters-filtergroup-registration": "Registracija uporabnika",
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 a62ef2e..87e209e 100644 (file)
@@ -123,7 +123,6 @@ table.toc td {
 /* Images */
 /* @noflip */div.floatright, table.floatright {
        margin: 0 0 .5em .5em;
-       border: 0;
 }
 
 div.floatright p {
@@ -132,7 +131,6 @@ div.floatright p {
 
 /* @noflip */div.floatleft, table.floatleft {
        margin: 0 .5em .5em 0;
-       border: 0;
 }
 
 div.floatleft p {
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 281e1df..97e24b6 100644 (file)
@@ -974,7 +974,10 @@ class ParserTestRunner {
                        'wgEnableUploads' => self::getOptionValue( 'wgEnableUploads', $opts, true ),
                        'wgLanguageCode' => $langCode,
                        'wgRawHtml' => self::getOptionValue( 'wgRawHtml', $opts, false ),
-                       'wgNamespacesWithSubpages' => [ 0 => isset( $opts['subpage'] ) ],
+                       'wgNamespacesWithSubpages' => [
+                               0 => isset( $opts['subpage'] ),
+                               2 => isset( $opts['subpage'] ),
+                       ],
                        'wgMaxTocLevel' => $maxtoclevel,
                        'wgAllowExternalImages' => self::getOptionValue( 'wgAllowExternalImages', $opts, true ),
                        'wgThumbLimits' => [ self::getOptionValue( 'thumbsize', $opts, 180 ) ],
index ed09203..1563525 100644 (file)
@@ -933,6 +933,7 @@ Italics and bold: 5-quote opening sequence: (5,6)
 ###
 ### multiple quote sequences in a line
 ###
+
 !! test
 Italics and bold: multiple quote sequences: (2,4,2)
 !! options
@@ -942,8 +943,7 @@ parsoid=wt2html
 !! html/*
 <p><i>foo'<b>bar</b></i>
 </p>
-!!end
-
+!! end
 
 # same html as previous, but wikitext adjusted to match parsoid html2wt
 !! test
@@ -955,7 +955,6 @@ Italics and bold: multiple quote sequences: (2,4,2+3) w/ nowiki
 </p>
 !! end
 
-
 !! test
 Italics and bold: multiple quote sequences: (2,4,3)
 !! options
@@ -965,8 +964,7 @@ parsoid=wt2html
 !! html/*
 <p><i>foo'<b>bar</b></i>
 </p>
-!!end
-
+!! end
 
 # same html as previous, but wikitext adjusted to match parsoid html2wt
 !! test
@@ -978,7 +976,6 @@ Italics and bold: multiple quote sequences: (2,4,3+2) w/ nowiki
 </p>
 !! end
 
-
 !! test
 Italics and bold: multiple quote sequences: (2,4,4)
 !! options
@@ -988,8 +985,7 @@ parsoid=wt2html
 !! html/*
 <p><i>foo'<b>bar'</b></i>
 </p>
-!!end
-
+!! end
 
 # same html as previous, but wikitext adjusted to match parsoid html2wt
 !! test
@@ -1001,7 +997,6 @@ Italics and bold: multiple quote sequences: (2,4,4+2) w/ nowiki
 </p>
 !! end
 
-
 # The PHP parser strips the empty tags out for giggles; parsoid doesn't.
 !! test
 Italics and bold: multiple quote sequences: (3,4,2)
@@ -1015,24 +1010,21 @@ parsoid=wt2html
 !! html/parsoid
 <p><b>foo'</b>bar<i></i>
 </p>
-!!end
+!! end
 
 # same html as previous, but wikitext adjusted to match parsoid html2wt
 !! test
 Italics and bold: multiple quote sequences: (3,4,2+2) w/ nowiki
-!! options
-parsoid
 !! wikitext
-'''<nowiki>foo'</nowiki>'''bar''<nowiki/>''
+'''foo''''bar''<nowiki/>''
 !! html/php
 <p><b>foo'</b>bar
 </p>
 !! html/parsoid
-<p><b><span typeof="mw:Nowiki">foo'</span></b>bar<i></i>
+<p><b>foo'</b>bar<i></i>
 </p>
 !! end
 
-
 # The PHP parser strips the empty tags out for giggles; parsoid doesn't.
 !! test
 Italics and bold: multiple quote sequences: (3,4,3)
@@ -1046,18 +1038,18 @@ parsoid=wt2html
 !! html/parsoid
 <p><b>foo'</b>bar<b></b>
 </p>
-!!end
+!! end
 
 # same html as previous, but wikitext adjusted to match parsoid html2wt
 !! test
 Italics and bold: multiple quote sequences: (3,4,3+3) w/ nowiki
 !! wikitext
-'''<nowiki>foo'</nowiki>'''bar'''<nowiki/>'''
+'''foo''''bar'''<nowiki/>'''
 !! html/php
 <p><b>foo'</b>bar
 </p>
 !! html/parsoid
-<p><b><span typeof="mw:Nowiki">foo'</span></b>bar<b></b>
+<p><b>foo'</b>bar<b></b>
 </p>
 !! end
 
@@ -1135,7 +1127,7 @@ The ''[[Main Page]]'''s talk page.
 <p>The <i><a href="/wiki/Main_Page" title="Main Page">Main Page</a>'</i>s talk page.
 </p>
 !! html/parsoid
-<p>The <i><a rel="mw:WikiLink"  href="Main_Page" title="Main Page">Main Page</a>'</i>s talk page.</p>
+<p>The <i><a rel="mw:WikiLink" href="./Main_Page" title="Main Page">Main Page</a>'</i>s talk page.</p>
 !! end
 
 !! test
@@ -2861,9 +2853,9 @@ Parsoid: pipe in transclusion parameter
 !! html/php+tidy
 <p><a rel="nofollow" class="external free" href="http://foo.com/a%7Cb">http://foo.com/a%7Cb</a></p>
 !! html/parsoid
-<p><a rel="mw:ExtLink" href="http://foo.com/a|b" about="#mwt1"
+<p><a rel="mw:ExtLink" href="http://foo.com/a%7Cb" about="#mwt1"
 typeof="mw:Transclusion"
-data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"http://foo.com/a&amp;#124;b"}},"i":0}}]}'>http://foo.com/a|b</a></p>
+data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"http://foo.com/a&amp;#124;b"}},"i":0}}]}'>http://foo.com/a%7Cb</a></p>
 !! end
 
 !! test
@@ -4798,6 +4790,17 @@ news:'a'b''c''d e
 <p><a rel="mw:ExtLink" href="news:'a'b">news:'a'b</a><i>c</i>d e</p>
 !! end
 
+!! test
+External links: with entity
+!! wikitext
+[http://&#x20;www.librarieswithoutborders.org Libraries without borders]
+!! html/php
+<p><a rel="nofollow" class="external text" href="http://+www.librarieswithoutborders.org">Libraries without borders</a>
+</p>
+!! html/parsoid
+<p><a rel="mw:ExtLink" href="http://+www.librarieswithoutborders.org" data-parsoid='{"a":{"href":"http://+www.librarieswithoutborders.org"},"sa":{"href":"http://&amp;#x20;www.librarieswithoutborders.org"}}'>Libraries without borders</a></p>
+!! end
+
 !! test
 External links: Lone protocols are never linked (T105697)
 !! wikitext
@@ -5460,7 +5463,7 @@ http://example.com/index.php?foozoid&#x5B;&#x5D;=bar
 !! html/parsoid
 <p><a rel="mw:ExtLink" href="http://example.com/index.php?foozoid%5B%5D=bar">http://example.com/index.php?foozoid%5B%5D=bar</a></p>
 
-<p><a rel="mw:ExtLink" href="http://example.com/index.php?foozoid[]=bar">http://example.com/index.php?foozoid[]=bar</a></p>
+<p><a rel="mw:ExtLink" href="http://example.com/index.php?foozoid%5B%5D=bar" data-parsoid='{"stx":"url","a":{"href":"http://example.com/index.php?foozoid%5B%5D=bar"},"sa":{"href":"http://example.com/index.php?foozoid&amp;#x5B;&amp;#x5D;=bar"}}'>http://example.com/index.php?foozoid%5B%5D=bar</a></p>
 !! end
 
 !! test
@@ -6407,7 +6410,7 @@ parsoid=wt2html,html2html
 !! html/parsoid
 <table><tbody>
 <tr>
-<td data-parsoid='{"startTagSrc":"| ","attrSepSrc":"|","autoInsertedEnd":true}'><a rel="mw:ExtLink" href="ftp://|x||"></a>" onmouseover="alert(document.cookie)">test</td></tr></tbody></table>
+<td data-parsoid='{"startTagSrc":"| ","attrSepSrc":"|","autoInsertedEnd":true}'>[<a rel="mw:ExtLink" href="ftp://%7Cx" data-parsoid='{"stx":"url","a":{"href":"ftp://%7Cx"},"sa":{"href":"ftp://|x"}}'>ftp://%7Cx</a></td><td data-parsoid='{"stx_v":"row","autoInsertedEnd":true}'>]" onmouseover="alert(document.cookie)">test</td></tr></tbody></table>
 !! end
 
 !! test
@@ -7485,7 +7488,7 @@ Piped link with multiple pipe characters in link text
 <p><a href="/wiki/Main_Page" title="Main Page">|The|Main|Page|</a>
 </p>
 !! html/parsoid
-<p><a rel="mw:WikiLink" href="Main_Page" title="Main Page">|The|Main|Page|</a></p>
+<p><a rel="mw:WikiLink" href="./Main_Page" title="Main Page">|The|Main|Page|</a></p>
 !! end
 
 !! test
@@ -7841,6 +7844,17 @@ Link containing double-single-quotes '' (bug 4598)
 <p><a rel="mw:WikiLink" href="./Lista_d''e_paise_d''o_munno" title="Lista d''e paise d''o munno">Lista d''e paise d''o munno</a></p>
 !! end
 
+!! test
+Link containing double quotes and spaces
+!! wikitext
+[[Cool "Gator"]]
+!! html/php
+<p><a href="/index.php?title=Cool_%22Gator%22&amp;action=edit&amp;redlink=1" class="new" title="Cool &quot;Gator&quot; (page does not exist)">Cool "Gator"</a>
+</p>
+!! html/parsoid
+<p><a rel="mw:WikiLink" href="./Cool_%22Gator%22" title='Cool "Gator"'>Cool "Gator"</a></p>
+!! end
+
 !! test
 Link containing double-single-quotes '' in text (bug 4598 sanity check)
 !! wikitext
@@ -7849,7 +7863,7 @@ Some [[Link|pretty ''italics'' and stuff]]!
 <p>Some <a href="/index.php?title=Link&amp;action=edit&amp;redlink=1" class="new" title="Link (page does not exist)">pretty <i>italics</i> and stuff</a>!
 </p>
 !! html/parsoid
-<p>Some <a rel="mw:WikiLink" href="Link" title="Link">pretty <i>italics</i> and stuff</a>!</p>
+<p>Some <a rel="mw:WikiLink" href="./Link" title="Link">pretty <i>italics</i> and stuff</a>!</p>
 !! end
 
 !! test
@@ -7879,9 +7893,9 @@ Link with double quotes in title part (literal) and alternate part (interpreted)
 </p>
 !! html/parsoid
 <p><span class="mw-default-size" typeof="mw:Error mw:Image" data-mw='{"errors":[{"key":"missing-image","message":"This image does not exist."}]}'><a href="./File:Denys_Savchenko_''Pentecoste''.jpg"><img resource="./File:Denys_Savchenko_''Pentecoste''.jpg" src="./Special:FilePath/Denys_Savchenko_''Pentecoste''.jpg" height="220" width="220"/></a></span></p>
-<p><a rel="mw:WikiLink" href="''Pentecoste''" title="''Pentecoste''">''Pentecoste''</a></p>
-<p><a rel="mw:WikiLink" href="''Pentecoste''" title="''Pentecoste''">Pentecoste</a></p>
-<p><a rel="mw:WikiLink" href="''Pentecoste''" title="''Pentecoste''"><i>Pentecoste</i></a></p>
+<p><a rel="mw:WikiLink" href="./''Pentecoste''" title="''Pentecoste''">''Pentecoste''</a></p>
+<p><a rel="mw:WikiLink" href="./''Pentecoste''" title="''Pentecoste''">Pentecoste</a></p>
+<p><a rel="mw:WikiLink" href="./''Pentecoste''" title="''Pentecoste''"><i>Pentecoste</i></a></p>
 !! end
 
 !! test
@@ -7976,7 +7990,7 @@ Piped link to URL: [[http://www.example.com|an example URL]]
 <p>Piped link to URL: [<a rel="nofollow" class="external text" href="http://www.example.com%7Can">example URL</a>]
 </p>
 !! html/parsoid
-<p>Piped link to URL: [<a rel="mw:ExtLink" href="http://www.example.com|an">example URL</a>]</p>
+<p>Piped link to URL: [<a rel="mw:ExtLink" href="http://www.example.com%7Can" data-parsoid='{"a":{"href":"http://www.example.com%7Can"},"sa":{"href":"http://www.example.com|an"}}'>example URL</a>]</p>
 !! end
 
 !! test
@@ -8134,19 +8148,32 @@ Link with multiple ":" in a subpage-supporting namespace (bug 63636)
 Handle title parsing for subpages
 !! options
 title=[[/123123]]
+subpage
 !! wikitext
 123
+!! html/php
+<p>123
+</p>
 !! html/parsoid
 <p>123</p>
 !! end
 
-## FIXME: Add a working php section here
+!! article
+User:Test/123
+!! text
+test 123
+!! endarticle
+
 !! test
 Link to a subpage from a namespace other than main
 !! options
-title=[[User:test]]
+title=[[User:Test]]
+subpage
 !! wikitext
 [[/123]]
+!! html/php
+<p><a href="/wiki/User:Test/123" title="User:Test/123">/123</a>
+</p>
 !! html/parsoid
 <p><a rel="mw:WikiLink" href="./User:Test/123" title="User:Test/123" data-parsoid='{"stx":"simple","a":{"href":"./User:Test/123"},"sa":{"href":"/123"}}'>/123</a></p>
 !! end
@@ -8168,7 +8195,8 @@ parsoid=wt2html
 !! test
 Purely hash wikilink
 !! options
-title=[[User:test/123]]
+title=[[User:Test/123]]
+subpage
 !! wikitext
 [[#a|b]]
 !! html/php
@@ -8180,12 +8208,10 @@ title=[[User:test/123]]
 
 !! test
 1. Interaction of linktrail and template encapsulation
-!! options
-parsoid
 !! wikitext
 {{echo|[[Foo]]}}l
-!! html
-<p><a rel="mw:WikiLink" href="Foo" title="Foo" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[[Foo]]"}},"i":0}},"l"]}'>Fool</a></p>
+!! html/parsoid
+<p><a rel="mw:WikiLink" href="./Foo" title="Foo" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[[Foo]]"}},"i":0}},"l"]}'>Fool</a></p>
 !! end
 
 !! test
@@ -8255,7 +8281,7 @@ Parsoid link trail escaping
 !! options
 parsoid=html2wt,html2html
 !! html/parsoid
-<p><a rel="mw:WikiLink" href="Apple" title="Apple">apple</a>s</p>
+<p><a rel="mw:WikiLink" href="./Apple" title="Apple">apple</a>s</p>
 !! wikitext
 [[apple]]<nowiki/>s
 !! end
@@ -8266,7 +8292,7 @@ Parsoid link prefix escaping
 language=is
 parsoid=html2wt,html2html
 !! html/parsoid
-<p>Aðrir mótmælenda<a rel="mw:WikiLink" href="Söfnuður" title="Söfnuður">söfnuður</a></p>
+<p>Aðrir mótmælenda<a rel="mw:WikiLink" href="./Söfnuður" title="Söfnuður">söfnuður</a></p>
 !! wikitext
 Aðrir mótmælenda<nowiki/>[[söfnuður]]
 !! end
@@ -8291,12 +8317,10 @@ Parsoid-centric test: Whitespace in ext- and wiki-links should be preserved
 
 !! test
 Parsoid: Scoped parsing should handle mixed transclusions and plain text
-!! options
-parsoid
 !! wikitext
 [[Foo|{{echo|a}} b {{echo|c}}]]
-!! html
-<p><a rel="mw:WikiLink" href="Foo" title="Foo"><span about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a"}},"i":0}}]}'>a</span> b <span about="#mwt3" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"c"}},"i":0}}]}'>c</span></a></p>
+!! html/parsoid
+<p><a rel="mw:WikiLink" href="./Foo" title="Foo"><span about="#mwt2" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"a"}},"i":0}}]}'>a</span> b <span about="#mwt3" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"c"}},"i":0}}]}'>c</span></a></p>
 !! end
 
 !! test
@@ -8711,8 +8735,8 @@ Parsoid bug 53221: Wikilinks should be properly entity-escaped
 !! options
 parsoid={ "modes": ["html2wt"], "suppressErrors": true }
 !! html/parsoid
-<p>He&amp;nbsp;llo <a href="Foo" rel="mw:WikiLink">He&amp;nbsp;llo</a></p>
-<p>He&amp;nbsp;llo <a href="He&amp;nbsp;llo" rel="mw:WikiLink">He&amp;nbsp;llo</a></p>
+<p>He&amp;nbsp;llo <a href="./Foo" rel="mw:WikiLink">He&amp;nbsp;llo</a></p>
+<p>He&amp;nbsp;llo <a href="./He&amp;nbsp;llo" rel="mw:WikiLink">He&amp;nbsp;llo</a></p>
 !! wikitext
 He&amp;nbsp;llo [[Foo|He&amp;nbsp;llo]]
 
@@ -10361,7 +10385,7 @@ Parsoid: Page property magic word with magic word contents
 !! wikitext
 {{DISPLAYTITLE:''{{PAGENAME}}''}}
 !! html/parsoid
-<meta property="mw:PageProp/displaytitle" content="Main Page" about="#mwt2" typeof="mw:ExpandedAttrs" data-parsoid='{"src":"{{DISPLAYTITLE:&#39;&#39;{{PAGENAME}}&#39;&#39;}}"}' data-mw='{"attribs":[[{"txt":"content"},{"html":"&lt;i data-parsoid=&#39;{\"dsr\":[15,31,2,2]}&#39;>&lt;span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=&#39;{\"pi\":[[]],\"dsr\":[17,29,null,null]}&#39; data-mw=&#39;{\"parts\":[{\"template\":{\"target\":{\"wt\":\"PAGENAME\",\"function\":\"pagename\"},\"params\":{},\"i\":0}}]}&#39;>Main Page&lt;/span>&lt;/i>"}]]}'/>
+<meta property="mw:PageProp/displaytitle" content="Main Page" about="#mwt3" typeof="mw:ExpandedAttrs" data-parsoid='{"src":"{{DISPLAYTITLE:&#39;&#39;{{PAGENAME}}&#39;&#39;}}"}' data-mw='{"attribs":[[{"txt":"content"},{"html":"&lt;i data-parsoid=&#39;{\"dsr\":[15,31,2,2]}&#39;>&lt;span about=\"#mwt2\" typeof=\"mw:Transclusion\" data-parsoid=&#39;{\"pi\":[[]],\"dsr\":[17,29,null,null]}&#39; data-mw=&#39;{\"parts\":[{\"template\":{\"target\":{\"wt\":\"PAGENAME\",\"function\":\"pagename\"},\"params\":{},\"i\":0}}]}&#39;>Main Page&lt;/span>&lt;/i>"}]]}'/>
 !! end
 
 !! test
@@ -13577,7 +13601,7 @@ Image with link parameter, wiki target
 <p><a href="/wiki/Main_Page" title="Main Page"><img alt="Foobar.jpg" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! html/parsoid
-<p><span class="mw-default-size" typeof="mw:Image"><a href="Main_Page"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941"/></a></span></p>
+<p><span class="mw-default-size" typeof="mw:Image"><a href="./Main_Page"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941"/></a></span></p>
 !! end
 
 # parsoid bug 49293 (part 1)
@@ -13684,7 +13708,7 @@ Image with link parameter (wiki target) and unnamed parameter
 <p><a href="/wiki/Main_Page" title="Title"><img alt="Title" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" /></a>
 </p>
 !! html/parsoid
-<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"Title"}'><a href="Main_Page"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941"/></a></span></p>
+<p><span class="mw-default-size" typeof="mw:Image" data-mw='{"caption":"Title"}'><a href="./Main_Page"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941"/></a></span></p>
 !! end
 
 !! test
@@ -13736,7 +13760,7 @@ parsoid=wt2html,wt2wt,html2html
 <div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/Main_Page" title="Main Page"><img alt="" src="http://example.com/images/e/ea/Thumb.png" width="135" height="135" class="thumbimage" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Title</div></div></div>
 
 !! html/parsoid
-<figure class="mw-default-size" typeof="mw:Image/Thumb" data-mw='{"thumb":"Thumb.png"}'><a href="Main_Page"><img resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135"/></a><figcaption>Title</figcaption></figure>
+<figure class="mw-default-size" typeof="mw:Image/Thumb" data-mw='{"thumb":"Thumb.png"}'><a href="./Main_Page"><img resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135"/></a><figcaption>Title</figcaption></figure>
 !! end
 
 !! test
@@ -13778,7 +13802,7 @@ parsoid=wt2html,wt2wt,html2html
 <div class="thumb tright"><div class="thumbinner" style="width:137px;"><a href="/wiki/Main_Page" title="Main Page"><img alt="alttext" src="http://example.com/images/e/ea/Thumb.png" width="135" height="135" class="thumbimage" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>Title</div></div></div>
 
 !! html/parsoid
-<figure class="mw-default-size" typeof="mw:Image/Thumb" data-mw='{"thumb":"Thumb.png"}'><a href="Main_Page"><img alt="alttext" resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135"/></a><figcaption>Title</figcaption></figure>
+<figure class="mw-default-size" typeof="mw:Image/Thumb" data-mw='{"thumb":"Thumb.png"}'><a href="./Main_Page"><img alt="alttext" resource="./File:Foobar.jpg" src="//example.com/images/e/ea/Thumb.png" data-file-width="135" data-file-height="135" data-file-type="bitmap" height="135" width="135"/></a><figcaption>Title</figcaption></figure>
 !! end
 
 !! test
@@ -13791,7 +13815,7 @@ parsoid=wt2html,wt2wt,html2html
 <div class="thumb tleft"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" class="thumbimage" /></a>  <div class="thumbcaption">This is a test image <a href="/wiki/Main_Page" title="Main Page">Main Page</a></div></div></div>
 
 !! html/parsoid
-<figure class="mw-default-size mw-halign-left" typeof="mw:Image/Frame"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941"/></a><figcaption>This is a test image <a rel="mw:WikiLink" href="Main_Page" title="Main Page">Main Page</a></figcaption></figure>
+<figure class="mw-default-size mw-halign-left" typeof="mw:Image/Frame"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941"/></a><figcaption>This is a test image <a rel="mw:WikiLink" href="./Main_Page" title="Main Page">Main Page</a></figcaption></figure>
 !! end
 
 !! test
@@ -13804,7 +13828,7 @@ parsoid=wt2html,wt2wt,html2html
 <div class="thumb tleft"><div class="thumbinner" style="width:1943px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Altitude" src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220" class="thumbimage" /></a>  <div class="thumbcaption">This is a test image <a href="/wiki/Main_Page" title="Main Page">Main Page</a></div></div></div>
 
 !! html/parsoid
-<figure class="mw-default-size mw-halign-left" typeof="mw:Image/Frame"><a href="./File:Foobar.jpg"><img alt="Altitude" resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941"/></a><figcaption>This is a test image <a rel="mw:WikiLink" href="Main_Page" title="Main Page">Main Page</a></figcaption></figure>
+<figure class="mw-default-size mw-halign-left" typeof="mw:Image/Frame"><a href="./File:Foobar.jpg"><img alt="Altitude" resource="./File:Foobar.jpg" src="//example.com/images/3/3a/Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="220" width="1941"/></a><figcaption>This is a test image <a rel="mw:WikiLink" href="./Main_Page" title="Main Page">Main Page</a></figcaption></figure>
 !! end
 
 !! test
@@ -14268,7 +14292,7 @@ parsoid=wt2html,wt2wt,html2html
 <p>[[Image:Foobar.jpg|thumb|This is a broken caption. But <a href="/wiki/Main_Page" title="Main Page">this</a> is just an ordinary link.
 </p>
 !! html/parsoid
-<p>[[Image:Foobar.jpg|thumb|This is a broken caption. But <a rel="mw:WikiLink" href="Main_Page" title="Main Page">this</a> is just an ordinary link.</p>
+<p>[[Image:Foobar.jpg|thumb|This is a broken caption. But <a rel="mw:WikiLink" href="./Main_Page" title="Main Page">this</a> is just an ordinary link.</p>
 !! end
 
 !! test
@@ -14381,7 +14405,7 @@ language=es
 <div class="thumb tleft"><div class="thumbinner" style="width:222px;"><a href="/wiki/Foo" title="Foo"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" width="220" height="25" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/330px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/440px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/Archivo:Foobar.jpg" class="internal" title="Aumentar"></a></div>caption</div></div></div>
 
 !! html/parsoid
-<figure class="mw-default-size mw-halign-left" typeof="mw:Image/Thumb"><a href="Foo"><img resource="./Archivo:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a><figcaption>caption</figcaption></figure>
+<figure class="mw-default-size mw-halign-left" typeof="mw:Image/Thumb"><a href="./Foo"><img resource="./Archivo:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a><figcaption>caption</figcaption></figure>
 !! end
 
 !! test
@@ -14755,8 +14779,8 @@ subpage title=[[Subpage test/1/2/3/4]]
 </p><p><a href="/wiki/Subpage_test/1/2/subpage" title="Subpage test/1/2/subpage">Subpage test/1/2/subpage</a>
 </p>
 !! html/parsoid
-<p><a rel="mw:WikiLink" href="Subpage_test/1/2/subpage" title="Subpage test/1/2/subpage">subpage</a></p>
-<p><a rel="mw:WikiLink" href="Subpage_test/1/2/subpage" title="Subpage test/1/2/subpage">Subpage_test/1/2/subpage</a></p>
+<p><a rel="mw:WikiLink" href="./Subpage_test/1/2/subpage" title="Subpage test/1/2/subpage">subpage</a></p>
+<p><a rel="mw:WikiLink" href="./Subpage_test/1/2/subpage" title="Subpage test/1/2/subpage">Subpage_test/1/2/subpage</a></p>
 !! end
 
 !! test
@@ -15046,12 +15070,12 @@ Bar
 Bar
 </p>
 !! html/parsoid
-<p>Foo <link rel="mw:PageProp/Category" href="Category:Baz"/> Bar</p>
-<p>Foo <link rel="mw:PageProp/Category" href="Category:Baz"/> Bar</p>
-<p>Foo <link rel="mw:PageProp/Category" href="Category:Baz"/> Bar</p>
-<p>Foo <link rel="mw:PageProp/Category" href="Category:Baz"/> Bar</p>
-<p>Foo <link rel="mw:PageProp/Category" href="Category:Baz"/> <link rel="mw:PageProp/Category" href="Category:Baz"/> <link rel="mw:PageProp/Category" href="Category:Baz"/> Bar <link rel="mw:PageProp/Category" href="Category:Baz"/> <link rel="mw:PageProp/Category" href="Category:Baz"/> <link rel="mw:PageProp/Category" href="Category:Baz"/> <link rel="mw:PageProp/Category" href="Category:Baz"/> <link rel="mw:PageProp/Category" href="Category:Baz" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[[Category:Baz]]"}},"i":0}}]}'/></p>
-<link rel="mw:PageProp/Category" href="Category:Baz"/>
+<p>Foo <link rel="mw:PageProp/Category" href="./Category:Baz"/> Bar</p>
+<p>Foo <link rel="mw:PageProp/Category" href="./Category:Baz"/> Bar</p>
+<p>Foo <link rel="mw:PageProp/Category" href="./Category:Baz"/> Bar</p>
+<p>Foo <link rel="mw:PageProp/Category" href="./Category:Baz"/> Bar</p>
+<p>Foo <link rel="mw:PageProp/Category" href="./Category:Baz"/> <link rel="mw:PageProp/Category" href="./Category:Baz"/> <link rel="mw:PageProp/Category" href="./Category:Baz"/> Bar <link rel="mw:PageProp/Category" href="./Category:Baz"/> <link rel="mw:PageProp/Category" href="./Category:Baz"/> <link rel="mw:PageProp/Category" href="./Category:Baz"/> <link rel="mw:PageProp/Category" href="./Category:Baz"/> <link rel="mw:PageProp/Category" href="./Category:Baz" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[[Category:Baz]]"}},"i":0}}]}'/></p>
+<link rel="mw:PageProp/Category" href="./Category:Baz"/>
 !! end
 
 ## We used to, but no longer wt2wt this test since the default serializer
@@ -16083,7 +16107,7 @@ div with braces in attribute value
 !! wikitext
 <div title="{}">Foo</div>
 !! html/php
-<div title="&#123;}">Foo</div>
+<div title="&#123;&#125;">Foo</div>
 
 !! html/parsoid
 <div title="{}">Foo</div>
@@ -16523,9 +16547,11 @@ Template:Div style
 Bug 2304: HTML attribute safety (safe template; regression bug 2309)
 !! wikitext
 <div title="{{test}}"></div>
-!! html
+!! html/php
 <div title="This is a test template"></div>
 
+!! html/parsoid
+<div title="This is a test template" about="#mwt2" typeof="mw:ExpandedAttrs" data-parsoid='{"stx":"html","a":{"title":"This is a test template"},"sa":{"title":"{{test}}"}}' data-mw='{"attribs":[[{"txt":"title"},{"html":"&lt;span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=&#39;{\"pi\":[[]],\"dsr\":[12,20,null,null]}&#39; data-mw=&#39;{\"parts\":[{\"template\":{\"target\":{\"wt\":\"test\",\"href\":\"./Template:Test\"},\"params\":{},\"i\":0}}]}&#39;>This is a test template&lt;/span>"}]]}'></div>
 !! end
 
 # Parsoid has enough context to handle this case
@@ -16544,29 +16570,36 @@ Bug 2304: HTML attribute safety (dangerous template; 2309)
 Bug 2304: HTML attribute safety (dangerous style template; 2309)
 !! wikitext
 <div style="{{dangerous style attribute}}"></div>
-!! html
+!! html/php
 <div style="/* insecure input */"></div>
 
+!! html/parsoid
+<div style="/* insecure input */" about="#mwt2" typeof="mw:ExpandedAttrs" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"{{dangerous style attribute}}"}}' data-mw='{"attribs":[[{"txt":"style"},{"html":"&lt;span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid=&#39;{\"pi\":[[]],\"dsr\":[12,41,null,null]}&#39; data-mw=&#39;{\"parts\":[{\"template\":{\"target\":{\"wt\":\"dangerous style attribute\",\"href\":\"./Template:Dangerous_style_attribute\"},\"params\":{},\"i\":0}}]}&#39;>border-size: expression(alert(document.cookie))&lt;/span>"}]]}'></div>
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (safe parameter; 2309)
 !! wikitext
 {{div style|width: 200px}}
-!! html
+!! html/php
 <div style="float: right; width: 200px">Magic div</div>
 
+!! html/parsoid
+<div style="float: right; width: 200px" about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"stx":"html","a":{"style":"float: right; width: 200px"},"sa":{"style":"float: right; {{{1}}}"},"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"div style","href":"./Template:Div_style"},"params":{"1":{"wt":"width: 200px"}},"i":0}}]}'>Magic div</div>
 !! end
 
 !! test
 Bug 2304: HTML attribute safety (unsafe parameter; 2309)
 !! wikitext
 {{div style|width: expression(alert(document.cookie))}}
-!! html
+!! html/php
 <div style="/* insecure input */">Magic div</div>
 
+!! html/parsoid
+<div style="/* insecure input */" about="#mwt1" typeof="mw:Transclusion" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"float: right; {{{1}}}"},"pi":[[{"k":"1"}]]}' data-mw='{"parts":[{"template":{"target":{"wt":"div style","href":"./Template:Div_style"},"params":{"1":{"wt":"width: expression(alert(document.cookie))"}},"i":0}}]}'>Magic div</div>
 !! end
 
+## Parsoid output here differs; needs investigation.
 !! test
 Bug 2304: HTML attribute safety (unsafe breakout parameter; 2309)
 !! wikitext
@@ -16576,6 +16609,7 @@ Bug 2304: HTML attribute safety (unsafe breakout parameter; 2309)
 
 !! end
 
+## Parsoid output here differs; needs investigation.
 !! test
 Bug 2304: HTML attribute safety (unsafe breakout parameter 2; 2309)
 !! wikitext
@@ -16612,7 +16646,6 @@ Bug 2304: HTML attribute safety (bold)
 
 !! end
 
-
 !! test
 Bug 2304: HTML attribute safety (ISBN)
 !! wikitext
@@ -16662,18 +16695,22 @@ Bug 2304: HTML attribute safety (named web link)
 Bug 3244: HTML attribute safety (extension; safe)
 !! wikitext
 <div style="<nowiki>background:blue</nowiki>"></div>
-!! html
+!! html/php
 <div style="background:blue"></div>
 
+!! html/parsoid
+<div style="background:blue" data-parsoid='{"stx":"html","a":{"style":"background:blue"},"sa":{"style":"&lt;nowiki>background:blue&lt;/nowiki>"}}'></div>
 !! end
 
 !! test
 Bug 3244: HTML attribute safety (extension; unsafe)
 !! wikitext
 <div style="<nowiki>border-left:expression(alert(document.cookie))</nowiki>"></div>
-!! html
+!! html/php
 <div style="/* insecure input */"></div>
 
+!! html/parsoid
+<div style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"&lt;nowiki>border-left:expression(alert(document.cookie))&lt;/nowiki>"}}'></div>
 !! end
 
 # More MSIE fun discovered by Tom Gilder
@@ -16682,45 +16719,55 @@ Bug 3244: HTML attribute safety (extension; unsafe)
 MSIE CSS safety test: spurious slash
 !! wikitext
 <div style="background-image:u\rl(javascript:alert('boo'))">evil</div>
-!! html
+!! html/php
 <div style="/* insecure input */">evil</div>
 
+!! html/parsoid
+<div style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"background-image:u\\rl(javascript:alert(&#39;boo&#39;))"}}'>evil</div>
 !! end
 
 !! test
 MSIE CSS safety test: hex code
 !! wikitext
 <div style="background-image:u\72l(javascript:alert('boo'))">evil</div>
-!! html
+!! html/php
 <div style="/* insecure input */">evil</div>
 
+!! html/parsoid
+<div style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"background-image:u\\72l(javascript:alert(&#39;boo&#39;))"}}'>evil</div>
 !! end
 
 !! test
 MSIE CSS safety test: comment in url
 !! wikitext
 <div style="background-image:u/**/rl(javascript:alert('boo'))">evil</div>
-!! html
+!! html/php
 <div style="background-image:u rl(javascript:alert(&#39;boo&#39;))">evil</div>
 
+!! html/parsoid
+<div style="background-image:u rl(javascript:alert('boo'))" data-parsoid='{"stx":"html","a":{"style":"background-image:u rl(javascript:alert(&#39;boo&#39;))"},"sa":{"style":"background-image:u/**/rl(javascript:alert(&#39;boo&#39;))"}}'>evil</div>
 !! end
 
 !! test
 MSIE CSS safety test: comment in expression
 !! wikitext
 <div style="background-image:expres/**/sion(alert('boo4'))">evil4</div>
-!! html
+!! html/php
 <div style="background-image:expres sion(alert(&#39;boo4&#39;))">evil4</div>
 
+!! html/parsoid
+<div style="background-image:expres sion(alert('boo4'))" data-parsoid='{"stx":"html","a":{"style":"background-image:expres sion(alert(&#39;boo4&#39;))"},"sa":{"style":"background-image:expres/**/sion(alert(&#39;boo4&#39;))"}}'>evil4</div>
 !! end
 
 !! test
 CSS safety test (all browsers): vertical tab (bug 55332 / CVE-2013-4567)
 !! wikitext
 <p style="font-size: 100px; background-image:url\b(https://www.google.com/images/srpr/logo6w.png)">A</p>
-!! html
+!! html/php
 <p style="/* invalid control char */">A</p>
 
+!! html/parsoid
+<p style="/* invalid control char */" data-parsoid='{"stx":"html","a":{"style":"/* invalid control char */"},"sa":{"style":"font-size: 100px; background-image:url\\b(https://www.google.com/images/srpr/logo6w.png)"}}'>A</p>
 !! end
 
 !! test
@@ -16728,10 +16775,13 @@ MSIE 6 CSS safety test: Fullwidth (bug 55332)
 !! wikitext
 <p style="font-size: 100px; color: expression((title='XSSed'),'red')">A</p>
 <div style="top:EXPRESSION(alert())">B</div>
-!! html
+!! html/php
 <p style="/* insecure input */">A</p>
 <div style="/* insecure input */">B</div>
 
+!! html/parsoid
+<p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expression((title=&#39;XSSed&#39;),&#39;red&#39;)"}}'>A</p>
+<div style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"top:EXPRESSION(alert())"}}'>B</div>
 !! end
 
 !! test
@@ -16739,10 +16789,13 @@ MSIE 6 CSS safety test: IPA extensions (bug 55332)
 !! wikitext
 <div style="background-image:uʀʟ(javascript:alert())">A</div>
 <p style="font-size: 100px; color: expʀessɪoɴ((title='XSSed'),'red')">B</p>
-!! html
+!! html/php
 <div style="/* insecure input */">A</div>
 <p style="/* insecure input */">B</p>
 
+!! html/parsoid
+<div style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"background-image:uʀʟ(javascript:alert())"}}'>A</div>
+<p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expʀessɪoɴ((title=&#39;XSSed&#39;),&#39;red&#39;)"}}'>B</p>
 !! end
 
 !! test
@@ -16751,23 +16804,30 @@ MSIE 6 CSS safety test: sup/sub script (bug 55332)
 <div style="background-image:url⁽javascript:alert())">A</div>
 <div style="background-image:url₍javascript:alert())">B</div>
 <p style="font-size: 100px; color: expressioⁿ((title='XSSed'),'red')">C</p>
-!! html
+!! html/php
 <div style="/* insecure input */">A</div>
 <div style="/* insecure input */">B</div>
 <p style="/* insecure input */">C</p>
 
+!! html/parsoid
+<div style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"background-image:url⁽javascript:alert())"}}'>A</div>
+<div style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"background-image:url₍javascript:alert())"}}'>B</div>
+<p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expressioⁿ((title=&#39;XSSed&#39;),&#39;red&#39;)"}}'>C</p>
 !! end
 
-# FIXME: Parsoid fails to sanitize this! See T58846.
 !! test
 Opera -o-link CSS
+!! options
+parsoid=wt2html,html2html
 !! wikitext
 <div
 title="&#100;&#97;&#116;&#97;&#58;&#116;&#101;&#120;&#116;&#47;&#104;&#116;&#109;&#108;&#44;&#60;&#105;&#109;&#103;&#32;&#115;&#114;&#99;&#61;&#49;&#32;&#111;&#110;&#101;&#114;&#114;&#111;&#114;&#61;&#97;&#108;&#101;&#114;&#116;&#40;&#49;&#41;&#62;"
 style="-o-link:attr(title);-o-link-source:current">X</div>
-!! html
+!! html/php
 <div title="data:text/html,&lt;img src=1 onerror=alert(1)&gt;" style="/* insecure input */">X</div>
 
+!! html/parsoid
+<div title="data:text/html,&lt;img src=1 onerror=alert(1)>" style="/* insecure input */" data-parsoid='{"stx":"html","a":{"title":"data:text/html,&lt;img src=1 onerror=alert(1)>","style":"/* insecure input */"},"sa":{"title":"&amp;#100;&amp;#97;&amp;#116;&amp;#97;&amp;#58;&amp;#116;&amp;#101;&amp;#120;&amp;#116;&amp;#47;&amp;#104;&amp;#116;&amp;#109;&amp;#108;&amp;#44;&amp;#60;&amp;#105;&amp;#109;&amp;#103;&amp;#32;&amp;#115;&amp;#114;&amp;#99;&amp;#61;&amp;#49;&amp;#32;&amp;#111;&amp;#110;&amp;#101;&amp;#114;&amp;#114;&amp;#111;&amp;#114;&amp;#61;&amp;#97;&amp;#108;&amp;#101;&amp;#114;&amp;#116;&amp;#40;&amp;#49;&amp;#41;&amp;#62;","style":"-o-link:attr(title);-o-link-source:current"}}'>X</div>
 !! end
 
 !! test
@@ -16780,7 +16840,7 @@ MSIE 6 CSS safety test: Repetition markers (bug 55332)
 <p style="font-size: 100px; color: expresﹽion((title='XSSed'),'red')">E</p>
 <p style="font-size: 100px; color: expresﹼion((title='XSSed'),'red')">F</p>
 <p style="font-size: 100px; color: expresーion((title='XSSed'),'red')">G</p>
-!! html
+!! html/php
 <p style="/* insecure input */">A</p>
 <p style="/* insecure input */">B</p>
 <p style="/* insecure input */">C</p>
@@ -16789,6 +16849,14 @@ MSIE 6 CSS safety test: Repetition markers (bug 55332)
 <p style="/* insecure input */">F</p>
 <p style="/* insecure input */">G</p>
 
+!! html/parsoid
+<p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expres〱ion((title=&#39;XSSed&#39;),&#39;red&#39;)"}}'>A</p>
+<p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expresゝion((title=&#39;XSSed&#39;),&#39;red&#39;)"}}'>B</p>
+<p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expresーion((title=&#39;XSSed&#39;),&#39;red&#39;)"}}'>C</p>
+<p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expresヽion((title=&#39;XSSed&#39;),&#39;red&#39;)"}}'>D</p>
+<p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expresﹽion((title=&#39;XSSed&#39;),&#39;red&#39;)"}}'>E</p>
+<p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expresﹼion((title=&#39;XSSed&#39;),&#39;red&#39;)"}}'>F</p>
+<p style="/* insecure input */" data-parsoid='{"stx":"html","a":{"style":"/* insecure input */"},"sa":{"style":"font-size: 100px; color: expresーion((title=&#39;XSSed&#39;),&#39;red&#39;)"}}'>G</p>
 !! end
 
 !! test
@@ -16852,7 +16920,6 @@ Expansion of multi-line templates in attribute values (bug 6255)
 
 !! end
 
-
 !! test
 Expansion of multi-line templates in attribute values (bug 6255 sanity check)
 !! wikitext
@@ -16886,6 +16953,7 @@ Tags which are hidden from Tidy cannot pass through the Sanitizer
 ###
 ### Parser hooks (see tests/parser/parserTestsParserHook.php for the <tag> extension)
 ###
+
 !! test
 Parser hook: empty input
 !! wikitext
@@ -18856,7 +18924,6 @@ stuff
 xxx
 !! end
 
-
 !! test
 Handling of &#x0A; in URLs
 !! wikitext
@@ -18865,9 +18932,7 @@ Handling of &#x0A; in URLs
 <ul><li><ul><li> <a rel="nofollow" class="external free" href="irc://%0Aa">irc://%0Aa</a></li></ul></li></ul>
 
 !! html/parsoid
-<ul><li><ul><li> <a rel="mw:ExtLink" href="irc://
-a">irc://
-a</a></li></ul></li></ul>
+<ul><li><ul><li> <a rel="mw:ExtLink" href="irc://%0Aa" data-parsoid='{"stx":"url","a":{"href":"irc://%0Aa"},"sa":{"href":"irc://&amp;#x0A;a"}}'>irc://%0Aa</a></li></ul></li></ul>
 !! end
 
 !! test
@@ -18881,7 +18946,6 @@ Handling of %0A in URLs
 <ul><li><ul><li> <a rel="mw:ExtLink" href="irc://%0Aa">irc://%0Aa</a></li></ul></li></ul>
 !! end
 
-
 # The PHP parser strips the empty tags out for giggles; parsoid doesn't.
 !! test
 5 quotes, code coverage +1 line
@@ -19452,6 +19516,27 @@ File:Foobar.jpg|alt=galleryalt|link=http://www.example.org
 </ul>
 !! end
 
+!! test
+Gallery override link with absolute external link with LanguageConverter
+!! options
+language=zh
+!! input
+<gallery>
+File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org
+</gallery>
+!! result
+<ul class="gallery mw-gallery-traditional">
+               <li class="gallerybox" style="width: 155px"><div style="width: 155px">
+                       <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="http://www.example.org"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div>
+                       <div class="gallerytext">
+<p>caption
+</p>
+                       </div>
+               </div></li>
+</ul>
+
+!! end
+
 !! test
 Gallery override link with malicious javascript (T36852)
 !! options
@@ -19474,7 +19559,7 @@ File:Foobar.jpg|alt=galleryalt|link=" onclick="alert('malicious javascript code!
 
 !! html/parsoid
 <ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","attrs":{},"body":{}}'>
-<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span style="display: inline-block; height: 100%; vertical-align: middle;"></span><span typeof="mw:Image" style="vertical-align: middle; display: inline-block;"><a href="./&quot;_onclick=&quot;alert('malicious_javascript_code!');"><img alt="galleryalt" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></span></div><div class="gallerytext"></div></li>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span style="display: inline-block; height: 100%; vertical-align: middle;"></span><span typeof="mw:Image" style="vertical-align: middle; display: inline-block;"><a href="./%22_onclick=%22alert('malicious_javascript_code!');"><img alt="galleryalt" resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="14" width="120"/></a></span></div><div class="gallerytext"></div></li>
 </ul>
 !! end
 
@@ -19504,6 +19589,24 @@ File:Foobar.jpg|link=<
 </ul>
 !! end
 
+!! test
+Serialize gallery without attrs in data-mw
+!! options
+parsoid={
+  "modes": ["html2wt"],
+  "nativeGallery": true
+}
+!! html/parsoid
+<ul class="gallery mw-gallery-traditional" typeof="mw:Extension/gallery" about="#mwt2" data-mw='{"name":"gallery","body":{}}'>
+<li class="gallerycaption">123</li>
+<li class="gallerybox" style="width: 155px;"><div class="thumb" style="width: 150px; height: 150px;"><span style="display: inline-block; height: 100%; vertical-align: middle;"></span><span style="vertical-align: middle; display: inline-block;">File:Test.png</span></div><div class="gallerytext"></div></li>
+</ul>
+!! wikitext
+<gallery caption="123">
+File:Test.png
+</gallery>
+!! end
+
 !! test
 HTML Hex character encoding (spells the word "JavaScript")
 !! options
@@ -19787,7 +19890,6 @@ dt/dd/dl test
 
 !!end
 
-
 # Images with the "|" character in external URLs in comment tags; Eats half the comment, leaves unmatched "</a>" tag.
 !! test
 Images with the "|" character in the comment
@@ -19797,7 +19899,7 @@ Images with the "|" character in the comment
 <div class="thumb tright"><div class="thumbinner" style="width:182px;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="" src="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg" width="180" height="20" class="thumbimage" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/270px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/360px-Foobar.jpg 2x" /></a>  <div class="thumbcaption"><div class="magnify"><a href="/wiki/File:Foobar.jpg" class="internal" title="Enlarge"></a></div>An <a rel="nofollow" class="external text" href="http://test/?param1=%7Cleft%7C&amp;param2=%7Cx">external</a> URL</div></div></div>
 
 !! html/parsoid
-<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a><figcaption>An <a rel="mw:ExtLink" href="http://test/?param1=|left|&amp;param2=|x">external</a> URL</figcaption></figure>
+<figure class="mw-default-size" typeof="mw:Image/Thumb"><a href="./File:Foobar.jpg"><img resource="./File:Foobar.jpg" src="//example.com/images/thumb/3/3a/Foobar.jpg/220px-Foobar.jpg" data-file-width="1941" data-file-height="220" data-file-type="bitmap" height="25" width="220"/></a><figcaption>An <a rel="mw:ExtLink" href="http://test/?param1=%7Cleft%7C&amp;param2=%7Cx" data-parsoid='{"a":{"href":"http://test/?param1=%7Cleft%7C&amp;param2=%7Cx"},"sa":{"href":"http://test/?param1=|left|&amp;param2=|x"}}'>external</a> URL</figcaption></figure>
 !! end
 
 !! test
@@ -20349,8 +20451,8 @@ parsoid=wt2html
 !! html/php
 cat=分类 sort=
 !! html/parsoid
-<p><a rel="mw:WikiLink" href="A" title="A">A</a></p>
-<link rel="mw:PageProp/Category" href="Category:分类"/>
+<p><a rel="mw:WikiLink" href="./A" title="A">A</a></p>
+<link rel="mw:PageProp/Category" href="./Category:分类"/>
 !! end
 
 !! test
@@ -20625,6 +20727,28 @@ Nested: -{zh-hans:Hi -{zh-cn:China;zh-sg:Singapore;}-;zh-hant:Hello -{zh-tw:Taiw
 # Since Parsoid is starting to emit canonical wikitext for links,
 # [http://example.com http://example.com] will not RT back to that
 # form anymore.
+!! test
+HTML markups with conversion syntax in attribs, nested in other conversion blocks
+!! options
+language=zh variant=zh-cn
+!! wikitext
+-{zh;zh-hans;zh-hant|<span title="-{X}-">A</span>}-
+!! html
+<p><span title="X">A</span>
+</p>
+!! end
+
+!! test
+HTML markups with conversion syntax in attribs, nested in other conversion blocks (not working yet)
+!! options
+language=zh variant=zh-cn disabled
+!! wikitext
+-{<span title="-{X}-">A</span>}-
+!! html
+<p><span title="X">A</span>
+</p>
+!! end
+
 !! test
 Proper conversion of text in external links
 !! options
@@ -22384,82 +22508,6 @@ File:foobar.jpg|caption|alt=galleryalt|link=InterWikiLink
 
 !! end
 
-!!test
-Gallery override link with absolute external link (bug 34852)
-!! wikitext
-<gallery>
-File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org
-</gallery>
-!! html
-<ul class="gallery mw-gallery-traditional">
-               <li class="gallerybox" style="width: 155px"><div style="width: 155px">
-                       <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="http://www.example.org"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div>
-                       <div class="gallerytext">
-<p>caption
-</p>
-                       </div>
-               </div></li>
-</ul>
-
-!! end
-
-!! test
-Gallery override link with absolute external link with LanguageConverter
-!! options
-language=zh
-!! input
-<gallery>
-File:foobar.jpg|caption|alt=galleryalt|link=http://www.example.org
-</gallery>
-!! result
-<ul class="gallery mw-gallery-traditional">
-               <li class="gallerybox" style="width: 155px"><div style="width: 155px">
-                       <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="http://www.example.org"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div>
-                       <div class="gallerytext">
-<p>caption
-</p>
-                       </div>
-               </div></li>
-</ul>
-
-!! end
-
-!!test
-Gallery override link with malicious javascript (bug 34852)
-!! wikitext
-<gallery>
-File:foobar.jpg|caption|alt=galleryalt|link=" onclick="alert('malicious javascript code!');
-</gallery>
-!! html
-<ul class="gallery mw-gallery-traditional">
-               <li class="gallerybox" style="width: 155px"><div style="width: 155px">
-                       <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/%22_onclick%3D%22alert(%27malicious_javascript_code!%27);"><img alt="galleryalt" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div>
-                       <div class="gallerytext">
-<p>caption
-</p>
-                       </div>
-               </div></li>
-</ul>
-
-!! end
-
-!!test
-Gallery with invalid title as link (bug 43964)
-!! wikitext
-<gallery>
-File:foobar.jpg|link=<
-</gallery>
-!! html
-<ul class="gallery mw-gallery-traditional">
-               <li class="gallerybox" style="width: 155px"><div style="width: 155px">
-                       <div class="thumb" style="width: 150px;"><div style="margin:68px auto;"><a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" src="http://example.com/images/thumb/3/3a/Foobar.jpg/120px-Foobar.jpg" width="120" height="14" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/180px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/240px-Foobar.jpg 2x" /></a></div></div>
-                       <div class="gallerytext">
-                       </div>
-               </div></li>
-</ul>
-
-!! end
-
 !!test
 Language parser function
 !! wikitext
@@ -22721,7 +22769,7 @@ A <ref>
 <p>A <span about="#mwt2" class="mw-ref" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref" data-mw='{"name":"ref","body":{"id":"mw-reference-text-cite_note-1"},"attrs":{}}'><a href="./Main_Page#cite_note-1"><span class="mw-reflink-text">[1]</span></a></span></p>
 
 <ol class="mw-references" typeof="mw:Extension/references" about="#mwt5" data-mw='{"name":"references","attrs":{}}'>
-<li about="#cite_note-1" id="cite_note-1"><a href="./Main_Page#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">This is a <b><a rel="mw:WikiLink" href="Bolded_link" title="Bolded link">bolded link</a></b> and this is a <span about="#mwt3" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"transclusion"}},"i":0}}]}'>transclusion</span>
+<li about="#cite_note-1" id="cite_note-1"><a href="./Main_Page#cite_ref-1" rel="mw:referencedBy"><span class="mw-linkback-text">↑ </span></a> <span id="mw-reference-text-cite_note-1" class="mw-reference-text">This is a <b><a rel="mw:WikiLink" href="./Bolded_link" title="Bolded link">bolded link</a></b> and this is a <span about="#mwt3" typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"transclusion"}},"i":0}}]}'>transclusion</span>
 </span></li>
 </ol>
 !!end
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 bd744c0..a12c8b2 100644 (file)
@@ -99,6 +99,37 @@ class MessageCacheTest extends MediaWikiLangTestCase {
                ];
        }
 
+       public function testReplaceMsg() {
+               global $wgContLang;
+
+               $messageCache = MessageCache::singleton();
+               $message = 'go';
+               $uckey = $wgContLang->ucfirst( $message );
+               $oldText = $messageCache->get( $message ); // "Ausführen"
+
+               $dbw = wfGetDB( DB_MASTER );
+               $dbw->startAtomic( __METHOD__ ); // simulate request and block deferred updates
+               $messageCache->replace( $uckey, 'Allez!' );
+               $this->assertEquals( 'Allez!',
+                       $messageCache->getMsgFromNamespace( $uckey, 'de' ),
+                       'Updates are reflected in-process immediately' );
+               $this->assertEquals( 'Allez!',
+                       $messageCache->get( $message ),
+                       'Updates are reflected in-process immediately' );
+               $this->makePage( 'Go', 'de', 'Race!' );
+               $dbw->endAtomic( __METHOD__ );
+
+               $this->assertEquals( 0,
+                       DeferredUpdates::pendingUpdatesCount(),
+                       'Post-commit deferred update triggers a run of all updates' );
+
+               $this->assertEquals( 'Race!', $messageCache->get( $message ), 'Correct final contents' );
+
+               $this->makePage( 'Go', 'de', $oldText );
+               $messageCache->replace( $uckey, $oldText ); // deferred update runs immediately
+               $this->assertEquals( $oldText, $messageCache->get( $message ), 'Content restored' );
+       }
+
        /**
         * There's a fallback case where the message key is given as fully qualified -- this
         * should ignore the passed $lang and use the language from the key
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 ) );