Bug 1347168 - Hold on to animation elements while compositors might refer to their animation functions; r=dholbert
authorBrian Birtles <birtles@gmail.com>
Tue, 21 Mar 2017 08:47:46 +0900
changeset 501806 705a77b42fc16df0baf5a770560fb980354a9487
parent 501805 3026456dca8ccbb45d1527e21dcff4ed5149630c
child 501807 3126547342d38a6ab74711cee3f426ebc86f3358
child 502224 c90ad4b528aadedb3e59fb40850b557a11d7a841
push id50127
push userna-g@nostrum.com
push dateTue, 21 Mar 2017 00:09:45 +0000
reviewersdholbert
bugs1347168
milestone55.0a1
Bug 1347168 - Hold on to animation elements while compositors might refer to their animation functions; r=dholbert MozReview-Commit-ID: 1SH546Iu2FK
dom/smil/nsSMILAnimationController.cpp
--- a/dom/smil/nsSMILAnimationController.cpp
+++ b/dom/smil/nsSMILAnimationController.cpp
@@ -380,23 +380,26 @@ nsSMILAnimationController::DoSample(bool
   // their animation effects removed in sample 'n').
   //
   // Parts (i) and (ii) are not functionally related but we combine them here to
   // save iterating over the animation elements twice.
 
   // Create the compositor table
   nsAutoPtr<nsSMILCompositorTable>
     currentCompositorTable(new nsSMILCompositorTable(0));
+  nsTArray<RefPtr<SVGAnimationElement>>
+    animElems(mAnimationElementTable.Count());
 
   for (auto iter = mAnimationElementTable.Iter(); !iter.Done(); iter.Next()) {
     SVGAnimationElement* animElem = iter.Get()->GetKey();
     SampleTimedElement(animElem, &activeContainers);
     AddAnimationToCompositorTable(animElem,
                                   currentCompositorTable,
                                   isStyleFlushNeeded);
+    animElems.AppendElement(animElem);
   }
   activeContainers.Clear();
 
   // STEP 4: Compare previous sample's compositors against this sample's.
   // (Transfer cached base values across, & remove animation effects from
   // no-longer-animated targets.)
   if (mLastCompositorTable) {
     // * Transfer over cached base values, from last sample's compositors