W3C home > Mailing lists > Public > public-css-archive@w3.org > July 2021

[csswg-drafts] [cssom] Serialization of large numbers should use scientific notation (#6471)

From: achristensen07 via GitHub <sysbot+gh@w3.org>
Date: Fri, 23 Jul 2021 01:38:54 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-951179283-1627004333-sysbot+gh@w3.org>
achristensen07 has just created a new issue for https://github.com/w3c/csswg-drafts:

== [cssom] Serialization of large numbers should use scientific notation ==
https://drafts.csswg.org/cssom/#serialize-a-css-component-value in the <number> section has a note that says "scientific notation is not used."  While this makes sense for small values so we serialize "0" instead of "6.123233995736766e-17" and this matches the behavior of Chrome and Firefox and I'm looking into implementing this in WebKit, for large numbers all browsers do use scientific notation, as illustrated by this simple example:
```
<body onload='checkLargeValues()'>
<script>
function checkLargeValues() {
    let target = document.getElementById('p');
    target.style['line-height'] = 1e+26;
    alert(window.getComputedStyle(target)['line-height'])
}
</script>
<p id="p"></p>
</body>
```
The phrase "in the shortest form possible" is already in the text, which suggests to me that multiple forms are possible.  I suggest the note be clarified to say something like "scientific notation is not used with negative exponents."

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6471 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 23 July 2021 01:38:56 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:39 UTC