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

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

Issue 251183006: Web Animations: Timeline should not advance during task execution (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use task start time 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
Index: Source/core/animation/AnimationClock.cpp
diff --git a/Source/core/animation/AnimationClock.cpp b/Source/core/animation/AnimationClock.cpp
index 649220690e67a27adf18592ac5d9a46d000c9ff2..e25af24f8a1a339d54ebb20b70d5cd0aa1a6cebd 100644
--- a/Source/core/animation/AnimationClock.cpp
+++ b/Source/core/animation/AnimationClock.cpp
@@ -35,18 +35,18 @@ namespace WebCore {
void AnimationClock::updateTime(double time)
{
- if (time > m_time)
+ if (time > m_time) {
m_time = time;
- m_frozen = true;
+ // Avoid a race where the animation start time received
+ // from the compositor may be earlier than the task time.
+ taskTime() = 0;
+ }
}
double AnimationClock::currentTime()
{
- if (!m_frozen) {
- double newTime = m_monotonicallyIncreasingTime();
- if (newTime >= m_time + minTimeBeforeUnsynchronizedAnimationClockTick)
- m_time = newTime;
- }
+ if (m_time < taskTime())
+ m_time = taskTime();
return m_time;
}

Powered by Google App Engine
This is Rietveld 408576698