Bug 1452040 - Get rid of NS_STYLE_FONT_WEIGHT_NORMAL and NS_STYLE_FONT_WEIGHT_BOLD. r=emilio
authorJonathan Watt <jwatt@jwatt.org>
Fri, 06 Apr 2018 14:53:25 +0100
changeset 468318 deafa2891c61a4570bcadb80b90adac0930b1d10
parent 468317 1a7f56d4af25927c756f94f333068ba5499b2895
child 468319 199800118427f31cb39876ddf50ef38cd8d352f4
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1452040
milestone61.0a1
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
Bug 1452040 - Get rid of NS_STYLE_FONT_WEIGHT_NORMAL and NS_STYLE_FONT_WEIGHT_BOLD. r=emilio
dom/mathml/nsMathMLElement.cpp
layout/style/FontFaceSet.cpp
layout/style/nsCSSProps.cpp
layout/style/nsStyleConsts.h
--- a/dom/mathml/nsMathMLElement.cpp
+++ b/dom/mathml/nsMathMLElement.cpp
@@ -721,20 +721,20 @@ nsMathMLElement::MapMathMLAttributesInto
                    nsGkAtoms::mathvariant_->GetUTF16String(),
                    aData->Document());
     if (value->Type() == nsAttrValue::eString &&
         !aData->PropertyIsSet(eCSSProperty_font_weight)) {
       nsAutoString str(value->GetStringValue());
       str.CompressWhitespace();
       if (str.EqualsASCII("normal")) {
         aData->SetKeywordValue(eCSSProperty_font_weight,
-                               NS_STYLE_FONT_WEIGHT_NORMAL);
+                               NS_FONT_WEIGHT_NORMAL);
       } else if (str.EqualsASCII("bold")) {
         aData->SetKeywordValue(eCSSProperty_font_weight,
-                               NS_STYLE_FONT_WEIGHT_BOLD);
+                               NS_FONT_WEIGHT_BOLD);
       }
     }
   }
 
   // mathvariant
   //
   // "Specifies the logical class of the token. Note that this class is more
   // than styling, it typically conveys semantic intent;"
--- a/layout/style/FontFaceSet.cpp
+++ b/layout/style/FontFaceSet.cpp
@@ -967,32 +967,32 @@ FontFaceSet::FindOrCreateUserFontEntryFr
                                                    FontFace* aFontFace,
                                                    SheetType aSheetType)
 {
   FontFaceSet* set = aFontFace->GetPrimaryFontFaceSet();
 
   nsCSSValue val;
   nsCSSUnit unit;
 
-  uint32_t weight = NS_STYLE_FONT_WEIGHT_NORMAL;
+  uint32_t weight = NS_FONT_WEIGHT_NORMAL;
   int32_t stretch = NS_STYLE_FONT_STRETCH_NORMAL;
   uint8_t italicStyle = NS_STYLE_FONT_STYLE_NORMAL;
   uint32_t languageOverride = NO_FONT_LANGUAGE_OVERRIDE;
   uint8_t fontDisplay = NS_FONT_DISPLAY_AUTO;
 
   // set up weight
   aFontFace->GetDesc(eCSSFontDesc_Weight, val);
   unit = val.GetUnit();
   if (unit == eCSSUnit_Integer || unit == eCSSUnit_Enumerated) {
     weight = val.GetIntValue();
     if (weight == 0) {
-      weight = NS_STYLE_FONT_WEIGHT_NORMAL;
+      weight = NS_FONT_WEIGHT_NORMAL;
     }
   } else if (unit == eCSSUnit_Normal) {
-    weight = NS_STYLE_FONT_WEIGHT_NORMAL;
+    weight = NS_FONT_WEIGHT_NORMAL;
   } else {
     NS_ASSERTION(unit == eCSSUnit_Null,
                  "@font-face weight has unexpected unit");
   }
 
   // set up stretch
   aFontFace->GetDesc(eCSSFontDesc_Stretch, val);
   unit = val.GetUnit();
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -1370,18 +1370,18 @@ const KTableEntry nsCSSProps::kFontVaria
 
 const KTableEntry nsCSSProps::kFontVariantPositionKTable[] = {
   { eCSSKeyword_super, NS_FONT_VARIANT_POSITION_SUPER },
   { eCSSKeyword_sub, NS_FONT_VARIANT_POSITION_SUB },
   { eCSSKeyword_UNKNOWN, -1 }
 };
 
 const KTableEntry nsCSSProps::kFontWeightKTable[] = {
-  { eCSSKeyword_normal, NS_STYLE_FONT_WEIGHT_NORMAL },
-  { eCSSKeyword_bold, NS_STYLE_FONT_WEIGHT_BOLD },
+  { eCSSKeyword_normal, NS_FONT_WEIGHT_NORMAL },
+  { eCSSKeyword_bold, NS_FONT_WEIGHT_BOLD },
   { eCSSKeyword_bolder, NS_STYLE_FONT_WEIGHT_BOLDER },
   { eCSSKeyword_lighter, NS_STYLE_FONT_WEIGHT_LIGHTER },
   { eCSSKeyword_UNKNOWN, -1 }
 };
 
 const KTableEntry nsCSSProps::kGridAutoFlowKTable[] = {
   { eCSSKeyword_row, NS_STYLE_GRID_AUTO_FLOW_ROW },
   { eCSSKeyword_column, NS_STYLE_GRID_AUTO_FLOW_COLUMN },
--- a/layout/style/nsStyleConsts.h
+++ b/layout/style/nsStyleConsts.h
@@ -568,19 +568,16 @@ enum class StyleDisplay : uint8_t {
 
 // See nsStyleFont
 // We should eventually stop using the NS_STYLE_* variants here.
 #define NS_STYLE_FONT_STYLE_NORMAL              NS_FONT_STYLE_NORMAL
 #define NS_STYLE_FONT_STYLE_ITALIC              NS_FONT_STYLE_ITALIC
 #define NS_STYLE_FONT_STYLE_OBLIQUE             NS_FONT_STYLE_OBLIQUE
 
 // See nsStyleFont
-// We should eventually stop using the NS_STYLE_* variants here.
-#define NS_STYLE_FONT_WEIGHT_NORMAL             NS_FONT_WEIGHT_NORMAL
-#define NS_STYLE_FONT_WEIGHT_BOLD               NS_FONT_WEIGHT_BOLD
 // The constants below appear only in style sheets and not computed style.
 #define NS_STYLE_FONT_WEIGHT_BOLDER             (-1)
 #define NS_STYLE_FONT_WEIGHT_LIGHTER            (-2)
 
 // See nsStyleFont
 #define NS_STYLE_FONT_SIZE_XXSMALL              0
 #define NS_STYLE_FONT_SIZE_XSMALL               1
 #define NS_STYLE_FONT_SIZE_SMALL                2