mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-03 23:30:46 +00:00

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