Last modified: 2014-06-06 04:15:26 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T37493, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 35493 - CSSMin::minify could trim a little more
CSSMin::minify could trim a little more
Status: NEW
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
1.17.x
All All
: Lowest enhancement (vote)
: Future release
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-26 17:16 UTC by Krinkle
Modified: 2014-06-06 04:15 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Krinkle 2012-03-26 17:16:15 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
Comment 1 Krinkle 2014-06-06 04:15:26 UTC
Added tests cases for these in Ic9195614acfd616ccd.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links