mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
Implement ToCss for str and String
This commit is contained in:
parent
12dca42dd7
commit
c8c6f3482f
12 changed files with 40 additions and 75 deletions
|
@ -70,9 +70,7 @@
|
|||
impl ToCss for ContentItem {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
match *self {
|
||||
ContentItem::String(ref s) => {
|
||||
cssparser::serialize_string(&**s, dest)
|
||||
}
|
||||
ContentItem::String(ref s) => s.to_css(dest),
|
||||
ContentItem::Counter(ref s, ref counter_style) => {
|
||||
try!(dest.write_str("counter("));
|
||||
try!(cssparser::serialize_identifier(&**s, dest));
|
||||
|
@ -84,9 +82,9 @@
|
|||
try!(dest.write_str("counters("));
|
||||
try!(cssparser::serialize_identifier(&**s, dest));
|
||||
try!(dest.write_str(", "));
|
||||
try!(cssparser::serialize_string(&**separator, dest));
|
||||
separator.to_css(dest)?;
|
||||
try!(dest.write_str(", "));
|
||||
try!(counter_style.to_css(dest));
|
||||
counter_style.to_css(dest)?;
|
||||
dest.write_str(")")
|
||||
}
|
||||
ContentItem::OpenQuote => dest.write_str("open-quote"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue