r107043 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107042‎ | r107043 | r107044 >
Date:08:49, 22 December 2011
Author:santhosh
Status:ok (Comments)
Tags:
Comment:
Use mw.util.addCSS for adding css. Based on bug 33305, and fixed in r106992.
Modified paths:
  • /trunk/extensions/WebFonts/resources/ext.webfonts.js (modified) (history)

Diff [purge]

Index: trunk/extensions/WebFonts/resources/ext.webfonts.js
@@ -108,8 +108,7 @@
109109 fontFormats = [],
110110 version = fontconfig.version || "0.0",
111111 versionSuffix = "?version=" + version + '&20111213',
112 - styleString = "<style type='text/css'>"
113 - + "@font-face { font-family: '"+fontFamily+"';\n",
 112+ styleString = "@font-face { font-family: '"+fontFamily+"';\n",
114113 ua = navigator.userAgent;
115114
116115 if ( fontconfig.eot !== undefined ) {
@@ -140,10 +139,8 @@
141140 styleString += fontFormats.join() + ";\n";
142141 styleString += "\tfont-weight: normal;}";
143142
144 - styleString += "\n</style>\n";
145143 // inject the css to the head of the page.
146 - // mw.util.addCSS wont work with fontface, and crashes IE.
147 - $( styleString ).appendTo( 'head' );
 144+ mw.util.addCSS( styleString );
148145 },
149146
150147 /**

Sign-offs

UserFlagDate
Nikerabbitinspected09:29, 22 December 2011

Follow-up revisions

RevisionCommit summaryAuthorDate
r107977MFT r107043, r107816, r107818reedy00:46, 4 January 2012
r112370[mw.loader] Refactor addInlineCSS's logic, fixing various bugs...krinkle23:22, 24 February 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r106992[Core JS] mw.util.addCSS: Insert style tag into dom before setting cssText...krinkle22:08, 21 December 2011

Comments

#Comment by Reedy (talk | contribs)   19:35, 3 January 2012

Untagging 1.18, path conflict, and code doesn't seem to tie up with 1.18

Status & tagging log