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

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: Add one more test case. 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.h ('k') | third_party/WebKit/Source/core/html/HTMLElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cbc5281a0e8e4324bd92f5e5cdd5b1e76f40b19c..a8db4d8a9e89710da17fd00e4ae89cb333f140ad 100644
--- a/third_party/WebKit/Source/core/dom/Node.cpp
+++ b/third_party/WebKit/Source/core/dom/Node.cpp
@@ -636,6 +636,25 @@ Node& Node::shadowIncludingRoot() const
return *root;
}
+bool Node::isUnclosedNodeOf(const Node& other) const
+{
+ if (!isInShadowTree() || treeScope() == other.treeScope())
+ return true;
+
+ const TreeScope* scope = &treeScope();
+ for (; scope->parentTreeScope(); scope = scope->parentTreeScope()) {
+ const ContainerNode& root = scope->rootNode();
+ if (root.isShadowRoot() && !toShadowRoot(root).isOpenOrV0())
+ break;
+ }
+
+ for (TreeScope* otherScope = &other.treeScope(); otherScope; otherScope = otherScope->parentTreeScope()) {
+ if (otherScope == scope)
+ return true;
+ }
+ return false;
+}
+
bool Node::needsDistributionRecalc() const
{
return shadowIncludingRoot().childNeedsDistributionRecalc();
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.h ('k') | third_party/WebKit/Source/core/html/HTMLElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698