The default bug view has changed. See this FAQ.

html5 email field does not use trim function to remove whitespace

RESOLVED FIXED in mozilla9

Status

()

Core
DOM: Core & HTML
RESOLVED FIXED
6 years ago
2 years ago

People

(Reporter: colin@tastydevelopment.co.uk, Assigned: mounir)

Tracking

(Blocks: 1 bug)

Trunk
mozilla9
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
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
3.


Expected Results:  
that the whitespace would be trimmed before the email was checked for validity
The following says that only 'Strip line breaks' should be performed on an email address. http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#e-mail-state
Component: General → Layout: Form Controls
OS: Windows XP → All
Product: Firefox → Core
QA Contact: general → layout.form-controls
Hardware: x86 → All
Version: unspecified → 2.0 Branch
Mounir?
(Reporter)

Comment 3

6 years ago
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).
(Assignee)

Comment 4

6 years ago
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 :)
Status: UNCONFIRMED → NEW
Component: Layout: Form Controls → DOM: Core & HTML
Ever confirmed: true
QA Contact: layout.form-controls → general
Version: 2.0 Branch → Trunk
(Assignee)

Comment 5

6 years ago
Specs bug has been open: http://www.w3.org/Bugs/Public/show_bug.cgi?id=12682
(Assignee)

Comment 6

6 years ago
Created attachment 553128 [details] [diff] [review]
Patch v1
Assignee: nobody → mounir
Status: NEW → ASSIGNED
Attachment #553128 - Flags: review?(Olli.Pettay)
(Assignee)

Updated

6 years ago
Whiteboard: [needs review]
Attachment #553128 - Flags: review?(Olli.Pettay) → review+
(Assignee)

Updated

6 years ago
Flags: in-testsuite+
Whiteboard: [needs review] → [inbound]
(Assignee)

Comment 7

6 years ago
Pushed:
http://hg.mozilla.org/mozilla-central/rev/c11ae0f171a4
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla9

Comment 8

2 years ago
Has this been regressed? When I type " foo@bar.com" in the Email Address field of https://landfill.bugzilla.org/bugzilla-tip/enter_bug.cgi, Firefox 35.0.1 complains that the email address is invalid. It doesn't let me submit the form.
Blocks: 1132142
It's possible.  Or possibly it never worked...  I filed bug 1132142 to track this.
You need to log in before you can comment on or make changes to this bug.