mirror of
https://github.com/servo/servo.git
synced 2025-08-23 22:35:33 +01:00
Derive ToCss for some shorthand properties
This commit is contained in:
parent
3a2e79274a
commit
a568f7752f
7 changed files with 33 additions and 93 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue