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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2051703002: Implement closed shadow adjustment for Element.offsetParent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resolve comments 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/layout/LayoutObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index 7b7996ca542c27b32613429569ccd690bd5d2d9f..b86045ea20a4e8284f30ef6f4520d6aaeb13ac77 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -3279,6 +3279,16 @@ Element* LayoutObject::offsetParent() const
return node && node->isElementNode() ? toElement(node) : nullptr;
}
+Element* LayoutObject::offsetParentForBinding() const
eae 2016/06/09 13:19:42 How about a more descriptive name like nearestUncl
kochi 2016/06/09 16:04:27 I chose "unclosedOffsetParent()", as it still retu
+{
+ Element* element = offsetParent();
+
+ while (element && (!element->isUnclosedNodeOf(*node()) || (element->isInShadowTree() && element->containingShadowRoot()->type() == ShadowRootType::UserAgent)))
+ element = element->layoutObject()->offsetParent();
+
+ return element;
+}
+
PositionWithAffinity LayoutObject::createPositionWithAffinity(int offset, TextAffinity affinity)
{
// If this is a non-anonymous layoutObject in an editable area, then it's simple.

Powered by Google App Engine
This is Rietveld 408576698