Closed
Bug 825009
Opened 12 years ago
Closed 12 years ago
Handles NaN and Infinity passed to .valueAsNumber
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla20
People
(Reporter: mounir, Unassigned)
References
Details
(Keywords: doc-bug-filed)
Attachments
(1 file)
5.92 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
.valueAsNumber = NaN should set the value to ""
.valueAsNumber = +/-Infinity should throw a TypeError. For the moment we can't throw that so we are just throwing another error.
Attachment #696069 -
Flags: review?(bugs)
Reporter | ||
Comment 1•12 years ago
|
||
W3C bug regarding the change: https://www.w3.org/Bugs/Public/show_bug.cgi?id=20496
Comment 2•12 years ago
|
||
Did you consider using NS_ENSURE_FINITE from nsContentUtils.h?
Comment 3•12 years ago
|
||
Comment on attachment 696069 [details] [diff] [review]
Patch
Since rest of the form element code uses MOZ_DOUBLE_* better to use it here too.
However, we need to make DOM code to use only one style of NAN macros.
A followup bug would be good.
// "" is being converted to 0.
s/being//
Add a todo for TypeError.
Attachment #696069 -
Flags: review?(bugs) → review+
Reporter | ||
Comment 4•12 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #3)
> Comment on attachment 696069 [details] [diff] [review]
> Patch
>
> Since rest of the form element code uses MOZ_DOUBLE_* better to use it here
> too.
> However, we need to make DOM code to use only one style of NAN macros.
> A followup bug would be good.
bug 825200
> Add a todo for TypeError.
There is a todo but that wasn't pointing to a bug. There is now bug 825197.
Reporter | ||
Comment 5•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Reporter | ||
Updated•12 years ago
|
Keywords: dev-doc-needed
You need to log in
before you can comment on or make changes to this bug.
Description
•