From dcdc3841227d1738c7fd9a6cdeadffe6f49c9281 Mon Sep 17 00:00:00 2001 From: CYBAI Date: Mon, 20 Nov 2017 21:36:49 +0800 Subject: [PATCH] Implement normal for FontSettings --- components/style/values/computed/font.rs | 8 -------- components/style/values/generics/mod.rs | 8 ++++++++ components/style/values/specified/font.rs | 8 -------- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/components/style/values/computed/font.rs b/components/style/values/computed/font.rs index ed2b7c9f881..86f33856d6b 100644 --- a/components/style/values/computed/font.rs +++ b/components/style/values/computed/font.rs @@ -290,14 +290,6 @@ pub type FontVariantNumeric = specified::VariantNumeric; /// Use FontSettings as computed type of FontFeatureSettings pub type FontFeatureSettings = FontSettings; -impl FontFeatureSettings { - #[inline] - /// Default value of `font-feature-settings` as `normal` - pub fn normal() -> FontFeatureSettings { - FontSettings::Normal - } -} - /// font-language-override can only have a single three-letter /// OpenType "language system" tag, so we should be able to compute /// it and store it as a 32-bit integer diff --git a/components/style/values/generics/mod.rs b/components/style/values/generics/mod.rs index 5052b2395e1..c2a20081c98 100644 --- a/components/style/values/generics/mod.rs +++ b/components/style/values/generics/mod.rs @@ -196,6 +196,14 @@ pub enum FontSettings { Tag(Vec>) } +impl FontSettings { + #[inline] + /// Default value of font settings as `normal` + pub fn normal() -> Self { + FontSettings::Normal + } +} + impl Parse for FontSettings { /// fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result> { diff --git a/components/style/values/specified/font.rs b/components/style/values/specified/font.rs index e8560387012..9a78441ab0e 100644 --- a/components/style/values/specified/font.rs +++ b/components/style/values/specified/font.rs @@ -1804,14 +1804,6 @@ impl Parse for FontLanguageOverride { /// This property provides low-level control over OpenType or TrueType font variations. pub type FontVariantSettings = FontSettings; -impl FontVariantSettings { - #[inline] - /// Default value of `font-variant-settings` - pub fn normal() -> FontVariantSettings { - FontSettings::Normal - } -} - #[derive(Clone, Debug, MallocSizeOf, PartialEq, ToComputedValue)] /// text-zoom. Enable if true, disable if false pub struct XTextZoom(pub bool);