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

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
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..1e743a94918c0502c13ef0dc528d40cfbeb86147
--- 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;
Inactive 2014/01/11 16:31:26 We usually add an extra white space only on the ri
pavane 2014/01/11 17:14:18 Done.
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 n = 0; n < animationsToApplySize; ++n) {
Inactive 2014/01/11 16:31:26 Any reason you're not using i as loop counter, lik
pavane 2014/01/11 17:14:18 No specific reason. :) Done.
+ if (animationsToApply[n]->inDocument() && animationsToApply[n]->isSVGDiscardElement()) {
+ RefPtr<SVGSMILElement> animDiscard = animationsToApply[n];
+ 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());
+ }
+ }
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698