Ignore:
Timestamp:
Jan 5, 2017, 10:31:27 AM (9 years ago)
Author:
Chris Dumez
Message:

Form validation: Align email validation with the latest HTML specification
https://bugs.webkit.org/show_bug.cgi?id=166697
<rdar://problem/29870245>

Reviewed by Alex Christensen.

Source/WebCore:

Align email validation with the latest HTML specification:

It particular, the following changes were made:

  • The first and last character of the domain now needs to be a letter or a digit
  • Parts of the domain can only be 63 characters in length

No new tests, extended existing test.

  • html/EmailInputType.cpp:

LayoutTests:

Extended / updated existing layout test to cover behavior changes.

  • fast/forms/ValidityState-typeMismatch-email-expected.txt:
  • fast/forms/resources/ValidityState-typeMismatch-email.js:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/html/EmailInputType.cpp

    r194819 r210361  
    3535namespace WebCore {
    3636
    37 static const char emailPattern[] =
    38     "[a-z0-9!#$%&'*+/=?^_`{|}~.-]+" // local part
    39     "@"
    40     "[a-z0-9-]+(\\.[a-z0-9-]+)*"; // domain part
     37// From https://html.spec.whatwg.org/#valid-e-mail-address.
     38static const char emailPattern[] = "^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$";
    4139
    4240static bool isValidEmailAddress(const String& address)
Note: See TracChangeset for help on using the changeset viewer.