Commit ab049848 authored by darin@apple.com's avatar darin@apple.com

text-transform: lowercase is not lang-dependent (Turkish languages : tr,az)

https://bugs.webkit.org/show_bug.cgi?id=21312

Reviewed by Ryosuke Niwa.

Source/WebCore:

Test: fast/text/text-transform-turkish-and-azeri.html

This patch covers text-transform: uppercase and text-transform: lowercase.
More changes will be needed to cover text-transform: capitalize.

* inspector/DOMPatchSupport.cpp:
(WebCore::DOMPatchSupport::patchNode): Use String::upper instead of String::makeUpper.
* page/EventHandler.cpp:
(WebCore::findDropZone): Use String::lower instead of String::makeLower.
* platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
(WebCore::HarfBuzzShaper::shapeHarfBuzzRuns): Use String::upper instead of String::makeUpper.
* platform/network/blackberry/rss/RSS10Parser.cpp: [Seriously, how is an RSS parser
part of WebKit's networking layer? Where are the tests that cover this? Seems wrong
to have this code in the project.]
(WebCore::RSS10Parser::parseXmlDoc): Use lower instead of makeLower.
(WebCore::RSS10Parser::parseItem): Ditto.
(WebCore::RSS10Parser::parseFeed): Ditto.
* platform/network/blackberry/rss/RSS20Parser.cpp:
(WebCore::RSS20Parser::parseXmlDoc): Ditto.
(WebCore::RSS20Parser::parseItem): Ditto.
(WebCore::RSS20Parser::parseFeed): Ditto.
(WebCore::RSS20Parser::parseEnclosure): Ditto.
* platform/network/blackberry/rss/RSSAtomParser.cpp:
(WebCore::RSSAtomParser::parseXmlDoc): Ditto.
(WebCore::RSSAtomParser::parseItem): Ditto.
(WebCore::RSSAtomParser::parseFeed): Ditto.
(WebCore::RSSAtomParser::parseLink): Ditto.
(WebCore::RSSAtomParser::parseContent): Ditto.
(WebCore::RSSAtomParser::parseAuthor): Ditto.
(WebCore::RSSAtomParser::parseCategory): Ditto.
* platform/text/win/LocaleWin.cpp:
(WebCore::convertLocaleNameToLCID): Use String::lower instead of String::makeLower.
* rendering/RenderText.cpp:
(WebCore::applyTextTransform): Use String::upper and String::lower instead of
String::makeUpper and String::makeLower, and also pass in the locale to each.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::uppercaseKnownHTTPMethod): Changed this so it doesn't call
upper just to return an already known string constant.

Source/WebKit/gtk:

* WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
(DumpRenderTreeSupportGtk::doCommand): Use StringImpl::upper instead of
StringImpl::makeUpper.

Source/WTF:

* wtf/text/StringImpl.cpp:
(WTF::StringImpl::upper): Removed an extra call that would unnecessarily reallocate
a StringImpl in the general non-ASCII case. Added an overload that takes a locale identifier.
(WTF::StringImpl::lower): Ditto.
* wtf/text/StringImpl.h: Ditto.
* wtf/text/WTFString.cpp:
(WTF::String::lower): Ditto.
(WTF::String::upper): Ditto.
* wtf/text/WTFString.h: Ditto. Also deleted the makeLower and makeUpper functions since they
offer no advantages over the lower and upper functions. Also added a constructor that takes
a RefPtr<StringImpl> with move construction to help.

LayoutTests:

* fast/text/text-transform-turkish-and-azeri-expected.html: Added.
* fast/text/text-transform-turkish-and-azeri.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156948 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 797b2567
2013-10-04 Darin Adler <darin@apple.com>
text-transform: lowercase is not lang-dependent (Turkish languages : tr,az)
https://bugs.webkit.org/show_bug.cgi?id=21312
Reviewed by Ryosuke Niwa.
* fast/text/text-transform-turkish-and-azeri-expected.html: Added.
* fast/text/text-transform-turkish-and-azeri.html: Added.
2013-10-04 Alexey Proskuryakov <ap@apple.com>
Roll out r156930 and r156937, they caused 34 assertion failures on bots.
<!DOCTYPE html>
<html>
<head><meta charset="utf-8"></head>
<body>
<p>Turkish uppercasing (each pair should match): İ İ, I I.</p>
<p>Turkish lowercasing (each pair should match): i i, i i, ı ı.</p>
<p>Azeri uppercasing (each pair should match): İ İ, I I.</p>
<p>Azeri lowercasing (each pair should match): i i, i i, ı ı.</p>
<p>Turkish subtag uppercasing (each pair should match): İ İ, I I.</p>
<p>Turkish subtag lowercasing (each pair should match): i i, i i, ı ı.</p>
<p>Azeri subtag uppercasing (each pair should match): İ İ, I I.</p>
<p>Azeri subtag lowercasing (each pair should match): i i, i i, ı ı.</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head><meta charset="utf-8"></head>
<body>
<p>Turkish uppercasing (each pair should match): <span lang="tr" style="text-transform: uppercase">i İ, ı I</span>.</p>
<p>Turkish lowercasing (each pair should match): <span lang="tr" style="text-transform: lowercase">İ i, İ i, I ı</span>.</p>
<p>Azeri uppercasing (each pair should match): <span lang="az" style="text-transform: uppercase">i İ, ı I</span>.</p>
<p>Azeri lowercasing (each pair should match): <span lang="az" style="text-transform: lowercase">İ i, İ i, I ı</span>.</p>
<p>Turkish subtag uppercasing (each pair should match): <span lang="TR-anySubtag" style="text-transform: uppercase">i İ, ı I</span>.</p>
<p>Turkish subtag lowercasing (each pair should match): <span lang="tR-reallyCanHaveAnythingHere" style="text-transform: lowercase">İ i, İ i, I ı</span>.</p>
<p>Azeri subtag uppercasing (each pair should match): <span lang="AZ-sameForAzeri" style="text-transform: uppercase">i İ, ı I</span>.</p>
<p>Azeri subtag lowercasing (each pair should match): <span lang="Az-allSubTagged" style="text-transform: lowercase">İ i, İ i, I ı</span>.</p>
</body>
</html>
2013-10-04 Darin Adler <darin@apple.com>
text-transform: lowercase is not lang-dependent (Turkish languages : tr,az)
https://bugs.webkit.org/show_bug.cgi?id=21312
Reviewed by Ryosuke Niwa.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::upper): Removed an extra call that would unnecessarily reallocate
a StringImpl in the general non-ASCII case. Added an overload that takes a locale identifier.
(WTF::StringImpl::lower): Ditto.
* wtf/text/StringImpl.h: Ditto.
* wtf/text/WTFString.cpp:
(WTF::String::lower): Ditto.
(WTF::String::upper): Ditto.
* wtf/text/WTFString.h: Ditto. Also deleted the makeLower and makeUpper functions since they
offer no advantages over the lower and upper functions. Also added a constructor that takes
a RefPtr<StringImpl> with move construction to help.
2013-10-04 Brent Fulgham <bfulgham@apple.com>
Remove Qt definitions from Platform.h
......
......@@ -552,7 +552,6 @@ upconvert:
// Do a slower implementation for cases that include non-ASCII characters.
bool error;
newImpl = createUninitialized(m_length, data16);
int32_t realLength = Unicode::toUpper(data16, length, source16, m_length, &error);
if (!error && realLength == length)
return newImpl;
......@@ -563,11 +562,93 @@ upconvert:
return newImpl.release();
}
PassRefPtr<StringImpl> StringImpl::fill(UChar character)
static inline bool needsTurkishCasingRules(const AtomicString& localeIdentifier)
{
if (!m_length)
// Either "tr" or "az" locale, with case sensitive comparison and allowing for an ignored subtag.
UChar first = localeIdentifier[0];
UChar second = localeIdentifier[1];
return ((isASCIIAlphaCaselessEqual(first, 't') && isASCIIAlphaCaselessEqual(second, 'r'))
|| (isASCIIAlphaCaselessEqual(first, 'a') && isASCIIAlphaCaselessEqual(second, 'z')))
&& (localeIdentifier.length() == 2 || localeIdentifier[2] == '-');
}
RefPtr<StringImpl> StringImpl::lower(const AtomicString& localeIdentifier)
{
#if !USE(ICU_UNICODE)
UNUSED_PARAM(localeIdentifier);
return lower();
#else
// Use the more-optimized code path most of the time.
// Assuming here that the only locale-specific lowercasing is the Turkish casing rules.
// FIXME: Could possibly optimize further by looking for the specific sequences
// that have locale-specific lowercasing. There are only three of them.
if (!needsTurkishCasingRules(localeIdentifier))
return lower();
// FIXME: Could share more code with the main StringImpl::lower by factoring out
// this last part into a shared function that takes a locale string, since this is
// just like the end of that function.
if (m_length > static_cast<unsigned>(numeric_limits<int32_t>::max()))
CRASH();
int length = m_length;
// Below, we pass in the hardcoded locale "tr". Passing that is more efficient than
// allocating memory just to turn localeIdentifier into a C string, and we assume
// there is no difference between the uppercasing for "tr" and "az" locales.
const UChar* source16 = characters();
UChar* data16;
RefPtr<StringImpl> newString = createUninitialized(length, data16);
UErrorCode status = U_ZERO_ERROR;
int realLength = u_strToLower(data16, length, source16, length, "tr", &status);
if (U_SUCCESS(status) && realLength == length)
return newString;
status = U_ZERO_ERROR;
newString = createUninitialized(realLength, data16);
u_strToLower(data16, realLength, source16, length, "tr", &status);
if (U_FAILURE(status))
return this;
return newString.release();
#endif
}
RefPtr<StringImpl> StringImpl::upper(const AtomicString& localeIdentifier)
{
#if !USE(ICU_UNICODE)
UNUSED_PARAM(localeIdentifier);
return upper();
#else
// Use the more-optimized code path most of the time.
// Assuming here that the only locale-specific lowercasing is the Turkish casing rules,
// and that the only affected character is lowercase "i".
if (!needsTurkishCasingRules(localeIdentifier) || find('i') == notFound)
return upper();
if (m_length > static_cast<unsigned>(numeric_limits<int32_t>::max()))
CRASH();
int length = m_length;
// Below, we pass in the hardcoded locale "tr". Passing that is more efficient than
// allocating memory just to turn localeIdentifier into a C string, and we assume
// there is no difference between the uppercasing for "tr" and "az" locales.
const UChar* source16 = characters();
UChar* data16;
RefPtr<StringImpl> newString = createUninitialized(length, data16);
UErrorCode status = U_ZERO_ERROR;
int realLength = u_strToUpper(data16, length, source16, length, "tr", &status);
if (U_SUCCESS(status) && realLength == length)
return newString;
newString = createUninitialized(realLength, data16);
status = U_ZERO_ERROR;
u_strToUpper(data16, realLength, source16, length, "tr", &status);
if (U_FAILURE(status))
return this;
return newString.release();
#endif
}
PassRefPtr<StringImpl> StringImpl::fill(UChar character)
{
if (!(character & ~0x7F)) {
LChar* data;
RefPtr<StringImpl> newImpl = createUninitialized(m_length, data);
......
......@@ -690,6 +690,8 @@ public:
WTF_EXPORT_STRING_API PassRefPtr<StringImpl> lower();
WTF_EXPORT_STRING_API PassRefPtr<StringImpl> upper();
WTF_EXPORT_STRING_API RefPtr<StringImpl> lower(const AtomicString& localeIdentifier);
WTF_EXPORT_STRING_API RefPtr<StringImpl> upper(const AtomicString& localeIdentifier);
WTF_EXPORT_STRING_API PassRefPtr<StringImpl> fill(UChar);
// FIXME: Do we need fill(char) or can we just do the right thing if UChar is ASCII?
......
......@@ -333,6 +333,20 @@ String String::upper() const
return m_impl->upper();
}
String String::lower(const AtomicString& localeIdentifier) const
{
if (!m_impl)
return String();
return m_impl->lower(localeIdentifier);
}
String String::upper(const AtomicString& localeIdentifier) const
{
if (!m_impl)
return String();
return m_impl->upper(localeIdentifier);
}
String String::stripWhiteSpace() const
{
if (!m_impl)
......
......@@ -122,6 +122,7 @@ public:
// Construct a string referencing an existing StringImpl.
String(StringImpl* impl) : m_impl(impl) { }
String(PassRefPtr<StringImpl> impl) : m_impl(impl) { }
String(RefPtr<StringImpl>&& impl) : m_impl(impl) { }
// Construct a string from a constant string literal.
WTF_EXPORT_STRING_API String(ASCIILiteral characters);
......@@ -318,8 +319,6 @@ public:
return *this;
}
void makeLower() { if (m_impl) m_impl = m_impl->lower(); }
void makeUpper() { if (m_impl) m_impl = m_impl->upper(); }
void fill(UChar c) { if (m_impl) m_impl = m_impl->fill(c); }
WTF_EXPORT_STRING_API void truncate(unsigned len);
......@@ -334,6 +333,9 @@ public:
WTF_EXPORT_STRING_API String lower() const;
WTF_EXPORT_STRING_API String upper() const;
WTF_EXPORT_STRING_API String lower(const AtomicString& localeIdentifier) const;
WTF_EXPORT_STRING_API String upper(const AtomicString& localeIdentifier) const;
WTF_EXPORT_STRING_API String stripWhiteSpace() const;
WTF_EXPORT_STRING_API String stripWhiteSpace(IsWhiteSpaceFunctionPtr) const;
WTF_EXPORT_STRING_API String simplifyWhiteSpace() const;
......
2013-10-04 Darin Adler <darin@apple.com>
text-transform: lowercase is not lang-dependent (Turkish languages : tr,az)
https://bugs.webkit.org/show_bug.cgi?id=21312
Reviewed by Ryosuke Niwa.
Test: fast/text/text-transform-turkish-and-azeri.html
This patch covers text-transform: uppercase and text-transform: lowercase.
More changes will be needed to cover text-transform: capitalize.
* inspector/DOMPatchSupport.cpp:
(WebCore::DOMPatchSupport::patchNode): Use String::upper instead of String::makeUpper.
* page/EventHandler.cpp:
(WebCore::findDropZone): Use String::lower instead of String::makeLower.
* platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
(WebCore::HarfBuzzShaper::shapeHarfBuzzRuns): Use String::upper instead of String::makeUpper.
* platform/network/blackberry/rss/RSS10Parser.cpp: [Seriously, how is an RSS parser
part of WebKit's networking layer? Where are the tests that cover this? Seems wrong
to have this code in the project.]
(WebCore::RSS10Parser::parseXmlDoc): Use lower instead of makeLower.
(WebCore::RSS10Parser::parseItem): Ditto.
(WebCore::RSS10Parser::parseFeed): Ditto.
* platform/network/blackberry/rss/RSS20Parser.cpp:
(WebCore::RSS20Parser::parseXmlDoc): Ditto.
(WebCore::RSS20Parser::parseItem): Ditto.
(WebCore::RSS20Parser::parseFeed): Ditto.
(WebCore::RSS20Parser::parseEnclosure): Ditto.
* platform/network/blackberry/rss/RSSAtomParser.cpp:
(WebCore::RSSAtomParser::parseXmlDoc): Ditto.
(WebCore::RSSAtomParser::parseItem): Ditto.
(WebCore::RSSAtomParser::parseFeed): Ditto.
(WebCore::RSSAtomParser::parseLink): Ditto.
(WebCore::RSSAtomParser::parseContent): Ditto.
(WebCore::RSSAtomParser::parseAuthor): Ditto.
(WebCore::RSSAtomParser::parseCategory): Ditto.
* platform/text/win/LocaleWin.cpp:
(WebCore::convertLocaleNameToLCID): Use String::lower instead of String::makeLower.
* rendering/RenderText.cpp:
(WebCore::applyTextTransform): Use String::upper and String::lower instead of
String::makeUpper and String::makeLower, and also pass in the locale to each.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::uppercaseKnownHTTPMethod): Changed this so it doesn't call
upper just to return an already known string constant.
2013-10-04 Alexey Proskuryakov <ap@apple.com>
Roll out r156930 and r156937, they caused 34 assertion failures on bots.
......@@ -142,8 +142,7 @@ Node* DOMPatchSupport::patchNode(Node* node, const String& markup, ExceptionCode
oldList.append(createDigest(child, 0));
// Compose the new list.
String markupCopy = markup;
markupCopy.makeLower();
String markupCopy = markup.lower();
Vector<OwnPtr<Digest> > newList;
for (Node* child = parentNode->firstChild(); child != node; child = child->nextSibling())
newList.append(createDigest(child, 0));
......
......@@ -2061,7 +2061,7 @@ static bool findDropZone(Node* target, Clipboard* clipboard)
if (dropZoneStr.isEmpty())
continue;
dropZoneStr.makeLower();
dropZoneStr = dropZoneStr.lower();
SpaceSplitString keywords(dropZoneStr, false);
if (keywords.isEmpty())
......
......@@ -494,8 +494,7 @@ bool HarfBuzzShaper::shapeHarfBuzzRuns(bool shouldSetDirection)
hb_buffer_add_utf16(harfBuzzBuffer.get(), &preContext, 1, 1, 0);
if (m_font->isSmallCaps() && u_islower(m_normalizedBuffer[currentRun->startIndex()])) {
String upperText = String(m_normalizedBuffer.get() + currentRun->startIndex(), currentRun->numCharacters());
upperText.makeUpper();
String upperText = String(m_normalizedBuffer.get() + currentRun->startIndex(), currentRun->numCharacters()).upper();
currentFontData = m_font->glyphDataForCharacter(upperText[0], false, SmallCapsVariant).fontData;
hb_buffer_add_utf16(harfBuzzBuffer.get(), reinterpret_cast<const uint16_t*>(upperText.characters()), currentRun->numCharacters(), 0, currentRun->numCharacters());
} else
......
......@@ -53,7 +53,7 @@ bool RSS10Parser::parseXmlDoc(xmlDocPtr doc)
for (; childnode; childnode = childnode->next) {
if (childnode->type == XML_ELEMENT_NODE) {
name = String(reinterpret_cast<const char*>(childnode->name));
name.makeLower();
name = name.lower();
if (name == "channel") {
BLACKBERRY_ASSERT(!m_root);
if (!m_root)
......@@ -98,7 +98,7 @@ RSSItem* RSS10Parser::parseItem(xmlNode* node)
for (; node; node = node->next) {
String name(reinterpret_cast<const char*>(node->name));
name.makeLower();
name = name.lower();
parseItemBaseAttribute(item, name, node);
}
......@@ -114,7 +114,7 @@ RSSFeed* RSS10Parser::parseFeed(xmlNode* node)
for (; node; node = node->next) {
String name(reinterpret_cast<const char*>(node->name));
name.makeLower();
name = name.lower();
parseItemBaseAttribute(feed, name, node);
}
......
......@@ -47,13 +47,13 @@ bool RSS20Parser::parseXmlDoc(xmlDocPtr doc)
for (; node; node = node->next) {
String name(reinterpret_cast<const char*>(node->name));
name.makeLower();
name = name.lower();
if (name == "rss") {
xmlNode* channel = node->children;
if (channel->type == XML_ELEMENT_NODE) {
name = reinterpret_cast<const char*>(channel->name);
name.makeLower();
name = name.lower();
if (name == "channel")
m_root = parseFeed(channel->children);
}
......@@ -90,7 +90,7 @@ RSSItem* RSS20Parser::parseItem(xmlNode* node)
for (; node; node = node->next) {
String name(reinterpret_cast<const char*>(node->name));
name.makeLower();
name = name.lower();
if (parseItemBaseAttribute(item, name, node))
continue;
......@@ -124,7 +124,7 @@ RSSFeed* RSS20Parser::parseFeed(xmlNode* node)
for (; node; node = node->next) {
String name(reinterpret_cast<const char*>(node->name));
name.makeLower();
name = name.lower();
if (parseItemBaseAttribute(feed, name, node))
continue;
......@@ -148,7 +148,7 @@ RSSEnclosure* RSS20Parser::parseEnclosure(xmlNode* node)
for (xmlAttr* attr = node->properties; attr; attr = attr->next) {
String name(reinterpret_cast<const char*>(attr->name));
name.makeLower();
name = name.lower();
if (name == "url")
enclosure->m_url = textFromXMLAttr(attr);
......
......@@ -80,7 +80,7 @@ bool RSSAtomParser::parseXmlDoc(xmlDocPtr doc)
for (; node; node = node->next) {
String name(reinterpret_cast<const char*>(node->name));
name.makeLower();
name = name.lower();
if (name == "feed") {
m_root = parseFeed(node->children);
......@@ -121,7 +121,7 @@ RSSItem* RSSAtomParser::parseItem(xmlNode* node)
String base;
for (xmlAttr* attr = node->properties; attr; attr = attr->next) {
String name(reinterpret_cast<const char*>(attr->name));
name.makeLower();
name = name.lower();
if (name == "base")
base = textFromXMLAttr(attr);
}
......@@ -129,7 +129,7 @@ RSSItem* RSSAtomParser::parseItem(xmlNode* node)
node = node->children;
for (; node; node = node->next) {
String name(reinterpret_cast<const char*>(node->name));
name.makeLower();
name = name.lower();
if (parseItemBaseAttribute(item, name, node, base))
continue;
......@@ -167,7 +167,7 @@ RSSFeed* RSSAtomParser::parseFeed(xmlNode* node)
for (; node; node = node->next) {
String name(reinterpret_cast<const char*>(node->name));
name.makeLower();
name = name.lower();
if (parseItemBaseAttribute(feed, name, node, emptyString()))
continue;
......@@ -193,7 +193,7 @@ RSSAtomLink* RSSAtomParser::parseLink(xmlNode* node)
for (xmlAttr* attr = node->properties; attr; attr = attr->next) {
String name(reinterpret_cast<const char*>(attr->name));
name.makeLower();
name = name.lower();
if (name == "href")
link->m_href = textFromXMLAttr(attr);
......@@ -238,7 +238,7 @@ String RSSAtomParser::parseContent(const String& base, xmlNode* node)
String src;
for (xmlAttr* attr = node->properties; attr; attr = attr->next) {
String name(reinterpret_cast<const char*>(attr->name));
name.makeLower();
name = name.lower();
if (name == "type")
type = textFromXMLAttr(attr);
......@@ -295,7 +295,7 @@ String RSSAtomParser::parseAuthor(xmlNode* node)
for (node = node->children; node; node = node->next) {
String name(reinterpret_cast<const char*>(node->name));
name.makeLower();
name = name.lower();
if (name == "name")
username = textFromXMLNode(node);
......@@ -320,7 +320,7 @@ String RSSAtomParser::parseCategory(xmlNode* node)
for (xmlAttr* attr = node->properties; attr; attr = attr->next) {
String name(reinterpret_cast<const char*>(attr->name));
name.makeLower();
name = name.lower();
// If there's a label, we use it, if not, use term attribute, as label is
// optional, but term is mandatory.
......
......@@ -109,8 +109,7 @@ static LCID WINAPI convertLocaleNameToLCID(LPCWSTR name, DWORD)
return LOCALE_USER_DEFAULT;
DEFINE_STATIC_LOCAL(NameToLCIDMap, map, ());
ensureNameToLCIDMap(map);
String localeName = String(name).replace('_', '-');
localeName.makeLower();
String localeName = String(name).replace('_', '-').lower();
do {
NameToLCIDMap::const_iterator iterator = map.find(localeName);
if (iterator != map.end())
......
......@@ -1331,10 +1331,10 @@ void applyTextTransform(const RenderStyle* style, String& text, UChar previousCh
makeCapitalized(&text, previousCharacter);
break;
case UPPERCASE:
text.makeUpper();
text = text.upper(style->locale());
break;
case LOWERCASE:
text.makeLower();
text = text.lower(style->locale());
break;
}
}
......
......@@ -452,12 +452,14 @@ bool XMLHttpRequest::isAllowedHTTPMethod(const String& method)
String XMLHttpRequest::uppercaseKnownHTTPMethod(const String& method)
{
if (equalIgnoringCase(method, "COPY") || equalIgnoringCase(method, "DELETE") || equalIgnoringCase(method, "GET")
|| equalIgnoringCase(method, "HEAD") || equalIgnoringCase(method, "INDEX") || equalIgnoringCase(method, "LOCK")
|| equalIgnoringCase(method, "M-POST") || equalIgnoringCase(method, "MKCOL") || equalIgnoringCase(method, "MOVE")
|| equalIgnoringCase(method, "OPTIONS") || equalIgnoringCase(method, "POST") || equalIgnoringCase(method, "PROPFIND")
|| equalIgnoringCase(method, "PROPPATCH") || equalIgnoringCase(method, "PUT") || equalIgnoringCase(method, "UNLOCK")) {
return method.upper();
const char* const methods[] = { "COPY", "DELETE", "GET", "HEAD", "INDEX", "LOCK", "M-POST", "MKCOL", "MOVE", "OPTIONS", "POST", "PROPFIND", "PROPPATCH", "PUT", "UNLOCK" };
for (unsigned i = 0; i < WTF_ARRAY_LENGTH(methods); ++i) {
if (equalIgnoringCase(method, methods[i])) {
// Don't bother allocating a new string if it's already all uppercase.
if (method == methods[i])
break;
return ASCIILiteral(methods[i]);
}
}
return method;
}
......
2013-10-04 Darin Adler <darin@apple.com>
text-transform: lowercase is not lang-dependent (Turkish languages : tr,az)
https://bugs.webkit.org/show_bug.cgi?id=21312
Reviewed by Ryosuke Niwa.
* WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
(DumpRenderTreeSupportGtk::doCommand): Use StringImpl::upper instead of
StringImpl::makeUpper.
2013-10-04 Anders Carlsson <andersca@apple.com>
FramePolicyFunction should be an std::function
......
......@@ -358,8 +358,7 @@ void DumpRenderTreeSupportGtk::doCommand(WebKitWebView* webView, const char* com
// Make the first char in upper case.
String firstChar = commandString.left(1);
commandString = commandString.right(commandString.length() - 1);
firstChar.makeUpper();
commandString.insert(firstChar, 0);
commandString.insert(firstChar.upper(), 0);
editor.command(commandString).execute();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment