From d7954691c1f3c5d46d259f66469a049c0d1e5b58 Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Wed, 15 Oct 2014 10:03:35 -0700 Subject: [PATCH] Use more consistent background image scaling Chrome in particular would end up with fairly small and inconsistent background sizes when using background-size: contain;. This makes sense according to the docs at https://developer.mozilla.org/en-US/docs/Web/CSS/background-size, which doesn't specify that the background actually has to fill the entire element. background-size: 100% 100%; does force full-size scaling, which is what we want. Verified to work as expected in Chrome 38 on Linux. Change-Id: I508e08dac1480491efcd1d27cfac16187bfbd4fe --- MathMathML.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MathMathML.php b/MathMathML.php index 32e56cc..b440cf2 100644 --- a/MathMathML.php +++ b/MathMathML.php @@ -379,7 +379,8 @@ class MathMathML extends MathRenderer { $class = $classOverride; } - $style = 'background-image: url(\''. $url. '\'); background-repeat: no-repeat; background-size: contain;'; + // TODO: move the common styles to the global stylesheet! + $style = 'background-image: url(\''. $url. '\'); background-repeat: no-repeat; background-size: 100% 100%;'; $this->correctSvgStyle( $this->getSvg(), $style ); if ( $class ) { $attribs['class'] = $class; } if ( $style ) { $attribs['style'] = $style; }