EmailInputType::PunycodeEncodeEmailAddress does not check for hyphen
Categories
(Core :: DOM: Forms, defect)
Tracking
()
People
(Reporter: hsivonen, Unassigned)
References
Details
(Keywords: good-first-bug)
Per https://html.spec.whatwg.org/#valid-e-mail-address , EmailInputType::PunycodeEncodeEmailAddress should check that labels don't start or end with a hyphen, but we don't currently check for that. (We should probably check what other browser do before checking it. Trailing hyphens do exist in labels that are not overseen by ICANN. See bug 1184059.)
| Reporter | ||
Updated•2 years ago
|
| Reporter | ||
Updated•2 years ago
|
Comment 1•2 months ago
|
||
Labels starting/ending with hyphens are still considered as suffering from a type mismatch (in Firefox as well as WebKit and Chromium), so I guess the question is just whether it should also be considered as suffering from bad input and whether value should still be puny-encoded or not?
Chromium seems to never set badInput for email inputs (even when puny-encoding fails), and only puny-encodes value if it is a valid email address. (And there is also the question of whether two consecutive dots should be checked for.)
| Reporter | ||
Comment 2•2 months ago
|
||
We should port https://github.com/hsivonen/emaildemo/blob/main/src/lib.rs to Gecko. See long discussion in https://github.com/whatwg/html/pull/10522 and https://github.com/whatwg/html/issues/4562
Description
•