Bug 1073336 part 7 - Move style flushing to CSSAnimationPlayer and CSSTransitionPlayer; r=dbaron

Previously AnimationPlayer::Play() and AnimationPlayer::PlayState() would flush
styles as part of their operation. This, however, is only needed when the player
corresponds to a CSS Animation or CSS Transition. Now that we have concrete
subclasses for each of these cases we can move style flushing to the subclasses
and remove it from the base class (which is expected to be shared with
animations that are not dependent on style).
This commit is contained in:
Brian Birtles
2014-11-17 13:45:58 +09:00
parent fc90515b33
commit e5f74b42c4
6 changed files with 44 additions and 24 deletions

View File

@@ -41,6 +41,24 @@ CSSAnimationPlayer::Pause(UpdateFlags aUpdateFlags)
AnimationPlayer::Pause(aUpdateFlags);
}
mozilla::dom::AnimationPlayState
CSSAnimationPlayer::PlayStateFromJS() const
{
// Flush style to ensure that any properties controlling animation state
// (e.g. animation-play-state) are fully updated.
FlushStyle();
return AnimationPlayer::PlayStateFromJS();
}
void
CSSAnimationPlayer::PlayFromJS()
{
// Note that flushing style below might trigger calls to
// PlayFromStyle()/PauseFromStyle() on this object.
FlushStyle();
AnimationPlayer::PlayFromJS();
}
void
CSSAnimationPlayer::PlayFromStyle()
{