On Mon, Jan 24, 2011 at 8:51 PM, Brion Vibber brion@pobox.com wrote:
So from the August 2009 survey on English Wikipedia, that leaves 18 email addresses out of over 3 million listed as confirmed, of which a few *might* be deliverable addresses that could not be fixed by the user tweaking them during input (ie, they actually rely on those extra chars being there in order to be delivered to the right person).
But note that I counted only the worsening of false negatives, not the improvement in false positives -- I only looked at confirmed addresses. It seems likely that a vastly larger number of undeliverable addresses would be rejected at an early stage with the more restrictive check, allowing users to correct them before submitting so that the e-mail doesn't get lost in the ether. So it seems like a clear improvement overall.
However, the code should probably at least strip whitespace (including internal whitespace, not just trailing/leading) onkeypress/oninput/onsubmit or such. This came up in something like 0.1% of the sample. Non-techy users would probably get pretty confused by a trailing space messing the whole thing up.
I suggest that for Firefox 4, we shortcut the JavaScript logic and just use type=email. It's pretty nicely designed. Here's a test case (this is a URL, just paste all the lines in Firefox 4's URL bar):
data:text/html,<form><input type=email name=email placeholder=E-mail> <br><input placeholder="Some other input"><br><input type=submit></form>
Firefox 4b9 seems not to implement the latest spec update, so foo@localhost doesn't work, but that should be an easy fix. If someone is willing to poke at their source code, I imagine it'd be possible to get the updated check in the final release. Unfortunately, WebKit's form constraint validation implementation is broken all over the place, and Opera's is pretty ugly (like only checking validity onsubmit), so we should probably blacklist them if we use any form validation features.