Open Bug 1575412 Opened 5 years ago Updated 2 years ago

Change <input type="email"> spec to accept non-ASCII before the @ in email addresses

Categories

(Core :: DOM: Core & HTML, defect, P3)

69 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: aria, Unassigned)

Details

Attachments

(1 file)

Attached file email.html

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0

Steps to reproduce:

I typed valid e-mail address in an <input type="email"> field.

Actual results:

Some valid e-mail addresses were believed to be invalid by Firefox:

Expected results:

Valid e-mail addresses should be accepted.

See:

Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core

The spec says:

This requirement is a willful violation of RFC 5322, which defines a syntax for e-mail addresses that is simultaneously too strict (before the "@" character), too vague (after the "@" character), and too lax (allowing comments, whitespace characters, and quoted strings in manners unfamiliar to most users) to be of practical use here.

https://html.spec.whatwg.org/#valid-e-mail-address

That said, rejecting the last six examples seems problematic. My understanding is that it's the responsibility of the browser UI layer to convert them to ASCII before applying the constraint validation.

ni annevk & mbrodesser to confirm.

Flags: needinfo?(mbrodesser)
Flags: needinfo?(annevk)

The non-domain portion cannot be converted to ASCII, see https://en.wikipedia.org/wiki/International_email#Interoperability_via_downgrading (I didn't want to dig through all email RFCs again). This is tracked by https://github.com/whatwg/html/issues/4562. So I'd say this is not an issue with Firefox as currently the standard does not allow for these email addresses.

However, it might be worth tracking here since this is something that would be in our power to solve if it got prioritized.

Flags: needinfo?(annevk)
Flags: needinfo?(mbrodesser)

Best practice seems to be to accept any e-mail address with a @ in the middle, because any other test might be slightly wrong, at least for the local part, and any attempt to cover the whole standard is doomed to result in a very complicated regex.

Domain part could be restricted a bit from the standard I guess, since IP addresses are discouraged for this and not likely to be useful for online form, so accepting anything that could be a valid (international) domain name is fine IMHO.

(In reply to ariasuni from comment #3)

Best practice seems to be to accept any e-mail address with a @ in the middle, because any other test might be slightly wrong, at least for the local part, and any attempt to cover the whole standard is doomed to result in a very complicated regex.

Domain part could be restricted a bit from the standard I guess, since IP addresses are discouraged for this and not likely to be useful for online form, so accepting anything that could be a valid (international) domain name is fine IMHO.

Depends on what your goals are. If you want the server to receive email addresses that common software can actually send email to, it seems useful for the browser to normalize the addresses to the backward-compatible format.

Priority: -- → P3
Summary: Native form validation for <input type="email"> doesn’t accept valid addresses → Change <input type="email"> spec to accept non-ASCII before the @ in email addresses

Depends on what your goals are. If you want the server to receive email addresses that common software can actually send email to, it seems useful for the browser to normalize the addresses to the backward-compatible format.

But what are the goals of the current behavior? If someone has an e-mail address using idiosyncrasies of the standard, all right. But for Unicode local-part and domains, I don’t see how’s that helping anyone.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: