mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
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:
parent
1eb51daba6
commit
dc1e5372da
1 changed files with 1 additions and 13 deletions
|
@ -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(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue