From 57dda2b95e0997165dcc6eba83e5aa101bd10b51 Mon Sep 17 00:00:00 2001 From: Krinkle Date: Fri, 24 Feb 2012 23:22:30 +0000 Subject: [mw.loader] Refactor addInlineCSS's logic, fixing various bugs * Using mw.util.addCSS as base to instance of bug 33305 automatically * Expose as mw.loader.addStyleTag * Re-use the code in mw.util.addCSS * Drop the "text > Cdata > element > jQuery object > innerHTML", in favor of setting cssText or appending a text node (html escapement isn't a problem when working with text nodes directly). * Appending this way also works in IE, no need for the dispose/re-create style-tag logic in the try-catch(). * Follows-up r110988 (fixme) --- resources/mediawiki/mediawiki.util.js | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'resources/mediawiki/mediawiki.util.js') diff --git a/resources/mediawiki/mediawiki.util.js b/resources/mediawiki/mediawiki.util.js index 277b19457cfb..6edbe5d1d7b8 100644 --- a/resources/mediawiki/mediawiki.util.js +++ b/resources/mediawiki/mediawiki.util.js @@ -149,23 +149,24 @@ }, /** - * Append a new style block to the head + * Append a new style block to the head and return the CSSStyleSheet object. + * Use .ownerNode to access the