Last Comment Bug 657702 - html5 email field does not use trim function to remove whitespace
: html5 email field does not use trim function to remove whitespace
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: All All
-- normal (vote)
: mozilla9
Assigned To: Mounir Lamouri (:mounir)
: Andrew Overholt [:overholt]
Depends on:
Blocks: 1132142
  Show dependency treegraph
Reported: 2011-05-17 11:10 PDT by
Modified: 2015-02-11 10:51 PST (History)
6 users (show)
mounir: in‑testsuite+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Patch v1 (3.50 KB, patch)
2011-08-15 01:47 PDT, Mounir Lamouri (:mounir)
bugs: review+
Details | Diff | Splinter Review

Description User image 2011-05-17 11:10:31 PDT
User-Agent:       Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1

The rendered HTML5 email field does not accept an email address with whitespace at the beginning or end where it is difficult for the user to see (s)he has entered them by mistake (perhaps during copy and paste)

Well done for getting html5 and css3 implemented, but this has forced me to rollback after observing my register interest form is easier to use in more cases in IE6 :P

Reproducible: Always

Steps to Reproduce:
1. write some html5 and run it in firefox
2. enter an email with whitespace at the end

Expected Results:  
that the whitespace would be trimmed before the email was checked for validity
Comment 1 User image Kevin Brosnan [:kbrosnan] 2011-05-17 11:19:18 PDT
The following says that only 'Strip line breaks' should be performed on an email address.
Comment 2 User image Boris Zbarsky [:bz] (still a bit busy) 2011-05-17 12:00:12 PDT
Comment 3 User image 2011-05-18 00:57:04 PDT
Is there good reason to not strip whitespace from each end of the email address?

My friend was baffled trying to use my form because he could not see the erroneous whitespace - I trim the field before DB now it is no longer a form field.

I could use js to alert the user but seems simple for the browser to do it (or for me to revert to HTML text field).
Comment 4 User image Mounir Lamouri (:mounir) 2011-05-18 01:04:45 PDT
Your suggestion makes sense to me. I'm going to open a bug against the specifications and will apply the change if accepted.

Thank you very much for your feedback :)
Comment 5 User image Mounir Lamouri (:mounir) 2011-05-18 02:40:42 PDT
Specs bug has been open:
Comment 6 User image Mounir Lamouri (:mounir) 2011-08-15 01:47:15 PDT
Created attachment 553128 [details] [diff] [review]
Patch v1
Comment 7 User image Mounir Lamouri (:mounir) 2011-08-22 10:57:43 PDT
Comment 8 User image Frédéric Buclin 2015-02-11 10:24:22 PST
Has this been regressed? When I type "" in the Email Address field of, Firefox 35.0.1 complains that the email address is invalid. It doesn't let me submit the form.
Comment 9 User image Boris Zbarsky [:bz] (still a bit busy) 2015-02-11 10:51:31 PST
It's possible.  Or possibly it never worked...  I filed bug 1132142 to track this.

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