From 5cf6c9e68d0867f75991c93e4ce9620bb67dbaa0 Mon Sep 17 00:00:00 2001 From: Sujay Krishna Suresh Date: Wed, 25 Jul 2012 14:56:21 +0530 Subject: [PATCH] A more readable HTMLDocument.createElementNS --- src/html/document.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/html/document.js b/src/html/document.js index 509588eb..ec69d8f5 100644 --- a/src/html/document.js +++ b/src/html/document.js @@ -174,16 +174,13 @@ __extend__(HTMLDocument.prototype, { }, createElementNS : function (uri, local) { //print('createElementNS :'+uri+" "+local); - if(!uri){ - return this.createElement(local); - }else if ("http://www.w3.org/1999/xhtml" == uri) { - return this.createElement(local); - } else if ("http://www.w3.org/1998/Math/MathML" == uri) { - return this.createElement(local); - } else if ("http://www.w3.org/2000/svg" == uri) { - return this.createElement(local); + if(!uri || + uri == "http://www.w3.org/1999/xhtml" || + uri == "http://www.w3.org/1998/Math/MathML" || + uri == "http://www.w3.org/2000/svg") { + return this.createElement(local); } else { - return Document.prototype.createElementNS.apply(this,[uri, local]); + return Document.prototype.createElementNS.apply(this,[uri, local]); } }, get anchors(){