X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/e789468531597875c9c171d0554230856d40a2b9..83c3d33472c6828f617ffde4bea861e7cd403e79:/src/wlxml/wlxml.js?ds=sidebyside diff --git a/src/wlxml/wlxml.js b/src/wlxml/wlxml.js index 40ab196..ef70d3d 100644 --- a/src/wlxml/wlxml.js +++ b/src/wlxml/wlxml.js @@ -44,6 +44,19 @@ var WLXMLDocumentNodeMethods = { } }.bind(this)); return toret; + }, + getContextRoot: function() { + var contextRoot; + [this].concat(this.parents()).some(function(n) { + if(n.isContextRoot()) { + contextRoot = n; + return true; + } + }); + return contextRoot; + }, + hasSameContextRoot: function(other) { + return this.getContextRoot().sameNode(other.getContextRoot()); } }; @@ -183,7 +196,6 @@ var WLXMLDocumentNode = function() { }; WLXMLDocumentNode.prototype = Object.create(smartxml.DocumentNode.prototype); - var WLXMLTextNode = function() { smartxml.TextNode.apply(this, arguments); };