"Krinkle" posted a comment on MediaWiki.r110988.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/110988#c31408

Commit summary for MediaWiki.r110988:

(bug 31676) Group dynamically inserted CSS into a single <style> tag, because 
IE limits the number of styles it'll apply to 32 (seriously?!?). 3rd party 
users were complaining about IE not applying some modules' CSS when many 
modules were loaded; this wasn't a problem on WMF wikis as far as I know

Krinkle's comment:

Also, aside from checking the media-attribute. Just checking it isn't enough. 
Doing so would still create various style-tags when there are different 
media-types used.

it's using <code>getMarker().prev()</code> as attempt to get the "right" one. 
If it's right, use it. If not, create one. But if there are more than 2 style 
tags in use, it would have to look back further.

Aside from that, separating by media-type and concatenating them into one tag 
don't play well together since media-types are not exclusive. For example "all" 
includes "screen". Taking the following as use case:
* module A (media type: screen)
* module B (media type: print)
* module B (media type: all)
* module C (media type: screen)

The 'screen' style would be appended to the earlier created and recycled 
"screen" media type style tag, thus messing with the cascading order (A:screen 
> C:screen > B:all, instead of A:screen > B:all, C:screen)

While discussing this on IRC, we came up with an easy work around though. 
ResourceLoader is already taking care of this by wrapping code in @media-type 
groups. The only media type that ever makes it to implement() is "all". We can 
drop this check.

_______________________________________________
MediaWiki-CodeReview mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview

Reply via email to