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

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

Issue 2051703002: Implement closed shadow adjustment for Element.offsetParent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename functions, update comment 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/LayoutBoxModelObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
index cb416dca18088a6b66608b98352cce926530b206..1cc2e651513a393665d805641e59883a71410d91 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
@@ -758,7 +758,7 @@ LayoutSize LayoutBoxModelObject::stickyPositionOffset() const
return LayoutSize(scrollableArea->stickyConstraintsMap().get(layer()).computeStickyOffset(constrainingRect));
}
-LayoutPoint LayoutBoxModelObject::adjustedPositionRelativeToOffsetParent(const LayoutPoint& startPoint) const
+LayoutPoint LayoutBoxModelObject::adjustedPositionRelativeToUnclosedOffsetParent(const LayoutPoint& startPoint) const
{
// If the element is the HTML body element or doesn't have a parent
// return 0 and stop this algorithm.
@@ -768,10 +768,12 @@ LayoutPoint LayoutBoxModelObject::adjustedPositionRelativeToOffsetParent(const L
LayoutPoint referencePoint = startPoint;
referencePoint.move(parent()->columnOffset(referencePoint));
- // If the offsetParent of the element is null, or is the HTML body element,
+ // Calling unclosedOffsetParent() here to skip through non-unclosed (i.e.
+ // inaccessible in a closed shadow or UA shadow) nodes to get offset parent.
+ // If the unclosedOffsetParent of the element is null,
// return the distance between the canvas origin and the left border edge
// of the element and stop this algorithm.
- Element* element = offsetParent();
+ Element* element = unclosedOffsetParent();
hayato 2016/06/10 01:41:51 Why did you change the behavior of LayoutBoxModelO
kochi 2016/06/10 02:07:49 adjustedPositionRelativeToOffsetParent() is called
if (!element)
return referencePoint;
@@ -815,14 +817,14 @@ LayoutUnit LayoutBoxModelObject::offsetLeft() const
{
// Note that LayoutInline and LayoutBox override this to pass a different
// startPoint to adjustedPositionRelativeToOffsetParent.
- return adjustedPositionRelativeToOffsetParent(LayoutPoint()).x();
+ return adjustedPositionRelativeToUnclosedOffsetParent(LayoutPoint()).x();
}
LayoutUnit LayoutBoxModelObject::offsetTop() const
{
// Note that LayoutInline and LayoutBox override this to pass a different
// startPoint to adjustedPositionRelativeToOffsetParent.
- return adjustedPositionRelativeToOffsetParent(LayoutPoint()).y();
+ return adjustedPositionRelativeToUnclosedOffsetParent(LayoutPoint()).y();
}
int LayoutBoxModelObject::pixelSnappedOffsetWidth() const
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h ('k') | third_party/WebKit/Source/core/layout/LayoutInline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698