From a71167895c373ae505be6a8bc6f217d46a2d1abb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Mon, 23 Mar 2015 21:55:12 +0100 Subject: [PATCH] ResourceLoaderImageModule: Synchronize CSS with .background-image-svg LESS mixin Bug: T87504 Change-Id: I790bd953fabbd4ff03f15c94fe101e2f65891520 --- includes/resourceloader/ResourceLoaderImageModule.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/includes/resourceloader/ResourceLoaderImageModule.php b/includes/resourceloader/ResourceLoaderImageModule.php index 8fbe4975cb..5be4419c11 100644 --- a/includes/resourceloader/ResourceLoaderImageModule.php +++ b/includes/resourceloader/ResourceLoaderImageModule.php @@ -264,18 +264,23 @@ class ResourceLoaderImageModule extends ResourceLoaderModule { } /** + * SVG support using a transparent gradient to guarantee cross-browser + * compatibility (browsers able to understand gradient syntax support also SVG). + * http://pauginer.tumblr.com/post/36614680636/invisible-gradient-technique + * + * Keep synchronized with the .background-image-svg LESS mixin in + * /resources/src/mediawiki.less/mediawiki.mixins.less. + * * @param string $primary Primary URI * @param string $fallback Fallback URI * @return string[] CSS declarations to use given URIs as background-image */ protected function getCssDeclarations( $primary, $fallback ) { - // SVG support using a transparent gradient to guarantee cross-browser - // compatibility (browsers able to understand gradient syntax support also SVG). - // http://pauginer.tumblr.com/post/36614680636/invisible-gradient-technique return array( "background-image: url($fallback);", "background-image: -webkit-linear-gradient(transparent, transparent), url($primary);", "background-image: linear-gradient(transparent, transparent), url($primary);", + "background-image: -o-linear-gradient(transparent, transparent), url($fallback);", ); } -- 2.20.1