Closed
Bug 771559
Opened 13 years ago
Closed 12 years ago
HTML's "valid floating point number" doesn't match ToDouble()
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla28
People
(Reporter: mounir, Assigned: jwatt)
References
()
Details
(Whiteboard: [qa-])
Attachments
(1 file)
1.16 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
See:
http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#valid-floating-point-number
I haven't checked more deeply than that but it seems at least that we allow stuff like "+22" while HTML algorithm refuses it.
FWIW, Webkit and Presto are following the specs.
![]() |
Assignee | |
Comment 1•12 years ago
|
||
I should be able to get what we want using StringToDoubleConverter, I think.
Assignee: nobody → jwatt
![]() |
Assignee | |
Comment 2•12 years ago
|
||
Interesting thread on HTML vs. JS number parsing:
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-August/thread.html#32792
![]() |
Assignee | |
Comment 3•12 years ago
|
||
(In reply to Jonathan Watt [:jwatt] from comment #1)
> I should be able to get what we want using StringToDoubleConverter, I think.
Actually, no. We now have webcore's Decimal class and, like for NS_FORM_INPUT_RANGE, we should use HTMLInputElement::ConvertStringToNumber, which uses webcore's Decimal::fromString, which Google has written to conform to the HTML5's rules for a "valid floating point number":
https://mxr.mozilla.org/mozilla-central/source/mfbt/decimal/Decimal.h?mark=165-172&rev=a296036e608f#165
![]() |
Assignee | |
Comment 4•12 years ago
|
||
Attachment #8336809 -
Flags: review?(bugs)
Comment 5•12 years ago
|
||
Comment on attachment 8336809 [details] [diff] [review]
patch
Some test would be nice.
Attachment #8336809 -
Flags: review?(bugs) → review+
![]() |
Assignee | |
Comment 6•12 years ago
|
||
Comment 7•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Updated•12 years ago
|
Whiteboard: [qa-]
You need to log in
before you can comment on or make changes to this bug.
Description
•