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

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2716583005: Do not promote position sticky or fixed elements unless they move with scroll. (Closed)
Patch Set: Avoid computing constraints for non-anchored sticky and add/update tests. Created 3 years, 9 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/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index 4959e65cffdd86d3499cbe53c908e02024163cdf..76aceedf504d4195d643d94ee6111a9be5a80178 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -1744,7 +1744,8 @@ bool FrameView::invalidateViewportConstrainedObjects() {
for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) {
LayoutObject* layoutObject = viewportConstrainedObject;
LayoutItem layoutItem = LayoutItem(layoutObject);
- ASSERT(layoutItem.style()->hasViewportConstrainedPosition());
+ DCHECK(layoutItem.style()->hasViewportConstrainedPosition() ||
+ layoutItem.style()->hasStickyConstrainedPosition());
ASSERT(layoutItem.hasLayer());
PaintLayer* layer = LayoutBoxModel(layoutItem).layer();
@@ -5018,7 +5019,7 @@ bool FrameView::hasVisibleSlowRepaintViewportConstrainedObjects() const {
// Whether the Layer sticks to the viewport is a tree-depenent
// property and our viewportConstrainedObjects collection is maintained
// with only LayoutObject-level information.
- if (!layer->sticksToViewport())
+ if (!layer->fixedToViewport() && !layer->sticksToScroller())
continue;
// If the whole subtree is invisible, there's no reason to scroll on

Powered by Google App Engine
This is Rietveld 408576698