mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Replace write! with to_css and write_str in some ToCss impls
This commit is contained in:
parent
c1b196b7cb
commit
7e92c15e00
11 changed files with 58 additions and 42 deletions
|
@ -2316,7 +2316,7 @@ https://drafts.csswg.org/css-fonts-4/#low-level-font-variation-settings-control-
|
|||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
match *self {
|
||||
SpecifiedValue::Auto => dest.write_str("auto"),
|
||||
SpecifiedValue::Relative(rel) => write!(dest, "{}", rel),
|
||||
SpecifiedValue::Relative(rel) => rel.to_css(dest),
|
||||
// can only be specified by pres attrs; should not
|
||||
// serialize to anything else
|
||||
SpecifiedValue::Absolute(_) => Ok(()),
|
||||
|
|
|
@ -148,36 +148,36 @@
|
|||
% endfor
|
||||
|
||||
if i != 0 {
|
||||
write!(dest, ", ")?;
|
||||
dest.write_str(", ")?;
|
||||
}
|
||||
|
||||
if i == len - 1 {
|
||||
self.background_color.to_css(dest)?;
|
||||
write!(dest, " ")?;
|
||||
dest.write_str(" ")?;
|
||||
}
|
||||
|
||||
image.to_css(dest)?;
|
||||
% for name in "repeat attachment".split():
|
||||
write!(dest, " ")?;
|
||||
dest.write_str(" ")?;
|
||||
${name}.to_css(dest)?;
|
||||
% endfor
|
||||
|
||||
write!(dest, " ")?;
|
||||
dest.write_str(" ")?;
|
||||
Position {
|
||||
horizontal: position_x.clone(),
|
||||
vertical: position_y.clone()
|
||||
}.to_css(dest)?;
|
||||
|
||||
if *size != background_size::single_value::get_initial_specified_value() {
|
||||
write!(dest, " / ")?;
|
||||
dest.write_str(" / ")?;
|
||||
size.to_css(dest)?;
|
||||
}
|
||||
|
||||
if *origin != Origin::padding_box || *clip != Clip::border_box {
|
||||
write!(dest, " ")?;
|
||||
dest.write_str(" ")?;
|
||||
origin.to_css(dest)?;
|
||||
if *clip != From::from(*origin) {
|
||||
write!(dest, " ")?;
|
||||
dest.write_str(" ")?;
|
||||
clip.to_css(dest)?;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue