Only pretty-print the parser report JS vars
[lhc/web/wiklou.git] / includes / OutputPage.php
index 545ab73..d34ace8 100644 (file)
@@ -251,11 +251,6 @@ class OutputPage extends ContextSource {
         */
        protected $styles = [];
 
-       /**
-        * Whether jQuery is already handled.
-        */
-       protected $mJQueryDone = false;
-
        private $mIndexPolicy = 'index';
        private $mFollowPolicy = 'follow';
        private $mVaryHeader = [
@@ -295,6 +290,9 @@ class OutputPage extends ContextSource {
         */
        private $copyrightUrl;
 
+       /** @var array Profiling data */
+       private $limitReportData = [];
+
        /**
         * Constructor for OutputPage. This should not be called directly.
         * Instead a new RequestContext should be created and it will implicitly create
@@ -609,29 +607,6 @@ class OutputPage extends ContextSource {
                $this->mModuleStyles = array_merge( $this->mModuleStyles, (array)$modules );
        }
 
-       /**
-        * Get the list of module messages to include on this page
-        *
-        * @deprecated since 1.26 Obsolete
-        * @param bool $filter
-        * @param string|null $position
-        * @return array Array of module names
-        */
-       public function getModuleMessages( $filter = false, $position = null ) {
-               wfDeprecated( __METHOD__, '1.26' );
-               return [];
-       }
-
-       /**
-        * Load messages of one or more ResourceLoader modules.
-        *
-        * @deprecated since 1.26 Use addModules() instead
-        * @param string|array $modules Module name (string) or array of module names
-        */
-       public function addModuleMessages( $modules ) {
-               wfDeprecated( __METHOD__, '1.26' );
-       }
-
        /**
         * @return null|string ResourceLoader target
         */
@@ -1782,11 +1757,14 @@ class OutputPage extends ContextSource {
                        }
                }
 
-               // enable OOUI if requested via ParserOutput
+               // Enable OOUI if requested via ParserOutput
                if ( $parserOutput->getEnableOOUI() ) {
                        $this->enableOOUI();
                }
 
+               // Include profiling data
+               $this->limitReportData = $parserOutput->getLimitReportData();
+
                // Link flags are ignored for now, but may in the future be
                // used to mark individual language links.
                $linkFlags = [];
@@ -2688,6 +2666,11 @@ class OutputPage extends ContextSource {
                        $bodyClasses[] = 'capitalize-all-nouns';
                }
 
+               // Parser feature migration class
+               // The idea is that this will eventually be removed, after the wikitext
+               // which requires it is cleaned up.
+               $bodyClasses[] = 'mw-hide-empty-elt';
+
                $bodyClasses[] = $sk->getPageClasses( $this->getTitle() );
                $bodyClasses[] = 'skin-' . Sanitizer::escapeClass( $sk->getSkinName() );
                $bodyClasses[] =
@@ -3098,7 +3081,13 @@ class OutputPage extends ContextSource {
         * @return string
         */
        function getBottomScripts() {
-               return $this->getScriptsForBottomQueue();
+               return $this->getScriptsForBottomQueue() .
+                       ResourceLoader::makeInlineScript(
+                               ResourceLoader::makeConfigSetScript(
+                                       [ 'wgPageParseReport' => $this->limitReportData ],
+                                       true
+                               )
+                       );
        }
 
        /**