gecko-dev/dom/animation
Brian Birtles c9b30cafe3 Bug 1052147 - Initialize AnimationPlayer::mPlayState to running state; r=dbaron
The assertion in nsTimeStamp::operator >= occasionally fails due to a null RHS
timestamp when called from AnimationPlayer::GetCurrentTimeDuration, which, in
turn, is called from AnimationPlayer::SetSource.

The issue appears to be that we're not correctly initializing
AnimationPlayer.mPlayState. This value can be running (0) or paused (1) but we
only ever compare against the paused state (i.e. every other value is
effectively treated as running). If we don't initialize this we can end
up in the paused state but with mPauseStart not set to a valid (non-null)
TimeStamp. This creates an inconsistent state since we assume that when we're
paused mPauseStart is non-null, hence the assertion fails.

This gets tickled because, since bug 1040543, we call
AnimationPlayer::SetSource from nsAnimationManager::BuildAnimations *before* we
set mPlayState and mPauseStart.

This patch initializes mPlayState to the running state so we don't accidentally
end up in an inconsistent state.

It also removes some (now unnecessary) initialization of mPlayState and
mPauseStart from nsTransitionManager::ConsiderStartingTransition.

In future we could also consider reworking nsAnimationManager::BuildAnimations
so that we call SetSource on the new animation player *after* setting up its
play state. That may be more correct and would further avoid this problem but
may not be necessary since all that code is likely to change in the near future.
2014-08-13 18:21:45 +09:00
..
test Bug 1002332 - Make AnimationTimeline record the last refresh time and use that when there is no refresh driver; r=bz 2014-07-24 13:37:38 +09:00
Animation.cpp Bug 1040543 part 8 - Move timing parameters from AnimationPlayer to Animation; r=bz 2014-08-10 17:06:50 +10:00
Animation.h Bug 1040543 part 11 - Make ElementPropertyTransition inherit from Animation instead of AnimationPlayer; r=bz 2014-08-10 17:06:52 +10:00
AnimationPlayer.cpp Bug 1040543 part 9 - Move IsFinishedTransition from AnimationPlayer to Animation; r=bz 2014-08-10 17:06:51 +10:00
AnimationPlayer.h Bug 1052147 - Initialize AnimationPlayer::mPlayState to running state; r=dbaron 2014-08-13 18:21:45 +09:00
AnimationTimeline.cpp Bug 1002332 - Make AnimationTimeline record the last refresh time and use that when there is no refresh driver; r=bz 2014-07-24 13:37:38 +09:00
AnimationTimeline.h Bug 1050611 - Fix more bad implicit constructors in dom and docshell; r=smaug 2014-08-08 09:49:39 -04:00
moz.build Bug 1040543 part 3 - Add Animation interface; r=bz 2014-08-10 17:06:46 +10:00