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

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: Reinstate assert 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/animation/DocumentTimeline.cpp
diff --git a/Source/core/animation/DocumentTimeline.cpp b/Source/core/animation/DocumentTimeline.cpp
index 1681ef4a4b74a5b0b9319b25542fd1dad63b9062..e8ee68655f3c8d2ac72ceb0c8502cf5bdcef0ae5 100644
--- a/Source/core/animation/DocumentTimeline.cpp
+++ b/Source/core/animation/DocumentTimeline.cpp
@@ -77,19 +77,20 @@ void DocumentTimeline::wake()
m_timing->serviceOnNextFrame();
}
-void DocumentTimeline::serviceAnimations(double monotonicAnimationStartTime)
+bool DocumentTimeline::serviceAnimations()
{
TRACE_EVENT0("webkit", "DocumentTimeline::serviceAnimations");
m_timing->cancelWake();
- 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;
}
@@ -103,6 +104,8 @@ void DocumentTimeline::serviceAnimations(double monotonicAnimationStartTime)
if (m_document->view() && !m_players.isEmpty())
m_document->view()->scheduleAnimation();
+
+ return didTriggerStyleRecalc;
}
void DocumentTimeline::setZeroTime(double zeroTime)

Powered by Google App Engine
This is Rietveld 408576698