Auto merge of #19918 - emilio:font-stuff-is-a-mess, r=nox

style: Refactor font-feature-settings and font-variation-settings.

This fixes all known issues with serialization and parsing of these two
properties, and in particular calc handling and such:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1434692
  https://bugzilla.mozilla.org/show_bug.cgi?id=1434724

Also does a fair amount of cleanup and all that, which was needed, this code
was a mess.

There are further cleanups that can be done, like renaming the
font-variation-settings animation stuff.

<!-- 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/19918)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-02-01 06:45:20 -06:00 committed by GitHub
commit dcd13b857c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 356 additions and 327 deletions

View file

@ -9,7 +9,7 @@
#![deny(missing_docs)]
#[cfg(feature = "gecko")]
use computed_values::{font_feature_settings, font_stretch, font_style, font_weight};
use computed_values::{font_stretch, font_style, font_weight};
use cssparser::{AtRuleParser, DeclarationListParser, DeclarationParser, Parser};
use cssparser::{SourceLocation, CowRcStr};
use error_reporting::{ContextualParseError, ParseErrorReporter};
@ -25,6 +25,8 @@ use str::CssStringWriter;
use style_traits::{Comma, CssWriter, OneOrMoreSeparated, ParseError};
use style_traits::{StyleParseErrorKind, ToCss};
use values::computed::font::FamilyName;
#[cfg(feature = "gecko")]
use values::specified::font::SpecifiedFontFeatureSettings;
use values::specified::url::SpecifiedUrl;
/// A source for a font-face rule.
@ -399,8 +401,8 @@ font_face_descriptors! {
],
/// The feature settings of this font face.
"font-feature-settings" feature_settings / mFontFeatureSettings: font_feature_settings::T = {
font_feature_settings::T::Normal
"font-feature-settings" feature_settings / mFontFeatureSettings: SpecifiedFontFeatureSettings = {
font_feature_settings::SpecifiedValue::normal()
},
/// The language override of this font face.