Chromium Code Reviews| 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 60bc7d9c1f0b10387e35cea5af6102cff05cc949..39b51de3caff42f42c1d34f568e1b90173a0a65e 100644 |
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| @@ -311,11 +311,18 @@ void CompositedLayerMapping::updateStickyConstraints( |
| &m_owningLayer); |
| // Find the layout offset of the unshifted sticky box within its enclosing |
| - // layer. |
| + // layer. If the enclosing layer is not the scroller, the offset must be |
| + // adjusted to include the scroll offset to keep it relative. |
|
chrishtr
2017/02/28 19:36:28
"relative to compositingContainer"
smcgruer
2017/03/01 19:58:39
Done.
|
| + PaintLayer* enclosingLayer = |
| + m_owningLayer.enclosingLayerWithCompositedLayerMapping(ExcludeSelf); |
|
chrishtr
2017/02/28 19:36:28
Please pass compositingContainer to updateStickyCo
smcgruer
2017/03/01 19:58:40
Done.
|
| LayoutPoint enclosingLayerOffset; |
| - m_owningLayer.enclosingLayerWithCompositedLayerMapping(ExcludeSelf) |
| - ->convertToLayerCoords(m_owningLayer.ancestorOverflowLayer(), |
| - enclosingLayerOffset); |
| + enclosingLayer->convertToLayerCoords(ancestorOverflowLayer, |
| + enclosingLayerOffset); |
| + if (enclosingLayer != ancestorOverflowLayer) { |
| + enclosingLayerOffset += LayoutSize( |
| + ancestorOverflowLayer->getScrollableArea()->getScrollOffset()); |
| + } |
| + |
| FloatPoint stickyBoxOffset = |
| constraints.scrollContainerRelativeStickyBoxRect().location(); |
| DCHECK(!m_contentOffsetInCompositingLayerDirty); |