Bug 1308099 part 1 - Rename AnimationPhase::Null to AnimationPhase::Idle. r?hiro draft
authorMantaroh Yoshinaga <mantaroh@gmail.com>
Wed, 25 Jan 2017 15:43:57 +0900
changeset 466073 ac06b32b56ca2e1233260b40e146c8493de03149
parent 465990 6dccae211ae5fec6a1c1244b878ce0b93860154f
child 466074 26ff9d0c1e1b623f525a0164160337df88582410
child 466076 79bac18a32b666da115f301449fd040b5c017ef8
child 466077 3a59df8260b7f0d419c9695ebf549be9174f6aa5
push id42777
push usermantaroh@gmail.com
push dateWed, 25 Jan 2017 06:50:24 +0000
reviewershiro
bugs1308099
milestone54.0a1
Bug 1308099 part 1 - Rename AnimationPhase::Null to AnimationPhase::Idle. r?hiro In Web Animations specification, if the animation effect is in none of the any phase, it define as 'Idle' phase. [1] But, in the gecko, it defined as 'Null' phase. So we will need to use 'Idle' phase for consistency. [1] https://w3c.github.io/web-animations/#idle-phase MozReview-Commit-ID: FlPpYOqdM4X
dom/animation/ComputedTiming.h
layout/style/nsAnimationManager.cpp
layout/style/nsAnimationManager.h
layout/style/nsTransitionManager.h
--- a/dom/animation/ComputedTiming.h
+++ b/dom/animation/ComputedTiming.h
@@ -59,22 +59,22 @@ struct ComputedTiming
   bool FillsBackwards() const {
     MOZ_ASSERT(mFill != dom::FillMode::Auto,
                "mFill should not be Auto in ComputedTiming.");
     return mFill == dom::FillMode::Both ||
            mFill == dom::FillMode::Backwards;
   }
 
   enum class AnimationPhase {
-    Null,   // Not sampled (null sample time)
+    Idle,   // Not sampled (null sample time)
     Before, // Sampled prior to the start of the active interval
     Active, // Sampled within the active interval
     After   // Sampled after (or at) the end of the active interval
   };
-  AnimationPhase      mPhase = AnimationPhase::Null;
+  AnimationPhase      mPhase = AnimationPhase::Idle;
 
   ComputedTimingFunction::BeforeFlag mBeforeFlag =
     ComputedTimingFunction::BeforeFlag::Unset;
 
 };
 
 } // namespace mozilla
 
--- a/layout/style/nsAnimationManager.cpp
+++ b/layout/style/nsAnimationManager.cpp
@@ -224,17 +224,17 @@ CSSAnimation::QueueEvents()
       (iterationBoundary - computedTiming.mIterationStart));
 
   TimeStamp startTimeStamp     = ElapsedTimeToTimeStamp(intervalStartTime);
   TimeStamp endTimeStamp       = ElapsedTimeToTimeStamp(intervalEndTime);
   TimeStamp iterationTimeStamp = ElapsedTimeToTimeStamp(iterationStartTime);
 
   AutoTArray<AnimationEventParams, 2> events;
   switch (mPreviousPhase) {
-    case AnimationPhase::Null:
+    case AnimationPhase::Idle:
     case AnimationPhase::Before:
       if (currentPhase == AnimationPhase::Active) {
         events.AppendElement(AnimationEventParams{ eAnimationStart,
                                                    intervalStartTime,
                                                    startTimeStamp });
       } else if (currentPhase == AnimationPhase::After) {
         events.AppendElement(AnimationEventParams{ eAnimationStart,
                                                    intervalStartTime,
--- a/layout/style/nsAnimationManager.h
+++ b/layout/style/nsAnimationManager.h
@@ -71,17 +71,17 @@ class CSSAnimation final : public Animat
 public:
  explicit CSSAnimation(nsIGlobalObject* aGlobal,
                        const nsSubstring& aAnimationName)
     : dom::Animation(aGlobal)
     , mAnimationName(aAnimationName)
     , mIsStylePaused(false)
     , mPauseShouldStick(false)
     , mNeedsNewAnimationIndexWhenRun(false)
-    , mPreviousPhase(ComputedTiming::AnimationPhase::Null)
+    , mPreviousPhase(ComputedTiming::AnimationPhase::Idle)
     , mPreviousIteration(0)
   {
     // We might need to drop this assertion once we add a script-accessible
     // constructor but for animations generated from CSS markup the
     // animation-name should never be empty.
     MOZ_ASSERT(!mAnimationName.IsEmpty(), "animation-name should not be empty");
   }
 
--- a/layout/style/nsTransitionManager.h
+++ b/layout/style/nsTransitionManager.h
@@ -267,17 +267,17 @@ protected:
   //
   // For (b) and (c) the owning element will return !IsSet().
   OwningElementRef mOwningElement;
 
   // The 'transition phase' used to determine which transition events need
   // to be queued on this tick.
   // See: https://drafts.csswg.org/css-transitions-2/#transition-phase
   enum class TransitionPhase {
-    Idle   = static_cast<int>(ComputedTiming::AnimationPhase::Null),
+    Idle   = static_cast<int>(ComputedTiming::AnimationPhase::Idle),
     Before = static_cast<int>(ComputedTiming::AnimationPhase::Before),
     Active = static_cast<int>(ComputedTiming::AnimationPhase::Active),
     After  = static_cast<int>(ComputedTiming::AnimationPhase::After),
     Pending
   };
   TransitionPhase mPreviousTransitionPhase;
 
   // When true, indicates that when this transition next leaves the idle state,