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

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

Issue 2508953003: WTF: Add comments and tests for Unicode aware case-insensitive string operations. (Closed)
Patch Set: Created 4 years, 1 month 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 3c516adf647f803ba4eb9509c21688d456bb787d..c2b55e4b312ec04c18ca580a3b9381824bf0a2ac 100644
--- a/third_party/WebKit/Source/wtf/text/WTFString.h
+++ b/third_party/WebKit/Source/wtf/text/WTFString.h
@@ -187,7 +187,9 @@ class WTF_EXPORT String {
: kNotFound;
}
- // Unicode aware case insensitive string matching.
+ // Unicode aware case insensitive string matching. Non-ASCII characters might
+ // match to ASCII characters. This function is rarely used to implement web
+ // platform features.
size_t findIgnoringCase(const StringView& value, unsigned start = 0) const {
return m_impl ? m_impl->findIgnoringCase(value, start) : kNotFound;
}
@@ -280,7 +282,10 @@ class WTF_EXPORT String {
String left(unsigned len) const { return substring(0, len); }
String right(unsigned len) const { return substring(length() - len, len); }
- // Returns a lowercase/uppercase version of the string
+ // Returns a lowercase/uppercase version of the string. These functions might
+ // convert non-ASCII characters to ASCII characters. For example, lower() for
+ // U+212A is 'k', upper() for U+017F is 'S'.
+ // These functions are rarely used to implement web platform features.
String lower() const;
String upper() const;
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringView.h ('k') | third_party/WebKit/Source/wtf/text/WTFStringTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698