From 13ffd04c5f4c7dde668bfb1312bf829934a912dd Mon Sep 17 00:00:00 2001 From: Gilles Dubuc Date: Tue, 2 May 2017 14:58:06 +0200 Subject: [PATCH] Toggle logo preloading via the skin Bug: T100999 Change-Id: I0e18dc7fdbf133f3e4002f48f3040604687571dc --- includes/OutputPage.php | 9 ++++++++- includes/skins/Skin.php | 9 +++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 5c05ad75d0..85610b9a5b 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2388,7 +2388,14 @@ class OutputPage extends ContextSource { // jQuery etc. can work correctly. $response->header( 'X-UA-Compatible: IE=Edge' ); - $this->addLogoPreloadLinkHeaders(); + if ( !$this->mArticleBodyOnly ) { + $sk = $this->getSkin(); + + if ( $sk->shouldPreloadLogo() ) { + $this->addLogoPreloadLinkHeaders(); + } + } + $linkHeader = $this->getLinkHeader(); if ( $linkHeader ) { $response->header( $linkHeader ); diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index 99658f294a..7f00767e07 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -444,6 +444,15 @@ abstract class Skin extends ContextSource { return $wgLogo; } + /** + * Whether the logo should be preloaded with an HTTP link header or not + * @since 1.29 + * @return bool + */ + public function shouldPreloadLogo() { + return false; + } + /** * @return string HTML */ -- 2.20.1