Chromium Code Reviews| 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(); |
| } |
| } |