Closed
Bug 470769
Opened 16 years ago
Closed 10 years ago
computed styles for integer-valued properties are printed in scientific (exponential) notation
Categories
(Core :: DOM: CSS Object Model, defect, P4)
Core
DOM: CSS Object Model
Tracking
()
RESOLVED
FIXED
mozilla31
People
(Reporter: dbaron, Assigned: dbaron)
References
Details
Attachments
(2 files)
5.27 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
6.20 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
Computed styles for integer-valued properties are incorrectly printed in scientific (exponential) notation. This patch fixes the problem by using doubles instead of floats so that we can accurately represent the full range of 32-bit unsigned and signed integers and thus round-trip them correctly. We probably ought to switch to storing integers at some point, but this removes the practical problems with not doing so. We probably also ought to ensure we never serialize to scientific notation... (I originally put this patch in bug 373875, but that's a different bug.)
Attachment #354169 -
Flags: superreview?(bzbarsky)
Attachment #354169 -
Flags: review?(bzbarsky)
Updated•16 years ago
|
Attachment #354169 -
Flags: superreview?(bzbarsky)
Attachment #354169 -
Flags: superreview+
Attachment #354169 -
Flags: review?(bzbarsky)
Attachment #354169 -
Flags: review+
Comment 1•16 years ago
|
||
Comment on attachment 354169 [details] [diff] [review] patch We could just make the float setters take a double instead of casting. With that change, r+sr=bzbarsky
Assignee | ||
Comment 2•16 years ago
|
||
I don't think any of the casts here are actually needed; I just put them in for clarity. So I'm not sure exactly what change you wanted..
Comment 3•16 years ago
|
||
I was thinking of the |void SetNumber(float aValue)| and SetPercent setters, but I'm fine with just leaving those as-is.
Assignee | ||
Comment 4•16 years ago
|
||
Landed: http://hg.mozilla.org/mozilla-central/rev/441f119f1a0c and then backed out: http://hg.mozilla.org/mozilla-central/rev/e0740bbd7f75 http://hg.mozilla.org/mozilla-central/rev/3fdd6aaa25f1
Assignee | ||
Comment 5•16 years ago
|
||
I relanded the test: http://hg.mozilla.org/mozilla-central/rev/82fd9752b6e1
Assignee | ||
Updated•16 years ago
|
Assignee: dbaron → nobody
Assignee | ||
Updated•16 years ago
|
Status: ASSIGNED → NEW
Comment 6•15 years ago
|
||
Is there a time table for this issue to be fixed?
Assignee | ||
Comment 7•15 years ago
|
||
No. Did you actually hit it in a real Web page?
Comment 8•15 years ago
|
||
Yes. We are using a JS library that is creating a "grid" widget with a scroll bar. The library tries to size the scroll bar appropriately based on the number of entries in the data store. The library sets the height of the scroll bar widget to be 40671324px which firefox then converts to 4.06713e+7px
Assignee | ||
Comment 9•15 years ago
|
||
That's not this bug; this bug is about integer-valued properties, not length-valued properties.
Assignee | ||
Comment 10•15 years ago
|
||
In fact, it's bug 373875, which is mentioned in comment 0 of this bug.
Comment 11•15 years ago
|
||
Sorry for the confusion, I will move my discussion there.
Assignee | ||
Comment 12•15 years ago
|
||
Since I never mentioned it before: the reason this had to be backed out was a significant number of test failures of the form: failed | -moz-border-radius-topleft of radius4 - got "10.0000001490116%", expected "10%" because we were converting float to double and then serializing as double.
Assignee | ||
Updated•10 years ago
|
Component: CSS Parsing and Computation → DOM: CSS Object Model
Priority: -- → P4
Assignee | ||
Comment 17•10 years ago
|
||
I'll write a less risky patch for this.
Assignee | ||
Comment 18•10 years ago
|
||
Attachment #8398857 -
Flags: review?(bzbarsky)
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → dbaron
Status: NEW → ASSIGNED
Comment 19•10 years ago
|
||
Comment on attachment 8398857 [details] [diff] [review] Store computed styles of integer-valued properties as integers in nsROCSSPrimitiveValue, so they round-trip correctly r=me. Thank you for doing this!
Attachment #8398857 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 20•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/b5323125a871
Flags: in-testsuite+
Comment 21•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/b5323125a871
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in
before you can comment on or make changes to this bug.
Description
•