Derive ToCss for SVGPaint

I wonder if there wasn't a bug in the former implementation, given there is no
space written before the fallback value.
This commit is contained in:
Anthony Ramine 2017-07-20 10:30:44 +02:00
parent 1eb51daba6
commit dc1e5372da

View file

@ -255,7 +255,7 @@ impl ToCss for FontSettingTagFloat {
/// ///
/// https://www.w3.org/TR/SVG2/painting.html#SpecifyingPaint /// https://www.w3.org/TR/SVG2/painting.html#SpecifyingPaint
#[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
#[derive(Clone, Debug, PartialEq, ToAnimatedValue, ToComputedValue)] #[derive(Clone, Debug, PartialEq, ToAnimatedValue, ToComputedValue, ToCss)]
pub struct SVGPaint<ColorType> { pub struct SVGPaint<ColorType> {
/// The paint source /// The paint source
pub kind: SVGPaintKind<ColorType>, pub kind: SVGPaintKind<ColorType>,
@ -336,15 +336,3 @@ impl<ColorType: Parse> Parse for SVGPaint<ColorType> {
} }
} }
} }
impl<ColorType: ToCss> ToCss for SVGPaint<ColorType> {
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
self.kind.to_css(dest)?;
if let Some(ref fallback) = self.fallback {
fallback.to_css(dest)?;
}
Ok(())
}
}