r110587 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110586‎ | r110587 | r110588 >
Date:16:31, 2 February 2012
Author:catrope
Status:ok
Tags:
Comment:
Fix bug in CSSJanus where background-position and background-position-x weren't flipped if negative values were given. Trevor found this by running the original CSSJanus test suite against his NodeJS port; I should port the test suite to PHPUnit some time
Modified paths:
  • /trunk/phase3/includes/libs/CSSJanus.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/libs/CSSJanus.php
@@ -113,8 +113,8 @@
114114 $patterns['four_notation_color'] = "/(-color\s*:\s*){$patterns['color']}(\s+){$patterns['color']}(\s+){$patterns['color']}(\s+){$patterns['color']}/i";
115115 // The two regexes below are parenthesized differently then in the original implementation to make the
116116 // callback's job more straightforward
117 - $patterns['bg_horizontal_percentage'] = "/(background(?:-position)?\s*:\s*[^%]*?)({$patterns['num']})(%\s*(?:{$patterns['quantity']}|{$patterns['ident']}))/";
118 - $patterns['bg_horizontal_percentage_x'] = "/(background-position-x\s*:\s*)({$patterns['num']})(%)/";
 117+ $patterns['bg_horizontal_percentage'] = "/(background(?:-position)?\s*:\s*[^%]*?)(-?{$patterns['num']})(%\s*(?:{$patterns['quantity']}|{$patterns['ident']}))/";
 118+ $patterns['bg_horizontal_percentage_x'] = "/(background-position-x\s*:\s*)(-?{$patterns['num']})(%)/";
119119 }
120120
121121 /**

Status & tagging log