Bug 1178662 part 2 - Rename *NoUpdate function in Animation. r?birtles draft
authorMantaroh Yoshinaga <mantaroh@gmail.com>
Tue, 31 May 2016 09:42:37 +0900
changeset 373068 f08656a34ae1fa55c36d7d8d38707541ac360ba2
parent 372909 3435dd7ad71fe9003bdeee18fd38d815e033beef
child 373069 128e8395ed3f2093e4e5abd68f61e7660be2acf7
push id19674
push usermantaroh@gmail.com
push dateTue, 31 May 2016 00:42:59 +0000
reviewersbirtles
bugs1178662
milestone49.0a1
Bug 1178662 part 2 - Rename *NoUpdate function in Animation. r?birtles MozReview-Commit-ID: 6P8pze62IYq
dom/animation/Animation.cpp
dom/animation/Animation.h
layout/style/nsAnimationManager.cpp
layout/style/nsTransitionManager.h
--- a/dom/animation/Animation.cpp
+++ b/dom/animation/Animation.cpp
@@ -353,17 +353,17 @@ Animation::GetFinished(ErrorResult& aRv)
     MaybeResolveFinishedPromise();
   }
   return mFinished;
 }
 
 void
 Animation::Cancel()
 {
-  DoCancel();
+  CancelNoUpdate();
   PostUpdate();
 }
 
 // https://w3c.github.io/web-animations/#finish-an-animation
 void
 Animation::Finish(ErrorResult& aRv)
 {
   if (mPlaybackRate == 0 ||
@@ -416,24 +416,24 @@ Animation::Finish(ErrorResult& aRv)
     nsNodeUtils::AnimationChanged(this);
   }
   PostUpdate();
 }
 
 void
 Animation::Play(ErrorResult& aRv, LimitBehavior aLimitBehavior)
 {
-  DoPlay(aRv, aLimitBehavior);
+  PlayNoUpdate(aRv, aLimitBehavior);
   PostUpdate();
 }
 
 void
 Animation::Pause(ErrorResult& aRv)
 {
-  DoPause(aRv);
+  PauseNoUpdate(aRv);
   PostUpdate();
 }
 
 // https://w3c.github.io/web-animations/#reverse-an-animation
 void
 Animation::Reverse(ErrorResult& aRv)
 {
   if (!mTimeline || mTimeline->GetCurrentTime().IsNull()) {
@@ -657,17 +657,17 @@ Animation::SilentlySetPlaybackRate(doubl
   mPlaybackRate = aPlaybackRate;
   if (!previousTime.IsNull()) {
     SilentlySetCurrentTime(previousTime.Value());
   }
 }
 
 // https://w3c.github.io/web-animations/#cancel-an-animation
 void
-Animation::DoCancel()
+Animation::CancelNoUpdate()
 {
   if (mPendingState != PendingState::NotPending) {
     CancelPendingTasks();
     if (mReady) {
       mReady->MaybeReject(NS_ERROR_DOM_ABORT_ERR);
     }
   }
 
@@ -840,17 +840,17 @@ Animation::NotifyEffectTimingUpdated()
              "We should only update timing effect when we have a target "
              "effect");
   UpdateTiming(Animation::SeekFlag::NoSeek,
                Animation::SyncNotifyFlag::Async);
 }
 
 // https://w3c.github.io/web-animations/#play-an-animation
 void
-Animation::DoPlay(ErrorResult& aRv, LimitBehavior aLimitBehavior)
+Animation::PlayNoUpdate(ErrorResult& aRv, LimitBehavior aLimitBehavior)
 {
   AutoMutationBatchForAnimation mb(*this);
 
   bool abortedPause = mPendingState == PendingState::PausePending;
 
   Nullable<TimeDuration> currentTime = GetCurrentTime();
   if (mPlaybackRate > 0.0 &&
       (currentTime.IsNull() ||
@@ -920,17 +920,17 @@ Animation::DoPlay(ErrorResult& aRv, Limi
   UpdateTiming(SeekFlag::NoSeek, SyncNotifyFlag::Async);
   if (IsRelevant()) {
     nsNodeUtils::AnimationChanged(this);
   }
 }
 
 // https://w3c.github.io/web-animations/#pause-an-animation
 void
-Animation::DoPause(ErrorResult& aRv)
+Animation::PauseNoUpdate(ErrorResult& aRv)
 {
   if (IsPausedOrPausing()) {
     return;
   }
 
   AutoMutationBatchForAnimation mb(*this);
 
   // If we are transitioning from idle, fill in the current time
@@ -1163,18 +1163,18 @@ Animation::IsPossiblyOrphanedPendingAnim
   //   or bound to a different document.
   //   (note that for the case of our effect changing we should handle
   //   that in SetEffect)
   // * We started playing but our timeline became inactive.
   //   In this case the pending animation tracker will drop us from its hashmap
   //   when we have been painted.
   // * When we started playing we couldn't find a PendingAnimationTracker to
   //   register with (perhaps the effect had no document) so we simply
-  //   set mPendingState in DoPlay and relied on this method to catch us on the
-  //   next tick.
+  //   set mPendingState in PlayNoUpdate and relied on this method to catch us
+  //   on the next tick.
 
   // If we're not pending we're ok.
   if (mPendingState == PendingState::NotPending) {
     return false;
   }
 
   // If we have a pending ready time then we will be started on the next
   // tick.
--- a/dom/animation/Animation.h
+++ b/dom/animation/Animation.h
@@ -139,17 +139,17 @@ public:
    * PauseFromJS is currently only here for symmetry with PlayFromJS but
    * in future we will likely have to flush style in
    * CSSAnimation::PauseFromJS so we leave it for now.
    */
   void PauseFromJS(ErrorResult& aRv) { Pause(aRv); }
 
   // Wrapper functions for Animation DOM methods when called from style.
 
-  virtual void CancelFromStyle() { DoCancel(); }
+  virtual void CancelFromStyle() { CancelNoUpdate(); }
 
   virtual void Tick();
   bool NeedsTicks() const
   {
     AnimationPlayState playState = PlayState();
     return playState == AnimationPlayState::Running ||
            playState == AnimationPlayState::Pending;
   }
@@ -314,19 +314,19 @@ public:
   void ComposeStyle(RefPtr<AnimValuesStyleRule>& aStyleRule,
                     nsCSSPropertySet& aSetProperties);
 
   void NotifyEffectTimingUpdated();
 
 protected:
   void SilentlySetCurrentTime(const TimeDuration& aNewCurrentTime);
   void SilentlySetPlaybackRate(double aPlaybackRate);
-  void DoCancel();
-  void DoPlay(ErrorResult& aRv, LimitBehavior aLimitBehavior);
-  void DoPause(ErrorResult& aRv);
+  void CancelNoUpdate();
+  void PlayNoUpdate(ErrorResult& aRv, LimitBehavior aLimitBehavior);
+  void PauseNoUpdate(ErrorResult& aRv);
   void ResumeAt(const TimeDuration& aReadyTime);
   void PauseAt(const TimeDuration& aReadyTime);
   void FinishPendingAt(const TimeDuration& aReadyTime)
   {
     if (mPendingState == PendingState::PlayPending) {
       ResumeAt(aReadyTime);
     } else if (mPendingState == PendingState::PausePending) {
       PauseAt(aReadyTime);
--- a/layout/style/nsAnimationManager.cpp
+++ b/layout/style/nsAnimationManager.cpp
@@ -89,33 +89,33 @@ CSSAnimation::PlayFromJS(ErrorResult& aR
 }
 
 void
 CSSAnimation::PlayFromStyle()
 {
   mIsStylePaused = false;
   if (!mPauseShouldStick) {
     ErrorResult rv;
-    DoPlay(rv, Animation::LimitBehavior::Continue);
+    PlayNoUpdate(rv, Animation::LimitBehavior::Continue);
     // play() should not throw when LimitBehavior is Continue
     MOZ_ASSERT(!rv.Failed(), "Unexpected exception playing animation");
   }
 }
 
 void
 CSSAnimation::PauseFromStyle()
 {
   // Check if the pause state is being overridden
   if (mIsStylePaused) {
     return;
   }
 
   mIsStylePaused = true;
   ErrorResult rv;
-  DoPause(rv);
+  PauseNoUpdate(rv);
   // pause() should only throw when *all* of the following conditions are true:
   // - we are in the idle state, and
   // - we have a negative playback rate, and
   // - we have an infinitely repeating animation
   // The first two conditions will never happen under regular style processing
   // but could happen if an author made modifications to the Animation object
   // and then updated animation-play-state. It's an unusual case and there's
   // no obvious way to pass on the exception information so we just silently
--- a/layout/style/nsTransitionManager.h
+++ b/layout/style/nsTransitionManager.h
@@ -136,17 +136,17 @@ public:
   virtual AnimationPlayState PlayStateFromJS() const override;
   virtual void PlayFromJS(ErrorResult& aRv) override;
 
   // A variant of Play() that avoids posting style updates since this method
   // is expected to be called whilst already updating style.
   void PlayFromStyle()
   {
     ErrorResult rv;
-    DoPlay(rv, Animation::LimitBehavior::Continue);
+    PlayNoUpdate(rv, Animation::LimitBehavior::Continue);
     // play() should not throw when LimitBehavior is Continue
     MOZ_ASSERT(!rv.Failed(), "Unexpected exception playing transition");
   }
 
   void CancelFromStyle() override
   {
     // The animation index to use for compositing will be established when
     // this transition next transitions out of the idle state but we still