Bug 1305325 - Part 3: Make AnimationPropertyValueDetails::mValue optional. r?birtles draft
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Sun, 27 Nov 2016 13:03:37 +0900
changeset 444634 29da907c729a66545a5e59ce06166bb0fe91d7aa
parent 444633 398c8c21b770dfc19602208029b4205b754042bc
child 444635 50b1f0e789147a5354108ef45a59151de3d31237
push id37310
push userhiikezoe@mozilla-japan.org
push dateMon, 28 Nov 2016 10:41:52 +0000
reviewersbirtles
bugs1305325
milestone53.0a1
Bug 1305325 - Part 3: Make AnimationPropertyValueDetails::mValue optional. r?birtles MozReview-Commit-ID: H2fhRfC0Uoh
dom/animation/KeyframeEffectReadOnly.cpp
dom/webidl/KeyframeEffect.webidl
--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -795,21 +795,23 @@ static void
 CreatePropertyValue(nsCSSPropertyID aProperty,
                     float aOffset,
                     const Maybe<ComputedTimingFunction>& aTimingFunction,
                     const StyleAnimationValue& aValue,
                     AnimationPropertyValueDetails& aResult)
 {
   aResult.mOffset = aOffset;
 
-  nsString stringValue;
-  DebugOnly<bool> uncomputeResult =
-    StyleAnimationValue::UncomputeValue(aProperty, aValue, stringValue);
-  MOZ_ASSERT(uncomputeResult, "failed to uncompute value");
-  aResult.mValue = stringValue;
+  if (!aValue.IsNull()) {
+    nsString stringValue;
+    DebugOnly<bool> uncomputeResult =
+      StyleAnimationValue::UncomputeValue(aProperty, aValue, stringValue);
+    MOZ_ASSERT(uncomputeResult, "failed to uncompute value");
+    aResult.mValue.Construct(stringValue);
+  }
 
   if (aTimingFunction) {
     aResult.mEasing.Construct();
     aTimingFunction->AppendToString(aResult.mEasing.Value());
   } else {
     aResult.mEasing.Construct(NS_LITERAL_STRING("linear"));
   }
 
--- a/dom/webidl/KeyframeEffect.webidl
+++ b/dom/webidl/KeyframeEffect.webidl
@@ -40,17 +40,17 @@ interface KeyframeEffectReadOnly : Anima
   // We use object instead of ComputedKeyframe so that we can put the
   // property-value pairs on the object.
   [Throws] sequence<object> getKeyframes();
 };
 
 // Non-standard extensions
 dictionary AnimationPropertyValueDetails {
   required double             offset;
-  required DOMString          value;
+           DOMString          value;
            DOMString          easing;
   required CompositeOperation composite;
 };
 
 dictionary AnimationPropertyDetails {
   required DOMString                               property;
   required boolean                                 runningOnCompositor;
            DOMString                               warning;