Bug 43973

Summary: <input type=number> should not have an invalid number as its value
Product: WebKit Reporter: Kent Tamura <tkent>
Component: FormsAssignee: Kent Tamura <tkent>
Status: RESOLVED FIXED    
Severity: Normal CC: adele, darin, dglazkov
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 37024, 42484, 45376    
Attachments:
Description Flags
Patch
none
Patch 2 (rebased)
none
Patch 3 none

Description Kent Tamura 2010-08-13 08:17:20 PDT
Making <input type=number> conformable to the current HTML5 spec.
Discussed at http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-August/027896.html
Comment 1 Kent Tamura 2010-08-13 08:35:14 PDT
Created attachment 64346 [details]
Patch
Comment 2 Kent Tamura 2010-08-30 02:11:35 PDT
Created attachment 65892 [details]
Patch 2 (rebased)
Comment 3 Dimitri Glazkov (Google) 2010-09-01 09:22:00 PDT
Comment on attachment 65892 [details]
Patch 2 (rebased)

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

> WebCore/dom/InputElement.h:64
> +    virtual bool isCommittableValue(const String&) const = 0;
How about isAcceptableValue? Committable seems unclear.

> WebCore/rendering/RenderTextControlSingleLine.cpp:681
> +        else if (!node()->isHTMLElement() || !static_cast<HTMLInputElement*>(node())->formControlValueMatchesRenderer())
What does this check mean?
Comment 4 Kent Tamura 2010-09-02 03:01:36 PDT
Created attachment 66343 [details]
Patch 3
Comment 5 Kent Tamura 2010-09-02 03:03:48 PDT
Thank you for reviewing!

(In reply to comment #3)
> > WebCore/dom/InputElement.h:64
> > +    virtual bool isCommittableValue(const String&) const = 0;
> How about isAcceptableValue? Committable seems unclear.

Done.

> > WebCore/rendering/RenderTextControlSingleLine.cpp:681
> > +        else if (!node()->isHTMLElement() || !static_cast<HTMLInputElement*>(node())->formControlValueMatchesRenderer())
> What does this check mean?

Good catch.  This was experimental code for localized numbers and is not needed at this moment. I removed it.
Comment 6 Dimitri Glazkov (Google) 2010-09-02 07:29:06 PDT
Comment on attachment 66343 [details]
Patch 3

yay, team!
Comment 7 Kent Tamura 2010-09-09 21:49:19 PDT
Comment on attachment 66343 [details]
Patch 3

Clearing flags on attachment: 66343

Committed r67164: <http://trac.webkit.org/changeset/67164>
Comment 8 Kent Tamura 2010-09-09 21:49:28 PDT
All reviewed patches have been landed.  Closing bug.