X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/e789468531597875c9c171d0554230856d40a2b9..17bbb9fd36eff5978689a9dc4a2fec69b716e674:/src/wlxml/wlxml.js?ds=inline 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); };