author | Brian Birtles <birtles@gmail.com> |
Fri, 27 Mar 2015 15:56:45 +0900 | |
changeset 236033 | a9ae40ed6d0c1083ce6b39bba1747599a2941bef |
parent 236032 | 7d8a20857b50140f0b10f13f4f44b51ad19b57be |
child 236034 | ecac23a4d71331b943e636d1f668555b83294d22 |
push id | 57572 |
push user | bbirtles@mozilla.com |
push date | Fri, 27 Mar 2015 06:57:17 +0000 |
treeherder | mozilla-inbound@ecac23a4d713 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jwatt |
bugs | 1109390 |
milestone | 39.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
|
--- a/dom/animation/AnimationPlayer.cpp +++ b/dom/animation/AnimationPlayer.cpp @@ -420,37 +420,45 @@ AnimationPlayer::ComposeStyle(nsRefPtr<c void AnimationPlayer::DoPlay() { // FIXME: When we implement finishing behavior (bug 1074630) we will // need to pass a flag so that when we start playing due to a change in // animation-play-state we *don't* trigger finishing behavior. + bool reuseReadyPromise = false; + if (mPendingState != PendingState::NotPending) { + CancelPendingTasks(); + reuseReadyPromise = true; + } + Nullable<TimeDuration> currentTime = GetCurrentTime(); if (mPlaybackRate > 0.0 && (currentTime.IsNull())) { mHoldTime.SetValue(TimeDuration(0)); } else if (mPlaybackRate < 0.0 && (currentTime.IsNull())) { mHoldTime.SetValue(TimeDuration(SourceContentEnd())); } else if (mPlaybackRate == 0.0 && currentTime.IsNull()) { mHoldTime.SetValue(TimeDuration(0)); } if (mHoldTime.IsNull()) { return; } - // Clear ready promise. We'll create a new one lazily. - mReady = nullptr; - // Clear the start time until we resolve a new one mStartTime.SetNull(); + if (!reuseReadyPromise) { + // Clear ready promise. We'll create a new one lazily. + mReady = nullptr; + } + mPendingState = PendingState::PlayPending; nsIDocument* doc = GetRenderedDocument(); if (!doc) { TriggerOnNextTick(Nullable<TimeDuration>()); return; }