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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 2474813002: Clamping shouldn't clear the fragment anchor. (Closed)
Patch Set: address review comments Created 4 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@gmail.com> 10 * Christian Biesinger <cbiesinger@gmail.com>
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 cache->handleScrollPositionChanged(&box()); 447 cache->handleScrollPositionChanged(&box());
448 box().view()->clearHitTestCache(); 448 box().view()->clearHitTestCache();
449 449
450 // Inform the FrameLoader of the new scroll position, so it can be restored 450 // Inform the FrameLoader of the new scroll position, so it can be restored
451 // when navigating back. 451 // when navigating back.
452 if (layer()->isRootLayer()) { 452 if (layer()->isRootLayer()) {
453 frameView->frame().loader().saveScrollState(); 453 frameView->frame().loader().saveScrollState();
454 frameView->didChangeScrollOffset(); 454 frameView->didChangeScrollOffset();
455 } 455 }
456 456
457 // All scrolls clear the fragment anchor. 457 if (scrollTypeClearsFragmentAnchor(scrollType))
458 frameView->clearFragmentAnchor(); 458 frameView->clearFragmentAnchor();
459 459
460 // Clear the scroll anchor, unless it is the reason for this scroll. 460 // Clear the scroll anchor, unless it is the reason for this scroll.
461 if (RuntimeEnabledFeatures::scrollAnchoringEnabled() && 461 if (RuntimeEnabledFeatures::scrollAnchoringEnabled() &&
462 scrollType != AnchoringScroll && scrollType != ClampingScroll) 462 scrollType != AnchoringScroll && scrollType != ClampingScroll)
463 scrollAnchor()->clear(); 463 scrollAnchor()->clear();
464 } 464 }
465 465
466 IntSize PaintLayerScrollableArea::scrollOffsetInt() const { 466 IntSize PaintLayerScrollableArea::scrollOffsetInt() const {
467 return flooredIntSize(m_scrollOffset); 467 return flooredIntSize(m_scrollOffset);
468 } 468 }
(...skipping 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after
1961 1961
1962 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: 1962 void PaintLayerScrollableArea::DelayScrollOffsetClampScope::
1963 clampScrollableAreas() { 1963 clampScrollableAreas() {
1964 for (auto& scrollableArea : *s_needsClamp) 1964 for (auto& scrollableArea : *s_needsClamp)
1965 scrollableArea->clampScrollOffsetsAfterLayout(); 1965 scrollableArea->clampScrollOffsetsAfterLayout();
1966 delete s_needsClamp; 1966 delete s_needsClamp;
1967 s_needsClamp = nullptr; 1967 s_needsClamp = nullptr;
1968 } 1968 }
1969 1969
1970 } // namespace blink 1970 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | third_party/WebKit/Source/platform/scroll/ScrollTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698