From e2e3acf76a3ae14114e715acc6e235f7f8c4e652 Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Tue, 10 Oct 2017 16:35:36 -0700 Subject: [PATCH] Print logo should use an absolute URI The logo is configured as a relative URL. CSSMin encodeImageAsDataURI requires a file path. There seems to be no reason to use a data uri here. The print stylesheet is loaded on page load so the image will be downloaded before a print action takes place. Inspecting I788bcecadf26e4e5558b5b37e6fb1b2e9378277e using a data uri makes little difference to the synchronous nature of a print. Bug: T177800 Change-Id: I0254ae8e360f09fe1c786695510550c7fec02026 --- README.md | 2 ++ ResourceLoaderLessModule.php | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4b3f40bed..85e6ff712 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ below. Alternatively, a PNG or other type of image can be used, but its dimensions also need to match the corresponding variable below. That in turn may result in blurry images, though. +The URL can be absolute or relative. + Example configuration: $wgVectorPrintLogo = [ diff --git a/ResourceLoaderLessModule.php b/ResourceLoaderLessModule.php index a90160124..ca980fd93 100644 --- a/ResourceLoaderLessModule.php +++ b/ResourceLoaderLessModule.php @@ -44,8 +44,7 @@ class ResourceLoaderLessModule extends ResourceLoaderFileModule { $printLogo = $config->get( 'VectorPrintLogo' ); if ( $printLogo ) { $lessVars[ 'printLogo' ] = true; - $lessVars[ 'printLogoUrl' ] = CSSMin::buildUrlValue( - CSSMin::encodeImageAsDataURI( $printLogo['url'] ) ); + $lessVars[ 'printLogoUrl' ] = CSSMin::buildUrlValue( $printLogo['url'] ); $lessVars[ 'printLogoWidth' ] = intval( $printLogo['width'] ); $lessVars[ 'printLogoHeight' ] = intval( $printLogo['height'] ); } else {