Not part of the build (barely). Don't skip updating per-char arrays for characters that are cluster continuations (in small-caps code).
authorroc+@cs.cmu.edu
Wed, 13 Jun 2007 11:28:38 -0700
changeset 2358 1c89e84e322fe555701a11584f540107b348d351
parent 2357 23051e1358751a604c0b9380663d391ceb5a716f
child 2359 a153070c07f254036d3217b9e5e1df5a7d2f6d87
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherdermozilla-central@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9a6pre
Not part of the build (barely). Don't skip updating per-char arrays for characters that are cluster continuations (in small-caps code).
layout/generic/nsTextRunTransformations.cpp
--- a/layout/generic/nsTextRunTransformations.cpp
+++ b/layout/generic/nsTextRunTransformations.cpp
@@ -349,17 +349,17 @@ nsFontVariantTextRunFactory::RebuildText
   if (!inner)
     return;
 
   nsCaseTransformTextRunFactory uppercaseFactory(nsnull, PR_TRUE);
 
   aTextRun->ResetGlyphRuns();
 
   PRUint32 runStart = 0;
-  PRPackedBool runIsLowercase = PR_FALSE;
+  PRBool runIsLowercase = PR_FALSE;
   nsAutoTArray<nsStyleContext*,50> styleArray;
   nsAutoTArray<PRPackedBool,50> canBreakBeforeArray;
   nsAutoTArray<PRUint32,10> lineBreakBeforeArray;
 
   PRUint32 nextLineBreak = 0;
   PRUint32 i;
   for (i = 0; i <= length; ++i) {
     if (nextLineBreak < aTextRun->mLineBreaks.Length() &&
@@ -367,26 +367,27 @@ nsFontVariantTextRunFactory::RebuildText
       lineBreakBeforeArray.AppendElement(i - runStart);
       ++nextLineBreak;
     }
 
     PRBool isLowercase = PR_FALSE;
     if (i < length) {
       // Characters that aren't the start of a cluster are ignored here. They
       // get added to whatever lowercase/non-lowercase run we're in.
-      if (!inner->IsClusterStart(i))
-        continue;
-
-      if (styles[i]->GetStyleFont()->mFont.variant == NS_STYLE_FONT_VARIANT_SMALL_CAPS) {
-        PRUnichar ch = str[i];
-        PRUnichar ch2;
-        converter->ToUpper(ch, &ch2);
-        isLowercase = ch != ch2 || ch == SZLIG;
+      if (!inner->IsClusterStart(i)) {
+        isLowercase = runIsLowercase;
       } else {
-        // Don't transform the character! I.e., pretend that it's not lowercase
+        if (styles[i]->GetStyleFont()->mFont.variant == NS_STYLE_FONT_VARIANT_SMALL_CAPS) {
+          PRUnichar ch = str[i];
+          PRUnichar ch2;
+          converter->ToUpper(ch, &ch2);
+          isLowercase = ch != ch2 || ch == SZLIG;
+        } else {
+          // Don't transform the character! I.e., pretend that it's not lowercase
+        }
       }
     }
 
     if ((i == length || runIsLowercase != isLowercase) && runStart < i) {
       nsAutoPtr<gfxTextRun> child;
       // Setup actual line break data for child (which may affect shaping)
       innerParams.mInitialBreaks = lineBreakBeforeArray.Elements();
       innerParams.mInitialBreakCount = lineBreakBeforeArray.Length();