Closed
Bug 771559
Opened 8 years ago
Closed 6 years ago
HTML's "valid floating point number" doesn't match ToDouble()
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Not set
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•6 years ago
|
||
I should be able to get what we want using StringToDoubleConverter, I think.
Assignee: nobody → jwatt
Assignee | ||
Comment 2•6 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•6 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•6 years ago
|
||
Attachment #8336809 -
Flags: review?(bugs)
Comment 5•6 years ago
|
||
Comment on attachment 8336809 [details] [diff] [review] patch Some test would be nice.
Attachment #8336809 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 6•6 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/836ee14f6a37
Comment 7•6 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/836ee14f6a37
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Updated•6 years ago
|
Whiteboard: [qa-]
You need to log in
before you can comment on or make changes to this bug.
Description
•