Bug 1108616 - part 1 - Language-specific text-transform casing behavior should only be used when content was explicitly tagged for language. r=dbaron a=sledru
authorJonathan Kew <jkew@mozilla.com>
Tue, 23 Dec 2014 12:50:10 +0000
changeset 231929 ad8ee13c6c6203cb8930d3f15170754c94c5e9a2
parent 231928 e35cdb2013afa46d0493e4c856a78e3f35a0cc43
child 231930 311e27cefcebf67a19b8342a3df9d3a4b736ac13
push id6
push userryanvm@gmail.com
push dateMon, 12 Jan 2015 22:04:06 +0000
treeherdermozilla-b2g37_v2_2@895c8fc7b734 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron, sledru
bugs1108616
milestone36.0a2
Bug 1108616 - part 1 - Language-specific text-transform casing behavior should only be used when content was explicitly tagged for language. r=dbaron a=sledru
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;