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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp

Issue 2683313003: Always invalidate sticky constraints on the ancestor overflow layer (Closed)
Patch Set: Add test and short circuit for enclosing scroller. 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
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 c3f9368ccc8c86a72f400ecd57acbec015062842..8e0b7cd75a1134571ab759df6e32a1549f3675f7 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
@@ -424,15 +424,24 @@ void LayoutBoxModelObject::styleDidChange(StyleDifference diff,
}
void LayoutBoxModelObject::invalidateStickyConstraints() {
- if (!layer())
- return;
+ PaintLayer* enclosing = enclosingLayer();
+
+ if (PaintLayerScrollableArea* scrollableArea =
+ enclosing->getScrollableArea()) {
+ scrollableArea->invalidateAllStickyConstraints();
+ // If this object doesn't have a layer and its enclosing layer is a scroller
+ // then we don't need to invalidate the sticky constraints on the ancestor
+ // scroller because the enclosing scroller won't have changed size.
+ if (!layer())
+ return;
+ }
// This intentionally uses the stale ancestor overflow layer compositing input
// as if we have saved constraints for this layer they were saved in the
// previous frame.
DisableCompositingQueryAsserts disabler;
if (const PaintLayer* ancestorOverflowLayer =
- layer()->ancestorOverflowLayer())
+ enclosing->ancestorOverflowLayer())
ancestorOverflowLayer->getScrollableArea()
->invalidateAllStickyConstraints();
}

Powered by Google App Engine
This is Rietveld 408576698