style/values/generics/
effects.rs1use crate::values::generics::{NonNegative, ZeroToOne};
8
9#[derive(
11 Animate,
12 Clone,
13 ComputeSquaredDistance,
14 Debug,
15 MallocSizeOf,
16 PartialEq,
17 SpecifiedValueInfo,
18 ToAnimatedValue,
19 ToAnimatedZero,
20 ToCss,
21 ToResolvedValue,
22 ToShmem,
23)]
24#[repr(C)]
25pub struct GenericBoxShadow<Color, SizeLength, BlurShapeLength, ShapeLength> {
26 pub base: GenericSimpleShadow<Color, SizeLength, BlurShapeLength>,
28 pub spread: ShapeLength,
30 #[animation(constant)]
32 #[css(represents_keyword)]
33 pub inset: bool,
34}
35
36pub use self::GenericBoxShadow as BoxShadow;
37
38#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
40#[derive(
41 Clone,
42 ComputeSquaredDistance,
43 Debug,
44 MallocSizeOf,
45 PartialEq,
46 SpecifiedValueInfo,
47 ToAnimatedValue,
48 ToComputedValue,
49 ToCss,
50 ToResolvedValue,
51 ToShmem,
52)]
53#[animation(no_bound(U))]
54#[repr(C, u8)]
55pub enum GenericFilter<Angle, Factor, Length, Shadow, U> {
56 #[css(function)]
58 Blur(#[animation(field_bound)] NonNegative<Length>),
59 #[css(function)]
61 Brightness(#[animation(field_bound)] NonNegative<Factor>),
62 #[css(function)]
64 Contrast(#[animation(field_bound)] NonNegative<Factor>),
65 #[css(function)]
67 Grayscale(#[animation(field_bound)] ZeroToOne<Factor>),
68 #[css(function)]
70 HueRotate(Angle),
71 #[css(function)]
73 Invert(#[animation(field_bound)] ZeroToOne<Factor>),
74 #[css(function)]
76 Opacity(#[animation(field_bound)] ZeroToOne<Factor>),
77 #[css(function)]
79 Saturate(#[animation(field_bound)] NonNegative<Factor>),
80 #[css(function)]
82 Sepia(#[animation(field_bound)] ZeroToOne<Factor>),
83 #[css(function)]
85 DropShadow(Shadow),
86 #[animation(error)]
88 Url(U),
89}
90
91pub use self::GenericFilter as Filter;
92
93#[derive(
98 Animate,
99 Clone,
100 ComputeSquaredDistance,
101 Debug,
102 MallocSizeOf,
103 PartialEq,
104 SpecifiedValueInfo,
105 ToAnimatedValue,
106 ToAnimatedZero,
107 ToCss,
108 ToResolvedValue,
109 ToShmem,
110)]
111#[repr(C)]
112pub struct GenericSimpleShadow<Color, SizeLength, ShapeLength> {
113 pub color: Color,
115 pub horizontal: SizeLength,
117 pub vertical: SizeLength,
119 pub blur: ShapeLength,
121}
122
123pub use self::GenericSimpleShadow as SimpleShadow;