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
This commit is contained in:
jdlrobson 2017-10-10 16:35:36 -07:00 committed by Jdlrobson
parent 100ec7e9a2
commit e2e3acf76a
2 changed files with 3 additions and 2 deletions

View File

@ -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 = [

View File

@ -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 {