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)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: mounir, Assigned: jwatt)

References

()

Details

(Whiteboard: [qa-])

Attachments

(1 file)

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.
I should be able to get what we want using StringToDoubleConverter, I think.
Assignee: nobody → jwatt
(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
Attached patch patchSplinter Review
Attachment #8336809 - Flags: review?(bugs)
Comment on attachment 8336809 [details] [diff] [review] patch Some test would be nice.
Attachment #8336809 - Flags: review?(bugs) → review+
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: