r106992 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106991‎ | r106992 | r106993 >
Date:22:08, 21 December 2011
Author:krinkle
Status:ok (Comments)
Tags:
Comment:
[Core JS] mw.util.addCSS: Insert style tag into dom before setting cssText
* Fixes bug 33305
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/resources/mediawiki/mediawiki.util.js (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -194,6 +194,8 @@
195195 * (bug 33156) Special:Block now allows you to confirm you want to block yourself
196196 when using non-normalized username
197197 * (bug 33246) News icon shown for news:// URLs but not for news: URLs
 198+* (bug 33305) Make mw.util.addCSS resistant to IE's @font-face bug with setting
 199+ cssText before DOM insertion.
198200
199201 === API changes in 1.19 ===
200202 * (bug 19838) siprop=interwikimap can now use the interwiki cache.
Index: trunk/phase3/resources/mediawiki/mediawiki.util.js
@@ -160,13 +160,14 @@
161161 var s = document.createElement( 'style' );
162162 s.type = 'text/css';
163163 s.rel = 'stylesheet';
 164+ // Insert into document before setting cssText (bug 33305)
 165+ document.getElementsByTagName('head')[0].appendChild( s );
164166 if ( s.styleSheet ) {
165167 s.styleSheet.cssText = text; // IE
166168 } else {
167169 // Safari sometimes borks on null
168170 s.appendChild( document.createTextNode( text + '' ) );
169171 }
170 - document.getElementsByTagName('head')[0].appendChild( s );
171172 return s.sheet || s;
172173 },
173174

Follow-up revisions

RevisionCommit summaryAuthorDate
r107043Use mw.util.addCSS for adding css. Based on bug 33305, and fixed in r106992.santhosh08:49, 22 December 2011
r107119rephrase r106992 release noteskrinkle22:30, 22 December 2011
r107924Merge r106992, manually merge r107119reedy19:21, 3 January 2012
r107957Merge r107913 (merges r105007 from trunk) and r107924 (merges r106992 from tr...reedy22:57, 3 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
r106706[WebFonts] Code quality & clean up...krinkle22:02, 19 December 2011

Comments

#Comment by Santhosh.thottingal (talk | contribs)   08:57, 22 December 2011

I think the release-notes text is wrong. It should be : (bug 33305) Make mw.util.addCSS resistant to IE's @font-face bug with setting cssText after DOM insertion.

#Comment by Krinkle (talk | contribs)   22:32, 22 December 2011

It's not as much wrong as it is ambiguous. Intended as "Internet Explorer has a bug with setting cssText before DOM insertion".

In r107119 I've rephrased it to drop the the last part that was describing the bug more - instead re-using that sentence part to describe the taken solution.

Status & tagging log