mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +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,
|
"round" => Round,
|
||||||
"no-repeat" => NoRepeat);
|
"no-repeat" => NoRepeat);
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
|
||||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
|
#[derive(Clone, Debug, PartialEq, ToCss)]
|
||||||
pub enum SpecifiedValue {
|
pub enum SpecifiedValue {
|
||||||
RepeatX,
|
RepeatX,
|
||||||
RepeatY,
|
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]
|
#[inline]
|
||||||
pub fn get_initial_value() -> computed_value::T {
|
pub fn get_initial_value() -> computed_value::T {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue