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
--- 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,