Bug 55988

Summary: input type=email is too strict
Product: WebKit Reporter: Nathan Samson <nathansamson+webkit>
Component: FormsAssignee: Kent Tamura <tkent>
Status: RESOLVED FIXED    
Severity: Normal CC: cmarcelo, commit-queue, dglazkov, morrita, tkent
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Bug Depends on:    
Bug Blocks: 19264    
Attachments:
Description Flags
Patch none

Description Nathan Samson 2011-03-08 17:27:54 PST
Example document (extract)

<form>
<input type="email" name="email" />
<input type="submit" label="Submit" />
</form>

When typing in the input field: "nathan@psi" and submitting the form a popup/tooltip appears with the text: "Enter an email" (manually translated from dutch, the correct english sentence will probably be different).
The text message is compliant with the spec (a valid email should be entered), but this is exactly what I did, so it shouldn't complain.

This happens in Chrome 10 (10.0.648.127, windows) and Chrome 11 (11.0.695.0, linux), but NOT in chrome 9 (9.0.597.107, linux).
It works in firefox 4, and it should work as I see the spec. Also it says what you should do, but the check itself seems to be incorrect. (@psi is a valid domainname, its the name of my computer, the site where it is hosted is also @psi, so it should be able to contact it).
Comment 1 Kent Tamura 2011-03-09 01:05:49 PST
Actually, the W3C HTML5 says:
http://www.w3.org/TR/html5/states-of-the-type-attribute.html#valid-e-mail-address
> A valid e-mail address is a string that matches the ABNF production 1*( atext / "." ) "@" ldh-str 1*( "." ldh-str )

and WHATWG HTML says:
http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address
> A valid e-mail address is a string that matches the ABNF production 1*( atext / "." ) "@" ldh-str *( "." ldh-str )

I think the WHATWG definition was changed recently.
The current WebKit implementation is based on the W3C HTML5 specification, which rejects "nathan@psi".  We should update the implementation for the WHATWG definition.
Comment 2 Kent Tamura 2011-05-11 04:10:29 PDT
Created attachment 93103 [details]
Patch
Comment 3 WebKit Commit Bot 2011-05-11 18:18:24 PDT
Comment on attachment 93103 [details]
Patch

Clearing flags on attachment: 93103

Committed r86298: <http://trac.webkit.org/changeset/86298>
Comment 4 WebKit Commit Bot 2011-05-11 18:18:29 PDT
All reviewed patches have been landed.  Closing bug.