https://bugzilla.wikimedia.org/show_bug.cgi?id=33305
Web browser: ---
Bug #: 33305
Summary: Make mw.util.addCSS resistant to IE's @font-face bug
with setting cssText before DOM insertion
Product: MediaWiki
Version: 1.17
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: Javascript
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
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
--
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l