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
Родитель 2f6554bf7c
Коммит 953d3f8dfc
2 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -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);
}
}

Просмотреть файл

@ -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;