Re: [csswg-drafts] [css-values-4] Validity of generic interpolation function mix() (#6700)

It can't be used as a lower-level syntax, unfortunately.

We have to be able to tell, at parse-time, what the type of the function is, and do so *without* clever grammar manipulation (because browsers don't have powerful-enough grammar handling tools right now, and have no plans to add such). That is, any attempt to define their parse-time validity as something like "sub it and see if it works" is a no-go. I tried that with `var()` fallback values and had to back it out, because when you had two or more var() functions they can interact in complex ways and you have exponential checking possibilities.

The existing mixing functions are fine in this regard - math functions define precisely how to determine their type, cross-fade() is an `<image>`, color-mix() is a `<color>`.

This is also important because we have to know *how* to interpolate the values; a bare "red" as one of the values *might* be a color keyword and want to be interpolated "as `<color>`", but we can't know that for certain without the clever grammar manipulation (putting it in, parsing the property, and seeing what component it gets assigned to).

Whole-property values are fine, because their interpolation type is just "the property it's being used in".

So, any low-level interpolation function *must* be type-specific and clearly advertise its type at parse-time in some manner.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6700#issuecomment-931724942 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 30 September 2021 21:40:16 UTC