[mw.loader] Refactor addInlineCSS's logic, fixing various bugs
authorKrinkle <krinkle@users.mediawiki.org>
Fri, 24 Feb 2012 23:22:30 +0000 (23:22 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Fri, 24 Feb 2012 23:22:30 +0000 (23:22 +0000)
commit57dda2b95e0997165dcc6eba83e5aa101bd10b51
tree31b334896d029eba81386be88be5da966fe53dee
parent829e60f1bd6ff30e7e863bcaa851a1f52508bea3
[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.js
resources/mediawiki/mediawiki.util.js