Auto merge of #20191 - jfkthame:font-shorthand-resets-variation-settings, r=emilio

style: Make 'font' shorthand reset 'font-variation-settings' property

As required by the spec: https://drafts.csswg.org/css-fonts-4/#font-prop

See https://bugzilla.mozilla.org/show_bug.cgi?id=1435983

Basically, make font-variation-settings work in the same way as font-feature-settings
already does.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

- [ ] There are tests for these changes OR
- [X] These changes do not require tests because font-variation-settings isn't supported in servo; it is implemented here for gecko/stylo, and will be tested by mozilla-central mochitests.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20191)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-03-04 11:50:56 -05:00 committed by GitHub
commit 1783e41f34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 87 additions and 14 deletions

View file

@ -4857,7 +4857,7 @@ pub extern "C" fn Servo_ParseFontDescriptor(
use style::font_face::{FontDisplay, FontWeight, Source};
use style::properties::longhands::font_language_override;
use style::values::computed::font::FamilyName;
use style::values::specified::font::{SpecifiedFontFeatureSettings, FontVariationSettings};
use style::values::specified::font::{SpecifiedFontFeatureSettings, SpecifiedFontVariationSettings};
let string = unsafe { (*value).to_string() };
let mut input = ParserInput::new(&string);
@ -4907,7 +4907,7 @@ pub extern "C" fn Servo_ParseFontDescriptor(
eCSSFontDesc_Src / Vec<Source>,
eCSSFontDesc_UnicodeRange / Vec<UnicodeRange>,
eCSSFontDesc_FontFeatureSettings / SpecifiedFontFeatureSettings,
eCSSFontDesc_FontVariationSettings / FontVariationSettings,
eCSSFontDesc_FontVariationSettings / SpecifiedFontVariationSettings,
eCSSFontDesc_FontLanguageOverride / font_language_override::SpecifiedValue,
eCSSFontDesc_Display / FontDisplay,
]

View file

@ -40,7 +40,7 @@ size_of_test!(test_size_of_rule_node, RuleNode, 80);
// This is huge, but we allocate it on the stack and then never move it,
// we only pass `&mut SourcePropertyDeclaration` references around.
size_of_test!(test_size_of_parsed_declaration, style::properties::SourcePropertyDeclaration, 576);
size_of_test!(test_size_of_parsed_declaration, style::properties::SourcePropertyDeclaration, 608);
size_of_test!(test_size_of_computed_image, computed::image::Image, 40);
size_of_test!(test_size_of_specified_image, specified::image::Image, 40);