Bug 1228501 patch 4 - Remove nsStyleFont::CalcFontDifference, which now duplicates the list of tests in nsFont::Equals. r=jdaggett
authorL. David Baron <dbaron@dbaron.org>
Mon, 30 Nov 2015 14:02:25 -0800
changeset 308899 d197e2ef0123e53cf40dedc2b9c9a317d1082973
parent 308898 16798ce74d1e41d4cf87efd2db1604529acef19e
child 308900 c15544b94db594a4619d63329704a0252e4e22b0
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdaggett
bugs1228501
milestone45.0a1
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
Bug 1228501 patch 4 - Remove nsStyleFont::CalcFontDifference, which now duplicates the list of tests in nsFont::Equals. r=jdaggett
gfx/src/nsFont.h
layout/style/nsStyleStruct.cpp
layout/style/nsStyleStruct.h
--- a/gfx/src/nsFont.h
+++ b/gfx/src/nsFont.h
@@ -118,16 +118,20 @@ struct nsFont {
 
   nsFont();
   ~nsFont();
 
   bool operator==(const nsFont& aOther) const {
     return Equals(aOther);
   }
 
+  bool operator!=(const nsFont& aOther) const {
+    return !Equals(aOther);
+  }
+
   bool Equals(const nsFont& aOther) const;
 
   nsFont& operator=(const nsFont& aOther);
 
   void CopyAlternates(const nsFont& aOther);
 
   // Add featureSettings into style
   void AddFontFeaturesToStyle(gfxFontStyle *aStyle) const;
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -168,29 +168,25 @@ nsStyleFont::EnableZoom(nsPresContext* a
   }
 }
 
 nsChangeHint nsStyleFont::CalcDifference(const nsStyleFont& aOther) const
 {
   MOZ_ASSERT(mAllowZoom == aOther.mAllowZoom,
              "expected mAllowZoom to be the same on both nsStyleFonts");
   if (mSize != aOther.mSize ||
+      mFont != aOther.mFont ||
       mLanguage != aOther.mLanguage ||
       mExplicitLanguage != aOther.mExplicitLanguage ||
       mMathVariant != aOther.mMathVariant ||
       mMathDisplay != aOther.mMathDisplay ||
       mMinFontSizeRatio != aOther.mMinFontSizeRatio) {
     return NS_STYLE_HINT_REFLOW;
   }
 
-  nsChangeHint hint = CalcFontDifference(mFont, aOther.mFont);
-  if (hint) {
-    return hint;
-  }
-
   // XXX Should any of these cause a non-nsChangeHint_NeutralChange change?
   if (mGenericID != aOther.mGenericID ||
       mScriptLevel != aOther.mScriptLevel ||
       mScriptUnconstrainedSize != aOther.mScriptUnconstrainedSize ||
       mScriptMinSize != aOther.mScriptMinSize ||
       mScriptSizeMultiplier != aOther.mScriptSizeMultiplier) {
     return nsChangeHint_NeutralChange;
   }
@@ -224,43 +220,16 @@ nsStyleFont::GetLanguage(nsPresContext* 
     // NOTE this should not be used elsewhere, because we want websites
     // to use UTF-8 with proper language tag, instead of relying on
     // deriving language from charset. See bug 1040668 comment 67.
     language = aPresContext->GetLanguageFromCharset();
   }
   return language.forget();
 }
 
-nsChangeHint nsStyleFont::CalcFontDifference(const nsFont& aFont1, const nsFont& aFont2)
-{
-  if ((aFont1.size == aFont2.size) && 
-      (aFont1.sizeAdjust == aFont2.sizeAdjust) && 
-      (aFont1.style == aFont2.style) &&
-      (aFont1.weight == aFont2.weight) &&
-      (aFont1.stretch == aFont2.stretch) &&
-      (aFont1.smoothing == aFont2.smoothing) &&
-      (aFont1.fontlist == aFont2.fontlist) &&
-      (aFont1.kerning == aFont2.kerning) &&
-      (aFont1.synthesis == aFont2.synthesis) &&
-      (aFont1.variantAlternates == aFont2.variantAlternates) &&
-      (aFont1.alternateValues == aFont2.alternateValues) &&
-      (aFont1.featureValueLookup == aFont2.featureValueLookup) &&
-      (aFont1.variantCaps == aFont2.variantCaps) &&
-      (aFont1.variantEastAsian == aFont2.variantEastAsian) &&
-      (aFont1.variantLigatures == aFont2.variantLigatures) &&
-      (aFont1.variantNumeric == aFont2.variantNumeric) &&
-      (aFont1.variantPosition == aFont2.variantPosition) &&
-      (aFont1.fontFeatureSettings == aFont2.fontFeatureSettings) &&
-      (aFont1.languageOverride == aFont2.languageOverride) &&
-      (aFont1.systemFont == aFont2.systemFont)) {
-    return NS_STYLE_HINT_NONE;
-  }
-  return NS_STYLE_HINT_REFLOW;
-}
-
 static bool IsFixedData(const nsStyleSides& aSides, bool aEnumOK)
 {
   NS_FOR_CSS_SIDES(side) {
     if (!IsFixedUnit(aSides.Get(side), aEnumOK))
       return false;
   }
   return true;
 }
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -112,17 +112,16 @@ struct nsStyleFont {
   }
   static nsChangeHint DifferenceAlwaysHandledForDescendants() {
     // CalcDifference never returns the reflow hints that are sometimes
     // handled for descendants as hints not handled for descendants.
     return nsChangeHint_NeedReflow |
            nsChangeHint_ReflowChangesSizeOrPosition |
            nsChangeHint_ClearAncestorIntrinsics;
   }
-  static nsChangeHint CalcFontDifference(const nsFont& aFont1, const nsFont& aFont2);
 
   /**
    * Return aSize multiplied by the current text zoom factor (in aPresContext).
    * aSize is allowed to be negative, but the caller is expected to deal with
    * negative results.  The result is clamped to nscoord_MIN .. nscoord_MAX.
    */
   static nscoord ZoomText(nsPresContext* aPresContext, nscoord aSize);
   /**