Last modified: 2012-04-16 09:16:05 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 T29396, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27396 - JS minifier breaks URLs in CSS strings
JS minifier breaks URLs in CSS strings
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
unspecified
All All
: Normal critical (vote)
: ---
Assigned To: Trevor Parscal
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-14 12:37 UTC by Krinkle
Modified: 2012-04-16 09:16 UTC (History)
3 users (show)

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


Attachments

Description Krinkle 2011-02-14 12:37:04 UTC
On http://translatewiki.net/wiki/Thread:Support/Page_last_modified there is:

<pre>
...
( jQuery ) );


}, {"all": ".ui-button{display:inline-block; ... background:#e1e1e1 url(http:


mediaWiki.loader.implement("jquery.ui.core",function($,mw){ ...
</pre>

" ... " is inserted by me and not in the actual code

The "SyntaxError: Parse error" traces back to directly after "http:"

ie. the "//" in http:// was treated as a comment. I'm not sure whether this is caused by the CSS minifer or by the javascript minifier that ran afterwards.


In the end obviously the JavaScript minifier is the one removing the // comment, but the root cause could be in the CSS minifier.

Possible work around:
Don't minify the end output of load.php (ie. the "mediaWiki.loader.implement" calls), but only run javascript minify on the modules themselfs between { and } of the implemenet() call, and the CSS minifer on what is in the later argument.
Reason being that the call to mediaWiki.loader.load are so simple there's no need to minify them, it would only bring in extra unneeded risks such as the js minifier screwing in the css-string.

Ofcourse that's not a permanent solution as there could be a css string like that inside a module as well such as:

$(el).attr('style', 'background: url(http:// ...
or 
appendCSS( 'el { background: url(http:// ...

This is breaking javascript execution completely on some pages of TranslateWiki.net

--
Krinkle
Comment 1 Roan Kattouw 2011-02-14 21:16:29 UTC
Are you sure this is reproducible on either trunk, REL1_17 or 1.17wmf1? I fixed this a few days ago, and TWN might just be running old code.
Comment 2 Mark A. Hershberger 2011-02-15 20:17:43 UTC
It looks ugly on twn, but seems fine on mw.org.  This+Roan's comment makes me think it isn't a blocker for now.
Comment 3 Roan Kattouw 2011-02-18 17:25:45 UTC
This should be fixed now. Closing as FIXED, please REOPEN if new problems arise.

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


Navigation
Links