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

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: Create a stacking context for sticky. 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 00ea3e0c061dc0b8079ecbcec191fa1d1502d403..eb86bffea57232ba5de24823b852481e782a3baa 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