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

The CSS Working Group just discussed `[css-values] Clarifying serialization of negative zero and expression simplification`, and agreed to the following:

* `RESOLVED: Allow the modulus parameter to be optional in the case of rounding numbers and default to 1.`
* `RESOLVED: -0% serializes to a normalized form`

<details><summary>The full IRC log of that discussion</summary>
&lt;Frances> RESOLVED: Allow the modulus parameter to be optional in the case of rounding numbers and default to 1.<br>
&lt;Frances> Tab: Track positive 0 and negative 0 separately, could result in different infinities in separate cases. We mostly separate this away. Could become an unsigned 0.<br>
&lt;Frances> Tab: One case where it isn't true if the 0 is a percentage so could be positive or negative in +0% and -0%. How important is this? We could just stick with the spec to imply need to verify if clear, and care about percentages and simplify.<br>
&lt;TabAtkins> max(0%, -0%) (or min(), or clamp())<br>
&lt;Frances> Alan: Can we see if the spec is clear, does the spec talk enough about positive and negative percentages?<br>
&lt;Frances> Tab: Would have to keep the max function with both arguments, carefully threading a few arguments.<br>
&lt;Frances> David: If the goal is serialization round tripping, we don't parse negative 0 into a negative 0.<br>
&lt;TabAtkins> min(1% / -infinity, 0%)<br>
&lt;Frances> Tab: If writing a solution similar to it, would still have to parse in the current semantics.<br>
&lt;Frances> Tab: Currently it should require both arguments to be preserved.<br>
&lt;emilio> theq+<br>
&lt;emilio> err<br>
&lt;emilio> q+<br>
&lt;astearns> ack emilio<br>
&lt;Frances> Emilio: Preserving the original syntax, we need to serialize it to something else. Infinity basically normalized the serialization, we don't preserve the actual author documentation.<br>
&lt;Frances> Tab: Not a problem to simplify more aggressively in the use case in it does not matter.<br>
&lt;Frances> Alan: Write tests for the spec based on the test production.<br>
&lt;Frances> Emilio: Could become a complicated code path, serializing -0%, and draw a calc tree.<br>
&lt;TabAtkins> happy to figure out how to normalize such an expression, at minimum<br>
&lt;Frances> Alan: Any other concerns?<br>
&lt;Frances> David: Like the idea of trying to keep it simple for a use case.<br>
&lt;dbaron> s/David:/dbaron: Not really an implementor as far as this code is concerned, but I/<br>
&lt;dbaron> s/a use case/something without much of a use case/<br>
&lt;Frances> Tab: We can resolve to at minimum serialize in case of a complex tree.<br>
&lt;Frances> PROPOSAL: -0% serializes to a normalized form<br>
&lt;Frances> RESOLVED: -0% serializes to a normalized form<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9750#issuecomment-1969513980 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 17:42:41 UTC