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

Unified Diff: Source/core/dom/Document.cpp

Issue 73643004: Web Animations: Extract an API for servicing animations (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Switch to references for non-null params. Created 7 years, 1 month 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/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 18e31034aa800e46b7093e13314f4244274dff04..1a05d91561a2a75e4cb798ada1d716ada940278d 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -43,6 +43,7 @@
#include "bindings/v8/ScriptController.h"
#include "core/accessibility/AXObjectCache.h"
#include "core/animation/AnimationClock.h"
+#include "core/animation/DocumentAnimations.h"
#include "core/animation/DocumentTimeline.h"
#include "core/animation/css/TransitionTimeline.h"
#include "core/css/CSSDefaultStyleSheets.h"
@@ -1508,27 +1509,6 @@ PassRefPtr<TreeWalker> Document::createTreeWalker(Node* root, unsigned whatToSho
return TreeWalker::create(root, whatToShow, filter);
}
-void Document::serviceAnimations(double monotonicAnimationStartTime)
-{
- if (!RuntimeEnabledFeatures::webAnimationsEnabled())
- return;
-
- animationClock().updateTime(monotonicAnimationStartTime);
- bool didTriggerStyleRecalc = timeline()->serviceAnimations();
- didTriggerStyleRecalc |= transitionTimeline()->serviceAnimations();
- if (!didTriggerStyleRecalc)
- animationClock().unfreeze();
-}
-
-void Document::dispatchAnimationEvents()
-{
- if (!RuntimeEnabledFeatures::webAnimationsEnabled())
- return;
-
- timeline()->dispatchEvents();
- transitionTimeline()->dispatchEvents();
-}
-
void Document::scheduleStyleRecalc()
{
if (shouldDisplaySeamlesslyWithParent()) {
@@ -1772,9 +1752,7 @@ void Document::updateStyleIfNeeded()
AnimationUpdateBlock animationUpdateBlock(m_frame ? &m_frame->animation() : 0);
recalcStyle(NoChange);
- if (RuntimeEnabledFeatures::webAnimationsEnabled())
- cssPendingAnimations().startPendingAnimations();
- m_animationClock->unfreeze();
+ DocumentAnimations::serviceAfterStyleRecalc(*this);
}
void Document::updateStyleForNodeIfNeeded(Node* node)

Powered by Google App Engine
This is Rietveld 408576698