Bug 1339690 - Part 4: Rename ApplyDistributeSpacing to DistributeKeyframes. draft
authorBoris Chiou <boris.chiou@gmail.com>
Thu, 15 Jun 2017 10:47:32 +0800
changeset 594707 ecd6fe9074f421d6e856131004ef09afa3c4f664
parent 594706 8790c59e9c2b2e0686439b517dc12d63b8f0d233
child 594708 6f829eb38b0b18958f8c10aa2d98c58c53d3861e
push id64112
push userbmo:boris.chiou@gmail.com
push dateThu, 15 Jun 2017 10:38:49 +0000
bugs1339690
milestone56.0a1
Bug 1339690 - Part 4: Rename ApplyDistributeSpacing to DistributeKeyframes. There is no spacing mode any more, so rename this function. MozReview-Commit-ID: 9DIqKmQnuJo
dom/animation/KeyframeEffectReadOnly.cpp
dom/animation/KeyframeUtils.cpp
dom/animation/KeyframeUtils.h
--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -212,17 +212,17 @@ KeyframeEffectReadOnly::DoSetKeyframes(n
                 "StyleType should be nsStyleContext* or "
                 "const ServoComputedValues*");
 
   if (KeyframesEqualIgnoringComputedOffsets(aKeyframes, mKeyframes)) {
     return;
   }
 
   mKeyframes = Move(aKeyframes);
-  KeyframeUtils::ApplyDistributeSpacing(mKeyframes);
+  KeyframeUtils::DistributeKeyframes(mKeyframes);
 
   if (mAnimation && mAnimation->IsRelevant()) {
     nsNodeUtils::AnimationChanged(mAnimation);
   }
 
   // We need to call UpdateProperties() if the StyleType is not nullptr.
   if (aStyle) {
     UpdateProperties(aStyle);
--- a/dom/animation/KeyframeUtils.cpp
+++ b/dom/animation/KeyframeUtils.cpp
@@ -460,17 +460,17 @@ KeyframeUtils::GetKeyframesFromObject(JS
     keyframes.Clear();
     aRv.Throw(NS_ERROR_DOM_ANIM_MISSING_PROPS_ERR);
   }
 
   return keyframes;
 }
 
 /* static */ void
-KeyframeUtils::ApplyDistributeSpacing(nsTArray<Keyframe>& aKeyframes)
+KeyframeUtils::DistributeKeyframes(nsTArray<Keyframe>& aKeyframes)
 {
   if (aKeyframes.IsEmpty()) {
     return;
   }
 
   // If the first keyframe has an unspecified offset, fill it in with 0%.
   // If there is only a single keyframe, then it gets 100%.
   if (aKeyframes.Length() > 1) {
@@ -1466,17 +1466,17 @@ RequiresAdditiveAnimation(const nsTArray
     }
   };
 
   StyleBackendType styleBackend = aDocument->GetStyleBackendType();
 
   for (size_t i = 0, len = aKeyframes.Length(); i < len; i++) {
     const Keyframe& frame = aKeyframes[i];
 
-    // We won't have called ApplyDistributeSpacing when this is called so
+    // We won't have called DistributeKeyframes when this is called so
     // we can't use frame.mComputedOffset. Instead we do a rough version
     // of that algorithm that substitutes null offsets with 0.0 for the first
     // frame, 1.0 for the last frame, and 0.5 for everything else.
     double computedOffset = i == len - 1
                             ? 1.0
                             : i == 0 ? 0.0 : 0.5;
     double offsetToUse = frame.mOffset
                          ? frame.mOffset.value()
--- a/dom/animation/KeyframeUtils.h
+++ b/dom/animation/KeyframeUtils.h
@@ -94,17 +94,17 @@ public:
   /**
    * Calculate the computed offset of keyframes by evenly distributing keyframes
    * with a missing offset.
    *
    * @see https://w3c.github.io/web-animations/#calculating-computed-keyframes
    *
    * @param aKeyframes The set of keyframes to adjust.
    */
-  static void ApplyDistributeSpacing(nsTArray<Keyframe>& aKeyframes);
+  static void DistributeKeyframes(nsTArray<Keyframe>& aKeyframes);
 
   /**
    * Converts an array of Keyframe objects into an array of AnimationProperty
    * objects. This involves creating an array of computed values for each
    * longhand property and determining the offset and timing function to use
    * for each value.
    *
    * @param aKeyframes The input keyframes.