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

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: Fix bugs with overflow scrollers in sticky position constraints, add unit tests, and test clipped b… Created 4 years, 7 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 2a5c4d143e73884234b4f620d1ef50914e9f5326..d5f8ce3c8ccd82365db1a606531e0d8d01aa04d4 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -1616,7 +1616,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())
@@ -1626,8 +1626,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.
@@ -3244,7 +3248,7 @@ void FrameView::setScrollOffset(const DoublePoint& offset, ScrollType scrollType
m_pendingScrollDelta += scrollDelta;
clearFragmentAnchor();
- updateLayersAndCompositingAfterScrollIfNeeded();
+ updateLayersAndCompositingAfterScrollIfNeeded(scrollDelta);
Document* document = m_frame->document();
document->enqueueScrollEventForNode(document);

Powered by Google App Engine
This is Rietveld 408576698