Bug 1394311 - Use lowercase consistently for looking up the language group. r=manishearth, a=gchang
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 28 Aug 2017 09:06:11 +0200
changeset 423874 63632d8680a0f966234bcbe8836b12ae00a41cc4
parent 423873 e2a6a68b89183e6f2178fbd3e36fc62ca2b1732b
child 423875 346027fa6dc3beaa9b336a107276fbbd8d175005
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmanishearth, gchang
bugs1394311
milestone56.0
Bug 1394311 - Use lowercase consistently for looking up the language group. r=manishearth, a=gchang This should be the only callee affected, given gfxPlatformFontList::GetFontPrefLangFor already uses case-insensitive string comparison. This makes it also consistent with the rest of the functions in the file, which lowercase their inputs as well. MozReview-Commit-ID: 4fNUBdpayHL
intl/locale/nsLanguageAtomService.cpp
--- a/intl/locale/nsLanguageAtomService.cpp
+++ b/intl/locale/nsLanguageAtomService.cpp
@@ -96,16 +96,17 @@ nsLanguageAtomService::GetLanguageGroup(
   return retVal;
 }
 
 already_AddRefed<nsIAtom>
 nsLanguageAtomService::GetUncachedLanguageGroup(nsIAtom* aLanguage) const
 {
   nsAutoCString langStr;
   aLanguage->ToUTF8String(langStr);
+  ToLowerCase(langStr);
 
   nsAutoCString langGroupStr;
   nsresult res =
     nsUConvPropertySearch::SearchPropertyValue(kLangGroups,
                                                ArrayLength(kLangGroups),
                                                langStr, langGroupStr);
   while (NS_FAILED(res)) {
     int32_t hyphen = langStr.RFindChar('-');