Bug 1337313 - Part 1: Use AnimationValue in CreatePropertyValue.
Replace the argument type with AnimationValue.
MozReview-Commit-ID: IeydVOLKTB9
--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -1075,26 +1075,26 @@ KeyframeEffectReadOnly::GetTarget(
aRv.SetNull();
}
}
static void
CreatePropertyValue(nsCSSPropertyID aProperty,
float aOffset,
const Maybe<ComputedTimingFunction>& aTimingFunction,
- const StyleAnimationValue& aValue,
+ const AnimationValue& aValue,
dom::CompositeOperation aComposite,
AnimationPropertyValueDetails& aResult)
{
aResult.mOffset = aOffset;
if (!aValue.IsNull()) {
nsString stringValue;
DebugOnly<bool> uncomputeResult =
- StyleAnimationValue::UncomputeValue(aProperty, aValue, stringValue);
+ StyleAnimationValue::UncomputeValue(aProperty, aValue.mGecko, stringValue);
MOZ_ASSERT(uncomputeResult, "failed to uncompute value");
aResult.mValue.Construct(stringValue);
}
if (aTimingFunction) {
aResult.mEasing.Construct();
aTimingFunction->AppendToString(aResult.mEasing.Value());
} else {
@@ -1130,17 +1130,17 @@ KeyframeEffectReadOnly::GetProperties(
for (size_t segmentIdx = 0, segmentLen = property.mSegments.Length();
segmentIdx < segmentLen;
segmentIdx++)
{
const AnimationPropertySegment& segment = property.mSegments[segmentIdx];
binding_detail::FastAnimationPropertyValueDetails fromValue;
CreatePropertyValue(property.mProperty, segment.mFromKey,
- segment.mTimingFunction, segment.mFromValue.mGecko,
+ segment.mTimingFunction, segment.mFromValue,
segment.mFromComposite, fromValue);
// We don't apply timing functions for zero-length segments, so
// don't return one here.
if (segment.mFromKey == segment.mToKey) {
fromValue.mEasing.Reset();
}
// The following won't fail since we have already allocated the capacity
// above.
@@ -1151,17 +1151,17 @@ KeyframeEffectReadOnly::GetProperties(
// to add it if either:
// a) this is the last segment, or
// b) the next segment's from-value differs.
if (segmentIdx == segmentLen - 1 ||
property.mSegments[segmentIdx + 1].mFromValue.mGecko !=
segment.mToValue.mGecko) {
binding_detail::FastAnimationPropertyValueDetails toValue;
CreatePropertyValue(property.mProperty, segment.mToKey,
- Nothing(), segment.mToValue.mGecko,
+ Nothing(), segment.mToValue,
segment.mToComposite, toValue);
// It doesn't really make sense to have a timing function on the
// last property value or before a sudden jump so we just drop the
// easing property altogether.
toValue.mEasing.Reset();
propertyDetails.mValues.AppendElement(toValue, mozilla::fallible);
}
}