bool Node::contains(const Node* node) const {
if (!node)
return false;
return this == node || node->isDescendantOf(this);
}
So, this function can be called |isDescendantOfOrSelf()|. It seems we can get rid of editing.nodes.isDescendatOf by replacing it with |Node.prototype.contains()|.
Closure compiler has wrong externs for Node.prototype.contains() in ie_dom.js, which accept {Element|null} rather than {Node|null}. So, we should have workaround for this incompatibility.
See https://developer.mozilla.org/en-US/docs/Web/API/Node.contains
Here is implementation in Blink
So, this function can be called |isDescendantOfOrSelf()|. It seems we can get rid of editing.nodes.isDescendatOf by replacing it with |Node.prototype.contains()|.