Brian Birtles 8f3566ea35 Bug 1402547 - Handle addition/interpolate of nsSMILCSSValueType objects when both objects are empty; r=hiro
In some rare cases we can end up with both arguments passed to
nsSMILCSSValueType::SandwichAdd being "empty", that is, having the type
nsSMILCSSValueType but a null pointer.

This can happen, for example, when we have a two by-animations and linear
interpolation causing us to pass the "empty" from-value up as the underlying
value from the first by-animation to the second by-animation (which it will try
to add with its empty from-value).

In this case the result of adding "empty" to "empty" should just be "empty"
which we achieve by just doing an early return (since the fallback behavior for
failed addition is to just use the second argument as the result; note that if
we return true though the result would also be the same).

We don't currently have a test case that produces this for interpolate but it
makes sense that trying to interpolate "empty" to "empty" should likewise fail
and just produce "empty". In this case failing will make us fall back to
discrete animation and just use the "empty" values as-is. Indicating failure,
however, has the additional effect of making us use the special keyTimes
behavior defined for discrete animation.

MozReview-Commit-ID: IZ5qg0Mk5Uy

--HG--
extra : rebase_source : 402e881cd8639885568e0a32fb49aa4dfa7cbbde
2017-10-02 14:03:53 +09:00
..