Last modified: 2014-06-06 04:27:01 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 T37471, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 35471 - Gadgets with CSS+JS should not have their stylesheet ripped out of context into the only=styles <link>
Gadgets with CSS+JS should not have their stylesheet ripped out of context in...
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
Gadgets (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Krinkle
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-25 17:42 UTC by Bawolff (Brian Wolff)
Modified: 2014-06-06 04:27 UTC (History)
6 users (show)

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


Attachments

Description Bawolff (Brian Wolff) 2012-03-25 17:42:38 UTC
Sometime around 1.19, gadgets switched to loading CSS via RL. This broke some stuff on Wikinews, as gadgets that @import'ed their css from 'pedia broke, since RL made it so the @import statement was not at very top of file.

Resource loader should re-order the @import statement in a module so its at the very top of a combined css file.
Comment 1 Krinkle 2012-03-25 17:48:59 UTC

*** This bug has been marked as a duplicate of bug 34669 ***
Comment 2 Krinkle 2012-03-25 18:02:58 UTC
When ResourceLoader loads a module it requests it from load.php and gets a set of javascript executables, a set of CSS strings (not 1 long string). And then it inserts them into the document with <style> elements. Separate style elements for each original css string.

So @import will work fine.

However recently in trunk (1.20svn) this <style> element generation was changes to instead use 1 long <style> element, but that broke @import (bug 34669).

However since this is on enwikinews, that can't be the problem. From our IRC convo, the problem is that the css you referred to wasn't loaded by the ResouceLoader client (mw.loader), but from load.php directly with an only=styles argument.

only=styles means it is not allowed to use dynamic injection, but only pure CSS. This methods should never be used for more than 1 module because it means @import rules will end up somewhere in the middle.

Similar to bug 34669, there is no good solution because changing the location of the @import rule will change the cascading nature, they simply must not be merged into 1 stylesheet. They have to be separate.

load.php with only=styles directly in the HTML should be very rarely used. Only for fairly static modules that need to work without javascript. And even then not with multiple modules combined (unless it can be absolutely sure that @import is not used such as mediawiki core's skin+screen+print stylesheet).

I think this is a bug in the gadget extension that incorrectly is putting modules in the top <link> queue
Comment 3 Max Semenik 2014-04-29 17:19:43 UTC
I see no problem here: Gadgets won't load modules via RL unless you tell it to. If your gadget is not RL-compatible, either fix it or don't use RL.

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


Navigation
Links