Bug 1305325 - Part 5: Make AnimationPropertyValueDetails::mValue optional. r?birtles draft
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Wed, 16 Nov 2016 06:30:57 +0900
changeset 439346 9ae1c012e8ec11e86400e1aee459d5f485b59795
parent 439345 4cc2227bcfb545ff98adb9758ae68f6ea0e36f3e
child 439347 40f542cf7e731a391c29881f1a960b54ea46f8a3
push id35977
push userhiikezoe@mozilla-japan.org
push dateTue, 15 Nov 2016 21:34:46 +0000
reviewersbirtles
bugs1305325
milestone53.0a1
Bug 1305325 - Part 5: Make AnimationPropertyValueDetails::mValue optional. r?birtles MozReview-Commit-ID: AjSfaUHerqL
dom/animation/KeyframeEffectReadOnly.cpp
dom/webidl/KeyframeEffect.webidl
--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -803,21 +803,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;