Bug 1346669 - Make font-synthesis not a subprop of font shorthand. r=jfkthame

MozReview-Commit-ID: KUX72Gr4SYs
This commit is contained in:
Xidorn Quan
2017-03-13 12:36:19 +11:00
parent 29fc2f8612
commit 0bcaa746f1
8 changed files with 6 additions and 23 deletions

View File

@@ -5968,7 +5968,6 @@ exports.CSS_PROPERTIES = {
"font-feature-settings",
"font-language-override",
"font-kerning",
"font-synthesis",
"font-variant-alternates",
"font-variant-caps",
"font-variant-east-asian",

View File

@@ -863,8 +863,6 @@ Declaration::GetPropertyValueInternal(
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 =
@@ -891,7 +889,6 @@ Declaration::GetPropertyValueInternal(
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 ||
@@ -910,9 +907,6 @@ Declaration::GetPropertyValueInternal(
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 ||

View File

@@ -14050,7 +14050,6 @@ CSSParserImpl::ParseFont()
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);
@@ -14071,7 +14070,6 @@ CSSParserImpl::ParseFont()
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);
@@ -14178,9 +14176,6 @@ CSSParserImpl::ParseFont()
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,

View File

@@ -2818,7 +2818,6 @@ static const nsCSSPropertyID gFontSubpropTable[] = {
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,

View File

@@ -3857,13 +3857,13 @@ nsRuleNode::SetFont(nsPresContext* aPresContext, nsStyleContext* aContext,
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

View File

@@ -2895,7 +2895,7 @@ var gCSSProperties = {
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",

View File

@@ -375,8 +375,7 @@ Any line which doesn't follow the format above would be ignored like comment.
* 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]
@@ -435,9 +434,7 @@ Any line which doesn't follow the format above would be ignored like comment.
* 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]
@@ -509,7 +506,6 @@ Any line which doesn't follow the format above would be ignored like comment.
## 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

View File

@@ -48,7 +48,7 @@ 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");