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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 2404393003: Tie scroll anchoring adjustments to frame lifecycle instead of layout. (Closed)
Patch Set: add DCHECK Created 4 years, 2 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/paint/PaintLayerScrollableArea.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
index 60e26e7f06221dc65c16a6a16a84f84d02d69581..269315c8c8c2b9484cf5b7e4a151c033feff5db1 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -459,7 +459,7 @@ void PaintLayerScrollableArea::updateScrollOffset(const ScrollOffset& newOffset,
// Clear the scroll anchor, unless it is the reason for this scroll.
if (RuntimeEnabledFeatures::scrollAnchoringEnabled() &&
- scrollType != AnchoringScroll)
+ scrollType != AnchoringScroll && scrollType != ClampingScroll)
scrollAnchor()->clear();
}
@@ -786,14 +786,10 @@ void PaintLayerScrollableArea::clampScrollOffsetsAfterLayout() {
return;
}
- // Restore before clamping because clamping clears the scroll anchor.
- if (shouldPerformScrollAnchoring())
- m_scrollAnchor.restore();
-
if (scrollOriginChanged())
setScrollOffsetUnconditionally(clampScrollOffset(scrollOffset()));
else
- ScrollableArea::setScrollOffset(scrollOffset(), ProgrammaticScroll);
+ ScrollableArea::setScrollOffset(scrollOffset(), ClampingScroll);
setNeedsScrollOffsetClamp(false);
resetScrollOriginChanged();
« no previous file with comments | « third_party/WebKit/Source/core/layout/ScrollAnchor.cpp ('k') | third_party/WebKit/Source/platform/scroll/ScrollTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698