Backed out changeset 3a3cd254f508 (bug 1228501)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Mon, 30 Nov 2015 12:10:38 +0100
changeset 308863 849931b41e226dbd3e3a4a801dc7de67f0d71989
parent 308862 00534f958b5a639737f9810fda197dad3d8b9186
child 308864 23a833513092e3e911a8b943193c6e7296866c40
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 out3a3cd254f508e87d384d7598b67751489370812a
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 3a3cd254f508 (bug 1228501)
gfx/src/nsFont.cpp
gfx/src/nsFont.h
layout/style/nsRuleNode.cpp
layout/style/nsStyleStruct.cpp
--- a/gfx/src/nsFont.cpp
+++ b/gfx/src/nsFont.cpp
@@ -43,32 +43,34 @@ nsFont::nsFont(FontFamilyType aGenericTy
 void
 nsFont::Init()
 {
   systemFont = false;
   smoothing = NS_FONT_SMOOTHING_AUTO;
   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;
   variantEastAsian = 0;
   variantLigatures = 0;
   variantNumeric = 0;
   variantPosition = NS_FONT_VARIANT_POSITION_NORMAL;
 }
 
 nsFont::nsFont(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;
   kerning = aOther.kerning;
   synthesis = aOther.synthesis;
   fontFeatureSettings = aOther.fontFeatureSettings;
   languageOverride = aOther.languageOverride;
   variantAlternates = aOther.variantAlternates;
@@ -111,23 +113,33 @@ bool nsFont::BaseEquals(const nsFont& aO
       (alternateValues == aOther.alternateValues) &&
       (featureValueLookup == aOther.featureValueLookup) &&
       (smoothing == aOther.smoothing)) {
     return true;
   }
   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;
   kerning = aOther.kerning;
   synthesis = aOther.synthesis;
   fontFeatureSettings = aOther.fontFeatureSettings;
   languageOverride = aOther.languageOverride;
   variantAlternates = aOther.variantAlternates;
--- a/gfx/src/nsFont.h
+++ b/gfx/src/nsFont.h
@@ -61,16 +61,20 @@ struct nsFont {
 
   // Some font-variant-alternates property values require
   // font-specific settings defined via @font-feature-values rules.
   // These are resolved *after* font matching occurs.
 
   // -- 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;
 
   // The weight of the font; see gfxFontConstants.h.
   uint16_t weight;
 
   // The stretch of the font (the sum of various NS_FONT_STRETCH_*
   // constants; see gfxFontConstants.h).
@@ -118,21 +122,18 @@ struct nsFont {
 
   nsFont();
   ~nsFont();
 
   bool operator==(const nsFont& aOther) const {
     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);
 
   void CopyAlternates(const nsFont& aOther);
 
   // Add featureSettings into style
   void AddFontFeaturesToStyle(gfxFontStyle *aStyle) const;
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -3408,16 +3408,17 @@ nsRuleNode::SetFont(nsPresContext* aPres
     if (LookAndFeel::GetFont(fontID, systemFontName, fontStyle, devPerCSS)) {
       systemFontName.Trim("\"'");
       systemFont.fontlist = FontFamilyList(systemFontName, eUnquotedName);
       systemFont.fontlist.SetDefaultFontType(eFamily_none);
       systemFont.style = fontStyle.style;
       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()->
                                   AppUnitsPerDevPixelAtUnitFullZoom());
       //systemFont.langGroup = fontStyle.langGroup;
       systemFont.sizeAdjust = fontStyle.sizeAdjust;
 
 #ifdef XP_WIN
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -246,17 +246,20 @@ nsChangeHint nsStyleFont::CalcFontDiffer
       (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;
+    if ((aFont1.decorations == aFont2.decorations)) {
+      return NS_STYLE_HINT_NONE;
+    }
+    return nsChangeHint_RepaintFrame;
   }
   return NS_STYLE_HINT_REFLOW;
 }
 
 static bool IsFixedData(const nsStyleSides& aSides, bool aEnumOK)
 {
   NS_FOR_CSS_SIDES(side) {
     if (!IsFixedUnit(aSides.Get(side), aEnumOK))