Skip to content

Commit

Permalink
Backed out changeset 3a3cd254f508 (bug 1228501)
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed Nov 30, 2015
1 parent f7b1746 commit b203022
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
12 changes: 12 additions & 0 deletions gfx/src/nsFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ 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;
Expand All @@ -64,6 +65,7 @@ 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;
Expand Down Expand Up @@ -116,13 +118,23 @@ 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;
style = aOther.style;
systemFont = aOther.systemFont;
weight = aOther.weight;
stretch = aOther.stretch;
decorations = aOther.decorations;
smoothing = aOther.smoothing;
size = aOther.size;
sizeAdjust = aOther.sizeAdjust;
Expand Down
11 changes: 6 additions & 5 deletions gfx/src/nsFont.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ 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;

Expand Down Expand Up @@ -123,11 +127,8 @@ struct nsFont {
return Equals(aOther);
}

// FIXME (in patch 3): These are now the same. Remove BaseEquals!
bool Equals(const nsFont& aOther) const
{
return BaseEquals(aOther);
}
bool Equals(const nsFont& aOther) const ;
// Compare ignoring differences in 'variant' and 'decoration'
bool BaseEquals(const nsFont& aOther) const;

nsFont& operator=(const nsFont& aOther);
Expand Down
1 change: 1 addition & 0 deletions layout/style/nsRuleNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3413,6 +3413,7 @@ 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()->
Expand Down
5 changes: 4 additions & 1 deletion layout/style/nsStyleStruct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,10 @@ nsChangeHint nsStyleFont::CalcFontDifference(const nsFont& aFont1, const nsFont&
(aFont1.fontFeatureSettings == aFont2.fontFeatureSettings) &&
(aFont1.languageOverride == aFont2.languageOverride) &&
(aFont1.systemFont == aFont2.systemFont)) {
return NS_STYLE_HINT_NONE;
if ((aFont1.decorations == aFont2.decorations)) {
return NS_STYLE_HINT_NONE;
}
return nsChangeHint_RepaintFrame;
}
return NS_STYLE_HINT_REFLOW;
}
Expand Down

0 comments on commit b203022

Please sign in to comment.