Numbers in cssom attributes should not use scientific notification |
||||||
Issue description
Steps to reproduce the problem:
1. set "1000000px" height (or larger) for an element. For example:
document.body.style.height = "1000988px";
2. get this value For example:
document.body.style.height
What is the expected behavior?
The value of element.style.height will be the same as set ("1000988px")
What went wrong?
The value is "1.00099e+06px"
In the "Serializing CSS Values" section of the cssom spec, it says "Note: scientific notation is not used."
https://drafts.csswg.org/cssom/#serializing-css-values
,
Jun 16 2017
Firefox (v54.0, 64bits) 1000988px => document.body.style.height=1000990px 10009888px => document.body.style.height=1.00099e+7px IE11 (v11.0.42) 1000988px => document.body.style.height=1000988px 10009888px => document.body.style.height=10009888px 100098888px => document.body.style.height=21474836.47px Firefox also uses scientific notification, but IE does not.
,
Jun 22 2017
Yeah, serializing to scinot loses precision, and actually changes the meaning in some circumstances - currently, scinot is defined to make it parse as a <number>, not an <integer>. (This doesn't matter for dimensions.) We should fix this.
,
Oct 12 2017
I can take this on
,
Dec 6 2017
,
Jan 8 2018
,
Jan 8
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jan 10
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by ericwilligers@chromium.org
, May 12 2017