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

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

Issue 2020103002: Fix sticky constraints and update sticky layer positions recursively after scroll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify sticky box rect calculation. Created 4 years, 6 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 932181ae0fa9b46cc6388a13447feaad9db9de32..59372c7c70218962635316316b0a5e377b7dad0e 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -1623,7 +1623,7 @@ void FrameView::didScrollTimerFired(Timer<FrameView>*)
m_frame->document()->fetcher()->updateAllImageResourcePriorities();
}
-void FrameView::updateLayersAndCompositingAfterScrollIfNeeded()
+void FrameView::updateLayersAndCompositingAfterScrollIfNeeded(const DoubleSize& scrollDelta)
{
// Nothing to do after scrolling if there are no fixed position elements.
if (!hasViewportConstrainedObjects())
@@ -1633,8 +1633,12 @@ void FrameView::updateLayersAndCompositingAfterScrollIfNeeded()
for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) {
LayoutObject* layoutObject = viewportConstrainedObject;
PaintLayer* layer = toLayoutBoxModelObject(layoutObject)->layer();
- if (layoutObject->style()->position() == StickyPosition)
- layer->updateLayerPosition();
+ if (layoutObject->style()->position() == StickyPosition) {
+ // TODO(skobes): Resolve circular dependency between scroll offset and
+ // compositing state, and remove this disabler. https://crbug.com/420741
+ DisableCompositingQueryAsserts disabler;
+ layer->updateLayerPositionsAfterOverflowScroll(scrollDelta);
+ }
}
// If there fixed position elements, scrolling may cause compositing layers to change.
@@ -3326,7 +3330,7 @@ void FrameView::setScrollOffset(const DoublePoint& offset, ScrollType scrollType
m_pendingScrollDelta += scrollDelta;
clearFragmentAnchor();
- updateLayersAndCompositingAfterScrollIfNeeded();
+ updateLayersAndCompositingAfterScrollIfNeeded(scrollDelta);
Document* document = m_frame->document();
document->enqueueScrollEventForNode(document);
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698