Bug 1287725 - Drop KeyframeEffectReadOnly::HasAnimationOfProperties and nsLayoutUtils::HasCurrentAnimationsForProperties. r?birtles draft
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Tue, 26 Jul 2016 06:44:11 +0900
changeset 392634 3ef8dd705de99abd6ef385975b806d8deb6303b9
parent 392445 251fccc1f62bf0eac569ef4f6717fea61ebadb27
child 526366 8c22ccffe702c6547033364adc88ac89625af401
push id24064
push userhiikezoe@mozilla-japan.org
push dateMon, 25 Jul 2016 21:45:09 +0000
reviewersbirtles
bugs1287725
milestone50.0a1
Bug 1287725 - Drop KeyframeEffectReadOnly::HasAnimationOfProperties and nsLayoutUtils::HasCurrentAnimationsForProperties. r?birtles MozReview-Commit-ID: K33ga7KpLIo
dom/animation/KeyframeEffect.cpp
dom/animation/KeyframeEffect.h
layout/base/ActiveLayerTracker.cpp
layout/base/nsLayoutUtils.cpp
layout/base/nsLayoutUtils.h
--- a/dom/animation/KeyframeEffect.cpp
+++ b/dom/animation/KeyframeEffect.cpp
@@ -502,29 +502,16 @@ KeyframeEffectReadOnly::GetAnimationOfPr
         result = nullptr;
       }
       return result;
     }
   }
   return nullptr;
 }
 
-bool
-KeyframeEffectReadOnly::HasAnimationOfProperties(
-                          const nsCSSProperty* aProperties,
-                          size_t aPropertyCount) const
-{
-  for (size_t i = 0; i < aPropertyCount; i++) {
-    if (HasAnimationOfProperty(aProperties[i])) {
-      return true;
-    }
-  }
-  return false;
-}
-
 #ifdef DEBUG
 bool
 SpecifiedKeyframeArraysAreEqual(const nsTArray<Keyframe>& aA,
                                 const nsTArray<Keyframe>& aB)
 {
   if (aA.Length() != aB.Length()) {
     return false;
   }
--- a/dom/animation/KeyframeEffect.h
+++ b/dom/animation/KeyframeEffect.h
@@ -289,18 +289,16 @@ public:
                     ErrorResult& aRv);
   void SetKeyframes(nsTArray<Keyframe>&& aKeyframes,
                     nsStyleContext* aStyleContext);
   const AnimationProperty*
   GetAnimationOfProperty(nsCSSProperty aProperty) const;
   bool HasAnimationOfProperty(nsCSSProperty aProperty) const {
     return GetAnimationOfProperty(aProperty) != nullptr;
   }
-  bool HasAnimationOfProperties(const nsCSSProperty* aProperties,
-                                size_t aPropertyCount) const;
   const InfallibleTArray<AnimationProperty>& Properties() const {
     return mProperties;
   }
   InfallibleTArray<AnimationProperty>& Properties() {
     return mProperties;
   }
 
   // Update |mProperties| by recalculating from |mKeyframes| using
--- a/layout/base/ActiveLayerTracker.cpp
+++ b/layout/base/ActiveLayerTracker.cpp
@@ -441,17 +441,17 @@ ActiveLayerTracker::IsStyleAnimated(nsDi
     }
     if (CheckScrollInducedActivity(layerActivity, activityIndex, aBuilder)) {
       return true;
     }
   }
   if (aProperty == eCSSProperty_transform && aFrame->Combines3DTransformWithAncestors()) {
     return IsStyleAnimated(aBuilder, aFrame->GetParent(), aProperty);
   }
-  return nsLayoutUtils::HasCurrentAnimationsForProperties(aFrame, &aProperty, 1);
+  return nsLayoutUtils::HasCurrentAnimationOfProperty(aFrame, aProperty);
 }
 
 /* static */ bool
 ActiveLayerTracker::IsOffsetOrMarginStyleAnimated(nsIFrame* aFrame)
 {
   LayerActivity* layerActivity = GetLayerActivity(aFrame);
   if (layerActivity) {
     if (layerActivity->mRestyleCounts[LayerActivity::ACTIVITY_LEFT] >= 2 ||
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -491,30 +491,16 @@ nsLayoutUtils::HasCurrentTransitions(con
       // Since |aEffect| is current, it must have an associated Animation
       // so we don't need to null-check the result of GetAnimation().
       return aEffect.IsCurrent() && aEffect.GetAnimation()->AsCSSTransition();
     }
   );
 }
 
 bool
-nsLayoutUtils::HasCurrentAnimationsForProperties(const nsIFrame* aFrame,
-                                                 const nsCSSProperty* aProperties,
-                                                 size_t aPropertyCount)
-{
-  return HasMatchingAnimations(aFrame,
-    [&aProperties, &aPropertyCount](KeyframeEffectReadOnly& aEffect)
-    {
-      return aEffect.IsCurrent() &&
-        aEffect.HasAnimationOfProperties(aProperties, aPropertyCount);
-    }
-  );
-}
-
-bool
 nsLayoutUtils::HasRelevantAnimationOfProperty(const nsIFrame* aFrame,
                                               nsCSSProperty aProperty)
 {
   return HasMatchingAnimations(aFrame,
     [&aProperty](KeyframeEffectReadOnly& aEffect)
     {
       return (aEffect.IsInEffect() || aEffect.IsCurrent()) &&
              aEffect.HasAnimationOfProperty(aProperty);
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -2241,24 +2241,16 @@ public:
   /**
    * Returns true if the frame has any current CSS transitions.
    * A current transition is any transition that has not yet finished playing
    * including paused transitions.
    */
   static bool HasCurrentTransitions(const nsIFrame* aFrame);
 
   /**
-   * Returns true if the frame has any current animations or transitions
-   * for any of the specified properties.
-   */
-  static bool HasCurrentAnimationsForProperties(const nsIFrame* aFrame,
-                                                const nsCSSProperty* aProperties,
-                                                size_t aPropertyCount);
-
-  /**
    * Returns true if the frame has current or in-effect (i.e. in before phase,
    * running or filling) animations or transitions for the
    * property.
    */
   static bool HasRelevantAnimationOfProperty(const nsIFrame* aFrame,
                                              nsCSSProperty aProperty);
 
   /**