Re: [csswg-drafts] [cssom] Serialize numbers using scientific notation? (#8538)

The CSS Working Group just discussed `[cssom] Serialize numbers using scientific notation?`, and agreed to the following:

* `RESOLVED: Accept proposal to match JS scinot serialization triggers, other than 6-digit decimal truncation rule`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> TabAtkins: our rules for serializing numbers are reasonably well-defined<br>
&lt;fantasai> TabAtkins: But we have scientific notation now, which is widely implemented<br>
&lt;fantasai> TabAtkins: Browsers use it for serialization *sometimes*, inconsistent, depends on the property...<br>
&lt;fantasai> TabAtkins: So the proposal here is to formalize when we serialize as scinot<br>
&lt;fantasai> TabAtkins: My proposal is to match JS exactly, which means that you use scinot whenever either the number has 22 or more digits of integer value, or has 6 or more leading zeroes in its decimal portion and is zero integer<br>
&lt;fantasai> TabAtkins: only change from JS is that we continue to truncate to only 6 digits after decimal point, maximum<br>
&lt;fantasai> TabAtkins: this is required for compat<br>
&lt;fantasai> TabAtkins: and also it hides some differences between browsers/properties<br>
&lt;fantasai> TabAtkins: and it also hides some floating-point variances<br>
&lt;fantasai> TabAtkins: so there's spec text in the issue<br>
&lt;fantasai> TabAtkins: and that's it<br>
&lt;bkardell_> do we have numbers that big?<br>
&lt;fantasai> TabAtkins: Wrt interop, we're all over the place<br>
&lt;fantasai> TabAtkins: every property and every browser does an effectively random thing<br>
&lt;fantasai> TabAtkins: partially due to different levels of precision, e.g. width supports subpixel, but scale property supports ...<br>
&lt;fantasai> TabAtkins: e.g. Chrome start scinot at 0.0001<br>
&lt;fantasai> TabAtkins: So no interop, so match JS with wrinkle about 6 digits seems reasonable to do with minimal impact on authors<br>
&lt;fantasai> Rossen_: Any additional comments?<br>
&lt;fantasai> TabAtkins: dbaron's point was to bias towards older formats during serialization<br>
&lt;fantasai> ... that's part of why the bounds are so wide<br>
&lt;fantasai> ... Most numbers you will ever encounter in a stylesheet do not trigger scinot<br>
&lt;fantasai> TabAtkins: but outside those bounds, e.g. when serializing a transform matrix, need to serialize somehow<br>
&lt;fantasai> Rossen_: Pretty clear proposal, not seeing anyone rushing to the queue ...<br>
&lt;fantasai> ... any objections to the proposal?<br>
&lt;fantasai> RESOLVED: Accept proposal to match JS scinot serialization triggers, other than 6-digit decimal truncation rule<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8538#issuecomment-1523755872 using your GitHub account


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

Received on Wednesday, 26 April 2023 16:56:08 UTC