Bug 1109390 part 15 - Update AnimationPlayer::SetCurrentTime to cancel any pending pause tasks; r=jwatt
authorBrian Birtles <birtles@gmail.com>
Fri, 27 Mar 2015 15:56:45 +0900
changeset 266401 ecac23a4d71331b943e636d1f668555b83294d22
parent 266400 a9ae40ed6d0c1083ce6b39bba1747599a2941bef
child 266402 776865752a675fbb707a9c8bb880af90fa27d029
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt
bugs1109390
milestone39.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 1109390 part 15 - Update AnimationPlayer::SetCurrentTime to cancel any pending pause tasks; r=jwatt
dom/animation/AnimationPlayer.cpp
--- a/dom/animation/AnimationPlayer.cpp
+++ b/dom/animation/AnimationPlayer.cpp
@@ -118,17 +118,22 @@ AnimationPlayer::SilentlySetCurrentTime(
 }
 
 // Implements http://w3c.github.io/web-animations/#set-the-current-time
 void
 AnimationPlayer::SetCurrentTime(const TimeDuration& aSeekTime)
 {
   SilentlySetCurrentTime(aSeekTime);
 
-  // Once pending pause tasks are supported, cancel that here.
+  if (mPendingState == PendingState::PausePending) {
+    CancelPendingTasks();
+    if (mReady) {
+      mReady->MaybeResolve(this);
+    }
+  }
 
   UpdateSourceContent();
   PostUpdate();
 
   // FIXME: Once bug 1074630 is fixed, run the procedure to update a player's
   // finished state for player:
   // http://w3c.github.io/web-animations/#update-a-players-finished-state
 }