From 06c8e0163e665d86d2c43a92047396e9b26cc8c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 9 Sep 2017 13:07:12 +0200 Subject: [PATCH] style: Manually expand ComputedValueAsSpecified in the keyword macros. --- components/style/macros.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/components/style/macros.rs b/components/style/macros.rs index 79dafc6e050..4edcf3f7d08 100644 --- a/components/style/macros.rs +++ b/components/style/macros.rs @@ -58,7 +58,7 @@ macro_rules! define_numbered_css_keyword_enum { } } -/// A macro for implementing `ComputedValueAsSpecified`, and `Parse` traits for +/// A macro for implementing `ToComputedValue`, and `Parse` traits for /// the enums defined using `define_css_keyword_enum` macro. /// /// NOTE: We should either move `Parse` trait to `style_traits` @@ -76,7 +76,17 @@ macro_rules! add_impls_for_keyword_enum { } } - impl $crate::values::computed::ComputedValueAsSpecified for $name {} + impl $crate::values::computed::ToComputedValue for $name { + type ComputedValue = $name; + + fn to_computed_value(&self, _: &$crate::values::computed::Context) -> Self { + self.clone() + } + + fn from_computed_value(other: &Self) -> Self { + other.clone() + } + } }; }