Bug 1108616 - Part 1: Language-specific text-transform casing behavior should only be used when content was explicitly tagged for language. r=dbaron, a=lsblakk
authorJonathan Kew <jkew@mozilla.com>
Tue, 23 Dec 2014 12:50:10 +0000
changeset 236605 b4b836075ec884c0b12c4d346aac317a2fcb1fdc
parent 236604 5aa2a3e4341eba2185f75acc2e2be8aaee5f45a0
child 236606 eb13a999ffeba4eba10e9f674abc32eed55f11ee
push id208
push userryanvm@gmail.com
push dateMon, 23 Feb 2015 15:44:39 +0000
treeherdermozilla-b2g37_v2_2@09dafeb43234 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron, lsblakk
bugs1108616
milestone35.0
Bug 1108616 - Part 1: Language-specific text-transform casing behavior should only be used when content was explicitly tagged for language. r=dbaron, a=lsblakk
layout/generic/nsTextRunTransformations.cpp
--- a/layout/generic/nsTextRunTransformations.cpp
+++ b/layout/generic/nsTextRunTransformations.cpp
@@ -306,18 +306,21 @@ nsCaseTransformTextRunFactory::Transform
     uint32_t ch = str[i];
 
     nsStyleContext* styleContext;
     if (aTextRun) {
       styleContext = aTextRun->mStyles[i];
       style = aAllUppercase ? NS_STYLE_TEXT_TRANSFORM_UPPERCASE :
         styleContext->StyleText()->mTextTransform;
 
-      if (lang != styleContext->StyleFont()->mLanguage) {
-        lang = styleContext->StyleFont()->mLanguage;
+      const nsStyleFont* styleFont = styleContext->StyleFont();
+      nsIAtom* newLang = styleFont->mExplicitLanguage
+                         ? styleFont->mLanguage : nullptr;
+      if (lang != newLang) {
+        lang = newLang;
         languageSpecificCasing = GetCasingFor(lang);
         greekState.Reset();
         irishState.Reset();
         irishMark = uint32_t(-1);
       }
     }
 
     int extraChars = 0;