-
Notifications
You must be signed in to change notification settings - Fork 756
Description
According to https://drafts.csswg.org/cssom/#serializing-css-values:
A base-ten number using digits 0-9 (U+0030 to U+0039) in the shortest form possible, using "." to separate decimals (if any), rounding the value if necessary to not produce more than 6 decimals, preceded by "-" (U+002D) if it is negative.
Note: scientific notation is not used.
However, what should this return? (see https://jsfiddle.net/ko5k3uxx/1/)
div.style.opacity = "1e-8";
div.style.opacity;
In Firefox, the answer is 1e-8; in Chrome, 1e-08; and in Edge, 1e-008. Clearly, scientific notation is being used, but even if it wasn't, the correct answer per the spec would probably be 0, if I read that text correctly (it should probably be reworded, as "decimals" is slightly unclear -- I assume it means "numbers after the decimal point"). However, this wouldn't round trip the value.