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)]
25#[repr(C)]
26pub struct GenericBoxShadow<Color, SizeLength, BlurShapeLength, ShapeLength> {
27 pub base: GenericSimpleShadow<Color, SizeLength, BlurShapeLength>,
29 pub spread: ShapeLength,
31 #[animation(constant)]
33 #[css(represents_keyword)]
34 pub inset: bool,
35}
36
37pub use self::GenericBoxShadow as BoxShadow;
38
39#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
41#[derive(
42 Clone,
43 ComputeSquaredDistance,
44 Debug,
45 MallocSizeOf,
46 PartialEq,
47 SpecifiedValueInfo,
48 ToAnimatedValue,
49 ToComputedValue,
50 ToCss,
51 ToResolvedValue,
52 ToShmem,
53)]
54#[animation(no_bound(U))]
55#[repr(C, u8)]
56pub enum GenericFilter<Angle, Factor, Length, Shadow, U> {
57 #[css(function)]
59 Blur(#[animation(field_bound)] NonNegative<Length>),
60 #[css(function)]
62 Brightness(#[animation(field_bound)] NonNegative<Factor>),
63 #[css(function)]
65 Contrast(#[animation(field_bound)] NonNegative<Factor>),
66 #[css(function)]
68 Grayscale(#[animation(field_bound)] ZeroToOne<Factor>),
69 #[css(function)]
71 HueRotate(Angle),
72 #[css(function)]
74 Invert(#[animation(field_bound)] ZeroToOne<Factor>),
75 #[css(function)]
77 Opacity(#[animation(field_bound)] ZeroToOne<Factor>),
78 #[css(function)]
80 Saturate(#[animation(field_bound)] NonNegative<Factor>),
81 #[css(function)]
83 Sepia(#[animation(field_bound)] ZeroToOne<Factor>),
84 #[css(function)]
86 DropShadow(Shadow),
87 #[animation(error)]
89 Url(U),
90}
91
92pub use self::GenericFilter as Filter;
93
94#[derive(
99 Animate,
100 Clone,
101 ComputeSquaredDistance,
102 Debug,
103 MallocSizeOf,
104 PartialEq,
105 SpecifiedValueInfo,
106 ToAnimatedValue,
107 ToAnimatedZero,
108 ToCss,
109 ToResolvedValue,
110 ToShmem,
111)]
112#[repr(C)]
113pub struct GenericSimpleShadow<Color, SizeLength, ShapeLength> {
114 pub color: Color,
116 pub horizontal: SizeLength,
118 pub vertical: SizeLength,
120 pub blur: ShapeLength,
122}
123
124pub use self::GenericSimpleShadow as SimpleShadow;