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

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: 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/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..9fb1ca483578a07ddf63457994a5911a5920be4a 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -3244,7 +3244,7 @@ void LayoutObject::imageChanged(ImageResource* image, const IntRect* rect)
imageChanged(static_cast<WrappedImagePtr>(image), rect);
}
-Element* LayoutObject::offsetParent() const
+Element* LayoutObject::offsetParentInternal() const
{
if (isDocumentElement() || isBody())
return nullptr;
@@ -3279,6 +3279,16 @@ Element* LayoutObject::offsetParent() const
return node && node->isElementNode() ? toElement(node) : nullptr;
}
+Element* LayoutObject::offsetParent() const
hayato 2016/06/09 08:22:03 A binding layer is the only client for this method
kochi 2016/06/09 13:09:28 Good catch! Currently Element::offsetParent() is
+{
+ Element* element = offsetParentInternal();
+
+ while (element && !element->isUnclosedNodeOf(*node()))
+ 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