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

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: Rebased Created 6 years, 10 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
Index: Source/platform/scroll/ScrollView.cpp
diff --git a/Source/platform/scroll/ScrollView.cpp b/Source/platform/scroll/ScrollView.cpp
index 3ffccdca21d1812740483c8ab056ba7a554163a6..2b8f98231b01cb4056fcb1c03159562bcf18ae61 100644
--- a/Source/platform/scroll/ScrollView.cpp
+++ b/Source/platform/scroll/ScrollView.cpp
@@ -285,14 +285,17 @@ void ScrollView::scrollTo(const IntSize& newOffset)
updateFixedElementsAfterScrolling();
}
-void ScrollView::setScrollPosition(const IntPoint& scrollPoint)
+void ScrollView::setScrollPosition(const IntPoint& scrollPoint, ScrollBehavior behavior)
{
IntPoint newScrollPosition = adjustScrollPositionWithinRange(scrollPoint);
if (newScrollPosition == scrollPosition())
return;
- updateScrollbars(IntSize(newScrollPosition.x(), newScrollPosition.y()));
+ if (behavior == ScrollBehaviorInstant)
+ updateScrollbars(IntSize(newScrollPosition.x(), newScrollPosition.y()));
+ else
+ ScrollableArea::programmaticallyScrollSmoothlyToOffset(newScrollPosition);
}
bool ScrollView::scroll(ScrollDirection direction, ScrollGranularity granularity)

Powered by Google App Engine
This is Rietveld 408576698