Fix bug in CSSJanus where background-position and background-position-x weren't flipp...
authorRoan Kattouw <catrope@users.mediawiki.org>
Thu, 2 Feb 2012 16:31:42 +0000 (16:31 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Thu, 2 Feb 2012 16:31:42 +0000 (16:31 +0000)
includes/libs/CSSJanus.php

index e6940ea..c8fc296 100644 (file)
@@ -113,8 +113,8 @@ class CSSJanus {
                $patterns['four_notation_color'] = "/(-color\s*:\s*){$patterns['color']}(\s+){$patterns['color']}(\s+){$patterns['color']}(\s+){$patterns['color']}/i";
                // The two regexes below are parenthesized differently then in the original implementation to make the
                // callback's job more straightforward
-               $patterns['bg_horizontal_percentage'] = "/(background(?:-position)?\s*:\s*[^%]*?)({$patterns['num']})(%\s*(?:{$patterns['quantity']}|{$patterns['ident']}))/";
-               $patterns['bg_horizontal_percentage_x'] = "/(background-position-x\s*:\s*)({$patterns['num']})(%)/";
+               $patterns['bg_horizontal_percentage'] = "/(background(?:-position)?\s*:\s*[^%]*?)(-?{$patterns['num']})(%\s*(?:{$patterns['quantity']}|{$patterns['ident']}))/";
+               $patterns['bg_horizontal_percentage_x'] = "/(background-position-x\s*:\s*)(-?{$patterns['num']})(%)/";
        }
 
        /**