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

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

Issue 1417613005: Revert of Web Animations: Use a single animation clock (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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: third_party/WebKit/Source/core/animation/AnimationTimeline.cpp
diff --git a/third_party/WebKit/Source/core/animation/AnimationTimeline.cpp b/third_party/WebKit/Source/core/animation/AnimationTimeline.cpp
index 6d4e56af05ab9e731b054555fef2e4f8181d2640..eace544522d53851cd4de48436927cb20ba83801 100644
--- a/third_party/WebKit/Source/core/animation/AnimationTimeline.cpp
+++ b/third_party/WebKit/Source/core/animation/AnimationTimeline.cpp
@@ -89,11 +89,6 @@
{
}
-bool AnimationTimeline::isActive()
-{
- return m_document && m_document->page();
-}
-
void AnimationTimeline::animationAttached(Animation& animation)
{
ASSERT(animation.timeline() == this);
@@ -150,7 +145,7 @@
}
ASSERT(m_outdatedAnimationCount == 0);
- ASSERT(m_lastCurrentTimeInternal == currentTimeInternal() || (std::isnan(currentTimeInternal()) && std::isnan(m_lastCurrentTimeInternal)));
+ ASSERT(m_lastCurrentTimeInternal == currentTimeInternal());
#if ENABLE(ASSERT)
for (const auto& animation : m_animationsNeedingUpdate)
@@ -214,7 +209,7 @@
double AnimationTimeline::currentTimeInternal(bool& isNull)
{
- if (!isActive()) {
+ if (!m_document) {
isNull = true;
return std::numeric_limits<double>::quiet_NaN();
}
@@ -243,7 +238,7 @@
void AnimationTimeline::setCurrentTimeInternal(double currentTime)
{
- if (!isActive())
+ if (!document())
return;
m_zeroTime = m_playbackRate == 0
? currentTime
@@ -278,9 +273,6 @@
if (currentTimeInternal() == m_lastCurrentTimeInternal)
return false;
- if (std::isnan(currentTimeInternal()) && std::isnan(m_lastCurrentTimeInternal))
- return false;
-
// We allow m_lastCurrentTimeInternal to advance here when there
// are no animations to allow animations spawned during style
// recalc to not invalidate this flag.
@@ -301,13 +293,13 @@
ASSERT(animation->outdated());
m_outdatedAnimationCount++;
m_animationsNeedingUpdate.add(animation);
- if (isActive() && !m_document->page()->animator().isServicingAnimations())
+ if (m_document && m_document->page() && !m_document->page()->animator().isServicingAnimations())
m_timing->serviceOnNextFrame();
}
void AnimationTimeline::setPlaybackRate(double playbackRate)
{
- if (!isActive())
+ if (!document())
return;
double currentTime = currentTimeInternal();
m_playbackRate = playbackRate;

Powered by Google App Engine
This is Rietveld 408576698