[webkit-reviews] review denied: [Bug 218880] Serialize CSS <number> values with rounding, limited decimal precision, and no exponents per-spec : [Attachment 414235] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 16 10:36:00 PST 2020


Darin Adler <darin at apple.com> has denied Tyler Wilcock
<twilco.o at protonmail.com>'s request for review:
Bug 218880: Serialize CSS <number> values with rounding, limited decimal
precision, and no exponents per-spec
https://bugs.webkit.org/show_bug.cgi?id=218880

Attachment 414235: Patch

https://bugs.webkit.org/attachment.cgi?id=414235&action=review




--- Comment #9 from Darin Adler <darin at apple.com> ---
Comment on attachment 414235
  --> https://bugs.webkit.org/attachment.cgi?id=414235
Patch

Thank you for tackling this!

While it’s great to have all these progressions, this takes the wrong basic
approach. Fixed-width serialization that truncates trailing zeros is *not*
shortest form serialization. Shortest form serialization is
String::number(double) and String::number(float), not
String::numberToStringFixedWidth.

The problems with serialization come from the fact that things are processed as
float, then converted to double, then serialized with shortest form. The way to
do this correctly for things that are float is to keep them as float, and not
convert to double before serializing.


More information about the webkit-reviews mailing list