mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Derive ToCss for MozImageRect<Color>
This commit is contained in:
parent
907d629ca4
commit
c2e746004a
1 changed files with 4 additions and 21 deletions
|
@ -154,14 +154,15 @@ impl ToCss for PaintWorklet {
|
||||||
/// Values for `moz-image-rect`.
|
/// Values for `moz-image-rect`.
|
||||||
///
|
///
|
||||||
/// `-moz-image-rect(<uri>, top, right, bottom, left);`
|
/// `-moz-image-rect(<uri>, top, right, bottom, left);`
|
||||||
#[derive(Clone, Debug, PartialEq, ToComputedValue)]
|
|
||||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
|
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||||
|
#[css(comma, function)]
|
||||||
|
#[derive(Clone, Debug, PartialEq, ToComputedValue, ToCss)]
|
||||||
pub struct MozImageRect<NumberOrPercentage> {
|
pub struct MozImageRect<NumberOrPercentage> {
|
||||||
pub url: SpecifiedUrl,
|
pub url: SpecifiedUrl,
|
||||||
pub top: NumberOrPercentage,
|
pub top: NumberOrPercentage,
|
||||||
pub bottom: NumberOrPercentage,
|
|
||||||
pub right: NumberOrPercentage,
|
pub right: NumberOrPercentage,
|
||||||
|
pub bottom: NumberOrPercentage,
|
||||||
pub left: NumberOrPercentage,
|
pub left: NumberOrPercentage,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,21 +330,3 @@ impl<C, L> fmt::Debug for ColorStop<C, L>
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<C> ToCss for MozImageRect<C>
|
|
||||||
where C: ToCss,
|
|
||||||
{
|
|
||||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
|
||||||
dest.write_str("-moz-image-rect(")?;
|
|
||||||
self.url.to_css(dest)?;
|
|
||||||
dest.write_str(", ")?;
|
|
||||||
self.top.to_css(dest)?;
|
|
||||||
dest.write_str(", ")?;
|
|
||||||
self.right.to_css(dest)?;
|
|
||||||
dest.write_str(", ")?;
|
|
||||||
self.bottom.to_css(dest)?;
|
|
||||||
dest.write_str(", ")?;
|
|
||||||
self.left.to_css(dest)?;
|
|
||||||
dest.write_str(")")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue