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

Unified Diff: third_party/WebKit/Source/wtf/text/StringImpl.cpp

Issue 2723053002: Use the correct case converter for |localName| and |tagName| (Closed)
Patch Set: Oops... Created 3 years, 10 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: third_party/WebKit/Source/wtf/text/StringImpl.cpp
diff --git a/third_party/WebKit/Source/wtf/text/StringImpl.cpp b/third_party/WebKit/Source/wtf/text/StringImpl.cpp
index 38252ebcb2607e78db212fb2bcc68fa9510c34b6..684b01b4840938a6777ff63fae2ace9b298edf49 100644
--- a/third_party/WebKit/Source/wtf/text/StringImpl.cpp
+++ b/third_party/WebKit/Source/wtf/text/StringImpl.cpp
@@ -803,6 +803,28 @@ upconvert:
return newImpl.release();
}
+PassRefPtr<StringImpl> StringImpl::upperASCII() {
+ if (is8Bit()) {
+ LChar* data8;
+ RefPtr<StringImpl> newImpl = createUninitialized(m_length, data8);
+
+ for (unsigned i = 0; i < m_length; ++i) {
+ LChar c = characters8()[i];
+ data8[i] = isASCIILower(c) ? toASCIIUpper(c) : c;
+ }
+ return newImpl.release();
+ }
+
+ UChar* data16;
+ RefPtr<StringImpl> newImpl = createUninitialized(m_length, data16);
+
+ for (unsigned i = 0; i < m_length; ++i) {
+ UChar c = characters16()[i];
+ data16[i] = isASCIILower(c) ? toASCIIUpper(c) : c;
+ }
+ return newImpl.release();
+}
+
static inline bool localeIdMatchesLang(const AtomicString& localeId,
const StringView& lang) {
RELEASE_ASSERT(lang.length() >= 2 && lang.length() <= 3);
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringImpl.h ('k') | third_party/WebKit/Source/wtf/text/StringImplTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698