diff --git a/dom/animation/AnimationPlayer.cpp b/dom/animation/AnimationPlayer.cpp index 6220d9e52087..2ec7bb872528 100644 --- a/dom/animation/AnimationPlayer.cpp +++ b/dom/animation/AnimationPlayer.cpp @@ -56,7 +56,7 @@ AnimationPlayer::PlayFromJS() void AnimationPlayer::PauseFromJS() { - Play(); + Pause(); // TODO (flush styles etc.) } diff --git a/dom/animation/AnimationPlayer.h b/dom/animation/AnimationPlayer.h index e85e102e43eb..f323cab448b0 100644 --- a/dom/animation/AnimationPlayer.h +++ b/dom/animation/AnimationPlayer.h @@ -31,7 +31,7 @@ protected: public: explicit AnimationPlayer(AnimationTimeline* aTimeline) - : mPlayState(NS_STYLE_ANIMATION_PLAY_STATE_RUNNING) + : mIsPaused(false) , mIsRunningOnCompositor(false) , mTimeline(aTimeline) { @@ -64,9 +64,7 @@ public: return mSource ? mSource->Name() : EmptyString(); } - bool IsPaused() const { - return mPlayState == NS_STYLE_ANIMATION_PLAY_STATE_PAUSED; - } + bool IsPaused() const { return mIsPaused; } bool IsRunning() const; @@ -84,7 +82,7 @@ public: // The beginning of the delay period. Nullable mStartTime; Nullable mHoldTime; - uint8_t mPlayState; + bool mIsPaused; bool mIsRunningOnCompositor; nsRefPtr mTimeline; diff --git a/layout/style/nsAnimationManager.cpp b/layout/style/nsAnimationManager.cpp index dd10ff34f2b1..de0f566d7a7a 100644 --- a/layout/style/nsAnimationManager.cpp +++ b/layout/style/nsAnimationManager.cpp @@ -324,7 +324,7 @@ nsAnimationManager::CheckAnimationRule(nsStyleContext* aStyleContext, } oldPlayer->mHoldTime.SetNull(); } - oldPlayer->mPlayState = newPlayer->mPlayState; + oldPlayer->mIsPaused = newPlayer->mIsPaused; // Replace new animation with the (updated) old one and remove the // old one from the array so we don't try to match it any more. @@ -459,7 +459,8 @@ nsAnimationManager::BuildAnimations(nsStyleContext* aStyleContext, dest->SetSource(destAnim); dest->mStartTime = now; - dest->mPlayState = src.GetPlayState(); + dest->mIsPaused = + src.GetPlayState() == NS_STYLE_ANIMATION_PLAY_STATE_PAUSED; if (dest->IsPaused()) { dest->mHoldTime.SetValue(TimeDuration(0)); }