| Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
|
| index 3babc9d05b8c435629655b7fa715dd8a26a78cc4..ab707c88a1388983ae3d600d7c82c15c257be10d 100644
|
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
|
| @@ -291,7 +291,8 @@ void CompositedLayerMapping::updateBackdropFilters(const ComputedStyle& style) {
|
| }
|
|
|
| void CompositedLayerMapping::updateStickyConstraints(
|
| - const ComputedStyle& style) {
|
| + const ComputedStyle& style,
|
| + const PaintLayer* compositingContainer) {
|
| bool sticky = style.position() == EPosition::kSticky;
|
| const PaintLayer* ancestorOverflowLayer =
|
| m_owningLayer.ancestorOverflowLayer();
|
| @@ -310,12 +311,18 @@ void CompositedLayerMapping::updateStickyConstraints(
|
| ancestorOverflowLayer->getScrollableArea()->stickyConstraintsMap().at(
|
| &m_owningLayer);
|
|
|
| - // Find the layout offset of the unshifted sticky box within its enclosing
|
| - // layer.
|
| + // Find the layout offset of the unshifted sticky box within its
|
| + // compositingContainer. If the enclosing layer is not the scroller, then
|
| + // the offset must be adjusted to include the scroll offset to keep it
|
| + // relative to compositingContainer.
|
| LayoutPoint enclosingLayerOffset;
|
| - m_owningLayer.enclosingLayerWithCompositedLayerMapping(ExcludeSelf)
|
| - ->convertToLayerCoords(m_owningLayer.ancestorOverflowLayer(),
|
| - enclosingLayerOffset);
|
| + compositingContainer->convertToLayerCoords(ancestorOverflowLayer,
|
| + enclosingLayerOffset);
|
| + if (compositingContainer != ancestorOverflowLayer) {
|
| + enclosingLayerOffset += LayoutSize(
|
| + ancestorOverflowLayer->getScrollableArea()->getScrollOffset());
|
| + }
|
| +
|
| FloatPoint stickyBoxOffset =
|
| constraints.scrollContainerRelativeStickyBoxRect().location();
|
| DCHECK(!m_contentOffsetInCompositingLayerDirty);
|
| @@ -1014,7 +1021,7 @@ void CompositedLayerMapping::updateGraphicsLayerGeometry(
|
| graphicsLayerParentLocation);
|
| updateContentsOffsetInCompositingLayer(snappedOffsetFromCompositedAncestor,
|
| graphicsLayerParentLocation);
|
| - updateStickyConstraints(layoutObject().styleRef());
|
| + updateStickyConstraints(layoutObject().styleRef(), compositingContainer);
|
| updateSquashingLayerGeometry(
|
| graphicsLayerParentLocation, compositingContainer, m_squashedLayers,
|
| m_squashingLayer.get(), &m_squashingLayerOffsetFromTransformedAncestor,
|
|
|