From: umherirrender Date: Wed, 9 Apr 2014 19:25:00 +0000 (+0200) Subject: document.createElementNS is null or not an object in IE8 X-Git-Tag: 1.31.0-rc.0~16223^2 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=cd361413d80a6af61991da642ace1c12130d2c0f;p=lhc%2Fweb%2Fwiklou.git 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 --- 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