Bug 1203009 part 2 - Remove {CSSAnimation,CSSTransition}::OwningElement() getter; r=heycam
authorBrian Birtles <birtles@gmail.com>
Tue, 15 Sep 2015 11:20:33 +0900
changeset 295301 5196bf0855ad3c9317f58faf727c0203d9963b0d
parent 295300 f9b2ef0b494612c8ae22cb486a848f3649c55c06
child 295302 b7af8129961f8f9401923debb1de40d73c90ae72
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1203009
milestone43.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 1203009 part 2 - Remove {CSSAnimation,CSSTransition}::OwningElement() getter; r=heycam This doesn't really save us much, but we don't need this method so we may as well drop it.
layout/style/nsAnimationManager.cpp
layout/style/nsAnimationManager.h
layout/style/nsTransitionManager.cpp
layout/style/nsTransitionManager.h
--- a/layout/style/nsAnimationManager.cpp
+++ b/layout/style/nsAnimationManager.cpp
@@ -149,21 +149,21 @@ CSSAnimation::HasLowerCompositeOrderThan
            Animation::HasLowerCompositeOrderThan(aOther) :
            false;
   }
   if (!aOther.IsUsingCustomCompositeOrder()) {
     return true;
   }
 
   // 3. Sort by document order
-  MOZ_ASSERT(mOwningElement.IsSet() && otherAnimation->OwningElement().IsSet(),
+  MOZ_ASSERT(mOwningElement.IsSet() && otherAnimation->mOwningElement.IsSet(),
              "Animations using custom composite order should have an "
              "owning element");
-  if (!mOwningElement.Equals(otherAnimation->OwningElement())) {
-    return mOwningElement.LessThan(otherAnimation->OwningElement());
+  if (!mOwningElement.Equals(otherAnimation->mOwningElement)) {
+    return mOwningElement.LessThan(otherAnimation->mOwningElement);
   }
 
   // 4. (Same element and pseudo): Sort by position in animation-name
   return mAnimationIndex < otherAnimation->mAnimationIndex;
 }
 
 void
 CSSAnimation::QueueEvents()
--- a/layout/style/nsAnimationManager.h
+++ b/layout/style/nsAnimationManager.h
@@ -120,38 +120,20 @@ public:
   }
   void CopyAnimationIndex(const CSSAnimation& aOther)
   {
     MOZ_ASSERT(IsUsingCustomCompositeOrder() &&
                aOther.IsUsingCustomCompositeOrder());
     mAnimationIndex = aOther.mAnimationIndex;
   }
 
-  // Returns the element or pseudo-element whose animation-name property
-  // this CSSAnimation corresponds to (if any). This is used for determining
-  // the relative composite order of animations generated from CSS markup.
-  //
-  // Typically this will be the same as the target element of the keyframe
-  // effect associated with this animation. However, it can differ in the
-  // following circumstances:
-  //
-  // a) If script removes or replaces the effect of this animation,
-  // b) If this animation is cancelled (e.g. by updating the
-  //    animation-name property or removing the owning element from the
-  //    document),
-  // c) If this object is generated from script using the CSSAnimation
-  //    constructor.
-  //
-  // For (b) and (c) the returned owning element will return !IsSet().
-  const OwningElementRef& OwningElement() const { return mOwningElement; }
-
   // Sets the owning element which is used for determining the composite
   // order of CSSAnimation objects generated from CSS markup.
   //
-  // @see OwningElement()
+  // @see mOwningElement
   void SetOwningElement(const OwningElementRef& aElement)
   {
     mOwningElement = aElement;
   }
 
   // Is this animation currently in effect for the purposes of computing
   // mWinsInCascade.  (In general, this can be computed from the timing
   // function.  This boolean remembers the state as of the last time we
@@ -166,16 +148,32 @@ protected:
                                         "before a CSS animation is destroyed");
   }
   virtual CommonAnimationManager* GetAnimationManager() const override;
 
   nsString mAnimationName;
 
   // The (pseudo-)element whose computed animation-name refers to this
   // animation (if any).
+  //
+  // This is used for determining the relative composite order of animations
+  // generated from CSS markup.
+  //
+  // Typically this will be the same as the target element of the keyframe
+  // effect associated with this animation. However, it can differ in the
+  // following circumstances:
+  //
+  // a) If script removes or replaces the effect of this animation,
+  // b) If this animation is cancelled (e.g. by updating the
+  //    animation-name property or removing the owning element from the
+  //    document),
+  // c) If this object is generated from script using the CSSAnimation
+  //    constructor.
+  //
+  // For (b) and (c) the owning element will return !IsSet().
   OwningElementRef mOwningElement;
 
   // When combining animation-play-state with play() / pause() the following
   // behavior applies:
   // 1. pause() is sticky and always overrides the underlying
   //    animation-play-state
   // 2. If animation-play-state is 'paused', play() will temporarily override
   //    it until animation-play-state next becomes 'running'.
--- a/layout/style/nsTransitionManager.cpp
+++ b/layout/style/nsTransitionManager.cpp
@@ -192,21 +192,21 @@ CSSTransition::HasLowerCompositeOrderTha
            Animation::HasLowerCompositeOrderThan(aOther) :
            false;
   }
   if (!aOther.IsUsingCustomCompositeOrder()) {
     return true;
   }
 
   // 3. Sort by document order
-  MOZ_ASSERT(mOwningElement.IsSet() && otherTransition->OwningElement().IsSet(),
+  MOZ_ASSERT(mOwningElement.IsSet() && otherTransition->mOwningElement.IsSet(),
              "Transitions using custom composite order should have an owning "
              "element");
-  if (!mOwningElement.Equals(otherTransition->OwningElement())) {
-    return mOwningElement.LessThan(otherTransition->OwningElement());
+  if (!mOwningElement.Equals(otherTransition->mOwningElement)) {
+    return mOwningElement.LessThan(otherTransition->mOwningElement);
   }
 
   // 4. (Same element and pseudo): Sort by transition generation
   if (mAnimationIndex != otherTransition->mAnimationIndex) {
     return mAnimationIndex < otherTransition->mAnimationIndex;
   }
 
   // 5. (Same transition generation): Sort by transition property
--- a/layout/style/nsTransitionManager.h
+++ b/layout/style/nsTransitionManager.h
@@ -129,37 +129,20 @@ public:
   }
 
   void SetCreationSequence(uint64_t aIndex)
   {
     MOZ_ASSERT(IsUsingCustomCompositeOrder());
     mAnimationIndex = aIndex;
   }
 
-  // Returns the element or pseudo-element whose transition-property property
-  // this CSSTransition corresponds to (if any). This is used for determining
-  // the relative composite order of transitions generated from CSS markup.
-  //
-  // Typically this will be the same as the target element of the keyframe
-  // effect associated with this transition. However, it can differ in the
-  // following circumstances:
-  //
-  // a) If script removes or replaces the effect of this transition,
-  // b) If this transition is cancelled (e.g. by updating the
-  //    transition-property or removing the owning element from the document),
-  // c) If this object is generated from script using the CSSTransition
-  //    constructor.
-  //
-  // For (b) and (c) the returned owning element will return !IsSet().
-  const OwningElementRef& OwningElement() const { return mOwningElement; }
-
   // Sets the owning element which is used for determining the composite
   // oder of CSSTransition objects generated from CSS markup.
   //
-  // @see OwningElement()
+  // @see mOwningElement
   void SetOwningElement(const OwningElementRef& aElement)
   {
     mOwningElement = aElement;
   }
 
 protected:
   virtual ~CSSTransition()
   {
@@ -169,16 +152,31 @@ protected:
 
   virtual CommonAnimationManager* GetAnimationManager() const override;
 
   void QueueEvents();
   bool HasEndEventToQueue() const override;
 
   // The (pseudo-)element whose computed transition-property refers to this
   // transition (if any).
+  //
+  // This is used for determining the relative composite order of transitions
+  // generated from CSS markup.
+  //
+  // Typically this will be the same as the target element of the keyframe
+  // effect associated with this transition. However, it can differ in the
+  // following circumstances:
+  //
+  // a) If script removes or replaces the effect of this transition,
+  // b) If this transition is cancelled (e.g. by updating the
+  //    transition-property or removing the owning element from the document),
+  // c) If this object is generated from script using the CSSTransition
+  //    constructor.
+  //
+  // For (b) and (c) the owning element will return !IsSet().
   OwningElementRef mOwningElement;
 
   bool mWasFinishedOnLastTick;
 };
 
 } // namespace dom
 
 struct TransitionEventInfo {