From 3f27654d97eb684206d614d87ce4b12b08dc1ca5 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Tue, 11 Jul 2017 14:58:04 +0200 Subject: [PATCH] Derive ToCss for specified values of background-repeat --- .../properties/longhand/background.mako.rs | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/components/style/properties/longhand/background.mako.rs b/components/style/properties/longhand/background.mako.rs index 9e4a7c82856..2c75d43dd05 100644 --- a/components/style/properties/longhand/background.mako.rs +++ b/components/style/properties/longhand/background.mako.rs @@ -46,8 +46,8 @@ ${helpers.predefined_type("background-image", "ImageLayer", "round" => Round, "no-repeat" => NoRepeat); - #[derive(Debug, Clone, PartialEq)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] + #[derive(Clone, Debug, PartialEq, ToCss)] pub enum SpecifiedValue { RepeatX, RepeatY, @@ -80,22 +80,6 @@ ${helpers.predefined_type("background-image", "ImageLayer", } } } - impl ToCss for SpecifiedValue { - fn to_css(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { - match *self { - SpecifiedValue::RepeatX => dest.write_str("repeat-x"), - SpecifiedValue::RepeatY => dest.write_str("repeat-y"), - SpecifiedValue::Other(horizontal, vertical) => { - horizontal.to_css(dest)?; - if let Some(vertical) = vertical { - dest.write_str(" ")?; - vertical.to_css(dest)?; - } - Ok(()) - } - } - } - } #[inline] pub fn get_initial_value() -> computed_value::T {