Commit cbdf6d50 authored by jdduke@chromium.org's avatar jdduke@chromium.org

[Android] Avoid early fling termination if initial time is non-positive

Main thread animations provide no guarantees that the initial fling timestamp
will be strictly positive.  Consequently, a (valid) timestamp of 0 applied to
Android's fling animation curve will yield a zero-sized scroll delta.  Feeding
this scroll delta through WebViewImpl reports that scrolling is impossible, in
which case the fling will early terminate.  Avoid this case by early returning
on non-positive fling timestamps, aligning with Aura's fling behavior.

BUG=371854

Review URL: https://codereview.chromium.org/275113002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269594 0039d316-1c4b-4281-b951-d872f2087c98
parent 60a7a7ef
......@@ -66,6 +66,11 @@ void FlingAnimatorImpl::CancelFling() {
bool FlingAnimatorImpl::apply(double time,
blink::WebGestureCurveTarget* target) {
// If the fling has yet to start, simply return and report true to prevent
// fling termination.
if (time <= 0)
return true;
const base::TimeTicks time_ticks =
base::TimeTicks() + base::TimeDelta::FromMicroseconds(
time * base::Time::kMicrosecondsPerSecond);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment