https://www.mediawiki.org/wiki/Special:Code/MediaWiki/106992
Revision: 106992 Author: krinkle Date: 2011-12-21 22:08:52 +0000 (Wed, 21 Dec 2011) Log Message: ----------- [Core JS] mw.util.addCSS: Insert style tag into dom before setting cssText * Fixes bug 33305 Modified Paths: -------------- trunk/phase3/RELEASE-NOTES-1.19 trunk/phase3/resources/mediawiki/mediawiki.util.js Modified: trunk/phase3/RELEASE-NOTES-1.19 =================================================================== --- trunk/phase3/RELEASE-NOTES-1.19 2011-12-21 22:06:02 UTC (rev 106991) +++ trunk/phase3/RELEASE-NOTES-1.19 2011-12-21 22:08:52 UTC (rev 106992) @@ -194,6 +194,8 @@ * (bug 33156) Special:Block now allows you to confirm you want to block yourself when using non-normalized username * (bug 33246) News icon shown for news:// URLs but not for news: URLs +* (bug 33305) Make mw.util.addCSS resistant to IE's @font-face bug with setting + cssText before DOM insertion. === API changes in 1.19 === * (bug 19838) siprop=interwikimap can now use the interwiki cache. Modified: trunk/phase3/resources/mediawiki/mediawiki.util.js =================================================================== --- trunk/phase3/resources/mediawiki/mediawiki.util.js 2011-12-21 22:06:02 UTC (rev 106991) +++ trunk/phase3/resources/mediawiki/mediawiki.util.js 2011-12-21 22:08:52 UTC (rev 106992) @@ -160,13 +160,14 @@ var s = document.createElement( 'style' ); s.type = 'text/css'; s.rel = 'stylesheet'; + // Insert into document before setting cssText (bug 33305) + document.getElementsByTagName('head')[0].appendChild( s ); if ( s.styleSheet ) { s.styleSheet.cssText = text; // IE } else { // Safari sometimes borks on null s.appendChild( document.createTextNode( text + '' ) ); } - document.getElementsByTagName('head')[0].appendChild( s ); return s.sheet || s; }, _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs