mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Added derive ToCss for Content and removed manual Impl
This commit is contained in:
parent
2f4362e0c1
commit
8116962298
2 changed files with 2 additions and 23 deletions
|
@ -146,28 +146,6 @@ impl Parse for Content {
|
|||
}
|
||||
}
|
||||
|
||||
impl ToCss for Content {
|
||||
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
|
||||
where W: Write,
|
||||
{
|
||||
match *self {
|
||||
Content::Normal => dest.write_str("normal"),
|
||||
Content::None => dest.write_str("none"),
|
||||
#[cfg(feature = "gecko")]
|
||||
Content::MozAltContent => dest.write_str("-moz-alt-content"),
|
||||
Content::Items(ref content) => {
|
||||
let mut iter = content.iter();
|
||||
iter.next().unwrap().to_css(dest)?;
|
||||
for c in iter {
|
||||
dest.write_str(" ")?;
|
||||
c.to_css(dest)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ToCss for ContentItem {
|
||||
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
|
||||
where W: Write,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue