$css = $noFlipClass->detokenize( $css );
$css = $noFlipSingle->detokenize( $css );
+ // Remove remaining /* @noflip */ annotations, they won't be needed anymore
+ // and can interfere with other code (bug 69698).
+ $css = self::nullTransform( $css );
+
+ return $css;
+ }
+
+ /**
+ * Remove @noflip annotations, but don't do any other transforms.
+ * @param string $css stylesheet to transform
+ * @return string Transformed stylesheet
+ */
+ public static function nullTransform( $css ) {
+ $patt = self::$patterns['noflip_annotation'];
+ $css = preg_replace( "/($patt)\\s*/i", '', $css );
+
return $css;
}
// (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 );