r106772 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106771‎ | r106772 | r106773 >
Date:09:07, 20 December 2011
Author:santhosh
Status:ok
Tags:
Comment:
mw.util.addCSS will make IE version <= 8 crash if the css is a fontface definition. Reverting to the jquery append to head.

Follow up r106706
Modified paths:
  • /trunk/extensions/WebFonts/resources/ext.webfonts.js (modified) (history)

Diff [purge]

Index: trunk/extensions/WebFonts/resources/ext.webfonts.js
@@ -108,7 +108,8 @@
109109 fontFormats = [],
110110 version = fontconfig.version || "0.0",
111111 versionSuffix = "?version=" + version + '&20111213',
112 - styleString = "@font-face { font-family: '"+fontFamily+"';\n",
 112+ styleString = "<style type='text/css'>"
 113+ + "@font-face { font-family: '"+fontFamily+"';\n",
113114 ua = navigator.userAgent;
114115
115116 if ( fontconfig.eot !== undefined ) {
@@ -139,7 +140,10 @@
140141 styleString += fontFormats.join() + ";\n";
141142 styleString += "\tfont-weight: normal;}";
142143
143 - mw.util.addCSS( styleString );
 144+ styleString += "\n</style>\n";
 145+ // inject the css to the head of the page.
 146+ // mw.util.addCSS wont work with fontface, and crashes IE.
 147+ $( styleString ).appendTo( 'head' );
144148 },
145149
146150 /**
@@ -414,4 +418,4 @@
415419 }
416420 };
417421
418 -})( jQuery, mediaWiki );
\ No newline at end of file
 422+})( jQuery, mediaWiki );

Follow-up revisions

RevisionCommit summaryAuthorDate
r107378I18ndeploy...nikerabbit13:32, 27 December 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r106706[WebFonts] Code quality & clean up...krinkle22:02, 19 December 2011

Status & tagging log