Bug 1305325 - Part 3: Make AnimationPropertyValueDetails::mValue optional. r?birtles,smaug
MozReview-Commit-ID: H2fhRfC0Uoh
--- 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;