Index: third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp |
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp b/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp |
index ab02ae1b29876a54f6bf9a60375de1bec3c4b0fc..af2340832e8dad8845e7a8f6ababeabbfe2ac122 100644 |
--- a/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp |
+++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp |
@@ -112,6 +112,10 @@ ScrollResult ScrollAnimator::userScroll( |
return ScrollAnimatorBase::userScroll(granularity, delta); |
} |
+ bool needsPostAnimationCleanup = m_runState == RunState::PostAnimationCleanup; |
+ if (m_runState == RunState::PostAnimationCleanup) |
+ resetAnimationState(); |
+ |
FloatSize consumedDelta = computeDeltaToConsume(delta); |
FloatPoint targetPos = desiredTargetPosition(); |
@@ -125,6 +129,13 @@ ScrollResult ScrollAnimator::userScroll( |
// unusedDelta. This differs from ScrollAnimatorMac currently. |
return ScrollResult(true, true, 0, 0); |
} |
+ |
+ // If the run state when this method was called was PostAnimationCleanup and |
+ // we're not starting an animation, stay in PostAnimationCleanup state so |
+ // that the main thread scrolling reason can be removed. |
+ if (needsPostAnimationCleanup) |
+ m_runState = RunState::PostAnimationCleanup; |
+ |
// Report unused delta only if there is no animation and we are not |
// starting one. This ensures we latch for the duration of the |
// animation rather than animating multiple scrollers at the same time. |