Bug 1337313 - Part 1: Use AnimationValue in CreatePropertyValue. draft
authorBoris Chiou <boris.chiou@gmail.com>
Wed, 08 Feb 2017 16:15:18 +0800
changeset 481602 26414bc77682955ea09b9c57be6be38cff4c07e5
parent 481601 5db06e4566a04f9dae9cc9a9a37a97cd09348441
child 481603 2179b30ec43d4edbd15869db56c488f31ccffd33
push id44867
push userbmo:boris.chiou@gmail.com
push dateFri, 10 Feb 2017 04:28:38 +0000
bugs1337313
milestone54.0a1
Bug 1337313 - Part 1: Use AnimationValue in CreatePropertyValue. Replace the argument type with AnimationValue. MozReview-Commit-ID: IeydVOLKTB9
dom/animation/KeyframeEffectReadOnly.cpp
--- 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);
       }
     }