Last Comment Bug 726758 - <input type=email> validation fails on addresses with whitespace at beginning or end
: <input type=email> validation fails on addresses with whitespace at beginning...
Status: RESOLVED INVALID
:
Product: Firefox
Classification: Client Software
Component: Untriaged (show other bugs)
: 13 Branch
: x86 Mac OS X
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-13 13:32 PST by Matt Parlane
Modified: 2012-02-13 14:02 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description User image Matt Parlane 2012-02-13 13:32:19 PST
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0a1) Gecko/20120210 Firefox/13.0a1
Build ID: 20120210040207

Steps to reproduce:

A document with simply these lines:

<!doctype html>
<input type=email>

does not allow an email address with a space at either the beginning or the end. The HTML5 spec says that the sanitization (sanitation?) process must include stripping leading and trailing whitespace from the value.

http://dev.w3.org/html5/spec/Overview.html#e-mail-state-type-email

Entering an email address with a space at the beginning or the end causes the box to have a red border when blurred, indicating an invalid email address.

I tested this with the latest Firefox UX nightly.


Actual results:

Email box had red border.


Expected results:

Not actually sure, I guess the whitespace characters should simply be removed.
Comment 2 User image Matt Parlane 2012-02-13 13:44:48 PST
(In reply to Robert Longson from comment #1)
> That's what the html5 specification calls for doesn't it?
> http://www.whatwg.org/specs/web-apps/current-work/#e-mail-state-
> %28type=email%29 and
> http://www.whatwg.org/specs/web-apps/current-work/#valid-e-mail-address

Then at what point is the whitespace stripped? What is the point of that line in the spec?

<quote>The value sanitization algorithm is as follows: Strip line breaks from the value, then strip leading and trailing whitespace from the value.</quote>
Comment 3 User image Robert Longson 2012-02-13 13:54:45 PST
According to the specification that happens when the multiple attribute is added/removed.
Comment 4 User image Matt Parlane 2012-02-13 14:02:41 PST
My apologies, it appears I've wasted everyones' time. I'm clearly not experienced at reading spec documents.

Note You need to log in before you can comment on or make changes to this bug.