Remove tracking of which font families are quirky, since we no longer use the information. (Bug 636040) r=jdaggett
authorL. David Baron <dbaron@dbaron.org>
Thu, 03 Mar 2011 13:18:42 -0800
changeset 63567 74c57fbb4121de3a272680c648451a108946c5dd
parent 63566 fa751027e9b8d529dd0e1b3a4f38cf2d98066f6b
child 63568 b17d9492f99fe31e43e354c22079cf30d8e117b5
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdaggett
bugs636040
milestone2.0b13pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Remove tracking of which font families are quirky, since we no longer use the information. (Bug 636040) r=jdaggett
content/canvas/src/nsCanvasRenderingContext2D.cpp
gfx/src/nsFont.cpp
gfx/src/nsFont.h
gfx/src/thebes/nsThebesDeviceContext.cpp
gfx/src/thebes/nsThebesFontMetrics.cpp
gfx/thebes/gfxFont.cpp
gfx/thebes/gfxFont.h
gfx/thebes/gfxPangoFonts.cpp
layout/style/nsRuleNode.cpp
layout/style/nsStyleStruct.cpp
layout/svg/base/src/nsSVGGlyphFrame.cpp
--- a/content/canvas/src/nsCanvasRenderingContext2D.cpp
+++ b/content/canvas/src/nsCanvasRenderingContext2D.cpp
@@ -2315,17 +2315,16 @@ nsCanvasRenderingContext2D::SetFont(cons
 
     gfxFontStyle style(fontStyle->mFont.style,
                        fontStyle->mFont.weight,
                        fontStyle->mFont.stretch,
                        NSAppUnitsToFloatPixels(fontSize, float(aupcp)),
                        language,
                        fontStyle->mFont.sizeAdjust,
                        fontStyle->mFont.systemFont,
-                       fontStyle->mFont.familyNameQuirks,
                        printerFont,
                        fontStyle->mFont.featureSettings,
                        fontStyle->mFont.languageOverride);
 
     CurrentState().fontGroup =
         gfxPlatform::GetPlatform()->CreateFontGroup(fontStyle->mFont.name,
                                                     &style,
                                                     presShell->GetPresContext()->GetUserFontSet());
--- a/gfx/src/nsFont.cpp
+++ b/gfx/src/nsFont.cpp
@@ -47,17 +47,16 @@ nsFont::nsFont(const char* aName, PRUint
                const nsString* aLanguageOverride)
 {
   NS_ASSERTION(aName && IsASCII(nsDependentCString(aName)),
                "Must only pass ASCII names here");
   name.AssignASCII(aName);
   style = aStyle;
   systemFont = PR_FALSE;
   variant = aVariant;
-  familyNameQuirks = PR_FALSE;
   weight = aWeight;
   stretch = aStretch;
   decorations = aDecoration;
   size = aSize;
   sizeAdjust = aSizeAdjust;
   if (aFeatureSettings) {
     featureSettings = *aFeatureSettings;
   }
@@ -71,17 +70,16 @@ nsFont::nsFont(const nsString& aName, PR
                nscoord aSize, float aSizeAdjust,
                const nsString* aFeatureSettings,
                const nsString* aLanguageOverride)
   : name(aName)
 {
   style = aStyle;
   systemFont = PR_FALSE;
   variant = aVariant;
-  familyNameQuirks = PR_FALSE;
   weight = aWeight;
   stretch = aStretch;
   decorations = aDecoration;
   size = aSize;
   sizeAdjust = aSizeAdjust;
   if (aFeatureSettings) {
     featureSettings = *aFeatureSettings;
   }
@@ -91,17 +89,16 @@ nsFont::nsFont(const nsString& aName, PR
 }
 
 nsFont::nsFont(const nsFont& aOther)
   : name(aOther.name)
 {
   style = aOther.style;
   systemFont = aOther.systemFont;
   variant = aOther.variant;
-  familyNameQuirks = aOther.familyNameQuirks;
   weight = aOther.weight;
   stretch = aOther.stretch;
   decorations = aOther.decorations;
   size = aOther.size;
   sizeAdjust = aOther.sizeAdjust;
   featureSettings = aOther.featureSettings;
   languageOverride = aOther.languageOverride;
 }
@@ -113,17 +110,16 @@ nsFont::nsFont()
 nsFont::~nsFont()
 {
 }
 
 PRBool nsFont::BaseEquals(const nsFont& aOther) const
 {
   if ((style == aOther.style) &&
       (systemFont == aOther.systemFont) &&
-      (familyNameQuirks == aOther.familyNameQuirks) &&
       (weight == aOther.weight) &&
       (stretch == aOther.stretch) &&
       (size == aOther.size) &&
       (sizeAdjust == aOther.sizeAdjust) &&
       name.Equals(aOther.name, nsCaseInsensitiveStringComparator()) &&
       (featureSettings == aOther.featureSettings) &&
       (languageOverride == aOther.languageOverride)) {
     return PR_TRUE;
@@ -142,17 +138,16 @@ PRBool nsFont::Equals(const nsFont& aOth
 }
 
 nsFont& nsFont::operator=(const nsFont& aOther)
 {
   name = aOther.name;
   style = aOther.style;
   systemFont = aOther.systemFont;
   variant = aOther.variant;
-  familyNameQuirks = aOther.familyNameQuirks;
   weight = aOther.weight;
   stretch = aOther.stretch;
   decorations = aOther.decorations;
   size = aOther.size;
   sizeAdjust = aOther.sizeAdjust;
   featureSettings = aOther.featureSettings;
   languageOverride = aOther.languageOverride;
   return *this;
--- a/gfx/src/nsFont.h
+++ b/gfx/src/nsFont.h
@@ -73,20 +73,16 @@ struct NS_GFX nsFont {
 
   // Force this font to not be considered a 'generic' font, even if
   // the name is the same as a CSS generic font family.
   PRUint8 systemFont;
 
   // The variant of the font (normal, small-caps)
   PRUint8 variant;
 
-  // True if the character set quirks (for treatment of "Symbol",
-  // "Wingdings", etc.) should be applied.
-  PRUint8 familyNameQuirks;
-
   // The weight of the font; see gfxFontConstants.h.
   PRUint16 weight;
 
   // The stretch of the font (the sum of various NS_FONT_STRETCH_*
   // constants; see gfxFontConstants.h).
   PRInt16 stretch;
 
   // The decorations on the font (underline, overline,
--- a/gfx/src/thebes/nsThebesDeviceContext.cpp
+++ b/gfx/src/thebes/nsThebesDeviceContext.cpp
@@ -826,17 +826,16 @@ nsThebesDeviceContext::GetSystemFont(nsS
     gfxFontStyle fontStyle;
     nsresult rv = gSystemFonts->GetSystemFont(aID, &fontName, &fontStyle);
     NS_ENSURE_SUCCESS(rv, rv);
 
     aFont->name = fontName;
     aFont->style = fontStyle.style;
     aFont->systemFont = fontStyle.systemFont;
     aFont->variant = NS_FONT_VARIANT_NORMAL;
-    aFont->familyNameQuirks = fontStyle.familyNameQuirks;
     aFont->weight = fontStyle.weight;
     aFont->stretch = fontStyle.stretch;
     aFont->decorations = NS_FONT_DECORATION_NONE;
     aFont->size = NSFloatPixelsToAppUnits(fontStyle.size, UnscaledAppUnitsPerDevPixel());
     //aFont->langGroup = fontStyle.langGroup;
     aFont->sizeAdjust = fontStyle.sizeAdjust;
 
     return rv;
--- a/gfx/src/thebes/nsThebesFontMetrics.cpp
+++ b/gfx/src/thebes/nsThebesFontMetrics.cpp
@@ -77,17 +77,16 @@ nsThebesFontMetrics::Init(const nsFont& 
     mTextRunRTL = PR_FALSE;
 
     gfxFloat size = gfxFloat(aFont.size) / mP2A;
 
     PRBool printerFont = mDeviceContext->IsPrinterSurface();
     mFontStyle = new gfxFontStyle(aFont.style, aFont.weight, aFont.stretch,
                                   size, aLanguage,
                                   aFont.sizeAdjust, aFont.systemFont,
-                                  aFont.familyNameQuirks,
                                   printerFont,
                                   aFont.featureSettings,
                                   aFont.languageOverride);
 
     mFontGroup =
         gfxPlatform::GetPlatform()->CreateFontGroup(aFont.name, mFontStyle, 
                                                     aUserFontSet);
     if (mFontGroup->FontListLength() < 1) 
--- a/gfx/thebes/gfxFont.cpp
+++ b/gfx/thebes/gfxFont.cpp
@@ -2855,33 +2855,32 @@ gfxFontStyle::ParseFontLanguageOverride(
   while (index++ < 4) {
     result = (result << 8) + 0x20;
   }
   return result;
 }
 
 gfxFontStyle::gfxFontStyle() :
     style(FONT_STYLE_NORMAL), systemFont(PR_TRUE), printerFont(PR_FALSE), 
-    familyNameQuirks(PR_FALSE), weight(FONT_WEIGHT_NORMAL),
+    weight(FONT_WEIGHT_NORMAL),
     stretch(NS_FONT_STRETCH_NORMAL), size(DEFAULT_PIXEL_FONT_SIZE),
     sizeAdjust(0.0f),
     language(gfxAtoms::x_western),
     languageOverride(NO_FONT_LANGUAGE_OVERRIDE)
 {
 }
 
 gfxFontStyle::gfxFontStyle(PRUint8 aStyle, PRUint16 aWeight, PRInt16 aStretch,
                            gfxFloat aSize, nsIAtom *aLanguage,
                            float aSizeAdjust, PRPackedBool aSystemFont,
-                           PRPackedBool aFamilyNameQuirks,
                            PRPackedBool aPrinterFont,
                            const nsString& aFeatureSettings,
                            const nsString& aLanguageOverride):
     style(aStyle), systemFont(aSystemFont), printerFont(aPrinterFont),
-    familyNameQuirks(aFamilyNameQuirks), weight(aWeight), stretch(aStretch),
+    weight(aWeight), stretch(aStretch),
     size(aSize), sizeAdjust(aSizeAdjust),
     language(aLanguage),
     languageOverride(ParseFontLanguageOverride(aLanguageOverride))
 {
     ParseFontFeatureSettings(aFeatureSettings, featureSettings);
 
     if (weight > 900)
         weight = 900;
@@ -2899,17 +2898,17 @@ gfxFontStyle::gfxFontStyle(PRUint8 aStyl
     if (!language) {
         NS_WARNING("null language");
         language = gfxAtoms::x_western;
     }
 }
 
 gfxFontStyle::gfxFontStyle(const gfxFontStyle& aStyle) :
     style(aStyle.style), systemFont(aStyle.systemFont), printerFont(aStyle.printerFont),
-    familyNameQuirks(aStyle.familyNameQuirks), weight(aStyle.weight),
+    weight(aStyle.weight),
     stretch(aStyle.stretch), size(aStyle.size),
     sizeAdjust(aStyle.sizeAdjust),
     language(aStyle.language),
     languageOverride(aStyle.languageOverride)
 {
     featureSettings.AppendElements(aStyle.featureSettings);
 }
 
--- a/gfx/thebes/gfxFont.h
+++ b/gfx/thebes/gfxFont.h
@@ -106,37 +106,32 @@ operator==(const gfxFontFeature& a, cons
 }
 
 
 struct THEBES_API gfxFontStyle {
     gfxFontStyle();
     gfxFontStyle(PRUint8 aStyle, PRUint16 aWeight, PRInt16 aStretch,
                  gfxFloat aSize, nsIAtom *aLanguage,
                  float aSizeAdjust, PRPackedBool aSystemFont,
-                 PRPackedBool aFamilyNameQuirks,
                  PRPackedBool aPrinterFont,
                  const nsString& aFeatureSettings,
                  const nsString& aLanguageOverride);
     gfxFontStyle(const gfxFontStyle& aStyle);
 
     // The style of font (normal, italic, oblique)
     PRUint8 style : 7;
 
     // Say that this font is a system font and therefore does not
     // require certain fixup that we do for fonts from untrusted
     // sources.
     PRPackedBool systemFont : 1;
 
     // Say that this font is used for print or print preview.
     PRPackedBool printerFont : 1;
 
-    // True if the character set quirks (for treatment of "Symbol",
-    // "Wingdings", etc.) should be applied.
-    PRPackedBool familyNameQuirks : 1;
-
     // The weight of the font: 100, 200, ... 900.
     PRUint16 weight;
 
     // The stretch of the font (the sum of various NS_FONT_STRETCH_*
     // constants; see gfxFontConstants.h).
     PRInt16 stretch;
 
     // The logical size of the font, in pixels
@@ -172,29 +167,28 @@ struct THEBES_API gfxFontStyle {
     // Not meant to be called when sizeAdjust = 0.
     gfxFloat GetAdjustedSize(gfxFloat aspect) const {
         NS_ASSERTION(sizeAdjust != 0.0, "Not meant to be called when sizeAdjust = 0");
         gfxFloat adjustedSize = PR_MAX(NS_round(size*(sizeAdjust/aspect)), 1.0);
         return PR_MIN(adjustedSize, FONT_MAX_SIZE);
     }
 
     PLDHashNumber Hash() const {
-        return ((style + (systemFont << 7) + (familyNameQuirks << 8) +
-            (weight << 9)) + PRUint32(size*1000) + PRUint32(sizeAdjust*1000)) ^
+        return ((style + (systemFont << 7) +
+            (weight << 8)) + PRUint32(size*1000) + PRUint32(sizeAdjust*1000)) ^
             nsISupportsHashKey::HashKey(language);
     }
 
     PRInt8 ComputeWeight() const;
 
     PRBool Equals(const gfxFontStyle& other) const {
         return (size == other.size) &&
             (style == other.style) &&
             (systemFont == other.systemFont) &&
             (printerFont == other.printerFont) &&
-            (familyNameQuirks == other.familyNameQuirks) &&
             (weight == other.weight) &&
             (stretch == other.stretch) &&
             (language == other.language) &&
             (sizeAdjust == other.sizeAdjust) &&
             (featureSettings == other.featureSettings) &&
             (languageOverride == other.languageOverride);
     }
 
--- a/gfx/thebes/gfxPangoFonts.cpp
+++ b/gfx/thebes/gfxPangoFonts.cpp
@@ -2341,17 +2341,17 @@ gfxFcFont::GetOrMakeFont(FcPattern *aReq
 
         // The LangSet in the FcPattern does not have an order so there is no
         // one particular language to choose and converting the set to a
         // string through FcNameUnparse() is more trouble than it's worth.
         nsIAtom *language = gfxAtoms::en; // TODO: get the correct language?
         // FIXME: Pass a real stretch based on renderPattern!
         gfxFontStyle fontStyle(style, weight, NS_FONT_STRETCH_NORMAL,
                                size, language, 0.0,
-                               PR_TRUE, PR_FALSE, PR_FALSE,
+                               PR_TRUE, PR_FALSE,
                                NS_LITERAL_STRING(""),
                                NS_LITERAL_STRING(""));
 
         // Note that a file/index pair (or FT_Face) and the gfxFontStyle are
         // not necessarily enough to provide a key that will describe a unique
         // font.  cairoFont contains information from renderPattern, which is a
         // fully resolved pattern from FcFontRenderPrepare.
         // FcFontRenderPrepare takes the requested pattern and the face
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -2939,41 +2939,35 @@ nsRuleNode::SetFont(nsPresContext* aPres
     // MJA: bug 31816
     if (aGenericFontID == kGenericFont_NONE) {
       // only bother appending fallback fonts if this isn't a fallback generic font itself
       if (!aFont->mFont.name.IsEmpty())
         aFont->mFont.name.Append((PRUnichar)',');
       // defaultVariableFont.name should always be "serif" or "sans-serif".
       aFont->mFont.name.Append(defaultVariableFont->name);
     }
-    aFont->mFont.familyNameQuirks =
-        (aPresContext->CompatibilityMode() == eCompatibility_NavQuirks &&
-         aFontData.mFamilyFromHTML);
     aFont->mFont.systemFont = PR_FALSE;
     // Technically this is redundant with the code below, but it's good
     // to have since we'll still want it once we get rid of
     // SetGenericFont (bug 380915).
     aFont->mGenericID = aGenericFontID;
   }
   else if (eCSSUnit_System_Font == aFontData.mFamily.GetUnit()) {
     aFont->mFont.name = systemFont.name;
-    aFont->mFont.familyNameQuirks = PR_FALSE;
     aFont->mFont.systemFont = PR_TRUE;
     aFont->mGenericID = kGenericFont_NONE;
   }
   else if (eCSSUnit_Inherit == aFontData.mFamily.GetUnit()) {
     aCanStoreInRuleTree = PR_FALSE;
     aFont->mFont.name = aParentFont->mFont.name;
-    aFont->mFont.familyNameQuirks = aParentFont->mFont.familyNameQuirks;
     aFont->mFont.systemFont = aParentFont->mFont.systemFont;
     aFont->mGenericID = aParentFont->mGenericID;
   }
   else if (eCSSUnit_Initial == aFontData.mFamily.GetUnit()) {
     aFont->mFont.name = defaultVariableFont->name;
-    aFont->mFont.familyNameQuirks = PR_FALSE;
     aFont->mFont.systemFont = defaultVariableFont->systemFont;
     aFont->mGenericID = kGenericFont_NONE;
   }
 
   // When we're in the loop in SetGenericFont, we must ensure that we
   // always keep aFont->mFlags set to the correct generic.  But we have
   // to be careful not to touch it when we're called directly from
   // ComputeFontData, because we could have a start struct.
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -203,17 +203,16 @@ nsStyleFont::UnZoomText(nsPresContext *a
 }
 
 nsChangeHint nsStyleFont::CalcFontDifference(const nsFont& aFont1, const nsFont& aFont2)
 {
   if ((aFont1.size == aFont2.size) && 
       (aFont1.sizeAdjust == aFont2.sizeAdjust) && 
       (aFont1.style == aFont2.style) &&
       (aFont1.variant == aFont2.variant) &&
-      (aFont1.familyNameQuirks == aFont2.familyNameQuirks) &&
       (aFont1.weight == aFont2.weight) &&
       (aFont1.stretch == aFont2.stretch) &&
       (aFont1.name == aFont2.name) &&
       (aFont1.featureSettings == aFont2.featureSettings) &&
       (aFont1.languageOverride == aFont2.languageOverride)) {
     if ((aFont1.decorations == aFont2.decorations)) {
       return NS_STYLE_HINT_NONE;
     }
--- a/layout/svg/base/src/nsSVGGlyphFrame.cpp
+++ b/layout/svg/base/src/nsSVGGlyphFrame.cpp
@@ -1597,17 +1597,16 @@ nsSVGGlyphFrame::EnsureTextRun(float *aD
     }
 
     const nsFont& font = fontData->mFont;
     PRBool printerFont = (presContext->Type() == nsPresContext::eContext_PrintPreview ||
                           presContext->Type() == nsPresContext::eContext_Print);
     gfxFontStyle fontStyle(font.style, font.weight, font.stretch, textRunSize,
                            mStyleContext->GetStyleVisibility()->mLanguage,
                            font.sizeAdjust, font.systemFont,
-                           font.familyNameQuirks,
                            printerFont,
                            font.featureSettings,
                            font.languageOverride);
 
     nsRefPtr<gfxFontGroup> fontGroup =
       gfxPlatform::GetPlatform()->CreateFontGroup(font.name, &fontStyle, presContext->GetUserFontSet());
 
     PRUint32 flags = gfxTextRunFactory::TEXT_NEED_BOUNDING_BOX |