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

Unified Diff: third_party/WebKit/Source/core/animation/Animation.cpp

Issue 2527043002: Blink Animation: Request serviceOnNextFrame on animation's finish and cancel. (Closed)
Patch Set: Created 4 years, 1 month 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 | « third_party/WebKit/Source/core/animation/Animation.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/animation/Animation.cpp
diff --git a/third_party/WebKit/Source/core/animation/Animation.cpp b/third_party/WebKit/Source/core/animation/Animation.cpp
index 8b9f2414f1bbeba0c50e8c9ef1c391e036445a92..a65c0b78df8b14bdd0c9e46510832eab27dc8582 100644
--- a/third_party/WebKit/Source/core/animation/Animation.cpp
+++ b/third_party/WebKit/Source/core/animation/Animation.cpp
@@ -447,7 +447,7 @@ void Animation::setStartTimeInternal(double newStartTime) {
} else if (!hadStartTime && m_timeline) {
// Even though this animation is not outdated, time to effect change is
// infinity until start time is set.
- m_timeline->wake();
+ forceServiceOnNextFrame();
}
}
@@ -619,6 +619,7 @@ void Animation::finish(ExceptionState& exceptionState) {
m_currentTimePending = false;
m_startTime = calculateStartTime(newCurrentTime);
m_playState = Finished;
+ forceServiceOnNextFrame();
}
ScriptPromise Animation::finished(ScriptState* scriptState) {
@@ -713,6 +714,10 @@ void Animation::setOutdated() {
m_timeline->setOutdatedAnimation(this);
}
+void Animation::forceServiceOnNextFrame() {
+ m_timeline->wake();
+}
+
bool Animation::canStartAnimationOnCompositor() const {
if (m_isCompositedAnimationDisabledForTesting || effectSuppressed())
return false;
@@ -884,6 +889,7 @@ void Animation::cancel() {
m_playState = Idle;
m_startTime = nullValue();
m_currentTimePending = false;
+ forceServiceOnNextFrame();
}
void Animation::beginUpdatingState() {
« no previous file with comments | « third_party/WebKit/Source/core/animation/Animation.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698