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

Unified Diff: Source/core/svg/animation/SMILTimeContainer.cpp

Issue 1178733005: SMIL animation should only progress() on active documents (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « LayoutTests/svg/animations/smil-scheduled-in-inactive-document-crash-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/svg/animation/SMILTimeContainer.cpp
diff --git a/Source/core/svg/animation/SMILTimeContainer.cpp b/Source/core/svg/animation/SMILTimeContainer.cpp
index 802a94cb39fb691813fa783f197a861ce5b1a8a6..2061b114a98921107d79ee6bdf6fd5feae731f19 100644
--- a/Source/core/svg/animation/SMILTimeContainer.cpp
+++ b/Source/core/svg/animation/SMILTimeContainer.cpp
@@ -84,6 +84,7 @@ void SMILTimeContainer::schedule(SVGSMILElement* animation, SVGElement* target,
ASSERT(target);
ASSERT(animation->hasValidAttributeName());
ASSERT(animation->hasValidAttributeType());
+ ASSERT(animation->inActiveDocument());
#if ENABLE(ASSERT)
ASSERT(!m_preventScheduledAnimationsChanges);
@@ -170,6 +171,9 @@ void SMILTimeContainer::begin()
{
RELEASE_ASSERT(!m_beginTime);
+ if (!document().isActive())
+ return;
+
if (!handleAnimationPolicy(RestartOnceTimerIfNotPaused))
return;
@@ -426,6 +430,9 @@ void SMILTimeContainer::serviceAnimations(double monotonicAnimationStartTime)
void SMILTimeContainer::updateAnimationsAndScheduleFrameIfNeeded(SMILTime elapsed, bool seekToTime)
{
+ if (!document().isActive())
+ return;
+
#if !ENABLE(OILPAN)
DiscardScope discardScope(m_ownerSVGElement);
#endif
@@ -446,6 +453,7 @@ void SMILTimeContainer::updateAnimationsAndScheduleFrameIfNeeded(SMILTime elapse
SMILTime SMILTimeContainer::updateAnimations(SMILTime elapsed, bool seekToTime)
{
+ ASSERT(document().isActive());
SMILTime earliestFireTime = SMILTime::unresolved();
#if ENABLE(ASSERT)
« no previous file with comments | « LayoutTests/svg/animations/smil-scheduled-in-inactive-document-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698