resourceloader: Simplify CSS loading by removing IE8 hacks
* Remove 'isIEto9'. Since we blacklist anything before 9, isIE9 is enough.
* Set the content of style tags and the href attribute of link tags before
inserting them into the DOM. Previously, we did DOM insertion first, due
to T35305. I verified that IE9 is not affected.
* Use document.head instead of document.getElementsByTagName( 'head' )[ 0 ].
* Set / extend the contents of link tags via
node.appendChild( document.createTextNode( ... ) ) this works in IE9, and
adding CSS in this way does not strip @media queries in the way that
repeat node.styleSheet.cssText += '...' operations will. This means the
workarounds put in place to mitigate T108727 can be removed.
quirksmode confirms that document.createTextNode() is supported in IE9,
and mentions the issue with style tags as IE8-specific:
http://quirksmode.org/dom/core/#t01
I created a test page with all the behaviors here:
https://people.wikimedia.org/~ori/If51f8303b/index.html
It loads correctly in IE9:
https://people.wikimedia.org/~ori/If51f8303b/screenshot.png
Change-Id: If51f8303b74fdc8001cfa20ea8b016fdc210b1b1