Bug 1037442 - Part 1: gfxFontFamily assertions on font entry family names should be case insensitive. r=jdaggett a=sylvestre
authorCameron McCormack <cam@mcc.id.au>
Sat, 26 Jul 2014 09:40:48 +1000
changeset 217249 8e8546266e99f8687e0775dce33a45b1c0edfa15
parent 217248 1a817719d9ea6ff8ace09ae660a87810deb81f7c
child 217250 50ef305a562bd7b2ac8c9d60728ddec872233a55
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdaggett, sylvestre
bugs1037442
milestone33.0a2
Bug 1037442 - Part 1: gfxFontFamily assertions on font entry family names should be case insensitive. r=jdaggett a=sylvestre
gfx/thebes/gfxUserFontSet.h
--- a/gfx/thebes/gfxUserFontSet.h
+++ b/gfx/thebes/gfxUserFontSet.h
@@ -101,17 +101,23 @@ public:
             if (mAvailableFonts[--i] == aFontEntry) {
                 mAvailableFonts.RemoveElementAt(i);
                 break;
             }
         }
         if (aFontEntry->mFamilyName.IsEmpty()) {
             aFontEntry->mFamilyName = Name();
         } else {
-            MOZ_ASSERT(aFontEntry->mFamilyName.Equals(Name()));
+#ifdef DEBUG
+            nsString thisName = Name();
+            nsString entryName = aFontEntry->mFamilyName;
+            ToLowerCase(thisName);
+            ToLowerCase(entryName);
+            MOZ_ASSERT(thisName.Equals(entryName));
+#endif
         }
         ResetCharacterMap();
     }
 
     // Replace aProxyFontEntry in the family's list with aRealFontEntry.
     void ReplaceFontEntry(gfxFontEntry *aProxyFontEntry,
                           gfxFontEntry *aRealFontEntry) {
         uint32_t numFonts = mAvailableFonts.Length();
@@ -120,17 +126,23 @@ public:
             gfxFontEntry *fe = mAvailableFonts[i];
             if (fe == aProxyFontEntry) {
                 // Note that this may delete aProxyFontEntry, if there's no
                 // other reference to it except from its family.
                 mAvailableFonts[i] = aRealFontEntry;
                 if (aRealFontEntry->mFamilyName.IsEmpty()) {
                     aRealFontEntry->mFamilyName = Name();
                 } else {
-                    MOZ_ASSERT(aRealFontEntry->mFamilyName.Equals(Name()));
+#ifdef DEBUG
+                  nsString thisName = Name();
+                  nsString entryName = aRealFontEntry->mFamilyName;
+                  ToLowerCase(thisName);
+                  ToLowerCase(entryName);
+                  MOZ_ASSERT(thisName.Equals(entryName));
+#endif
                 }
                 break;
             }
         }
         NS_ASSERTION(i < numFonts, "font entry not found in family!");
         ResetCharacterMap();
     }