Last modified: 2014-06-06 04:15:26 UTC
Based on the source[1] it currently trims: * '; ' => ';' * ': ' => ':' * ' {' => '{' * '{ ' => '{' * ', ' => ',' * '} ' => '}' * ';}' => '}' That still leaves room for improvement of 3 cases (found out through bug 35492). * Space before } > > return CSSMin::minify("foo { prop: foo }"); > foo{prop:foo } * Space before : > > return CSSMin::minify("foo { prop : foo; }"); > foo{prop :foo} * Space before ; > > return CSSMin::minify("foo { prop: foo ; }"); > foo{prop:foo } * Space before , > > return CSSMin::minify("foo { prop: foo , bar ; }"); > foo{prop:foo ,bar } Especially the latter two (space before comma or semi-colon) are a fairly common programming style by the "space-extremists". foo { prop: voo( .. ) , voo( .. ) ; prop: foo ; } I'm not going to be bold on this one because I haven't checked whether there are any side-effects to these 4 changes, but they seem easy gains :) [1] https://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/libs/CSSMin.php?revision=110557&view=markup#l210
Added tests cases for these in Ic9195614acfd616ccd.