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

Unified Diff: third_party/WebKit/Source/wtf/text/WTFString.h

Issue 1499933003: Use ASCII case-insensitive matching for attribute selectors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WTF -> StringTest Created 5 years 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: third_party/WebKit/Source/wtf/text/WTFString.h
diff --git a/third_party/WebKit/Source/wtf/text/WTFString.h b/third_party/WebKit/Source/wtf/text/WTFString.h
index f692c9fb859f4c0f78df5f06dea75c9cd632ac03..d8cd17676b9fd4ae79bb4b8ea5eddac1b479cac4 100644
--- a/third_party/WebKit/Source/wtf/text/WTFString.h
+++ b/third_party/WebKit/Source/wtf/text/WTFString.h
@@ -87,6 +87,7 @@ enum UTF8ConversionMode {
#define DISPATCH_CASE_OP(caseSensitivity, op, args) \
((caseSensitivity == TextCaseSensitive) ? op args : \
+ (caseSensitivity == TextCaseASCIIInsensitive) ? op##IgnoringASCIICase args : \
op##IgnoringCase args)
template<bool isSpecialCharacter(UChar), typename CharacterType>
@@ -236,6 +237,10 @@ public:
size_t findIgnoringCase(const String& str, unsigned start = 0) const
{ return m_impl ? m_impl->findIgnoringCase(str.impl(), start) : kNotFound; }
+ // ASCII case insensitive string matching.
+ size_t findIgnoringASCIICase(const String& str, unsigned start = 0) const
+ { return m_impl ? m_impl->findIgnoringASCIICase(str.impl(), start) : kNotFound; }
+
// Wrappers for find adding dynamic sensitivity check.
size_t find(const LChar* str, unsigned start, TextCaseSensitivity caseSensitivity) const
{ return DISPATCH_CASE_OP(caseSensitivity, find, (str, start)); }
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringImpl.cpp ('k') | third_party/WebKit/Source/wtf/text/WTFStringTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698