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

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

Issue 792513004: Implement CSSOM smooth scroll for Elements (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years 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
« no previous file with comments | « Source/platform/scroll/ScrollableArea.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/scroll/ScrollableArea.cpp
diff --git a/Source/platform/scroll/ScrollableArea.cpp b/Source/platform/scroll/ScrollableArea.cpp
index f1704953f0a5b59e98c1fe0d1817a5658c6be6a6..c5a7365096fe8b5f14ffee32125cd8c19568449d 100644
--- a/Source/platform/scroll/ScrollableArea.cpp
+++ b/Source/platform/scroll/ScrollableArea.cpp
@@ -430,10 +430,19 @@ bool ScrollableArea::scheduleAnimation()
void ScrollableArea::serviceScrollAnimations(double monotonicTime)
{
- if (ScrollAnimator* scrollAnimator = existingScrollAnimator())
+ bool hasRunningAnimation = false;
+ if (ScrollAnimator* scrollAnimator = existingScrollAnimator()) {
scrollAnimator->serviceScrollAnimations();
- if (ProgrammaticScrollAnimator* programmaticScrollAnimator = existingProgrammaticScrollAnimator())
+ if (scrollAnimator->hasRunningAnimation())
+ hasRunningAnimation = true;
+ }
+ if (ProgrammaticScrollAnimator* programmaticScrollAnimator = existingProgrammaticScrollAnimator()) {
programmaticScrollAnimator->tickAnimation(monotonicTime);
+ if (programmaticScrollAnimator->hasRunningAnimation())
+ hasRunningAnimation = true;
+ }
+ if (!hasRunningAnimation)
+ deregisterForAnimation();
}
void ScrollableArea::cancelProgrammaticScrollAnimation()
« no previous file with comments | « Source/platform/scroll/ScrollableArea.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698