Open tabatkins opened 5 months ago
Falling back to discrete makes sense to me. The spec text for this should likely go either in CSS Values under § 3. Combining Values where we define interpolation including handling out-of-range values, or in Web Animations under § 5.2 Animating Properties where we define discrete animation and how to choose a particular animation type.
Edit: Might it even be as simple as extending this sentence: "If the number of components or the types of corresponding components do not match, or if any component value uses discrete animation and the two corresponding values do not match, then the property values combine as discrete." ?
The CSS Working Group just discussed [css-animations] Handling values where endpoints are valid, but midpoints are IACVT
, and agreed to the following:
RESOLVED: if the interpolation endpoints are validly interpolable but the intermediate points are IACVT then we treat the entire interpolation as discrete
@tabatkins edited the calc-size-specific parts of this in 7d663053d15a1886a04c8d3b7523bca2a5fcf24c (and there's no longer any actual IACVT behavior there). I'm not sure if more general animations edits are needed here or not.
In #10220 we have a situation where the two endpoints of a
width
interpolation, say, might be large-but-validcalc-size()
functions, but the interpolation midpoints are invalid due to the calculation getting too large. I'm handling that "too large" case by saying the property becomes invalid-at-computed-value-time, since it's essentially the same issue as variable substitution, which can also become too large via billion-laugh attacks.This produces a new case that was previously not possible in animations, where two values are valid to interpolate, but their mid-interpolation value isn't valid. In Chrome's implementation, @dbaron isn't sure how to even handle that, and is currently instead doing something simpler.
How should we handle this? I'm inclined to say that the animation should fall back to discrete in this case, since the two endpoints are, by definition, valid.