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

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

Issue 135693003: Defer starting of animations until after compositing update (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reland after fixing flaky tests. Created 6 years, 10 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/DocumentAnimations.h ('k') | Source/core/animation/css/CSSPendingAnimations.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/DocumentAnimations.cpp
diff --git a/Source/core/animation/DocumentAnimations.cpp b/Source/core/animation/DocumentAnimations.cpp
index d37480414da2d0dbe1375c7db94c60db3cb1e56c..89b30e2c29c9c123cc949f80d2cc1f82049e6abd 100644
--- a/Source/core/animation/DocumentAnimations.cpp
+++ b/Source/core/animation/DocumentAnimations.cpp
@@ -50,32 +50,29 @@ void updateAnimationTiming(Document& document)
{
document.timeline()->serviceAnimations();
document.transitionTimeline()->serviceAnimations();
- if (!document.childNeedsStyleRecalc())
- document.animationClock().unfreeze();
}
-void dispatchAnimationEvents(Document& document)
+} // namespace
+
+void DocumentAnimations::dispatchAnimationEvents(Document& document)
{
document.timeline()->dispatchEvents();
document.transitionTimeline()->dispatchEvents();
}
-void dispatchAnimationEventsAsync(Document& document)
+void DocumentAnimations::dispatchAnimationEventsAsync(Document& document)
{
document.timeline()->dispatchEventsAsync();
document.transitionTimeline()->dispatchEventsAsync();
}
-} // namespace
-
-void DocumentAnimations::serviceOnAnimationFrame(Document& document, double monotonicAnimationStartTime)
+void DocumentAnimations::updateAnimationTimingForAnimationFrame(Document& document, double monotonicAnimationStartTime)
{
document.animationClock().updateTime(monotonicAnimationStartTime);
updateAnimationTiming(document);
- dispatchAnimationEvents(document);
}
-void DocumentAnimations::serviceBeforeGetComputedStyle(Node& node, CSSPropertyID property)
+void DocumentAnimations::updateAnimationTimingForGetComputedStyle(Node& node, CSSPropertyID property)
{
if (!node.isElementNode())
return;
@@ -90,13 +87,15 @@ void DocumentAnimations::serviceBeforeGetComputedStyle(Node& node, CSSPropertyID
}
}
-void DocumentAnimations::serviceAfterStyleRecalc(Document& document)
+void DocumentAnimations::startPendingAnimations(Document& document)
{
- if (document.cssPendingAnimations().startPendingAnimations() && document.view())
+ ASSERT(document.lifecycle().state() == DocumentLifecycle::CompositingClean);
+ if (document.cssPendingAnimations().startPendingAnimations()) {
+ ASSERT(document.view());
document.view()->scheduleAnimation();
+ }
document.animationClock().unfreeze();
- dispatchAnimationEventsAsync(document);
}
} // namespace WebCore
« no previous file with comments | « Source/core/animation/DocumentAnimations.h ('k') | Source/core/animation/css/CSSPendingAnimations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698