| Index: third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp
|
| index 92b93ede5558f7ae7b2706123227a683fa50e9b6..0bd4f35f2db6db7e4ae725e4830125b9b3d6b8b6 100644
|
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp
|
| @@ -102,24 +102,30 @@ void CompositingInputsUpdater::updateRecursive(PaintLayer* layer,
|
| layer->updateAncestorOverflowLayer(info.lastOverflowClipLayer);
|
| if (info.lastOverflowClipLayer && layer->needsCompositingInputsUpdate() &&
|
| layer->layoutObject()->style()->position() == EPosition::kSticky) {
|
| - if (info.lastOverflowClipLayer != previousOverflowLayer &&
|
| - !RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
|
| - // Old ancestor scroller should no longer have these constraints.
|
| - ASSERT(!previousOverflowLayer ||
|
| - !previousOverflowLayer->getScrollableArea()
|
| - ->stickyConstraintsMap()
|
| - .contains(layer));
|
| -
|
| - if (info.lastOverflowClipLayer->isRootLayer())
|
| + if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
|
| + if (info.lastOverflowClipLayer != previousOverflowLayer) {
|
| + // Old ancestor scroller should no longer have these constraints.
|
| + DCHECK(!previousOverflowLayer ||
|
| + !previousOverflowLayer->getScrollableArea()
|
| + ->stickyConstraintsMap()
|
| + .contains(layer));
|
| +
|
| + // If our ancestor scroller has changed and the previous one was the
|
| + // root layer, we are no longer viewport constrained.
|
| + if (previousOverflowLayer && previousOverflowLayer->isRootLayer()) {
|
| + layer->layoutObject()
|
| + ->view()
|
| + ->frameView()
|
| + ->removeViewportConstrainedObject(layer->layoutObject());
|
| + }
|
| + }
|
| +
|
| + if (info.lastOverflowClipLayer->isRootLayer()) {
|
| layer->layoutObject()
|
| ->view()
|
| ->frameView()
|
| ->addViewportConstrainedObject(layer->layoutObject());
|
| - else if (previousOverflowLayer && previousOverflowLayer->isRootLayer())
|
| - layer->layoutObject()
|
| - ->view()
|
| - ->frameView()
|
| - ->removeViewportConstrainedObject(layer->layoutObject());
|
| + }
|
| }
|
| layer->layoutObject()->updateStickyPositionConstraints();
|
|
|
|
|