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

Unified Diff: Source/core/animation/AnimationPlayer.cpp

Issue 235503010: Web Animations: Fix effect change calculation when player is cancelled but not held (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | Source/core/animation/AnimationPlayerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/AnimationPlayer.cpp
diff --git a/Source/core/animation/AnimationPlayer.cpp b/Source/core/animation/AnimationPlayer.cpp
index eb84cab28fe6ac38003280cd0d4c1e6e09a85b8a..5dcf433e06e2ecf1820bf9c4091573fdfb6e90ff 100644
--- a/Source/core/animation/AnimationPlayer.cpp
+++ b/Source/core/animation/AnimationPlayer.cpp
@@ -340,11 +340,13 @@ bool AnimationPlayer::update(UpdateReason reason)
double AnimationPlayer::timeToEffectChange()
{
ASSERT(!m_outdated);
- if (!m_content || m_held)
+ if (m_held || !hasStartTime())
return std::numeric_limits<double>::infinity();
+ if (!m_content)
+ return -currentTime() / m_playbackRate;
if (m_playbackRate > 0)
return m_content->timeToForwardsEffectChange() / m_playbackRate;
- return m_content->timeToReverseEffectChange() / std::abs(m_playbackRate);
+ return m_content->timeToReverseEffectChange() / -m_playbackRate;
}
void AnimationPlayer::cancel()
« no previous file with comments | « no previous file | Source/core/animation/AnimationPlayerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698