Bug 1347168 - Hold on to animation elements while compositors might refer to their animation functions; r=dholbert a=gchang
authorBrian Birtles <birtles@gmail.com>
Tue, 21 Mar 2017 08:47:46 +0900
changeset 379179 c5cc62e792d9f0bbd84e380da79102cc3efcfe08
parent 379178 6d07776e1a239872087b28b6710d78597309946b
child 379180 888b1394a1972ee72c04ff45e9cba38f77e49bcb
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert, gchang
bugs1347168
milestone53.0
Bug 1347168 - Hold on to animation elements while compositors might refer to their animation functions; r=dholbert a=gchang MozReview-Commit-ID: 1SH546Iu2FK
dom/smil/nsSMILAnimationController.cpp
--- a/dom/smil/nsSMILAnimationController.cpp
+++ b/dom/smil/nsSMILAnimationController.cpp
@@ -378,23 +378,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