From cd361413d80a6af61991da642ace1c12130d2c0f Mon Sep 17 00:00:00 2001 From: umherirrender Date: Wed, 9 Apr 2014 21:25:00 +0200 Subject: [PATCH] document.createElementNS is null or not an object in IE8 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/src/mediawiki/mediawiki.debug.profile.js b/resources/src/mediawiki/mediawiki.debug.profile.js index 9b0711a9fc..2b8f881c62 100644 --- a/resources/src/mediawiki/mediawiki.debug.profile.js +++ b/resources/src/mediawiki/mediawiki.debug.profile.js @@ -70,7 +70,10 @@ * @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 -- 2.20.1