diff --git a/components/style/values/generics/image.rs b/components/style/values/generics/image.rs index 7de8ba71f10..0f7549e4a56 100644 --- a/components/style/values/generics/image.rs +++ b/components/style/values/generics/image.rs @@ -69,7 +69,7 @@ pub enum GradientKind { } /// A radial gradient's ending shape. -#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq, ToComputedValue)] +#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq, ToComputedValue, ToCss)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum EndingShape { /// A circular gradient. @@ -89,7 +89,7 @@ pub enum Circle { } /// An ellipse shape. -#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq, ToComputedValue)] +#[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq, ToComputedValue, ToCss)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] pub enum Ellipse { /// An ellipse pair of radii. @@ -286,30 +286,26 @@ pub trait LineDirection { where W: fmt::Write; } -impl ToCss for EndingShape - where L: ToCss, LoP: ToCss, +impl ToCss for Circle +where + L: ToCss, { - fn to_css(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { + fn to_css(&self, dest: &mut W) -> fmt::Result + where + W: fmt::Write, + { match *self { - EndingShape::Circle(Circle::Extent(ShapeExtent::FarthestCorner)) | - EndingShape::Circle(Circle::Extent(ShapeExtent::Cover)) => { + Circle::Extent(ShapeExtent::FarthestCorner) | + Circle::Extent(ShapeExtent::Cover) => { dest.write_str("circle") }, - EndingShape::Circle(Circle::Extent(keyword)) => { + Circle::Extent(keyword) => { dest.write_str("circle ")?; keyword.to_css(dest) }, - EndingShape::Circle(Circle::Radius(ref length)) => { + Circle::Radius(ref length) => { length.to_css(dest) }, - EndingShape::Ellipse(Ellipse::Extent(keyword)) => { - keyword.to_css(dest) - }, - EndingShape::Ellipse(Ellipse::Radii(ref x, ref y)) => { - x.to_css(dest)?; - dest.write_str(" ")?; - y.to_css(dest) - }, } } }