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 486a11a43eb50a95648e8c40706d57d7d6d7f796..883758e27529c6b0d09f787ffbd90dbf53bc27f5 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp |
@@ -774,12 +774,21 @@ void LayoutBoxModelObject::updateStickyPositionConstraints() const { |
StickyPositionScrollingConstraints constraints; |
FloatSize skippedContainersOffset; |
LayoutBlock* containingBlock = this->containingBlock(); |
+ // The location container for boxes is not always the containing block. |
+ LayoutBox* locationContainer = isLayoutInline() |
+ ? containingBlock |
+ : toLayoutBox(this)->locationContainer(); |
// Skip anonymous containing blocks. |
while (containingBlock->isAnonymous()) { |
- skippedContainersOffset += |
- toFloatSize(FloatPoint(containingBlock->frameRect().location())); |
containingBlock = containingBlock->containingBlock(); |
} |
+ MapCoordinatesFlags flags = 0; |
+ skippedContainersOffset = |
+ toFloatSize(locationContainer |
+ ->localToAncestorQuadWithoutTransforms( |
+ FloatQuad(), containingBlock, flags) |
+ .boundingBox() |
+ .location()); |
LayoutBox* scrollAncestor = |
layer()->ancestorOverflowLayer()->isRootLayer() |
? nullptr |
@@ -807,13 +816,11 @@ void LayoutBoxModelObject::updateStickyPositionConstraints() const { |
} |
if (containingBlock != scrollAncestor) { |
FloatQuad localQuad(FloatRect(containingBlock->paddingBoxRect())); |
- TransformState transformState(TransformState::ApplyTransformDirection, |
- localQuad.boundingBox().center(), localQuad); |
- containingBlock->mapLocalToAncestor(scrollAncestor, transformState, |
- ApplyContainerFlip); |
- transformState.flatten(); |
scrollContainerRelativePaddingBoxRect = |
- transformState.lastPlanarQuad().boundingBox(); |
+ containingBlock |
+ ->localToAncestorQuadWithoutTransforms(localQuad, scrollAncestor, |
+ flags) |
+ .boundingBox(); |
// The sticky position constraint rects should be independent of the current |
// scroll position, so after mapping we add in the scroll position to get |