$this->addParserOutput( $parserOutput );
}
- /**
- * Add a ParserOutput object, but without Html.
- *
- * @deprecated since 1.24, use addParserOutputMetadata() instead.
- * @param ParserOutput $parserOutput
- */
- public function addParserOutputNoText( $parserOutput ) {
- wfDeprecated( __METHOD__, '1.24' );
- $this->addParserOutputMetadata( $parserOutput );
- }
-
/**
* Add all metadata associated with a ParserOutput object, but without the actual HTML. This
* includes categories, language links, ResourceLoader modules, effects of certain magic words,
// 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 );
return $tags;
}
- /**
- * @return string HTML tag links to be put in the header.
- * @deprecated since 1.24 Use OutputPage::headElement or if you have to,
- * OutputPage::getHeadLinksArray directly.
- */
- public function getHeadLinks() {
- wfDeprecated( __METHOD__, '1.24' );
- return implode( "\n", $this->getHeadLinksArray() );
- }
-
/**
* Generate a "<link rel/>" for a feed.
*
/**
* Add Link headers for preloading the wiki's logo.
*
- * @since 1.26
+ * @since 1.26
*/
protected function addLogoPreloadLinkHeaders() {
- $logo = $this->getConfig()->get( 'Logo' ); // wgLogo
- $logoHD = $this->getConfig()->get( 'LogoHD' ); // wgLogoHD
+ $logo = ResourceLoaderSkinModule::getLogo( $this->getConfig() );
$tags = [];
$logosPerDppx = [];
$logos = [];
- $logosPerDppx['1.0'] = $logo;
-
- if ( !$logoHD ) {
+ if ( !is_array( $logo ) ) {
// No media queries required if we only have one variant
$this->addLinkHeader( '<' . $logo . '>;rel=preload;as=image' );
return;
}
- foreach ( $logoHD as $dppx => $src ) {
- // Only 1.5x and 2x are supported
- // Note: Keep in sync with ResourceLoaderSkinModule
- if ( in_array( $dppx, [ '1.5x', '2x' ] ) ) {
- // LogoHD uses a string in this format: "1.5x"
- $dppx = substr( $dppx, 0, -1 );
- $logosPerDppx[$dppx] = $src;
- }
+ foreach ( $logo as $dppx => $src ) {
+ // Keys are in this format: "1.5x"
+ $dppx = substr( $dppx, 0, -1 );
+ $logosPerDppx[$dppx] = $src;
}
// Because PHP can't have floats as array keys
// (e.g. can't express ">= 1.5 and not >= 2).
// Workaround: Use <= 1.9999 in place of < 2.
$upper_bound = floatval( $logos[ $i + 1 ]['dppx'] ) - 0.000001;
- $media_query = '(min-resolution: ' . $logos[ $i ]['dppx'] .
+ $media_query = '(min-resolution: ' . $logos[ $i ]['dppx'] .
'dppx) and (max-resolution: ' . $upper_bound . 'dppx)';
} else {
// Largest dppx