diff options
author | dominikg@chromium.org <dominikg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-26 18:03:42 +0000 |
---|---|---|
committer | dominikg@chromium.org <dominikg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-26 18:03:42 +0000 |
commit | 4087d0ea896013672377f13861f40c409bd26b74 (patch) | |
tree | 592a9ac4326a1deac37b264047bd41c289385a85 /content/browser/renderer_host/input | |
parent | 186ba06bccf9cb6927145d844729331b6d6042a1 (diff) | |
download | chromium_src-4087d0ea896013672377f13861f40c409bd26b74.zip chromium_src-4087d0ea896013672377f13861f40c409bd26b74.tar.gz chromium_src-4087d0ea896013672377f13861f40c409bd26b74.tar.bz2 |
Round deltas for mouse-based synthetic scroll.
Even though WebMouseWheelEvents take floating point deltas, internally the
scroll position is stored as an integer. Rounding the deltas ensures that
the gesture state, especially |current_y_|, is consistent with the internal
state.
Re-enable ScrollActionTest, as this should fix flakiness in testScrollAction
unit test.
BUG=323249
NOTRY=true
Review URL: https://codereview.chromium.org/88713002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237353 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host/input')
-rw-r--r-- | content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.cc b/content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.cc index dac00d3..5421759 100644 --- a/content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.cc +++ b/content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.cc @@ -62,7 +62,11 @@ SyntheticGesture::Result SyntheticSmoothScrollGesture::ForwardMouseInputEvents( if (HasFinished()) return SyntheticGesture::GESTURE_FINISHED; - float delta = GetPositionDelta(interval); + // Even though WebMouseWheelEvents take floating point deltas, internally the + // scroll position is stored as an integer. Rounding the deltas ensures that + // the gesture state, especially |current_y_|, is consistent with the internal + // state. + float delta = round(GetPositionDelta(interval)); current_y_ += delta; ForwardMouseWheelEvent(target, delta); |