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

Unified Diff: Source/platform/scroll/ScrollView.cpp

Issue 134443003: Implement CSSOM Smooth Scroll API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/scroll/ScrollView.h ('k') | Source/platform/scroll/ScrollableArea.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/scroll/ScrollView.cpp
diff --git a/Source/platform/scroll/ScrollView.cpp b/Source/platform/scroll/ScrollView.cpp
index 56bc53593a29dea66d28b8b11cab74951a4a420a..ba3958575ade7bf08a1a9fe60493947931dc976b 100644
--- a/Source/platform/scroll/ScrollView.cpp
+++ b/Source/platform/scroll/ScrollView.cpp
@@ -279,14 +279,17 @@ void ScrollView::scrollTo(const IntSize& newOffset)
scrollContents(scrollDelta);
}
-void ScrollView::setScrollPosition(const IntPoint& scrollPoint)
+void ScrollView::setScrollPosition(const IntPoint& scrollPoint, ScrollBehavior scrollBehavior)
{
IntPoint newScrollPosition = adjustScrollPositionWithinRange(scrollPoint);
if (newScrollPosition == scrollPosition())
return;
- updateScrollbars(IntSize(newScrollPosition.x(), newScrollPosition.y()));
+ if (scrollBehavior == ScrollBehaviorInstant)
+ updateScrollbars(IntSize(newScrollPosition.x(), newScrollPosition.y()));
+ else
+ ScrollableArea::programmaticallyScrollSmoothlyToOffset(newScrollPosition);
}
bool ScrollView::scroll(ScrollDirection direction, ScrollGranularity granularity)
« no previous file with comments | « Source/platform/scroll/ScrollView.h ('k') | Source/platform/scroll/ScrollableArea.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698