Re: [csswg-drafts] [css-color-4] Computed value and serialization of `Infinity` and `NaN` in color functions (#8629)

  > I have no idea how `NaN` should be handled, so I skipped that for now.

If I am not mistaken, only nested math functions (unresolved before computed value) can produce `NaN`: `calc(min(1em, 0px / 0) + 1px)` would serialize to `calc(1px + min(1em, NaN * 1px))` as a specified value.

  > If a top-level calculation (a math function not nested inside of another math function) would produce a value whose numeric part is `NaN`, it instead act as though the numeric part is `0`.

https://drafts.csswg.org/css-values-4/#top-level-calculation

I think your tests should serialize `Infinity` to lowercase.

  > As usual for CSS keywords, these are ASCII case-insensitive. Thus, `calc(InFiNiTy)` is perfectly valid. However, `NaN` must be serialized with this canonical casing.

https://drafts.csswg.org/css-values-4/#calc-error-constants

Hope it helps. =)

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


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

Received on Wednesday, 22 March 2023 13:17:40 UTC