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 commit is contained in:
Emilio Cobos Álvarez 2018-02-01 02:14:26 +01:00
parent 09398d42af
commit 3b34d734e6
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
11 changed files with 270 additions and 261 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.
@ -395,8 +397,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.