From 07d1584bd97cce6691995be000560a7adf9892b1 Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Sun, 29 Nov 2015 23:15:01 -0800 Subject: [PATCH] Bug 1228501 patch 2 - Remove nsFont::decorations member variable. r=jdaggett The member variable was always set to 0 or to NS_FONT_DECORATION_NONE, which is 0. Although this does leave a gap in the structure, I don't see any opportunities for reordering members to actually shrink nsFont. --HG-- extra : commitid : 9INFKtizQnt --- gfx/src/nsFont.cpp | 12 ------------ gfx/src/nsFont.h | 11 +++++------ layout/style/nsRuleNode.cpp | 1 - layout/style/nsStyleStruct.cpp | 5 +---- 4 files changed, 6 insertions(+), 23 deletions(-) diff --git a/gfx/src/nsFont.cpp b/gfx/src/nsFont.cpp index bd3c905fa901..f493633a9f6d 100644 --- a/gfx/src/nsFont.cpp +++ b/gfx/src/nsFont.cpp @@ -48,7 +48,6 @@ nsFont::Init() sizeAdjust = -1.0f; kerning = NS_FONT_KERNING_AUTO; synthesis = NS_FONT_SYNTHESIS_WEIGHT | NS_FONT_SYNTHESIS_STYLE; - decorations = 0; variantAlternates = 0; variantCaps = NS_FONT_VARIANT_CAPS_NORMAL; @@ -65,7 +64,6 @@ nsFont::nsFont(const nsFont& aOther) systemFont = aOther.systemFont; weight = aOther.weight; stretch = aOther.stretch; - decorations = aOther.decorations; smoothing = aOther.smoothing; size = aOther.size; sizeAdjust = aOther.sizeAdjust; @@ -118,15 +116,6 @@ bool nsFont::BaseEquals(const nsFont& aOther) const return false; } -bool nsFont::Equals(const nsFont& aOther) const -{ - if (BaseEquals(aOther) && - (decorations == aOther.decorations)) { - return true; - } - return false; -} - nsFont& nsFont::operator=(const nsFont& aOther) { fontlist = aOther.fontlist; @@ -134,7 +123,6 @@ nsFont& nsFont::operator=(const nsFont& aOther) systemFont = aOther.systemFont; weight = aOther.weight; stretch = aOther.stretch; - decorations = aOther.decorations; smoothing = aOther.smoothing; size = aOther.size; sizeAdjust = aOther.sizeAdjust; diff --git a/gfx/src/nsFont.h b/gfx/src/nsFont.h index 7b4137543985..68f1c2acb1ab 100644 --- a/gfx/src/nsFont.h +++ b/gfx/src/nsFont.h @@ -66,10 +66,6 @@ struct nsFont { // -- bitmask for both enumerated and functional propvals uint16_t variantAlternates; - // The decorations on the font (underline, overline, - // line-through). The decorations can be binary or'd together. - uint8_t decorations; - // Smoothing - controls subpixel-antialiasing (currently OSX only) uint8_t smoothing; @@ -127,8 +123,11 @@ struct nsFont { return Equals(aOther); } - bool Equals(const nsFont& aOther) const ; - // Compare ignoring differences in 'variant' and 'decoration' + // FIXME (in patch 3): These are now the same. Remove BaseEquals! + bool Equals(const nsFont& aOther) const + { + return BaseEquals(aOther); + } bool BaseEquals(const nsFont& aOther) const; nsFont& operator=(const nsFont& aOther); diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index 9fee0a12abb2..7b3a3996db14 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -3413,7 +3413,6 @@ nsRuleNode::SetFont(nsPresContext* aPresContext, nsStyleContext* aContext, systemFont.systemFont = fontStyle.systemFont; systemFont.weight = fontStyle.weight; systemFont.stretch = fontStyle.stretch; - systemFont.decorations = NS_FONT_DECORATION_NONE; systemFont.size = NSFloatPixelsToAppUnits(fontStyle.size, aPresContext->DeviceContext()-> diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index 633c2bd35a68..59923d86b0d9 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -251,10 +251,7 @@ nsChangeHint nsStyleFont::CalcFontDifference(const nsFont& aFont1, const nsFont& (aFont1.fontFeatureSettings == aFont2.fontFeatureSettings) && (aFont1.languageOverride == aFont2.languageOverride) && (aFont1.systemFont == aFont2.systemFont)) { - if ((aFont1.decorations == aFont2.decorations)) { - return NS_STYLE_HINT_NONE; - } - return nsChangeHint_RepaintFrame; + return NS_STYLE_HINT_NONE; } return NS_STYLE_HINT_REFLOW; }