Index: Source/core/dom/Node.cpp |
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp |
index 1e80af0f00a8650f570082ee40da17996e303b16..a2c11241a9708062dde5d6fe584661a739741454 100644 |
--- a/Source/core/dom/Node.cpp |
+++ b/Source/core/dom/Node.cpp |
@@ -2779,6 +2779,17 @@ void Node::setIsCustomElement() |
setFlag(IsCustomElement); |
} |
+bool Node::canReach(const Node* target) const |
dglazkov
2013/05/08 16:37:29
I think we can use the new fancy stuff in DOM spec
|
+{ |
+ ASSERT(target); |
+ TreeScope* targetScope = target->treeScope(); |
+ for (TreeScope* scope = treeScope(); scope; scope = scope->parentTreeScope()) { |
+ if (scope == targetScope) |
+ return true; |
+ } |
+ return false; |
+} |
+ |
} // namespace WebCore |
#ifndef NDEBUG |