Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Unified Diff: third_party/WebKit/Source/core/dom/Node.cpp

Issue 2051703002: Implement closed shadow adjustment for Element.offsetParent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698