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

Side by Side 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: Call restore from PLSA/FV 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 3628 matching lines...) Expand 10 before | Expand all | Expand 10 after
3639 frameRectsChanged(); 3639 frameRectsChanged();
3640 positionScrollbarLayers(); 3640 positionScrollbarLayers();
3641 updateScrollCorner(); 3641 updateScrollCorner();
3642 } 3642 }
3643 3643
3644 adjustScrollPositionFromUpdateScrollbars(); 3644 adjustScrollPositionFromUpdateScrollbars();
3645 } 3645 }
3646 3646
3647 void FrameView::adjustScrollPositionFromUpdateScrollbars() 3647 void FrameView::adjustScrollPositionFromUpdateScrollbars()
3648 { 3648 {
3649 DoublePoint adjustedScrollPosition = clampScrollPosition(scrollPositionDoubl e()); 3649 DoublePoint clamped = clampScrollPosition(scrollPositionDouble());
3650 3650 if (clamped != scrollPositionDouble() || scrollOriginChanged()) {
3651 if (adjustedScrollPosition != scrollPositionDouble() || scrollOriginChanged( )) { 3651 // Since the scroll bounds have changed and the scroller is at a positio n
3652 ScrollableArea::setScrollPosition(adjustedScrollPosition, ProgrammaticSc roll); 3652 // that is outside its new bounds. Calling ScrollAnchor::restore
3653 // 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.
3654 // TODO(ymalik): This same logic exists in PaintLayerScrollableArea.
3655 // Remove when root-layer-scrolls is enabled.
3656 if (shouldPerformScrollAnchoring() && m_scrollAnchor.hasScroller()) {
3657 m_scrollAnchor.restore();
3658 clamped = clampScrollPosition(scrollPositionDouble());
3659 }
3660 if (clamped != scrollPositionDouble())
3661 ScrollableArea::setScrollPosition(clamped, ProgrammaticScroll);
3653 resetScrollOriginChanged(); 3662 resetScrollOriginChanged();
3654 } 3663 }
3655 } 3664 }
3656 3665
3657 IntRect FrameView::rectToCopyOnScroll() const 3666 IntRect FrameView::rectToCopyOnScroll() const
3658 { 3667 {
3659 IntRect scrollViewRect = convertToRootFrame(IntRect((shouldPlaceVerticalScro llbarOnLeft() && verticalScrollbar()) ? verticalScrollbar()->width() : 0, 0, vis ibleWidth(), visibleHeight())); 3668 IntRect scrollViewRect = convertToRootFrame(IntRect((shouldPlaceVerticalScro llbarOnLeft() && verticalScrollbar()) ? verticalScrollbar()->width() : 0, 0, vis ibleWidth(), visibleHeight()));
3660 if (hasOverlayScrollbars()) { 3669 if (hasOverlayScrollbars()) {
3661 int verticalScrollbarWidth = (verticalScrollbar() && !hasLayerForVertica lScrollbar()) ? verticalScrollbar()->width() : 0; 3670 int verticalScrollbarWidth = (verticalScrollbar() && !hasLayerForVertica lScrollbar()) ? verticalScrollbar()->width() : 0;
3662 int horizontalScrollbarHeight = (horizontalScrollbar() && !hasLayerForHo rizontalScrollbar()) ? horizontalScrollbar()->height() : 0; 3671 int horizontalScrollbarHeight = (horizontalScrollbar() && !hasLayerForHo rizontalScrollbar()) ? horizontalScrollbar()->height() : 0;
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
4275 } 4284 }
4276 4285
4277 bool FrameView::canThrottleRendering() const 4286 bool FrameView::canThrottleRendering() const
4278 { 4287 {
4279 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4288 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4280 return false; 4289 return false;
4281 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); 4290 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling);
4282 } 4291 }
4283 4292
4284 } // namespace blink 4293 } // namespace blink
OLDNEW
« 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