document.createElementNS is null or not an object in IE8
authorumherirrender <umherirrender_de.wp@web.de>
Wed, 9 Apr 2014 19:25:00 +0000 (21:25 +0200)
committerUmherirrender <umherirrender_de.wp@web.de>
Mon, 14 Apr 2014 16:39:16 +0000 (16:39 +0000)
Having $wgDebugToolbar = true and visiting the wiki with IE8 will give
no debug toolbar, using ?debug=true gives a "document.createElementNS is
null or not an object" javascript fatal.

Throw a error. The function 'createSvgElement' will never be called,
because profiling gives a "An ES5 compatible javascript engine
is required for the profile visualization." in IE8.

Change-Id: I763dae7459cb88f892823b9458ed6dd1dbbf3e9d

resources/src/mediawiki/mediawiki.debug.profile.js

index 9b0711a..2b8f881 100644 (file)
                 * @param string tag to create
                 * @return DOMElement
                 */
-               createSvgElement: document.createElementNS.bind( document, 'http://www.w3.org/2000/svg' ),
+               createSvgElement: document.createElementNS
+                       ? document.createElementNS.bind( document, 'http://www.w3.org/2000/svg' )
+                       // throw a error for browsers which does not support document.createElementNS (IE<8)
+                       : function () { throw new Error( 'document.createElementNS not supported' ); },
 
                /**
                 * @param DOMElement|undefined