Bug 1346669 - Make font-synthesis not a subprop of font shorthand. r=jfkthame
authorXidorn Quan <me@upsuper.org>
Mon, 13 Mar 2017 12:36:19 +1100
changeset 395520 0dcf56cef37d4d44a2342eaee006390dbdb48731
parent 395519 41c24766c4ce0e2f98ae6a0a3b2a7d294e6a4544
child 395521 58ae9ceae8251bdc4f6058aaa38765d0f6581b52
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs1346669
milestone55.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 1346669 - Make font-synthesis not a subprop of font shorthand. r=jfkthame MozReview-Commit-ID: KUX72Gr4SYs
devtools/shared/css/generated/properties-db.js
layout/style/Declaration.cpp
layout/style/nsCSSParser.cpp
layout/style/nsCSSProps.cpp
layout/style/nsRuleNode.cpp
layout/style/test/property_database.js
layout/style/test/stylo-failures.md
layout/style/test/test_system_font_serialization.html
--- a/devtools/shared/css/generated/properties-db.js
+++ b/devtools/shared/css/generated/properties-db.js
@@ -5963,17 +5963,16 @@ exports.CSS_PROPERTIES = {
       "font-size",
       "line-height",
       "font-size-adjust",
       "font-stretch",
       "-x-system-font",
       "font-feature-settings",
       "font-language-override",
       "font-kerning",
-      "font-synthesis",
       "font-variant-alternates",
       "font-variant-caps",
       "font-variant-east-asian",
       "font-variant-ligatures",
       "font-variant-numeric",
       "font-variant-position"
     ],
     "supports": [
--- a/layout/style/Declaration.cpp
+++ b/layout/style/Declaration.cpp
@@ -858,18 +858,16 @@ Declaration::GetPropertyValueInternal(
       const nsCSSValue *sizeAdjust =
         data->ValueFor(eCSSProperty_font_size_adjust);
       const nsCSSValue *featureSettings =
         data->ValueFor(eCSSProperty_font_feature_settings);
       const nsCSSValue *languageOverride =
         data->ValueFor(eCSSProperty_font_language_override);
       const nsCSSValue *fontKerning =
         data->ValueFor(eCSSProperty_font_kerning);
-      const nsCSSValue *fontSynthesis =
-        data->ValueFor(eCSSProperty_font_synthesis);
       const nsCSSValue *fontVariantAlternates =
         data->ValueFor(eCSSProperty_font_variant_alternates);
       const nsCSSValue *fontVariantCaps =
         data->ValueFor(eCSSProperty_font_variant_caps);
       const nsCSSValue *fontVariantEastAsian =
         data->ValueFor(eCSSProperty_font_variant_east_asian);
       const nsCSSValue *fontVariantLigatures =
         data->ValueFor(eCSSProperty_font_variant_ligatures);
@@ -886,17 +884,16 @@ Declaration::GetPropertyValueInternal(
             size->GetUnit() != eCSSUnit_System_Font ||
             lh->GetUnit() != eCSSUnit_System_Font ||
             family->GetUnit() != eCSSUnit_System_Font ||
             stretch->GetUnit() != eCSSUnit_System_Font ||
             sizeAdjust->GetUnit() != eCSSUnit_System_Font ||
             featureSettings->GetUnit() != eCSSUnit_System_Font ||
             languageOverride->GetUnit() != eCSSUnit_System_Font ||
             fontKerning->GetUnit() != eCSSUnit_System_Font ||
-            fontSynthesis->GetUnit() != eCSSUnit_System_Font ||
             fontVariantAlternates->GetUnit() != eCSSUnit_System_Font ||
             fontVariantCaps->GetUnit() != eCSSUnit_System_Font ||
             fontVariantEastAsian->GetUnit() != eCSSUnit_System_Font ||
             fontVariantLigatures->GetUnit() != eCSSUnit_System_Font ||
             fontVariantNumeric->GetUnit() != eCSSUnit_System_Font ||
             fontVariantPosition->GetUnit() != eCSSUnit_System_Font) {
           // This can't be represented as a shorthand.
           return;
@@ -905,19 +902,16 @@ Declaration::GetPropertyValueInternal(
                                    aSerialization);
       } else {
         // properties reset by this shorthand property to their
         // initial values but not represented in its syntax
         if (sizeAdjust->GetUnit() != eCSSUnit_None ||
             featureSettings->GetUnit() != eCSSUnit_Normal ||
             languageOverride->GetUnit() != eCSSUnit_Normal ||
             fontKerning->GetIntValue() != NS_FONT_KERNING_AUTO ||
-            fontSynthesis->GetUnit() != eCSSUnit_Enumerated ||
-            fontSynthesis->GetIntValue() !=
-              (NS_FONT_SYNTHESIS_WEIGHT | NS_FONT_SYNTHESIS_STYLE) ||
             fontVariantAlternates->GetUnit() != eCSSUnit_Normal ||
             fontVariantEastAsian->GetUnit() != eCSSUnit_Normal ||
             fontVariantLigatures->GetUnit() != eCSSUnit_Normal ||
             fontVariantNumeric->GetUnit() != eCSSUnit_Normal ||
             fontVariantPosition->GetUnit() != eCSSUnit_Normal) {
           return;
         }
 
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -14045,17 +14045,16 @@ CSSParserImpl::ParseFont()
       AppendValue(eCSSProperty_font_weight, family);
       AppendValue(eCSSProperty_font_size, family);
       AppendValue(eCSSProperty_line_height, family);
       AppendValue(eCSSProperty_font_stretch, family);
       AppendValue(eCSSProperty_font_size_adjust, family);
       AppendValue(eCSSProperty_font_feature_settings, family);
       AppendValue(eCSSProperty_font_language_override, family);
       AppendValue(eCSSProperty_font_kerning, family);
-      AppendValue(eCSSProperty_font_synthesis, family);
       AppendValue(eCSSProperty_font_variant_alternates, family);
       AppendValue(eCSSProperty_font_variant_caps, family);
       AppendValue(eCSSProperty_font_variant_east_asian, family);
       AppendValue(eCSSProperty_font_variant_ligatures, family);
       AppendValue(eCSSProperty_font_variant_numeric, family);
       AppendValue(eCSSProperty_font_variant_position, family);
     }
     else {
@@ -14066,17 +14065,16 @@ CSSParserImpl::ParseFont()
       AppendValue(eCSSProperty_font_weight, systemFont);
       AppendValue(eCSSProperty_font_size, systemFont);
       AppendValue(eCSSProperty_line_height, systemFont);
       AppendValue(eCSSProperty_font_stretch, systemFont);
       AppendValue(eCSSProperty_font_size_adjust, systemFont);
       AppendValue(eCSSProperty_font_feature_settings, systemFont);
       AppendValue(eCSSProperty_font_language_override, systemFont);
       AppendValue(eCSSProperty_font_kerning, systemFont);
-      AppendValue(eCSSProperty_font_synthesis, systemFont);
       AppendValue(eCSSProperty_font_variant_alternates, systemFont);
       AppendValue(eCSSProperty_font_variant_caps, systemFont);
       AppendValue(eCSSProperty_font_variant_east_asian, systemFont);
       AppendValue(eCSSProperty_font_variant_ligatures, systemFont);
       AppendValue(eCSSProperty_font_variant_numeric, systemFont);
       AppendValue(eCSSProperty_font_variant_position, systemFont);
     }
     return true;
@@ -14173,19 +14171,16 @@ CSSParserImpl::ParseFont()
       AppendValue(eCSSProperty_font_size, size);
       AppendValue(eCSSProperty_line_height, lineHeight);
       AppendValue(eCSSProperty_font_stretch, values[kFontStretchIndex]);
       AppendValue(eCSSProperty_font_size_adjust, nsCSSValue(eCSSUnit_None));
       AppendValue(eCSSProperty_font_feature_settings, nsCSSValue(eCSSUnit_Normal));
       AppendValue(eCSSProperty_font_language_override, nsCSSValue(eCSSUnit_Normal));
       AppendValue(eCSSProperty_font_kerning,
                   nsCSSValue(NS_FONT_KERNING_AUTO, eCSSUnit_Enumerated));
-      AppendValue(eCSSProperty_font_synthesis,
-                  nsCSSValue(NS_FONT_SYNTHESIS_WEIGHT | NS_FONT_SYNTHESIS_STYLE,
-                             eCSSUnit_Enumerated));
       AppendValue(eCSSProperty_font_variant_alternates,
                   nsCSSValue(eCSSUnit_Normal));
       AppendValue(eCSSProperty_font_variant_east_asian,
                   nsCSSValue(eCSSUnit_Normal));
       AppendValue(eCSSProperty_font_variant_ligatures,
                   nsCSSValue(eCSSUnit_Normal));
       AppendValue(eCSSProperty_font_variant_numeric,
                   nsCSSValue(eCSSUnit_Normal));
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -2813,17 +2813,16 @@ static const nsCSSPropertyID gFontSubpro
   eCSSProperty_font_size,
   eCSSProperty_line_height,
   eCSSProperty_font_size_adjust,
   eCSSProperty_font_stretch,
   eCSSProperty__x_system_font,
   eCSSProperty_font_feature_settings,
   eCSSProperty_font_language_override,
   eCSSProperty_font_kerning,
-  eCSSProperty_font_synthesis,
   eCSSProperty_font_variant_alternates,
   eCSSProperty_font_variant_caps,
   eCSSProperty_font_variant_east_asian,
   eCSSProperty_font_variant_ligatures,
   eCSSProperty_font_variant_numeric,
   eCSSProperty_font_variant_position,
   eCSSProperty_UNKNOWN
 };
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -3852,23 +3852,23 @@ nsRuleNode::SetFont(nsPresContext* aPres
   // font-kerning: none, enum, inherit, initial, -moz-system-font
   SetValue(*aRuleData->ValueForFontKerning(),
            aFont->mFont.kerning, aConditions,
            SETVAL_ENUMERATED | SETVAL_UNSET_INHERIT,
            aParentFont->mFont.kerning,
            defaultVariableFont->kerning,
            Unused, Unused, Unused, systemFont.kerning);
 
-  // font-synthesis: none, enum (bit field), inherit, initial, -moz-system-font
+  // font-synthesis: none, enum (bit field), inherit, initial
   SetValue(*aRuleData->ValueForFontSynthesis(),
            aFont->mFont.synthesis, aConditions,
            SETVAL_ENUMERATED | SETVAL_UNSET_INHERIT,
            aParentFont->mFont.synthesis,
            defaultVariableFont->synthesis,
-           Unused, /* none */ 0, Unused, systemFont.synthesis);
+           Unused, /* none */ 0, Unused, Unused);
 
   // font-variant-alternates: normal, enum (bit field) + functions, inherit,
   //                          initial, -moz-system-font
   const nsCSSValue* variantAlternatesValue =
     aRuleData->ValueForFontVariantAlternates();
   int32_t variantAlternates = 0;
 
   switch (variantAlternatesValue->GetUnit()) {
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -2890,17 +2890,17 @@ var gCSSProperties = {
   },
   "font": {
     domProp: "font",
     inherited: true,
     type: CSS_TYPE_TRUE_SHORTHAND,
     prerequisites: { "writing-mode": "initial" },
     subproperties: [ "font-style", "font-variant", "font-weight", "font-size", "line-height", "font-family", "font-stretch",
                      "font-size-adjust", "font-feature-settings", "font-language-override",
-                     "font-kerning", "font-synthesis", "font-variant-alternates", "font-variant-caps", "font-variant-east-asian",
+                     "font-kerning", "font-variant-alternates", "font-variant-caps", "font-variant-east-asian",
                      "font-variant-ligatures", "font-variant-numeric", "font-variant-position" ],
     initial_values: [ (gInitialFontFamilyIsSansSerif ? "medium sans-serif" : "medium serif") ],
     other_values: [ "large serif", "9px fantasy", "condensed bold italic small-caps 24px/1.4 Times New Roman, serif", "small inherit roman", "small roman inherit",
       // system fonts
       "caption", "icon", "menu", "message-box", "small-caption", "status-bar",
       // Gecko-specific system fonts
       "-moz-window", "-moz-document", "-moz-desktop", "-moz-info", "-moz-dialog", "-moz-button", "-moz-pull-down-menu", "-moz-list", "-moz-field", "-moz-workspace",
       // line-height with calc()
--- a/layout/style/test/stylo-failures.md
+++ b/layout/style/test/stylo-failures.md
@@ -370,18 +370,17 @@ Any line which doesn't follow the format
   * writing-mode: sideways-{lr,rl} and SVG values servo/servo#15213
     * test_logical_properties.html `sideways` [1224]
     * test_value_storage.html `writing-mode` [8]
 * Incorrect parsing
   * calc() doesn't support dividing expression servo/servo#15192
     * test_value_storage.html `calc(50px/` [7]
     * ... `calc(2em / ` [9]
   * calc() doesn't support number value servo/servo#15205
-    * test_value_storage.html `calc(1 +` [1]
-    * ... `calc(-2.5)` [1]
+    * test_value_storage.html `calc(-2.5)` [1]
   * size part of shorthand background/mask always desires two values servo/servo#15199
     * test_value_storage.html `'background'` [18]
     * ... `/ auto none` [34]
     * ... `/ auto repeat` [17]
   * border shorthands do not reset border-image servo/servo#15202
     * test_inherit_storage.html `for property 'border-image-` [5]
     * test_initial_storage.html `for property 'border-image-` [10]
     * test_value_storage.html `(for 'border-image-` [60]
@@ -430,19 +429,17 @@ Any line which doesn't follow the format
   * test_bug98997.html: pseudo-class :empty and :-moz-only-whitespace bug 1337068 [75]
   * :-moz-{first,last}-node
     * test_selectors.html `:-moz-` [4]
     * ... `unexpected rule index` [2]
   * :placeholder-shown
     * test_selectors.html `TypeError` [1]
 * issues arround font shorthand servo/servo#15032 servo/servo#15036
   * test_bug377947.html [2]
-  * test_inherit_storage.html `for property 'font-` [2]
-  * test_initial_storage.html `for property 'font-` [1]
-  * test_value_storage.html `'font'` [171]
+  * test_value_storage.html `'font'` [144]
   * test_shorthand_property_getters.html `font shorthand` [2]
   * test_system_font_serialization.html [10]
 * test_value_storage.html `font-size: calc(`: clamp negative value servo/servo#15296 [3]
 * rounding issue
   * test_value_storage.html `33.5833px` [2]
   * ... `0.766667px` [2]
   * ... `105.333px` [2]
 * test_viewport_units.html: viewport units support [8]
@@ -504,17 +501,16 @@ Any line which doesn't follow the format
   * unitless zero as angle bug 1234357
     * test_property_syntax_errors.html `linear-gradient(0,` [8]
     * ... `hue-rotate(0)` [6]
 * test_moz_device_pixel_ratio.html: probably unship -moz-device-pixel-ratio bug 1338425 [4]
 
 ## Spec Unclear
 
 * test_property_syntax_errors.html `'background'`: whether background shorthand should accept "text" [200]
-* test_inherit_computation.html `weight style`: whether font-synthesis should be reset by font w3c/csswg-drafts#1032 [8]
 
 ## Unknown / Unsure
 
 * test_additional_sheets.html: one sub-test cascade order is wrong [1]
 * test_selectors.html `:nth-child`: &lt;an+b&gt; parsing difference [14]
 * test_selectors_on_anonymous_content.html: xbl and :nth-child [1]
 * test_variables.html `url`: url in custom property [1]
 * test_pseudoelement_state.html: doesn't seem to work at all, but only range-thumb fails... [4]
--- a/layout/style/test/test_system_font_serialization.html
+++ b/layout/style/test/test_system_font_serialization.html
@@ -43,17 +43,17 @@ is(e.style.cssText, "font: menu;", "seri
 is(e.style.font, "menu", "font getter returns value");
 
 e.setAttribute("style", "font: menu; font-weight: -moz-use-system-font !important");
 is(e.style.cssText, "font: menu; font-weight: -moz-use-system-font !important;", "serialize system font and subproperty that is important");
 is(e.style.font, "", "font getter returns nothing");
 
 e.setAttribute("style", "font: inherit; font-family: Helvetica;");
 
-var cssTextStr = "font-style: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit; font-feature-settings: inherit; font-language-override: inherit; font-kerning: inherit; font-synthesis: inherit; font-variant: inherit;";
+var cssTextStr = "font-style: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit; font-feature-settings: inherit; font-language-override: inherit; font-kerning: inherit; font-variant: inherit;";
 
 is(e.style.cssText, cssTextStr + " font-family: Helvetica;", "don't serialize system font for font:inherit");
 is(e.style.font, "", "font getter returns nothing");
 
 </script>
 </pre>
 </body>
 </html>