[Webkit-unassigned] [Bug 218880] Serialize CSS <number> values with rounding, limited decimal precision, and no exponents per-spec

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


https://bugs.webkit.org/show_bug.cgi?id=218880

Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |darin at apple.com
 Attachment #414235|review?                     |review-
              Flags|                            |

--- 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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20201116/545fa279/attachment-0001.htm>


More information about the webkit-unassigned mailing list