Bug 92495
| Summary: | Change HTMLInputElement::setValueAsNumber to throw NOT_SUPPORTED_ERR only when the given value is NaN | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Kwang Yul Seo <skyul> |
| Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED INVALID | ||
| Severity: | Normal | ||
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Kwang Yul Seo
Currently, HTMLInputElement::setValueAsNumber throws NOT_SUPPORTED_ERR if newValue is infinity. This behavior is wrong because infinity is a valid number. Each input type additionally checks if the number is infinity or not. For example, NumberInputType::setValueAsDouble compares newValue to +floatMax and -floatMax and throws INVALID_STATE_ERR.
Changed HTMLInputElement::setValueAsNumber to check isnan(newValue) instead of !isfinite(newValue).
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Kwang Yul Seo
Oops. I found the following note from the HTML5 spec:
The Infinity and Not-a-Number (NaN) values are not valid floating-point numbers.