Derive ToCss for some shorthand properties

This commit is contained in:
Anthony Ramine 2017-06-17 11:32:02 +02:00
parent 3a2e79274a
commit a568f7752f
7 changed files with 33 additions and 93 deletions

View file

@ -5,7 +5,8 @@
<%namespace name="helpers" file="/helpers.mako.rs" />
<%helpers:shorthand name="list-style"
sub_properties="list-style-image list-style-position list-style-type"
sub_properties="list-style-position list-style-image list-style-type"
derive_serialize="True"
spec="https://drafts.csswg.org/css-lists/#propdef-list-style">
use properties::longhands::{list_style_image, list_style_position, list_style_type};
use values::{Either, None_};
@ -108,14 +109,4 @@
_ => Err(StyleParseError::UnspecifiedError.into()),
}
}
impl<'a> ToCss for LonghandsToSerialize<'a> {
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
self.list_style_position.to_css(dest)?;
dest.write_str(" ")?;
self.list_style_image.to_css(dest)?;
dest.write_str(" ")?;
self.list_style_type.to_css(dest)
}
}
</%helpers:shorthand>