Bug 1305325 - Part 3: Make AnimationPropertyValueDetails::mValue optional. r=birtles,smaug
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Sun, 04 Dec 2016 08:07:39 +0900
changeset 325225 b49d2c0ee616b893ab13518babfb9cdaa825d959
parent 325224 e1933856b6701f080c4c79d993a9bad43bc350b6
child 325226 a0406b8c234e82e4b2f983a7f01606a87d798079
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersbirtles, smaug
bugs1305325
milestone53.0a1
Bug 1305325 - Part 3: Make AnimationPropertyValueDetails::mValue optional. r=birtles,smaug 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;