Backed out changeset ec79945130ff (bug 1228501)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Mon, 30 Nov 2015 12:10:35 +0100
changeset 308861 37260f474fe4b9bb0b8a47f72773fd5c64585184
parent 308860 8780fa4a15558051a028ec1ea4a75b19531c6166
child 308862 00534f958b5a639737f9810fda197dad3d8b9186
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)
bugs1228501
milestone45.0a1
backs outec79945130ff962575dba5d4579071b7a3b38346
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
Backed out changeset ec79945130ff (bug 1228501)
gfx/src/nsFont.h
layout/style/nsStyleStruct.cpp
layout/style/nsStyleStruct.h
--- a/gfx/src/nsFont.h
+++ b/gfx/src/nsFont.h
@@ -118,20 +118,16 @@ 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,25 +168,29 @@ 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;
   }
@@ -220,16 +224,43 @@ 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,16 +112,17 @@ 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);
   /**