mirror of
https://github.com/servo/servo.git
synced 2025-08-26 07:38:21 +01:00
Make LonghandsToSerialize store reference to specified value
This significantly simplify the code.
This commit is contained in:
parent
2cc6593fa1
commit
f327b2fc73
15 changed files with 166 additions and 563 deletions
|
@ -98,27 +98,11 @@
|
|||
|
||||
impl<'a> LonghandsToSerialize<'a> {
|
||||
fn to_css_declared<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
match *self.list_style_position {
|
||||
DeclaredValue::CSSWideKeyword(CSSWideKeyword::Initial) =>
|
||||
try!(write!(dest, "outside")),
|
||||
_ => try!(self.list_style_position.to_css(dest))
|
||||
}
|
||||
|
||||
try!(write!(dest, " "));
|
||||
|
||||
match *self.list_style_image {
|
||||
DeclaredValue::CSSWideKeyword(CSSWideKeyword::Initial) =>
|
||||
try!(write!(dest, "none")),
|
||||
_ => try!(self.list_style_image.to_css(dest))
|
||||
};
|
||||
|
||||
try!(write!(dest, " "));
|
||||
|
||||
match *self.list_style_type {
|
||||
DeclaredValue::CSSWideKeyword(CSSWideKeyword::Initial) =>
|
||||
write!(dest, "disc"),
|
||||
_ => self.list_style_type.to_css(dest)
|
||||
}
|
||||
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