Bug 1339690 - Part 4: Rename ApplyDistributeSpacing to DistributeKeyframes.
There is no spacing mode any more, so rename this function.
MozReview-Commit-ID: 9DIqKmQnuJo
--- 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.