Merge "Drop zh-tw message "saveprefs""
[lhc/web/wiklou.git] / includes / OutputPage.php
index 8d4720b..552e181 100644 (file)
@@ -142,9 +142,6 @@ class OutputPage extends ContextSource {
        /** @var string Inline CSS styles. Use addInlineStyle() sparingly */
        protected $mInlineStyles = '';
 
-       /** @todo Unused? */
-       private $mLinkColours;
-
        /**
         * @var string Used by skin template.
         * Example: $tpl->set( 'displaytitle', $out->mPageLinkTitle );
@@ -2012,21 +2009,20 @@ class OutputPage extends ContextSource {
         * Add an HTTP header that will influence on the cache
         *
         * @param string $header Header name
-        * @param array|null $option
-        * @todo FIXME: Document the $option parameter; it appears to be for
-        *        X-Vary-Options but what format is acceptable?
+        * @param string[]|null $option Options for X-Vary-Options. Possible options are:
+        *  - "string-contains=$XXX" varies on whether the header value as a string
+        *    contains $XXX as a substring.
+        *  - "list-contains=$XXX" varies on whether the header value as a
+        *    comma-separated list contains $XXX as one of the list items.
         */
-       public function addVaryHeader( $header, $option = null ) {
+       public function addVaryHeader( $header, array $option = null ) {
                if ( !array_key_exists( $header, $this->mVaryHeader ) ) {
-                       $this->mVaryHeader[$header] = (array)$option;
-               } elseif ( is_array( $option ) ) {
-                       if ( is_array( $this->mVaryHeader[$header] ) ) {
-                               $this->mVaryHeader[$header] = array_merge( $this->mVaryHeader[$header], $option );
-                       } else {
-                               $this->mVaryHeader[$header] = $option;
-                       }
+                       $this->mVaryHeader[$header] = array();
+               }
+               if ( !is_array( $option ) ) {
+                       $option = array();
                }
-               $this->mVaryHeader[$header] = array_unique( (array)$this->mVaryHeader[$header] );
+               $this->mVaryHeader[$header] = array_unique( array_merge( $this->mVaryHeader[$header], $option ) );
        }
 
        /**
@@ -2909,8 +2905,7 @@ class OutputPage extends ContextSource {
 
                                // Automatically select style/script elements
                                if ( $only === ResourceLoaderModule::TYPE_STYLES ) {
-                                       $media = $group === 'print' ? 'print' : 'all';
-                                       $link = Html::linkedStyle( $url, $media );
+                                       $link = Html::linkedStyle( $url );
                                } else {
                                        if ( $context->getRaw() || $isRaw ) {
                                                // Startup module can't load itself, needs to use <script> instead of mw.loader.load
@@ -2996,10 +2991,6 @@ class OutputPage extends ContextSource {
                // Startup - this provides the client with the module manifest and loads jquery and mediawiki base modules
                $links[] = $this->makeResourceLoaderLink( 'startup', ResourceLoaderModule::TYPE_SCRIPTS );
 
-               if ( $this->getConfig()->get( 'ResourceLoaderExperimentalAsyncLoading' ) ) {
-                       $links[] = $this->getScriptsForBottomQueue();
-               }
-
                return self::getHtmlFromLoaderLinks( $links );
        }
 
@@ -3054,11 +3045,9 @@ class OutputPage extends ContextSource {
        }
 
        /**
-        * JS stuff to put at the 'bottom', which can either be the bottom of the
-        * "<body>" or the bottom of the "<head>" depending on
-        * $wgResourceLoaderExperimentalAsyncLoading: modules marked with position
-        * 'bottom', legacy scripts ($this->mScripts), user preferences, site JS
-        * and user JS.
+        * JS stuff to put at the 'bottom', which goes at the bottom of the `<body>`.
+        * These are modules marked with position 'bottom', legacy scripts ($this->mScripts),
+        * site JS, and user JS.
         *
         * @param bool $unused Previously used to let this method change its output based
         *  on whether it was called by getExternalHeadScripts() or getBottomScripts().
@@ -3142,10 +3131,6 @@ class OutputPage extends ContextSource {
                // In case the skin wants to add bottom CSS
                $this->getSkin()->setupSkinUserCss( $this );
 
-               if ( $this->getConfig()->get( 'ResourceLoaderExperimentalAsyncLoading' ) ) {
-                       // Already handled by getExternalHeadScripts()
-                       return '';
-               }
                return $this->getScriptsForBottomQueue();
        }