diff --git a/gfx/src/nsFont.h b/gfx/src/nsFont.h index fb0cdf636142..6276a7d61bf4 100644 --- a/gfx/src/nsFont.h +++ b/gfx/src/nsFont.h @@ -123,6 +123,10 @@ struct nsFont { return Equals(aOther); } + bool operator!=(const nsFont& aOther) const { + return !Equals(aOther); + } + bool Equals(const nsFont& aOther) const; nsFont& operator=(const nsFont& aOther); diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index 59923d86b0d9..37ec6111bcbe 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -173,6 +173,7 @@ 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 || @@ -181,11 +182,6 @@ nsChangeHint nsStyleFont::CalcDifference(const nsStyleFont& aOther) const 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 || @@ -229,33 +225,6 @@ nsStyleFont::GetLanguage(nsPresContext* aPresContext) 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) { diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index 3ab24d7ff363..2a8f87737a55 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -117,7 +117,6 @@ struct nsStyleFont { nsChangeHint_ReflowChangesSizeOrPosition | nsChangeHint_ClearAncestorIntrinsics; } - static nsChangeHint CalcFontDifference(const nsFont& aFont1, const nsFont& aFont2); /** * Return aSize multiplied by the current text zoom factor (in aPresContext).