COMMIT_MESSAGE

 1REGRESSION(287160@main) Perf-Dashboard subtest (speedometer3) spends considerable time in capitalizing content
 2https://bugs.webkit.org/show_bug.cgi?id=284062
 3
 4Reviewed by NOBODY (OOPS!).
 5
 61. In many cases we already have capitalized content
 72. u_totitle can surely handle ascii content (vs. the more expensive u_strToTitle)
 8
 9* Source/WebCore/rendering/RenderText.cpp:
 10(WebCore::capitalizeCharacter):

Source/WebCore/rendering/RenderText.cpp

@@static inline size_t capitalizeCharacter(String textContent, unsigned startChara
172172 }
173173
174174 auto capitalize = [&](const UChar* contentToCapitalize, size_t length) -> size_t {
 175 if (length == 1) {
 176 if ((*contentToCapitalize >= 'A' && *contentToCapitalize <= 'Z') || *contentToCapitalize == ' ')
 177 return 0;
 178 if (*contentToCapitalize <= 'z') {
 179 char32_t lastCharacter = u_totitle(*contentToCapitalize);
 180 output.append(lastCharacter);
 181 return 1;
 182 }
 183 }
 184
175185 UChar capitalizedCharacter;
176186 UErrorCode status = U_ZERO_ERROR;
177187 auto realLength = u_strToTitle(&capitalizedCharacter, 1, contentToCapitalize, length, nullptr, "", &status);