diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index ab290abefdc..fa296a3046a 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -316,7 +316,7 @@ % if not property.derived_from: match value { - DeclaredValue::Value(ref specified_value) => { + DeclaredValue::Value(specified_value) => { % if property.ident in SYSTEM_FONT_LONGHANDS and product == "gecko": if let Some(sf) = specified_value.get_system() { longhands::system_font::resolve_system_font(sf, context); diff --git a/components/style/properties/longhand/font.mako.rs b/components/style/properties/longhand/font.mako.rs index d9adc9610d8..d56bea05dc7 100644 --- a/components/style/properties/longhand/font.mako.rs +++ b/components/style/properties/longhand/font.mako.rs @@ -2014,15 +2014,10 @@ https://drafts.csswg.org/css-fonts-4/#low-level-font-variation-settings-control- animation_value_type="ComputedValue" flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER" spec="${variation_spec}"> - use values::computed::ComputedValueAsSpecified; use values::generics::FontSettings; - impl ComputedValueAsSpecified for SpecifiedValue {} - pub type SpecifiedValue = computed_value::T; - - pub mod computed_value { use values::generics::{FontSettings, FontSettingTagFloat}; pub type T = FontSettings; diff --git a/components/style/values/computed/mod.rs b/components/style/values/computed/mod.rs index 22852114eab..af6d416a20d 100644 --- a/components/style/values/computed/mod.rs +++ b/components/style/values/computed/mod.rs @@ -338,6 +338,7 @@ trivial_to_computed_value!(f32); trivial_to_computed_value!(i32); trivial_to_computed_value!(u8); trivial_to_computed_value!(u16); +trivial_to_computed_value!(u32); trivial_to_computed_value!(Atom); trivial_to_computed_value!(BorderStyle); trivial_to_computed_value!(Cursor); diff --git a/components/style/values/generics/mod.rs b/components/style/values/generics/mod.rs index 0f419da0383..34feefb04a7 100644 --- a/components/style/values/generics/mod.rs +++ b/components/style/values/generics/mod.rs @@ -129,8 +129,8 @@ impl Parse for CounterStyleOrNone { /// /// For font-feature-settings, this is a tag and an integer, /// for font-variation-settings this is a tag and a float -#[derive(Clone, Debug, Eq, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] +#[derive(Clone, Debug, Eq, PartialEq, ToComputedValue)] pub struct FontSettingTag { /// A four-character tag, packed into a u32 (one byte per character) pub tag: u32, @@ -187,7 +187,7 @@ impl Parse for FontSettingTag { /// A font settings value for font-variation-settings or font-feature-settings #[cfg_attr(feature = "servo", derive(HeapSizeOf))] -#[derive(Clone, Debug, Eq, PartialEq, ToCss)] +#[derive(Clone, Debug, Eq, PartialEq, ToComputedValue, ToCss)] pub enum FontSettings { /// No settings (default) Normal, @@ -210,16 +210,17 @@ impl Parse for FontSettings { /// /// Do not use this type anywhere except within FontSettings /// because it serializes with the preceding space -#[derive(Clone, Copy, Debug, Eq, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] +#[derive(Clone, Copy, Debug, Eq, PartialEq, ToComputedValue)] pub struct FontSettingTagInt(pub u32); + /// A number value to be used for font-variation-settings /// /// Do not use this type anywhere except within FontSettings /// because it serializes with the preceding space -#[derive(Clone, Debug, PartialEq)] -#[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[cfg_attr(feature = "gecko", derive(Animate, ComputeSquaredDistance))] +#[cfg_attr(feature = "servo", derive(HeapSizeOf))] +#[derive(Clone, Debug, PartialEq, ToComputedValue)] pub struct FontSettingTagFloat(pub f32); impl ToCss for FontSettingTagInt {