Index: third_party/WebKit/Source/core/dom/Node.cpp |
diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp |
index c0853351774bffbdfa5051e2dc6152fc5c16f15d..21c673a2d3a94a7a64d1ded1111eac6985884209 100644 |
--- a/third_party/WebKit/Source/core/dom/Node.cpp |
+++ b/third_party/WebKit/Source/core/dom/Node.cpp |
@@ -636,6 +636,22 @@ Node& Node::shadowIncludingRoot() const |
return *root; |
} |
+bool Node::isUnclosedNodeOf(const Node& other) const |
+{ |
+ if (treeScope() == other.treeScope()) |
+ return true; |
+ |
+ for (TreeScope* scope = &other.treeScope(); scope; scope = scope->parentTreeScope()) { |
+ if (scope == treeScope()) |
+ return true; |
+ } |
+ |
+ ContainerNode& root = treeScope().rootNode(); |
+ if (root.isShadowRoot() && toShadowRoot(root).isOpenOrV0()) |
+ return other.isUnclosedNodeOf(toShadowRoot(root).host()); |
hayato
2016/06/09 08:22:03
Is this opposite of the definition? Could you re-c
kochi
2016/06/09 10:49:39
Oops, you're right.
I read the latter half of the
|
+ return false; |
+} |
+ |
bool Node::needsDistributionRecalc() const |
{ |
return shadowIncludingRoot().childNeedsDistributionRecalc(); |