Although it's common to set properties on newly created elements off-DOM and insert them when ready, in Internet Explorer @font-face rules set through cssText don't work unless the <style> tag is in the DOM when the cssText is set.
Stupid ? Yes, very. But it's just the way it is.
See also:
- http://stackoverflow.com/questions/7931658/dynamically-adding-font-face-rule-in-ie-8-and-less/7952904#7952904
- https://www.mediawiki.org/wiki/Special:Code/MediaWiki/106706#c28088
We should simply change mw.util.addCSS to insert first and set cssText after. Might decrease performance a little bit (since it'd be changing the dom twice then), but we are discouraging use of addCSS anyway since people are encourages to maintain actual stylesheets instead (which are loaded by ResourceLoader in the same request at no signifiant additional cost).
The few uses of addCSS for dynamic style insertion will do fine.
Current code:
https://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/resources/mediawiki/mediawiki.util.js?revision=96151&view=markup#l146
Version: 1.17.x
Severity: normal