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)]
27pub struct GenericBoxShadow<Color, SizeLength, BlurShapeLength, ShapeLength> {
28 pub base: GenericSimpleShadow<Color, SizeLength, BlurShapeLength>,
30 pub spread: ShapeLength,
32 #[animation(constant)]
34 #[css(represents_keyword)]
35 pub inset: bool,
36}
37
38pub use self::GenericBoxShadow as BoxShadow;
39
40#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
42#[derive(
43 Clone,
44 ComputeSquaredDistance,
45 Debug,
46 MallocSizeOf,
47 PartialEq,
48 SpecifiedValueInfo,
49 ToAnimatedValue,
50 ToComputedValue,
51 ToCss,
52 ToResolvedValue,
53 ToShmem,
54 ToTyped,
55)]
56#[animation(no_bound(U))]
57#[repr(C, u8)]
58pub enum GenericFilter<Angle, Factor, Length, Shadow, U> {
59 #[css(function)]
61 Blur(#[animation(field_bound)] NonNegative<Length>),
62 #[css(function)]
64 Brightness(#[animation(field_bound)] NonNegative<Factor>),
65 #[css(function)]
67 Contrast(#[animation(field_bound)] NonNegative<Factor>),
68 #[css(function)]
70 Grayscale(#[animation(field_bound)] ZeroToOne<Factor>),
71 #[css(function)]
73 HueRotate(Angle),
74 #[css(function)]
76 Invert(#[animation(field_bound)] ZeroToOne<Factor>),
77 #[css(function)]
79 Opacity(#[animation(field_bound)] ZeroToOne<Factor>),
80 #[css(function)]
82 Saturate(#[animation(field_bound)] NonNegative<Factor>),
83 #[css(function)]
85 Sepia(#[animation(field_bound)] ZeroToOne<Factor>),
86 #[css(function)]
88 DropShadow(Shadow),
89 #[animation(error)]
91 Url(U),
92}
93
94pub use self::GenericFilter as Filter;
95
96#[derive(
101 Animate,
102 Clone,
103 ComputeSquaredDistance,
104 Debug,
105 MallocSizeOf,
106 PartialEq,
107 SpecifiedValueInfo,
108 ToAnimatedValue,
109 ToAnimatedZero,
110 ToCss,
111 ToResolvedValue,
112 ToShmem,
113 ToTyped,
114)]
115#[repr(C)]
116pub struct GenericSimpleShadow<Color, SizeLength, ShapeLength> {
117 pub color: Color,
119 pub horizontal: SizeLength,
121 pub vertical: SizeLength,
123 pub blur: ShapeLength,
125}
126
127pub use self::GenericSimpleShadow as SimpleShadow;