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

Unified Diff: Source/core/html/BaseTextInputType.cpp

Issue 13950014: Revert "Switch RegularExpression from YARR to V8" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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
Index: Source/core/html/BaseTextInputType.cpp
diff --git a/Source/core/html/BaseTextInputType.cpp b/Source/core/html/BaseTextInputType.cpp
index fd9c9e5b748ad7c458ac641039637b4bacb9c57b..9a9540f70035465b5eab3d57c83b1dd8526df30b 100644
--- a/Source/core/html/BaseTextInputType.cpp
+++ b/Source/core/html/BaseTextInputType.cpp
@@ -44,12 +44,9 @@ bool BaseTextInputType::patternMismatch(const String& value) const
if (rawPattern.isNull() || value.isEmpty())
return false;
String pattern = "^(" + rawPattern + ")$";
- RegularExpression regex(pattern, TextCaseSensitive);
- if (!regex.isValid())
- return false;
int matchLength = 0;
int valueLength = value.length();
- int matchOffset = regex.match(value, 0, &matchLength);
+ int matchOffset = RegularExpression(pattern, TextCaseSensitive).match(value, 0, &matchLength);
return matchOffset || matchLength != valueLength;
}
« no previous file with comments | « LayoutTests/fast/forms/pattern-attribute-invalid-regex-expected.txt ('k') | Source/core/platform/text/RegularExpression.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698