Bug 1150288 - Restore old behavior of mIsPreviousStateFinished into a new variable, since we need it in CanThrottle. r=birtles

(I don't understand the motivation for the changes to how it was set,
but this just switches to having two variables for the two uses.)

This fixes the test failures in test_animations_omta.html with OMT
animations enabled.
This commit is contained in:
L. David Baron 2015-04-01 20:30:17 -07:00
parent 2f6554bf7c
commit 953d3f8dfc
2 changed files with 8 additions and 2 deletions

View File

@ -406,7 +406,7 @@ AnimationPlayer::CanThrottle() const
// finishing, we need an unthrottled sample so we can apply the correct
// end-of-animation behavior on the main thread (either removing the
// animation style or applying the fill mode).
return mIsPreviousStateFinished;
return mFinishedAtLastComposeStyle;
}
void
@ -462,7 +462,9 @@ AnimationPlayer::ComposeStyle(nsRefPtr<css::AnimValuesStyleRule>& aStyleRule,
AutoRestore<Nullable<TimeDuration>> restoreHoldTime(mHoldTime);
bool updatedHoldTime = false;
if (PlayState() == AnimationPlayState::Pending &&
AnimationPlayState playState = PlayState();
if (playState == AnimationPlayState::Pending &&
mHoldTime.IsNull() &&
!mStartTime.IsNull()) {
Nullable<TimeDuration> timeToUse = mPendingReadyTime;
@ -485,6 +487,8 @@ AnimationPlayer::ComposeStyle(nsRefPtr<css::AnimValuesStyleRule>& aStyleRule,
if (updatedHoldTime) {
UpdateTiming();
}
mFinishedAtLastComposeStyle = (playState == AnimationPlayState::Finished);
}
}

View File

@ -57,6 +57,7 @@ public:
, mPendingState(PendingState::NotPending)
, mIsRunningOnCompositor(false)
, mIsPreviousStateFinished(false)
, mFinishedAtLastComposeStyle(false)
, mIsRelevant(false)
{
}
@ -332,6 +333,7 @@ protected:
// Indicates whether we were in the finished state during our
// most recent unthrottled sample (our last ComposeStyle call).
bool mIsPreviousStateFinished; // Spec calls this "previous finished state"
bool mFinishedAtLastComposeStyle;
// Indicates that the animation should be exposed in an element's
// getAnimations() list.
bool mIsRelevant;