mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Derive ToCss for specified values of background-repeat
This commit is contained in:
parent
118291ca91
commit
3f27654d97
1 changed files with 1 additions and 17 deletions
|
@ -46,8 +46,8 @@ ${helpers.predefined_type("background-image", "ImageLayer",
|
|||
"round" => Round,
|
||||
"no-repeat" => NoRepeat);
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[derive(Clone, Debug, PartialEq, ToCss)]
|
||||
pub enum SpecifiedValue {
|
||||
RepeatX,
|
||||
RepeatY,
|
||||
|
@ -80,22 +80,6 @@ ${helpers.predefined_type("background-image", "ImageLayer",
|
|||
}
|
||||
}
|
||||
}
|
||||
impl ToCss for SpecifiedValue {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
match *self {
|
||||
SpecifiedValue::RepeatX => dest.write_str("repeat-x"),
|
||||
SpecifiedValue::RepeatY => dest.write_str("repeat-y"),
|
||||
SpecifiedValue::Other(horizontal, vertical) => {
|
||||
horizontal.to_css(dest)?;
|
||||
if let Some(vertical) = vertical {
|
||||
dest.write_str(" ")?;
|
||||
vertical.to_css(dest)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get_initial_value() -> computed_value::T {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue