Skip to content

Commit

Permalink
Bug 1228501 patch 4 - Remove nsStyleFont::CalcFontDifference, which n…
Browse files Browse the repository at this point in the history
…ow duplicates the list of tests in nsFont::Equals. r=jdaggett
  • Loading branch information
dbaron committed Nov 30, 2015
1 parent 7df5dbe commit d6c09b1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 33 deletions.
4 changes: 4 additions & 0 deletions gfx/src/nsFont.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
33 changes: 1 addition & 32 deletions layout/style/nsStyleStruct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand All @@ -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 ||
Expand Down Expand Up @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion layout/style/nsStyleStruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit d6c09b1

Please sign in to comment.