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

Unified Diff: Source/core/platform/ScrollableArea.cpp

Issue 15725009: Should be able to scroll text in <input> fields with touch (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 7 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/core/platform/ScrollableArea.cpp
diff --git a/Source/core/platform/ScrollableArea.cpp b/Source/core/platform/ScrollableArea.cpp
index 0f02cf04bc2b3ff3a325ea00e11de5e29b5a5752..e9b61b322938f98a72470364ee7ed115be568800 100644
--- a/Source/core/platform/ScrollableArea.cpp
+++ b/Source/core/platform/ScrollableArea.cpp
@@ -82,6 +82,21 @@ void ScrollableArea::setScrollOrigin(const IntPoint& origin)
}
}
+bool ScrollableArea::touchScroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
Rick Byers 2013/05/30 16:15:00 Adding a new method for this feels wrong to me (as
Rick Byers 2013/05/30 16:15:00 This is called 'touchScroll' but there's nothing i
bokan 2013/05/30 18:23:51 That's what I tried at first, but that breaks non-
+{
+ // For a touch scroll, we don't need the scrollbars to exist (i.e. for an input text field)
+ ScrollbarOrientation orientation;
+ if (direction == ScrollUp || direction == ScrollDown)
+ orientation = VerticalScrollbar;
+ else
+ orientation = HorizontalScrollbar;
+
+ if (direction == ScrollUp || direction == ScrollLeft)
+ multiplier = -multiplier;
+
+ return scrollAnimator()->scroll(orientation, granularity, 1.0f, multiplier);
Rick Byers 2013/05/30 16:15:00 Is treating all values of 'granularity' really ok?
bokan 2013/05/30 18:23:51 In theory, it looks like a wheel could send a non-
+}
+
bool ScrollableArea::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier)
{
ScrollbarOrientation orientation;

Powered by Google App Engine
This is Rietveld 408576698