Bug 34209

Summary: rangeOverflow/rangeUnderflow support for type=date
Product: WebKit Reporter: Kent Tamura <tkent>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#date-state
Bug Depends on:    
Bug Blocks: 29070    
Attachments:
Description Flags
Proposed patch darin: review+

Description Kent Tamura 2010-01-27 02:44:53 PST
rangeOverflow/rangeUnderflow flags of ValidityState support for <input type=date>.
Comment 1 Kent Tamura 2010-01-27 02:55:39 PST
Created attachment 47513 [details]
Proposed patch
Comment 2 Darin Adler 2010-01-27 15:47:04 PST
Comment on attachment 47513 [details]
Proposed patch

> +    // Parses the src for the current type, and return the double
> +    // value for the parsing result if the parsing succeeds; Returns
> +    // defaultValue otherwise. This function can return NaN or
> +    // Infinity only if defaultValue is NaN or Infinity.
> +    double doubleValueFor(const String& src, double defaultValue) const;

If you think that the argument name is really needed, then please use the word "source" instead of the abbreviation "src". I think you can omit the argument name.

Might be nicer if this function name made it clearer it was a string parser. I'm not sure "double value for <xxx>" implies parsing.
Comment 3 Kent Tamura 2010-01-27 23:33:30 PST
(In reply to comment #2)
> If you think that the argument name is really needed, then please use the word
> "source" instead of the abbreviation "src". I think you can omit the argument
> name.

I removed "src" and changed the wording.

> Might be nicer if this function name made it clearer it was a string parser.
> I'm not sure "double value for <xxx>" implies parsing.

Renamed to parseToDouble().

Landed as r53975.