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

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: 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 9767274a2a6a1a2784f48e208702e6774aae7ad4..57259301fdb36d8bed355c79535d5eee37011177 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -456,7 +456,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();
}
@@ -813,14 +813,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();

Powered by Google App Engine
This is Rietveld 408576698