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

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

Issue 99533004: [SVG] Implement 'discard' element (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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/svg/SVGTagNames.in ('k') | Source/core/svg/animation/SVGSMILElement.h » ('j') | 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
old mode 100644
new mode 100755
index 4c5510cc4f6fbc270914c4ce41413a2bbb9f36d5..6c9a9b8b40f4a01eb699ee59466db87aa21f6085
--- a/Source/core/svg/animation/SMILTimeContainer.cpp
+++ b/Source/core/svg/animation/SMILTimeContainer.cpp
@@ -54,6 +54,8 @@ SMILTimeContainer::SMILTimeContainer(SVGSVGElement* owner)
SMILTimeContainer::~SMILTimeContainer()
{
+ m_timer.stop();
+ ASSERT(!m_timer.isActive());
#ifndef NDEBUG
ASSERT(!m_preventScheduledAnimationsChanges);
#endif
@@ -264,7 +266,7 @@ void SMILTimeContainer::updateAnimations(SMILTime elapsed, bool seekToTime)
m_preventScheduledAnimationsChanges = true;
#endif
- AnimationsVector animationsToApply;
+ Vector<RefPtr<SVGSMILElement> > animationsToApply;
GroupedAnimationsMap::iterator end = m_scheduledAnimations.end();
for (GroupedAnimationsMap::iterator it = m_scheduledAnimations.begin(); it != end; ++it) {
AnimationsVector* scheduled = it->value.get();
@@ -321,6 +323,22 @@ void SMILTimeContainer::updateAnimations(SMILTime elapsed, bool seekToTime)
#endif
startTimer(earliestFireTime, animationFrameDelay);
+
+ for (unsigned i = 0; i < animationsToApplySize; ++i) {
+ if (animationsToApply[i]->inDocument() && animationsToApply[i]->isSVGDiscardElement()) {
+ RefPtr<SVGSMILElement> animDiscard = animationsToApply[i];
+ RefPtr<SVGElement> targetElement = animDiscard->targetElement();
+ if (targetElement && targetElement->inDocument()) {
+ targetElement->remove(IGNORE_EXCEPTION);
+ ASSERT(!targetElement->inDocument());
+ }
+
+ if (animDiscard->inDocument()) {
+ animDiscard->remove(IGNORE_EXCEPTION);
+ ASSERT(!animDiscard->inDocument());
+ }
+ }
+ }
}
}
« no previous file with comments | « Source/core/svg/SVGTagNames.in ('k') | Source/core/svg/animation/SVGSMILElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698