X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FOutputPage.php;h=4635f991c280f4e903b4a4a56583c1fda7d2d44c;hb=694120c80e553d7c75f63de0201b3c1de2111cdd;hp=20b2c3c32da3025303e43998e077eba4bc09555e;hpb=d6f84e825c5b2ea214b460c5a8b204927213e75c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 20b2c3c32d..4635f991c2 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -314,15 +314,10 @@ class OutputPage extends ContextSource { * Constructor for OutputPage. This should not be called directly. * Instead a new RequestContext should be created and it will implicitly create * a OutputPage tied to that context. - * @param IContextSource|null $context + * @param IContextSource $context */ - function __construct( IContextSource $context = null ) { - if ( $context === null ) { - # Extensions should use `new RequestContext` instead of `new OutputPage` now. - wfDeprecated( __METHOD__, '1.18' ); - } else { - $this->setContext( $context ); - } + function __construct( IContextSource $context ) { + $this->setContext( $context ); } /** @@ -1981,6 +1976,7 @@ class OutputPage extends ContextSource { * @deprecated since 1.27 Use setCdnMaxage() instead */ public function setSquidMaxage( $maxage ) { + wfDeprecated( __METHOD__, '1.27' ); $this->setCdnMaxage( $maxage ); } @@ -4026,6 +4022,13 @@ class OutputPage extends ContextSource { return; } + if ( isset( $logo['svg'] ) ) { + // No media queries required if we only have a 1x and svg variant + // because all preload-capable browsers support SVGs + $this->addLinkHeader( '<' . $logo['svg'] . '>;rel=preload;as=image' ); + return; + } + foreach ( $logo as $dppx => $src ) { // Keys are in this format: "1.5x" $dppx = substr( $dppx, 0, -1 );