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..df30fbde50a018f0153d7606b648ddc7d4f91e31 100644 |
| --- a/third_party/WebKit/Source/core/frame/FrameView.cpp |
| +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp |
| @@ -3646,10 +3646,19 @@ void FrameView::updateScrollbars() |
| void FrameView::adjustScrollPositionFromUpdateScrollbars() |
| { |
| - DoublePoint adjustedScrollPosition = clampScrollPosition(scrollPositionDouble()); |
| - |
| - if (adjustedScrollPosition != scrollPositionDouble() || scrollOriginChanged()) { |
| - ScrollableArea::setScrollPosition(adjustedScrollPosition, ProgrammaticScroll); |
| + DoublePoint clamped = clampScrollPosition(scrollPositionDouble()); |
| + if (clamped != scrollPositionDouble() || scrollOriginChanged()) { |
| + // Since the scroll bounds have changed and the scroller is at a position |
| + // that is outside its new bounds. Calling ScrollAnchor::restore |
| + // ensures that no visible jump is seen when clamping. |
|
skobes
2016/07/15 20:17:42
I think this comment should mention that we restor
ymalik
2016/07/18 16:08:48
Done.
|
| + // TODO(ymalik): This same logic exists in PaintLayerScrollableArea. |
| + // Remove when root-layer-scrolls is enabled. |
| + if (shouldPerformScrollAnchoring() && m_scrollAnchor.hasScroller()) { |
| + m_scrollAnchor.restore(); |
| + clamped = clampScrollPosition(scrollPositionDouble()); |
| + } |
| + if (clamped != scrollPositionDouble()) |
| + ScrollableArea::setScrollPosition(clamped, ProgrammaticScroll); |
| resetScrollOriginChanged(); |
| } |
| } |