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

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

Issue 2152773002: Make scroll anchoring adjustment when the bounds of a scroller is changed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add comment Created 4 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9e64a983ed273135f768d12e98d0c4a98780eba9..2f1567b54aa5936428a1722e214109c461f59e91 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -3647,9 +3647,16 @@ void FrameView::updateScrollbars()
void FrameView::adjustScrollPositionFromUpdateScrollbars()
{
DoublePoint adjustedScrollPosition = clampScrollPosition(scrollPositionDouble());
-
if (adjustedScrollPosition != scrollPositionDouble() || scrollOriginChanged()) {
- ScrollableArea::setScrollPosition(adjustedScrollPosition, ProgrammaticScroll);
+ // Since the scroll bounds have changed and the scroller is at a position
+ // that is outside its new bounds. Calling ScrollAnchor::restore
skobes 2016/07/14 14:49:25 If the scroll bounds have changed, we will relayou
+ // ensures that no visible jump is seen when clamping.
+ if (shouldPerformScrollAnchoring() && m_scrollAnchor.hasScroller()) {
+ m_scrollAnchor.restore();
+ adjustedScrollPosition = clampScrollPosition(scrollPositionDouble());
+ }
+ if (adjustedScrollPosition != scrollPositionDouble())
+ ScrollableArea::setScrollPosition(adjustedScrollPosition, ProgrammaticScroll);
resetScrollOriginChanged();
}
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698