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

Side by Side Diff: Source/core/frame/FrameView.cpp

Issue 1173053003: Remove ScrollableArea::notifyScrollPositionChanged and cleanup scroll animators. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase + remove updateScrollbars from FrameView::setScrollPosition 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/frame/FrameView.h ('k') | Source/core/frame/RootFrameViewportTest.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 1471 matching lines...) Expand 10 before | Expand all | Expand 10 after
1482 // Only do a layout if changes have occurred that make it necessary. 1482 // Only do a layout if changes have occurred that make it necessary.
1483 LayoutView* layoutView = this->layoutView(); 1483 LayoutView* layoutView = this->layoutView();
1484 if (layoutView && layoutView->needsLayout()) 1484 if (layoutView && layoutView->needsLayout())
1485 layout(); 1485 layout();
1486 else 1486 else
1487 scrollToAnchor(); 1487 scrollToAnchor();
1488 } 1488 }
1489 1489
1490 void FrameView::setScrollPosition(const DoublePoint& scrollPoint, ScrollType scr ollType, ScrollBehavior scrollBehavior) 1490 void FrameView::setScrollPosition(const DoublePoint& scrollPoint, ScrollType scr ollType, ScrollBehavior scrollBehavior)
1491 { 1491 {
1492 cancelProgrammaticScrollAnimation();
1493 m_maintainScrollPositionAnchor = nullptr; 1492 m_maintainScrollPositionAnchor = nullptr;
1494 1493
1495 DoublePoint newScrollPosition = adjustScrollPositionWithinRange(scrollPoint) ; 1494 DoublePoint newScrollPosition = adjustScrollPositionWithinRange(scrollPoint) ;
1496 if (newScrollPosition == scrollPositionDouble()) 1495 if (newScrollPosition == scrollPositionDouble())
1497 return; 1496 return;
1498 1497
1499 if (scrollBehavior == ScrollBehaviorAuto) 1498 if (scrollBehavior == ScrollBehaviorAuto)
1500 scrollBehavior = scrollBehaviorStyle(); 1499 scrollBehavior = scrollBehaviorStyle();
1501 1500
1502 if (scrollBehavior == ScrollBehaviorInstant) { 1501 ScrollableArea::setScrollPosition(newScrollPosition, scrollType, scrollBehav ior);
1503 DoubleSize newOffset(newScrollPosition.x(), newScrollPosition.y());
1504 // TODO(bokan): Why do we need to go through updateScrollbars? If not, w e can
1505 // just delete this whole method and use the base version.
1506 updateScrollbars(newOffset);
1507 } else {
1508 ScrollableArea::setScrollPosition(newScrollPosition, ProgrammaticScroll, ScrollBehaviorSmooth);
1509 }
1510 } 1502 }
1511 1503
1512 void FrameView::setElasticOverscroll(const FloatSize& elasticOverscroll) 1504 void FrameView::setElasticOverscroll(const FloatSize& elasticOverscroll)
1513 { 1505 {
1514 m_elasticOverscroll = elasticOverscroll; 1506 m_elasticOverscroll = elasticOverscroll;
1515 if (m_horizontalScrollbar) { 1507 if (m_horizontalScrollbar) {
1516 float delta = elasticOverscroll.width() - m_horizontalScrollbar->elastic Overscroll(); 1508 float delta = elasticOverscroll.width() - m_horizontalScrollbar->elastic Overscroll();
1517 if (delta != 0) { 1509 if (delta != 0) {
1518 m_horizontalScrollbar->setElasticOverscroll(elasticOverscroll.width( )); 1510 m_horizontalScrollbar->setElasticOverscroll(elasticOverscroll.width( ));
1519 scrollAnimator()->notifyContentAreaScrolled(FloatSize(delta, 0)); 1511 scrollAnimator()->notifyContentAreaScrolled(FloatSize(delta, 0));
(...skipping 2490 matching lines...) Expand 10 before | Expand all | Expand 10 after
4010 4002
4011 if (!graphicsLayer) 4003 if (!graphicsLayer)
4012 return; 4004 return;
4013 4005
4014 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL ayoutObject(), paintInvalidationContainer, viewRect); 4006 DeprecatedPaintLayer::mapRectToPaintInvalidationBacking(localFrame->contentL ayoutObject(), paintInvalidationContainer, viewRect);
4015 4007
4016 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect))); 4008 graphicsLayerTimingRequests.add(graphicsLayer, Vector<std::pair<int64_t, Web Rect>>()).storedValue->value.append(std::make_pair(m_frame->frameID(), enclosing IntRect(viewRect)));
4017 } 4009 }
4018 4010
4019 } // namespace blink 4011 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/frame/RootFrameViewportTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698