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

Side by Side Diff: Source/core/paint/DeprecatedPaintLayerScrollableArea.cpp

Issue 1150003003: Cleanup ScrollableArea scrolling API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « Source/core/page/Page.cpp ('k') | Source/platform/mac/ScrollAnimatorMac.h » ('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) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 computeScrollDimensions(); 627 computeScrollDimensions();
628 628
629 // Layout may cause us to be at an invalid scroll position. In this case we need 629 // Layout may cause us to be at an invalid scroll position. In this case we need
630 // to pull our scroll offsets back to the max (or push them up to the min). 630 // to pull our scroll offsets back to the max (or push them up to the min).
631 DoubleSize clampedScrollOffset = clampScrollOffset(adjustedScrollOffset()); 631 DoubleSize clampedScrollOffset = clampScrollOffset(adjustedScrollOffset());
632 if (clampedScrollOffset != adjustedScrollOffset()) 632 if (clampedScrollOffset != adjustedScrollOffset())
633 scrollToOffset(clampedScrollOffset); 633 scrollToOffset(clampedScrollOffset);
634 634
635 if (originalScrollOffset != adjustedScrollOffset()) { 635 if (originalScrollOffset != adjustedScrollOffset()) {
636 DoublePoint origin(scrollOrigin()); 636 DoublePoint origin(scrollOrigin());
637 637 scrollPositionChanged(-origin + adjustedScrollOffset(), ProgrammaticScro ll);
638 // Call the base version here since calling this class' version will ear ly because the
639 // offset itself hasn't changed, the scroll origin has.
640 ScrollableArea::setScrollPosition(-origin + adjustedScrollOffset(), Prog rammaticScroll);
641 } 638 }
642 639
643 bool hasHorizontalOverflow = this->hasHorizontalOverflow(); 640 bool hasHorizontalOverflow = this->hasHorizontalOverflow();
644 bool hasVerticalOverflow = this->hasVerticalOverflow(); 641 bool hasVerticalOverflow = this->hasVerticalOverflow();
645 642
646 { 643 {
647 // Hits in compositing/overflow/automatically-opt-into-composited-scroll ing-after-style-change.html. 644 // Hits in compositing/overflow/automatically-opt-into-composited-scroll ing-after-style-change.html.
648 DisableCompositingQueryAsserts disabler; 645 DisableCompositingQueryAsserts disabler;
649 646
650 // overflow:scroll should just enable/disable. 647 // overflow:scroll should just enable/disable.
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 void DeprecatedPaintLayerScrollableArea::setTopmostScrollChild(DeprecatedPaintLa yer* scrollChild) 1390 void DeprecatedPaintLayerScrollableArea::setTopmostScrollChild(DeprecatedPaintLa yer* scrollChild)
1394 { 1391 {
1395 // We only want to track the topmost scroll child for scrollable areas with 1392 // We only want to track the topmost scroll child for scrollable areas with
1396 // overlay scrollbars. 1393 // overlay scrollbars.
1397 if (!hasOverlayScrollbars()) 1394 if (!hasOverlayScrollbars())
1398 return; 1395 return;
1399 m_nextTopmostScrollChild = scrollChild; 1396 m_nextTopmostScrollChild = scrollChild;
1400 } 1397 }
1401 1398
1402 } // namespace blink 1399 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/page/Page.cpp ('k') | Source/platform/mac/ScrollAnimatorMac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698