Closed
Bug 1370779
Opened 7 years ago
Closed 7 years ago
stylo: percentages serialized with some float "rounding errors"
Categories
(Core :: CSS Parsing and Computation, defect, P2)
Tracking
()
RESOLVED
FIXED
mozilla57
Tracking | Status | |
---|---|---|
firefox-esr52 | --- | unaffected |
firefox55 | --- | unaffected |
firefox56 | --- | wontfix |
firefox57 | --- | fixed |
People
(Reporter: bzbarsky, Assigned: xidorn)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
(deleted),
text/html
|
Details |
Consider the attached testcase. In Gecko, the two percentages on each line are the same. In stylo, the following lines have them different:
15% 15.000001%;
27% 27.000002%;
30% 30.000002%;
53% 52.999996%;
54% 54.000004%;
59% 58.999996%;
60% 60.000004%;
This was caught by some mochitests. Specifically, this causes dom/base/test/test_bug338679.html to fail. Good thing it happened to use "15" as the value...
If I had to guess, servo is taking floats, converting to double, then serializing the double.
Reporter | ||
Comment 1•7 years ago
|
||
Actually, looks like Gecko just asks the float-to-string machinery to produce 6 decimal digits of precision, rounding the last one; this is the general behavior of nsTSubstring_CharT::AppendFloat (the version that takes 32-bit floats). The errors above are all in the 8th digit, so they get rounded away.
Reporter | ||
Comment 2•7 years ago
|
||
Updated•7 years ago
|
Priority: -- → P2
Assignee | ||
Updated•7 years ago
|
Blocks: stylo-mochitest
Assignee | ||
Comment 3•7 years ago
|
||
A potential fix at https://github.com/servo/rust-cssparser/pull/173
Updated•7 years ago
|
Priority: P2 → --
Reporter | ||
Updated•7 years ago
|
Priority: -- → P3
Assignee | ||
Comment 4•7 years ago
|
||
This seems to affect several tests, so bump to P2.
Assignee: nobody → xidorn+moz
Priority: P3 → P2
Updated•7 years ago
|
No longer blocks: stylo-mochitest-crashes
status-firefox55:
--- → unaffected
status-firefox56:
--- → wontfix
status-firefox57:
--- → affected
status-firefox-esr52:
--- → unaffected
Pushed by xquan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a203d42085ea
Bump version of cssparser.
Pushed by xquan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/04080bc695e3
followup - Bump version of cssparser again to 0.19.4.
Pushed by xquan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e16dba457260
followup 2 - Downgrade cssparser to 0.19.2.
Pushed by xquan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6b0ed8c31532
followup 3 - Update several web-platform test expectation.
Comment 9•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a203d42085ea
https://hg.mozilla.org/mozilla-central/rev/04080bc695e3
https://hg.mozilla.org/mozilla-central/rev/e16dba457260
https://hg.mozilla.org/mozilla-central/rev/6b0ed8c31532
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Updated•2 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•