Output stylesheet links before other link elements in <head>
authorOri Livneh <ori@wikimedia.org>
Wed, 12 Aug 2015 15:52:39 +0000 (08:52 -0700)
committerOri Livneh <ori@wikimedia.org>
Wed, 12 Aug 2015 15:53:49 +0000 (08:53 -0700)
Since external CSS is render-blocking, it should be discoverable to the browser
as soon as possible. So move it up to the top of <head>.

Change-Id: I68a6cce2f33ceb7f6461fcbb7323ae13c413aa89

includes/OutputPage.php

index 26f9efa..d694e58 100644 (file)
@@ -2703,11 +2703,12 @@ class OutputPage extends ContextSource {
 
                $ret .= Html::element( 'title', null, $this->getHTMLTitle() ) . "\n";
 
+               $ret .= $this->buildCssLinks() . "\n";
+
                foreach ( $this->getHeadLinksArray() as $item ) {
                        $ret .= $item . "\n";
                }
 
-               $ret .= $this->buildCssLinks() . "\n";
                $ret .= $this->getHeadScripts() . "\n";
 
                foreach ( $this->mHeadItems as $item ) {