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

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

Issue 30813004: Revert r160071 "Web Animations: Implement AnimationClock and fix start time of animations" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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
« no previous file with comments | « Source/core/animation/DocumentTimeline.h ('k') | Source/core/animation/DocumentTimelineTest.cpp » ('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 c46729cd74cf25de129df2c6efbaa392eb2079ec..6236e5ead4ded98fd802bb0eceaa520e15e56690 100644
--- a/Source/core/animation/DocumentTimeline.cpp
+++ b/Source/core/animation/DocumentTimeline.cpp
@@ -31,7 +31,6 @@
#include "config.h"
#include "core/animation/DocumentTimeline.h"
-#include "core/animation/AnimationClock.h"
#include "core/animation/Player.h"
#include "core/dom/Document.h"
#include "core/frame/FrameView.h"
@@ -44,7 +43,8 @@ PassRefPtr<DocumentTimeline> DocumentTimeline::create(Document* document)
}
DocumentTimeline::DocumentTimeline(Document* document)
- : m_document(document)
+ : m_currentTime(nullValue())
+ , m_document(document)
, m_zeroTimeAsPerfTime(nullValue())
{
ASSERT(document);
@@ -65,8 +65,14 @@ void DocumentTimeline::serviceAnimations(double monotonicAnimationStartTime)
{
{
TRACE_EVENT0("webkit", "DocumentTimeline::serviceAnimations");
-
- m_document->animationClock().updateTime(monotonicAnimationStartTime);
+ // FIXME: The below ASSERT fires on Windows when running chrome.exe.
+ // Does not fire with --single-process, or on Linux, or in
+ // content_shell.exe. The assert condition has been moved up into the
+ // outer 'if' to work around this. http://crbug.com/280439.
+ if (!isNull(m_zeroTimeAsPerfTime) && (m_currentTime <= monotonicAnimationStartTime - m_zeroTimeAsPerfTime)) {
+ ASSERT(m_currentTime <= monotonicAnimationStartTime - m_zeroTimeAsPerfTime);
+ m_currentTime = monotonicAnimationStartTime - m_zeroTimeAsPerfTime;
+ }
double timeToNextEffect = -1;
for (int i = m_players.size() - 1; i >= 0; --i) {
@@ -86,11 +92,7 @@ void DocumentTimeline::setZeroTimeAsPerfTime(double zeroTime)
ASSERT(isNull(m_zeroTimeAsPerfTime));
m_zeroTimeAsPerfTime = zeroTime;
ASSERT(!isNull(m_zeroTimeAsPerfTime));
-}
-
-double DocumentTimeline::currentTime()
-{
- return m_document->animationClock().currentTime() - m_zeroTimeAsPerfTime;
+ m_currentTime = 0;
}
void DocumentTimeline::pauseAnimationsForTesting(double pauseTime)
@@ -113,7 +115,7 @@ size_t DocumentTimeline::numberOfActiveAnimationsForTesting() const
{
// Includes all players whose directly associated timed items
// are current or in effect.
- return isNull(m_zeroTimeAsPerfTime) ? 0 : m_players.size();
+ return isNull(m_currentTime) ? 0 : m_players.size();
}
} // namespace
« no previous file with comments | « Source/core/animation/DocumentTimeline.h ('k') | Source/core/animation/DocumentTimelineTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698