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

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

Issue 210703002: Web Animations: Sort Animations in the AnimationStack (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix compile? :| Created 6 years, 9 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 | « Source/core/animation/DocumentTimeline.h ('k') | Source/core/animation/css/CSSAnimations.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/DocumentTimeline.cpp
diff --git a/Source/core/animation/DocumentTimeline.cpp b/Source/core/animation/DocumentTimeline.cpp
index 8f2d489bd891828f3c9ebd2944c0b91691bd4f7b..77ef592d566ff005da38639a7d62257444a653db 100644
--- a/Source/core/animation/DocumentTimeline.cpp
+++ b/Source/core/animation/DocumentTimeline.cpp
@@ -80,7 +80,7 @@ AnimationPlayer* DocumentTimeline::createAnimationPlayer(TimedItem* child)
AnimationPlayer* DocumentTimeline::play(TimedItem* child)
{
AnimationPlayer* player = createAnimationPlayer(child);
- player->setStartTime(currentTime());
+ player->setStartTime(effectiveTime());
return player;
}
@@ -151,6 +151,12 @@ double DocumentTimeline::currentTime()
return m_document->animationClock().currentTime() - m_zeroTime;
}
+double DocumentTimeline::effectiveTime()
+{
+ double time = currentTime();
+ return std::isnan(time) ? 0 : time;
+}
+
void DocumentTimeline::pauseAnimationsForTesting(double pauseTime)
{
for (HashSet<RefPtr<AnimationPlayer> >::iterator it = m_playersNeedingUpdate.begin(); it != m_playersNeedingUpdate.end(); ++it)
« no previous file with comments | « Source/core/animation/DocumentTimeline.h ('k') | Source/core/animation/css/CSSAnimations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698