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

Unified Diff: third_party/WebKit/Source/core/html/forms/BaseTextInputType.cpp

Issue 2366803002: Fix pattern attribute handling for invalid regular expressions. (Closed)
Patch Set: Created 4 years, 3 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 | « third_party/WebKit/LayoutTests/fast/forms/ValidityState-patternMismatch-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/forms/BaseTextInputType.cpp
diff --git a/third_party/WebKit/Source/core/html/forms/BaseTextInputType.cpp b/third_party/WebKit/Source/core/html/forms/BaseTextInputType.cpp
index a2856b8c9fe789268630f1698f74322f699fabed..a665fb96b97c19d62b58ed9fc65a9e7945d2d1d3 100644
--- a/third_party/WebKit/Source/core/html/forms/BaseTextInputType.cpp
+++ b/third_party/WebKit/Source/core/html/forms/BaseTextInputType.cpp
@@ -101,6 +101,8 @@ bool BaseTextInputType::patternMismatch(const String& value) const
String pattern = "^(?:" + rawPattern + ")$";
m_regexp.reset(new ScriptRegexp(pattern, TextCaseSensitive, MultilineDisabled, ScriptRegexp::UTF16));
m_patternForRegexp = rawPattern;
+ } else if (!m_regexp->isValid()) {
+ return false;
}
int matchLength = 0;
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/forms/ValidityState-patternMismatch-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698