Was incorrectly assuming values between -1 and 1 were 0
Fixes an issue with mw-ui-input class in RTL mode which
makes use of box shadow.
Change-Id: I13e52467721bc2534e0a7c5245e3380ac43736ef
// (We can't just negate the value with unary minus due to the units.)
$flipSign = function ( $cssValue ) {
// Don't mangle zeroes
- if ( intval( $cssValue ) === 0 ) {
+ if ( floatval( $cssValue ) === 0.0 ) {
return $cssValue;
} elseif ( $cssValue[0] === '-' ) {
return substr( $cssValue, 1 );
// Don't mangle zeroes
'.foo { text-shadow: orange 0 2px; }'
),
+ array(
+ // Make sure floats are not considered zero
+ '.foo { box-shadow: inset .5em 0 0 white; }',
+ '.foo { box-shadow: inset -.5em 0 0 white; }',
+ ),
// Direction
// Note: This differs from the Python implementation,