Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(321)

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp

Issue 2706673002: Mark elements as viewport constrained when they become sticky positioned (Closed)
Patch Set: Rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameViewTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 808736d1679341dba7e7daf1021f787f94a3a48f..ae0dcc65cc9ceae71c10d3c3b75440b14e1082e9 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositingInputsUpdater.cpp
@@ -102,23 +102,27 @@ 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 (!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();
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameViewTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698