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

Unified Diff: third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp

Issue 1678713002: Correctly handle cancelling compositor animations initiated from main thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 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: 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 de0000b4a8f5a948cb00f564d08a62014024fb01..9f4b3ddbbceb3fafae6a6773a80141a4148e8164 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp
@@ -96,10 +96,9 @@ ScrollResultOneDimensional ScrollAnimator::userScroll(
TRACE_EVENT0("blink", "ScrollAnimator::scroll");
if (granularity == ScrollByPrecisePixel) {
- if (hasRunningAnimation()) {
- abortAnimation();
- resetAnimationState();
- }
+ // Cancel scroll animation because asked to instant scroll.
+ if (hasRunningAnimation())
+ cancelAnimation();
return ScrollAnimatorBase::userScroll(orientation, granularity, step, delta);
}
@@ -110,7 +109,7 @@ ScrollResultOneDimensional ScrollAnimator::userScroll(
FloatPoint targetPos = desiredTargetPosition();
targetPos.moveBy(pixelDelta);
- if (m_animationCurve) {
+ if (m_animationCurve && m_runState != RunState::WaitingToCancelOnCompositor) {
if ((targetPos - m_targetOffset).isZero()) {
// Report unused delta only if there is no animation running. See
// comment below regarding scroll latching.
« no previous file with comments | « third_party/WebKit/LayoutTests/virtual/threaded/fast/scroll-behavior/smooth-scroll/mousewheel-scroll-interrupted-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698