"Krinkle" posted a comment on MediaWiki.r100497.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/100497#c29137
Commit summary for MediaWiki.r100497:
Move styles in gadgets to the top of pages to avoid flash of unstyled content.
Those styles should be loaded after site and user styles to keep B/C.
Krinkle's comment:
* Styling core elements (most likely a CSS-only gadget):
This will be fixed by RL2, which allows a gadget to set the load position to
"top", which will make it load from the top queue (with JavaScript, in the same
request as most other modules), which will be loaded before the page is
rendered.
* CSS for any gadget in browsers without JS
Interesting case, although one could argue:
* Browsers without JS aren't officially supported, although it is the goal to
preserve core article reading in a pretty way for those browsers. Gadgets don't
fall under that imho.
* Adding a separate http request for all css sheets from the HEAD for each
gadget doesn't seem ideal
* By being in a {{tag|link|o}} in the HTML itself means cache updates are not
propagated as fast as other parts of the module, which is exactly why
ResourceLoader's client-side component uses dynamic loading through JavaScript
powered by the startup module. Using a LINK undoes all those advantages and
will cause this style to be updates less frequently, become part from the html
output, and likely have a shorter cache duration (not as good for performance,
although not a huge deal for logged-in only gadgets but we have the ability to
load gadgets for anonymous users and all logged-in users as well, so I think
it's worth considering not allowing gadgets to insert an additional LINK tag
for this reason as it goes against the very principle that ResourceLoader is
trying to acomplish).
* Potential risk of CSS and JS of a gadget going out of sync.
_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview