Chromium Code Reviews| 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 |