From c193c33cf3e10b222a47de0b971573b66b495cfc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Thu, 26 Jun 2014 09:31:08 +0200 Subject: [PATCH] wlxml: Document's root is always a context root --- src/wlxml/wlxml.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wlxml/wlxml.js b/src/wlxml/wlxml.js index df93b3e..262004c 100644 --- a/src/wlxml/wlxml.js +++ b/src/wlxml/wlxml.js @@ -33,6 +33,9 @@ var WLXMLDocumentNodeMethods = { isContextRoot: function() { var me = this.nodeType === Node.ELEMENT_NODE ? [this] : [], toret = false; + if(!this.parent()) { + return true; + } me.concat(this.parents()).some(function(node) { if(_.isFunction(node.object.isContextRoot) && node.object.isContextRoot(this)) { toret = true; -- 2.20.1