Bug 1149990 - Support replaying of finished CSS transitions by supporting setting of currentTime/startTime. r=birtles

This commit is contained in:
Jonathan Watt 2015-04-06 23:48:55 +01:00
parent 4ae23d2ace
commit 75a0893034
3 changed files with 6 additions and 3 deletions

View File

@ -697,6 +697,9 @@ AnimationPlayer::UpdateFinishedState(bool aSeekFlag)
} else if (!currentFinishedState && mIsPreviousStateFinished) {
// Clear finished promise. We'll create a new one lazily.
mFinished = nullptr;
if (mEffect->AsTransition()) {
mEffect->SetIsFinishedTransition(false);
}
}
mIsPreviousStateFinished = currentFinishedState;
// We must recalculate the current time to take account of any mHoldTime

View File

@ -300,10 +300,10 @@ public:
return mIsFinishedTransition;
}
void SetIsFinishedTransition() {
void SetIsFinishedTransition(bool aIsFinished) {
MOZ_ASSERT(AsTransition(),
"Calling SetIsFinishedTransition but it's not a transition");
mIsFinishedTransition = true;
mIsFinishedTransition = aIsFinished;
}
bool IsInPlay(const AnimationPlayer& aPlayer) const;

View File

@ -831,7 +831,7 @@ nsTransitionManager::FlushTransitions(FlushFlags aFlags)
// a non-animation style change that would affect it, we need
// to know not to start a new transition for the transition
// from the almost-completed value to the final value.
player->GetEffect()->SetIsFinishedTransition();
player->GetEffect()->SetIsFinishedTransition(true);
collection->UpdateAnimationGeneration(mPresContext);
transitionStartedOrEnded = true;
} else if ((computedTiming.mPhase ==