Make DeclaredValue store CSSWideKeyword

Rather than having separate variant for each CSS-wide keyword.
This commit is contained in:
Xidorn Quan 2017-02-28 18:53:51 +11:00
parent 29fd30601e
commit 03f6d21cb5
10 changed files with 120 additions and 115 deletions

View file

@ -99,21 +99,24 @@
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::Initial => try!(write!(dest, "outside")),
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::Initial => try!(write!(dest, "none")),
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::Initial => write!(dest, "disc"),
DeclaredValue::CSSWideKeyword(CSSWideKeyword::Initial) =>
write!(dest, "disc"),
_ => self.list_style_type.to_css(dest)
}
}