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

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: 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/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index 333d17dea30e5a45a176685a846d9fb2bab5e21e..c9c31defec8e1b0afdf6181ce78f3c89a97a7076 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -1728,7 +1728,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();
@@ -4958,7 +4959,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