Bug 1134379 - Cancel old AnimationPlayer when redirecting a transition. r=birtles
authorCameron McCormack <cam@mcc.id.au>
Thu, 19 Feb 2015 11:52:36 +1100
changeset 256869 f74fcc98ea52950862fd00e117ac6d52bff38c6c
parent 256868 c38eaa958c1e5caf3f22e8a5f6750e4c3799abd7
child 256870 688f46924277905d06c9576a80d1b04fcc1798e7
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles
bugs1134379
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1134379 - Cancel old AnimationPlayer when redirecting a transition. r=birtles
layout/style/nsTransitionManager.cpp
--- a/layout/style/nsTransitionManager.cpp
+++ b/layout/style/nsTransitionManager.cpp
@@ -576,16 +576,18 @@ nsTransitionManager::ConsiderStartingTra
     MOZ_ASSERT(
       i == currentIndex ||
       (players[i]->GetSource() &&
        players[i]->GetSource()->Properties()[0].mProperty != aProperty),
       "duplicate transitions for property");
   }
 #endif
   if (haveCurrentTransition) {
+    players[currentIndex]->Cancel();
+    oldPT = nullptr; // Clear pointer so it doesn't dangle
     players[currentIndex] = player;
   } else {
     if (!players.AppendElement(player)) {
       NS_WARNING("out of memory");
       return;
     }
   }
   aElementTransitions->UpdateAnimationGeneration(mPresContext);