HTML input with email type doesn't validate properly

RESOLVED INVALID

Status

()

Core
DOM: Core & HTML
RESOLVED INVALID
7 months ago
7 months ago

People

(Reporter: Adam M, Unassigned)

Tracking

53 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

7 months ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36

Steps to reproduce:

1. Create an HTML document with exactly one <input type="email"/>
2. Enter an email address with a single-character hostname into the input (`username@a`, for example), which is an invalid hostname according to RFC 952 


Actual results:

`document.querySelector('input').validity.valid` will return `true`


Expected results:

`document.querySelector('input').validity.valid` should return `false`, as a single-character hostname is not a valid hostname

Updated

7 months ago
Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
Hello Adam,

We are following the HTML specification on this aspect AFAICT: https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address

Note that the HTML spec wilfully violates RFC 5322. You will likely see that other browsers are following the HTML spec and not the RFC too.

If you would like the spec changed, please file[1] an issue on Github after looking at existing issues/discussions such as:
* https://github.com/whatwg/html/issues/1223
* https://github.com/whatwg/html/issues/1465

[1] https://github.com/whatwg/html/issues/new
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 months ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.