Bug 1518374 - Shuffle definitions in Animation.h; r=hiro
authorBrian Birtles <birtles@gmail.com>
Tue, 08 Jan 2019 06:47:43 +0000
changeset 509909 3ff9725e0c3a53a71fb3af3c1f4fd9f49828fa5b
parent 509908 e59729ade65262288e43f679455be1e5da8b13c3
child 509910 d497b0f223c9f1836cf320b594964794fd54f4bd
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershiro
bugs1518374
milestone66.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 1518374 - Shuffle definitions in Animation.h; r=hiro This arranges related declarations by function as opposed to trying to distinguish between functions that are Web-facing and those that are not. The order still corresponds to the order in the spec[1] however. [1] https://drafts.csswg.org/web-animations-1/#the-animation-interface Differential Revision: https://phabricator.services.mozilla.com/D15898
dom/animation/Animation.h
--- a/dom/animation/Animation.h
+++ b/dom/animation/Animation.h
@@ -79,74 +79,80 @@ class Animation : public DOMEventTargetH
    * animation's animation-play-state changes we shouldn't rewind the animation.
    */
   enum class LimitBehavior { AutoRewind, Continue };
 
   // Animation interface methods
   static already_AddRefed<Animation> Constructor(
       const GlobalObject& aGlobal, AnimationEffect* aEffect,
       const Optional<AnimationTimeline*>& aTimeline, ErrorResult& aRv);
+
   void GetId(nsAString& aResult) const { aResult = mId; }
   void SetId(const nsAString& aId);
+
   AnimationEffect* GetEffect() const { return mEffect; }
   void SetEffect(AnimationEffect* aEffect);
+  void SetEffectNoUpdate(AnimationEffect* aEffect);
+
   AnimationTimeline* GetTimeline() const { return mTimeline; }
   void SetTimeline(AnimationTimeline* aTimeline);
+  void SetTimelineNoUpdate(AnimationTimeline* aTimeline);
+
   Nullable<TimeDuration> GetStartTime() const { return mStartTime; }
+  Nullable<double> GetStartTimeAsDouble() const;
   void SetStartTime(const Nullable<TimeDuration>& aNewStartTime);
+  void SetStartTimeAsDouble(const Nullable<double>& aStartTime);
+
   // This is deliberately _not_ called GetCurrentTime since that would clash
   // with a macro defined in winbase.h
   Nullable<TimeDuration> GetCurrentTimeAsDuration() const {
     return GetCurrentTimeForHoldTime(mHoldTime);
   }
+  Nullable<double> GetCurrentTimeAsDouble() const;
   void SetCurrentTime(const TimeDuration& aNewCurrentTime);
+  void SetCurrentTimeAsDouble(const Nullable<double>& aCurrentTime,
+                              ErrorResult& aRv);
+
   double PlaybackRate() const { return mPlaybackRate; }
   void SetPlaybackRate(double aPlaybackRate);
+
   AnimationPlayState PlayState() const;
+  virtual AnimationPlayState PlayStateFromJS() const { return PlayState(); }
+
   bool Pending() const { return mPendingState != PendingState::NotPending; }
+  virtual bool PendingFromJS() const { return Pending(); }
+
   virtual Promise* GetReady(ErrorResult& aRv);
   Promise* GetFinished(ErrorResult& aRv);
-  void Cancel();
-  void Finish(ErrorResult& aRv);
-  virtual void Play(ErrorResult& aRv, LimitBehavior aLimitBehavior);
-  virtual void Pause(ErrorResult& aRv);
-  void Reverse(ErrorResult& aRv);
-  void UpdatePlaybackRate(double aPlaybackRate);
-  bool IsRunningOnCompositor() const;
+
   IMPL_EVENT_HANDLER(finish);
   IMPL_EVENT_HANDLER(cancel);
 
-  // Wrapper functions for Animation DOM methods when called
-  // from script.
-  //
-  // We often use the same methods internally and from script but when called
-  // from script we (or one of our subclasses) perform extra steps such as
-  // flushing style or converting the return type.
-  Nullable<double> GetStartTimeAsDouble() const;
-  void SetStartTimeAsDouble(const Nullable<double>& aStartTime);
-  Nullable<double> GetCurrentTimeAsDouble() const;
-  void SetCurrentTimeAsDouble(const Nullable<double>& aCurrentTime,
-                              ErrorResult& aRv);
-  virtual AnimationPlayState PlayStateFromJS() const { return PlayState(); }
-  virtual bool PendingFromJS() const { return Pending(); }
+  void Cancel();
+  virtual void CancelFromStyle() { CancelNoUpdate(); }
+
+  void Finish(ErrorResult& aRv);
+
+  virtual void Play(ErrorResult& aRv, LimitBehavior aLimitBehavior);
   virtual void PlayFromJS(ErrorResult& aRv) {
     Play(aRv, LimitBehavior::AutoRewind);
   }
+
+  virtual void Pause(ErrorResult& aRv);
   /**
    * 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.
+  void UpdatePlaybackRate(double aPlaybackRate);
+  void Reverse(ErrorResult& aRv);
 
-  virtual void CancelFromStyle() { CancelNoUpdate(); }
-  void SetTimelineNoUpdate(AnimationTimeline* aTimeline);
-  void SetEffectNoUpdate(AnimationEffect* aEffect);
+  bool IsRunningOnCompositor() const;
 
   virtual void Tick();
   bool NeedsTicks() const {
     return Pending() || PlayState() == AnimationPlayState::Running;
   }
 
   /**
    * Set the time to use for starting or pausing a pending animation.