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 66953009: Web Animations CSS: Fix DocumentTimeline::numberOfActiveAnimationsForTesting() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix const 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
« no previous file with comments | « LayoutTests/animations/animation-controller-drt-api-expected.txt ('k') | no next file » | 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 b3b7d08b93dcba629baae80b9b1073f6d829363f..3827b35d36365ff4e97c530bd961fb0db71ed437 100644
--- a/Source/core/animation/DocumentTimeline.cpp
+++ b/Source/core/animation/DocumentTimeline.cpp
@@ -158,7 +158,14 @@ size_t DocumentTimeline::numberOfActiveAnimationsForTesting() const
{
// Includes all players whose directly associated timed items
// are current or in effect.
- return isNull(m_zeroTime) ? 0 : m_players.size();
+ if (isNull(m_zeroTime))
+ return 0;
+ size_t count = 0;
+ for (size_t i = 0; i < m_players.size(); ++i) {
+ const TimedItem* timedItem = m_players[i]->source();
+ count += (timedItem && (timedItem->isCurrent() || timedItem->isInEffect()));
+ }
+ return count;
}
} // namespace
« no previous file with comments | « LayoutTests/animations/animation-controller-drt-api-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698