style/values/generics/
effects.rs1use crate::derives::*;
7
8use crate::values::generics::{NonNegative, ZeroToOne};
9
10#[derive(
12 Animate,
13 Clone,
14 ComputeSquaredDistance,
15 Debug,
16 MallocSizeOf,
17 PartialEq,
18 SpecifiedValueInfo,
19 ToAnimatedValue,
20 ToAnimatedZero,
21 ToCss,
22 ToResolvedValue,
23 ToShmem,
24 ToTyped,
25)]
26#[repr(C)]
27#[typed(todo_derive_fields)]
28pub struct GenericBoxShadow<Color, SizeLength, BlurShapeLength, ShapeLength> {
29 pub base: GenericSimpleShadow<Color, SizeLength, BlurShapeLength>,
31 pub spread: ShapeLength,
33 #[animation(constant)]
35 #[css(represents_keyword)]
36 pub inset: bool,
37}
38
39pub use self::GenericBoxShadow as BoxShadow;
40
41#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
43#[derive(
44 Clone,
45 ComputeSquaredDistance,
46 Debug,
47 MallocSizeOf,
48 PartialEq,
49 SpecifiedValueInfo,
50 ToAnimatedValue,
51 ToComputedValue,
52 ToCss,
53 ToResolvedValue,
54 ToShmem,
55 ToTyped,
56)]
57#[animation(no_bound(U))]
58#[repr(C, u8)]
59#[typed(todo_derive_fields)]
60pub enum GenericFilter<Angle, Factor, Length, Shadow, U> {
61 #[css(function)]
63 Blur(#[animation(field_bound)] NonNegative<Length>),
64 #[css(function)]
66 Brightness(#[animation(field_bound)] NonNegative<Factor>),
67 #[css(function)]
69 Contrast(#[animation(field_bound)] NonNegative<Factor>),
70 #[css(function)]
72 Grayscale(#[animation(field_bound)] ZeroToOne<Factor>),
73 #[css(function)]
75 HueRotate(Angle),
76 #[css(function)]
78 Invert(#[animation(field_bound)] ZeroToOne<Factor>),
79 #[css(function)]
81 Opacity(#[animation(field_bound)] ZeroToOne<Factor>),
82 #[css(function)]
84 Saturate(#[animation(field_bound)] NonNegative<Factor>),
85 #[css(function)]
87 Sepia(#[animation(field_bound)] ZeroToOne<Factor>),
88 #[css(function)]
90 DropShadow(Shadow),
91 #[animation(error)]
93 Url(U),
94}
95
96pub use self::GenericFilter as Filter;
97
98#[derive(
103 Animate,
104 Clone,
105 ComputeSquaredDistance,
106 Debug,
107 MallocSizeOf,
108 PartialEq,
109 SpecifiedValueInfo,
110 ToAnimatedValue,
111 ToAnimatedZero,
112 ToCss,
113 ToResolvedValue,
114 ToShmem,
115 ToTyped,
116)]
117#[repr(C)]
118#[typed(todo_derive_fields)]
119pub struct GenericSimpleShadow<Color, SizeLength, ShapeLength> {
120 pub color: Color,
122 pub horizontal: SizeLength,
124 pub vertical: SizeLength,
126 pub blur: ShapeLength,
128}
129
130pub use self::GenericSimpleShadow as SimpleShadow;