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

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

Issue 46043014: Web Animations CSS: Unfreeze AnimationClock if sampling timelines does not trigger style recalc (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Really fix unit tests 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
Index: Source/core/animation/DocumentTimeline.cpp
diff --git a/Source/core/animation/DocumentTimeline.cpp b/Source/core/animation/DocumentTimeline.cpp
index 1681ef4a4b74a5b0b9319b25542fd1dad63b9062..a5d1979d50f99b8ad8e2f1201b7d91fee36717a1 100644
--- a/Source/core/animation/DocumentTimeline.cpp
+++ b/Source/core/animation/DocumentTimeline.cpp
@@ -86,14 +86,20 @@ void DocumentTimeline::serviceAnimations(double monotonicAnimationStartTime)
m_document->animationClock().updateTime(monotonicAnimationStartTime);
double timeToNextEffect = std::numeric_limits<double>::infinity();
- double playerNextEffect;
+ bool didTriggerStyleRecalc = false;
for (int i = m_players.size() - 1; i >= 0; --i) {
- if (!m_players[i]->update(&playerNextEffect))
+ double playerNextEffect;
+ bool playerDidTriggerStyleRecalc;
+ if (!m_players[i]->update(&playerNextEffect, &playerDidTriggerStyleRecalc))
m_players.remove(i);
+ didTriggerStyleRecalc |= playerDidTriggerStyleRecalc;
if (playerNextEffect < timeToNextEffect)
timeToNextEffect = playerNextEffect;
}
+ if (!didTriggerStyleRecalc)
+ m_document->animationClock().unfreeze();
+
if (!m_players.isEmpty()) {
if (timeToNextEffect < s_minimumDelay)
m_timing->serviceOnNextFrame();

Powered by Google App Engine
This is Rietveld 408576698