* CSSJanus now supports rgb, hsl, rgba, and hsla color syntaxes.
* Special:Listfiles can no longer be sorted by image name when filtering
by user in miser mode.
+* (bug 49074) CSSJanus: Handle values of border-radius correctly.
=== API changes in 1.22 ===
* (bug 25553) The JSON output formatter now leaves forward slashes unescaped
'cursor_west' => null,
'four_notation_quantity' => null,
'four_notation_color' => null,
+ 'border_radius' => null,
'bg_horizontal_percentage' => null,
'bg_horizontal_percentage_x' => null,
);
$patterns['cursor_west'] = "/{$patterns['lookbehind_not_letter']}([ns]?)w-resize/";
$patterns['four_notation_quantity'] = "/(:\s*){$patterns['possibly_negative_quantity']}(\s+){$patterns['possibly_negative_quantity']}(\s+){$patterns['possibly_negative_quantity']}(\s+){$patterns['possibly_negative_quantity']}(\s*[;}])/i";
$patterns['four_notation_color'] = "/(-color\s*:\s*){$patterns['color']}(\s+){$patterns['color']}(\s+){$patterns['color']}(\s+){$patterns['color']}(\s*[;}])/i";
+ $patterns['border_radius'] = "/(border-radius\s*:\s*){$patterns['possibly_negative_quantity']}(\s+){$patterns['possibly_negative_quantity']}(\s+){$patterns['possibly_negative_quantity']}(\s+){$patterns['possibly_negative_quantity']}(\s*[;}])/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']}))/";
$css = self::fixLeftAndRight( $css );
$css = self::fixCursorProperties( $css );
$css = self::fixFourPartNotation( $css );
+ $css = self::fixBorderRadius( $css );
$css = self::fixBackgroundPosition( $css );
// Detokenize stuff we tokenized before
return $css;
}
+ /**
+ * Swaps appropriate corners in four-part border-radius rules.
+ * Needs to undo the effect of fixFourPartNotation() on those rules, too.
+ *
+ * @param $css string
+ * @return string
+ */
+ private static function fixBorderRadius( $css ) {
+ // Undo four_notation_quantity
+ $css = preg_replace( self::$patterns['border_radius'], '$1$2$3$8$5$6$7$4$9', $css );
+ // Do the real thing
+ $css = preg_replace( self::$patterns['border_radius'], '$1$4$3$2$5$8$7$6$9', $css );
+
+ return $css;
+ }
+
/**
* Flip horizontal background percentages.
* @param $css string
'.foo { padding: 1px inherit 3px auto; }',
'.foo { padding: 1px auto 3px inherit; }'
),
+ // border-radius assigns different meanings to the values
array(
'.foo { border-radius: .25em 15px 0pt 0ex; }',
- '.foo { border-radius: .25em 0ex 0pt 15px; }'
+ '.foo { border-radius: 15px .25em 0ex 0pt; }'
),
+ array(
+ '.foo { border-radius: 0px 0px 5px 5px; }',
+ ),
+ // Ensure the rule doesn't break other stuff
array(
'.foo { x-unknown: a b c d; }'
),