mw.loader: Remove support for IE6
authorTimo Tijhof <krinklemail@gmail.com>
Sun, 11 Jan 2015 15:43:35 +0000 (07:43 -0800)
committerKrinkle <krinklemail@gmail.com>
Tue, 13 Jan 2015 22:03:32 +0000 (22:03 +0000)
The client loader doesn't run in IE6.

Since MediaWiki 1.24, the startup module provides IE6 a
javascriptless environment.

Change-Id: I16628e21d6a89a31dc65baf4a22c6fb31dde2535

resources/src/mediawiki/mediawiki.js

index e0e2963..b63e889 100644 (file)
                         *
                         * @private
                         * @param {string} text CSS text
-                        * @param {HTMLElement|jQuery} [nextnode=document.head] The element where the style tag should be
-                        *  inserted before. Otherwise it will be appended to `<head>`.
+                        * @param {HTMLElement|jQuery} [nextnode=document.head] The element where the style tag
+                        *  should be inserted before. Otherwise it will be appended to `<head>`.
                         * @return {HTMLElement} Reference to the created `<style>` element.
                         */
                        function newStyleTag( text, nextnode ) {
                                var s = document.createElement( 'style' );
                                // Insert into document before setting cssText (bug 33305)
                                if ( nextnode ) {
-                                       // Must be inserted with native insertBefore, not $.fn.before.
-                                       // When using jQuery to insert it, like $nextnode.before( s ),
-                                       // then IE6 will throw "Access is denied" when trying to append
-                                       // to .cssText later. Some kind of weird security measure.
-                                       // http://stackoverflow.com/q/12586482/319266
-                                       // Works: jsfiddle.net/zJzMy/1
-                                       // Fails: jsfiddle.net/uJTQz
-                                       // Works again: http://jsfiddle.net/Azr4w/ (diff: the next 3 lines)
-                                       if ( nextnode.jquery ) {
-                                               nextnode = nextnode.get( 0 );
-                                       }
-                                       nextnode.parentNode.insertBefore( s, nextnode );
+                                       $( nextnode ).before( s );
                                } else {
                                        document.getElementsByTagName( 'head' )[0].appendChild( s );
                                }
                                        currReqBase
                                );
                                request = sortQuery( request );
-                               // Append &* to avoid triggering the IE6 extension check
+                               // Support: IE6
+                               // Append &* to satisfy load.php's WebRequest::checkUrlExtension test. This script
+                               // isn't actually used in IE6, but MediaWiki enforces it in general.
                                addScript( sourceLoadScript + '?' + $.param( request ) + '&*', null, async );
                        }