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

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: Merge with master and add comment explaining container content rect. 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 ab8f86fc55e8d846f5d136320978ddd47213644a..7c6924f6f3f0c5b713ce24224a4362063229afd5 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -1622,7 +1622,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())
@@ -1632,8 +1632,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.
@@ -3257,7 +3261,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