Bug 1181392 part 7 - Remove use of IsFinishedTransition from nsTransitionManager::ConsiderStartingTransition; r=dbaron

Of particular note, this patch removes the check for finished transitions in
the case when we can't animate the current change. This case occurs when either
we have a non-transition style change that happens to coincide with the current
transition value, or a style change to something we can't interpolate to. In
either case it's not clear why we would cancel the existing transition only if
it is still in motion and not if it is finished. It seems like it should be
cancelled in either case and hence this patch removes this check.

The other change relates to detecting reversing transitions. In this case we do
need to distinguish between transitions that have finished and those that have
not. For this purpose, checking if the animation is current should be
sufficient. (Note that comparing for PlayState() == Finished would not be enough
since we want to also exclude *idle*, i.e. cancelled, animations too.)
This commit is contained in:
Brian Birtles 2015-08-07 12:29:36 +09:00
parent ada993ef5a
commit 20281f56f4

View File

@ -570,7 +570,7 @@ nsTransitionManager::ConsiderStartingTransition(
}
if (!shouldAnimate) {
if (haveCurrentTransition && !oldPT->IsFinishedTransition()) {
if (haveCurrentTransition) {
// We're in the middle of a transition, and just got a non-transition
// style change to something that we can't animate. This might happen
// because we got a non-transition style change changing to the current
@ -607,7 +607,7 @@ nsTransitionManager::ConsiderStartingTransition(
// If the new transition reverses an existing one, we'll need to
// handle the timing differently.
if (haveCurrentTransition &&
!oldPT->IsFinishedTransition() &&
aElementTransitions->mAnimations[currentIndex]->HasCurrentEffect() &&
oldPT->mStartForReversingTest == endValue) {
// Compute the appropriate negative transition-delay such that right
// now we'd end up at the current position.