Open Bug 1890466 Opened 2 years ago Updated 2 months ago

EmailInputType::PunycodeEncodeEmailAddress does not check for hyphen

Categories

(Core :: DOM: Forms, defect)

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.)

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.)

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