Implement #[compute(clone)] for #[derive(ToComputedValue)]

This commit is contained in:
Anthony Ramine 2017-08-26 12:56:50 +02:00
parent efc852f6e3
commit 735e093de7
6 changed files with 37 additions and 95 deletions

View file

@ -35,16 +35,18 @@ pub enum Image<Gradient, MozImageRect, ImageUrl> {
/// A CSS gradient.
/// https://drafts.csswg.org/css-images/#gradients
#[derive(Clone, Debug, HasViewportPercentage, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
#[derive(Clone, Debug, HasViewportPercentage, PartialEq, ToComputedValue)]
pub struct Gradient<LineDirection, Length, LengthOrPercentage, Position, Color, Angle> {
/// Gradients can be linear or radial.
pub kind: GradientKind<LineDirection, Length, LengthOrPercentage, Position, Angle>,
/// The color stops and interpolation hints.
pub items: Vec<GradientItem<Color, LengthOrPercentage>>,
/// True if this is a repeating gradient.
#[compute(clone)]
pub repeating: bool,
/// Compatibility mode.
#[compute(clone)]
pub compat_mode: CompatMode,
}