Re: [csswg-drafts] [css-values] Clarifying serialization of negative zero and expression simplification (#9750)

Right now, we only have the "normalized serialization" for inf/nan values when they emerge at the top-level. That is, if the *entire expression* simplifies to inf/nan, we serialize it in a specific way (rather than requiring more of the exact tree to be preserved).

This doesn't quite work the same here - if an entire expression simplifies to -0%, we'll just serialize it as `0%` (or `calc(0%)`, depending on the value stage). This issue is only about how to serialize a -0% that occurs *within* an expression, and which blocks simplification.

> Tab seemed to agree during the call, but it doesn't seem to be the case from

Dang it, I keep forgetting that that *does* work. In that case, then, I think the issue is indeed no-change. If an expression simplifies to -0%, and this blocks further simplification, then you can simply serialize it as such.

So, yes, `max(1% / -infinity, 0%)` should serialize as `max(-0%, 0%)` (until the % is resolveable, at which point you do know which is larger and can simplify the `max()`).

I think I (a) will add a note to the spec explicitlly calling out that -0/etc does work in a calculation, so I stop forgetting, and (b) add a test for this case.

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


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

Received on Wednesday, 28 February 2024 18:03:21 UTC