Bug 1488279 - Reorder the member variables of Animation, r=hiro
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Tue, 04 Sep 2018 00:58:15 +0300
changeset 492312 a7985ade4e35e076274c2c841fc1b514f8505618
parent 492311 574af1378a606294bffe51dcf7216d81caaa036e
child 492313 3145e6f7f695cac7603ec23456f4e87a0b3d4775
push id1815
push userffxbld-merge
push dateMon, 15 Oct 2018 10:40:45 +0000
treeherdermozilla-release@18d4c09e9378 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershiro
bugs1488279
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1488279 - Reorder the member variables of Animation, r=hiro
dom/animation/Animation.h
--- a/dom/animation/Animation.h
+++ b/dom/animation/Animation.h
@@ -55,18 +55,18 @@ class Animation
 {
 protected:
   virtual ~Animation() {}
 
 public:
   explicit Animation(nsIGlobalObject* aGlobal)
     : DOMEventTargetHelper(aGlobal)
     , mPlaybackRate(1.0)
+    , mAnimationIndex(sNextAnimationIndex++)
     , mPendingState(PendingState::NotPending)
-    , mAnimationIndex(sNextAnimationIndex++)
     , mFinishedAtLastComposeStyle(false)
     , mIsRelevant(false)
     , mFinishedIsResolved(false)
     , mSyncWithGeometricAnimations(false)
   {
   }
 
   NS_DECL_ISUPPORTS_INHERITED
@@ -563,52 +563,58 @@ protected:
 
   // A Promise that is resolved when we reach the end of the effect, or
   // 0 when playing backwards. The Promise is replaced if the animation is
   // finished but then a state change makes it not finished.
   // This object is lazily created by GetFinished.
   // See http://drafts.csswg.org/web-animations/#current-finished-promise
   RefPtr<Promise> mFinished;
 
-  // Indicates if the animation is in the pending state (and what state it is
-  // waiting to enter when it finished pending). We use this rather than
-  // checking if this animation is tracked by a PendingAnimationTracker because
-  // the animation will continue to be pending even after it has been removed
-  // from the PendingAnimationTracker while it is waiting for the next tick
-  // (see TriggerOnNextTick for details).
-  enum class PendingState { NotPending, PlayPending, PausePending };
-  PendingState mPendingState;
-
   static uint64_t sNextAnimationIndex;
 
   // The relative position of this animation within the global animation list.
   // This is kNoIndex while the animation is in the idle state and is updated
   // each time the animation transitions out of the idle state.
   //
   // Note that subclasses such as CSSTransition and CSSAnimation may repurpose
   // this member to implement their own brand of sorting. As a result, it is
   // possible for two different objects to have the same index.
   uint64_t mAnimationIndex;
 
+  // Indicates if the animation is in the pending state (and what state it is
+  // waiting to enter when it finished pending). We use this rather than
+  // checking if this animation is tracked by a PendingAnimationTracker because
+  // the animation will continue to be pending even after it has been removed
+  // from the PendingAnimationTracker while it is waiting for the next tick
+  // (see TriggerOnNextTick for details).
+  enum class PendingState : uint8_t
+  {
+    NotPending,
+    PlayPending,
+    PausePending
+  };
+  PendingState mPendingState;
+
   bool mFinishedAtLastComposeStyle;
   // Indicates that the animation should be exposed in an element's
   // getAnimations() list.
   bool mIsRelevant;
 
-  RefPtr<MicroTaskRunnable> mFinishNotificationTask;
   // True if mFinished is resolved or would be resolved if mFinished has
   // yet to be created. This is not set when mFinished is rejected since
   // in that case mFinished is immediately reset to represent a new current
   // finished promise.
   bool mFinishedIsResolved;
 
   // True if this animation was triggered at the same time as one or more
   // geometric animations and hence we should run any transform animations on
   // the main thread.
   bool mSyncWithGeometricAnimations;
 
+  RefPtr<MicroTaskRunnable> mFinishNotificationTask;
+
   nsString mId;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_Animation_h