Bug 53744 - Number type input cannot be set to empty string if it has an initial value
Summary: Number type input cannot be set to empty string if it has an initial value
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Kent Tamura
URL: http://code.google.com/p/chromium/iss...
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-03 17:32 PST by Kent Tamura
Modified: 2011-02-28 17:54 PST (History)
2 users (show)

See Also:


Attachments
Patch (5.61 KB, patch)
2011-02-03 17:39 PST, Kent Tamura
no flags Details | Formatted Diff | Diff
Patch 2 (5.60 KB, patch)
2011-02-28 16:33 PST, Kent Tamura
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Tamura 2011-02-03 17:32:10 PST
Number type input cannot be set to empty string if it has an initial value
Comment 1 Kent Tamura 2011-02-03 17:39:24 PST
Created attachment 81158 [details]
Patch
Comment 2 Kent Tamura 2011-02-28 16:33:55 PST
Created attachment 84148 [details]
Patch 2

Rebased
Comment 3 Darin Adler 2011-02-28 16:37:57 PST
Comment on attachment 84148 [details]
Patch 2

View in context: https://bugs.webkit.org/attachment.cgi?id=84148&action=review

> Source/WebCore/dom/InputElement.h:120
> +    // represents the emtpy value.

Typo here, “empty”.

> Source/WebCore/html/NumberInputType.cpp:281
> +    return parseToDoubleForNumberType(proposedValue, 0) ? proposedValue : String("");

It’s more efficient to use emptyAtom here instead of String("").
Comment 4 Kent Tamura 2011-02-28 17:53:51 PST
Comment on attachment 84148 [details]
Patch 2

View in context: https://bugs.webkit.org/attachment.cgi?id=84148&action=review

Thank you for reviewing!

Landed as http://trac.webkit.org/changeset/79954 with the following fixes.

>> Source/WebCore/dom/InputElement.h:120
>> +    // represents the emtpy value.
> 
> Typo here, “empty”.

Fixed.

>> Source/WebCore/html/NumberInputType.cpp:281
>> +    return parseToDoubleForNumberType(proposedValue, 0) ? proposedValue : String("");
> 
> It’s more efficient to use emptyAtom here instead of String("").

Fixed.