Bug 1347168 - Hold on to animation elements while compositors might refer to their animation functions. r=dholbert, a=jcristau
authorBrian Birtles <birtles@gmail.com>
Tue, 21 Mar 2017 08:47:46 +0900
changeset 355447 b4fc7a4cb5e096cd8e7248bf400c3379a4b2a92a
parent 355446 c744e9d57250fdae8e8c84c88a4f7c6cab5a6f4a
child 355448 21eac0b4fd2f18710fe60b469ff9444c386ca715
push id6975
push userryanvm@gmail.com
push dateFri, 24 Mar 2017 21:24:58 +0000
treeherdermozilla-esr52@62df7046e959 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert, jcristau
bugs1347168
milestone52.0.2
Bug 1347168 - Hold on to animation elements while compositors might refer to their animation functions. r=dholbert, a=jcristau MozReview-Commit-ID: 1SH546Iu2FK
dom/smil/nsSMILAnimationController.cpp
--- a/dom/smil/nsSMILAnimationController.cpp
+++ b/dom/smil/nsSMILAnimationController.cpp
@@ -372,23 +372,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