Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Unified Diff: third_party/WebKit/Source/core/html/forms/EmailInputType.h

Issue 2037963002: Make ScriptRegexp for email address a member of EmailInputType. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: explicit, simplify ensureEmailRegexp() Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/forms/EmailInputType.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/forms/EmailInputType.h
diff --git a/third_party/WebKit/Source/core/html/forms/EmailInputType.h b/third_party/WebKit/Source/core/html/forms/EmailInputType.h
index fb005bd0fb0286d3209b92c3eb846e11b4c4ff2f..7c60c708df6602b601edf75d4107d2055556ebfb 100644
--- a/third_party/WebKit/Source/core/html/forms/EmailInputType.h
+++ b/third_party/WebKit/Source/core/html/forms/EmailInputType.h
@@ -40,11 +40,12 @@ public:
static InputType* create(HTMLInputElement&);
// They are public for unit testing.
- CORE_EXPORT static String convertEmailAddressToASCII(const String&);
- CORE_EXPORT static bool isValidEmailAddress(const String&);
+ CORE_EXPORT static String convertEmailAddressToASCII(const ScriptRegexp&, const String&);
+ CORE_EXPORT static bool isValidEmailAddress(const ScriptRegexp&, const String&);
+ CORE_EXPORT static std::unique_ptr<ScriptRegexp> createEmailRegexp();
private:
- EmailInputType(HTMLInputElement& element) : BaseTextInputType(element) { }
+ explicit EmailInputType(HTMLInputElement&);
void countUsage() override;
const AtomicString& formControlType() const override;
bool typeMismatchFor(const String&) const override;
@@ -56,8 +57,11 @@ private:
String convertFromVisibleValue(const String&) const override;
String visibleValue() const override;
+ ScriptRegexp& ensureEmailRegexp() const;
String convertEmailAddressToUnicode(const String&) const;
String findInvalidAddress(const String&) const;
+
+ mutable std::unique_ptr<ScriptRegexp> m_emailRegexp;
};
} // namespace blink
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/forms/EmailInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698