# HG changeset patch # User Jonathan Kew # Date 1518606125 -39600 # Node ID 3f431418dfe951f6762dc34e1c41edd77f34ea7a # Parent 8ce0b5c90b11e34180db4d3517856dea64f7aef6 Bug 1435984 - patch 2 - Support the font-variation-settings descriptor when parsing @font-face in the old Gecko style system. r=jwatt diff --git a/layout/style/nsCSSFontDescList.h b/layout/style/nsCSSFontDescList.h --- a/layout/style/nsCSSFontDescList.h +++ b/layout/style/nsCSSFontDescList.h @@ -6,10 +6,11 @@ CSS_FONT_DESC(font-family, Family) CSS_FONT_DESC(font-style, Style) CSS_FONT_DESC(font-weight, Weight) CSS_FONT_DESC(font-stretch, Stretch) CSS_FONT_DESC(src, Src) CSS_FONT_DESC(unicode-range, UnicodeRange) CSS_FONT_DESC(font-feature-settings, FontFeatureSettings) +CSS_FONT_DESC(font-variation-settings, FontVariationSettings) CSS_FONT_DESC(font-language-override, FontLanguageOverride) CSS_FONT_DESC(font-display, Display) diff --git a/layout/style/nsCSSFontFaceRule.cpp b/layout/style/nsCSSFontFaceRule.cpp --- a/layout/style/nsCSSFontFaceRule.cpp +++ b/layout/style/nsCSSFontFaceRule.cpp @@ -101,16 +101,20 @@ nsCSSFontFaceStyleDecl::GetPropertyValue case eCSSFontDesc_Stretch: val.AppendToString(eCSSProperty_font_stretch, aResult); return NS_OK; case eCSSFontDesc_FontFeatureSettings: nsStyleUtil::AppendFontFeatureSettings(val, aResult); return NS_OK; + case eCSSFontDesc_FontVariationSettings: + nsStyleUtil::AppendFontVariationSettings(val, aResult); + return NS_OK; + case eCSSFontDesc_FontLanguageOverride: val.AppendToString(eCSSProperty_font_language_override, aResult); return NS_OK; case eCSSFontDesc_Display: NS_ASSERTION(val.GetUnit() == eCSSUnit_Enumerated, "unknown unit for font-display descriptor"); AppendASCIItoUTF16(nsCSSProps::ValueToKeyword(val.GetIntValue(), diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -12051,16 +12051,22 @@ CSSParserImpl::ParseFontDescriptorValue( return ParseFontSrc(aValue); case eCSSFontDesc_UnicodeRange: return ParseFontRanges(aValue); case eCSSFontDesc_FontFeatureSettings: return ParseFontFeatureSettings(aValue); + case eCSSFontDesc_FontVariationSettings: + if (StylePrefs::sFontVariationsEnabled) { + return ParseFontVariationSettings(aValue); + } + return false; + case eCSSFontDesc_FontLanguageOverride: return ParseSingleTokenVariant(aValue, VARIANT_NORMAL | VARIANT_STRING, nullptr); case eCSSFontDesc_UNKNOWN: case eCSSFontDesc_COUNT: NS_NOTREACHED("bad nsCSSFontDesc code"); }