Skip to content

Commit 049b5b4

Browse files
box paintworklet to reduce genericimage size (#168)
1 parent 127952e commit 049b5b4

File tree

5 files changed

+4
-6
lines changed

5 files changed

+4
-6
lines changed

style/properties/longhands/border.mako.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ ${helpers.predefined_type(
112112
spec="https://drafts.csswg.org/css-backgrounds/#the-background-image",
113113
vector=False,
114114
animation_type="discrete",
115-
boxed=engine == "servo",
116115
ignored_when_colors_disabled=True,
117116
affects="paint",
118117
)}

style/properties/longhands/list.mako.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ ${helpers.predefined_type(
5959
initial_specified_value="specified::Image::None",
6060
animation_type="discrete",
6161
spec="https://drafts.csswg.org/css-lists/#propdef-list-style-image",
62-
boxed=engine == "servo",
6362
servo_restyle_damage="rebuild_and_reflow",
6463
affects="layout",
6564
)}

style/values/computed/image.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub type Image = generic::GenericImage<Gradient, ComputedUrl, Color, Percentage,
3232
#[cfg(feature = "gecko")]
3333
size_of_test!(Image, 16);
3434
#[cfg(feature = "servo")]
35-
size_of_test!(Image, 40);
35+
size_of_test!(Image, 24);
3636

3737
/// Computed values for a CSS gradient.
3838
/// <https://drafts.csswg.org/css-images/#gradients>

style/values/generics/image.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub enum GenericImage<G, ImageUrl, Color, Percentage, Resolution> {
4242
/// A paint worklet image.
4343
/// <https://drafts.css-houdini.org/css-paint-api/>
4444
#[cfg(feature = "servo")]
45-
PaintWorklet(PaintWorklet),
45+
PaintWorklet(Box<PaintWorklet>),
4646

4747
/// A `<cross-fade()>` image. Storing this directly inside of
4848
/// GenericImage increases the size by 8 bytes so we box it here

style/values/specified/image.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub type Image = generic::Image<Gradient, SpecifiedUrl, Color, Percentage, Resol
4646
#[cfg(feature = "gecko")]
4747
size_of_test!(Image, 16);
4848
#[cfg(feature = "servo")]
49-
size_of_test!(Image, 40);
49+
size_of_test!(Image, 24);
5050

5151
/// Specified values for a CSS gradient.
5252
/// <https://drafts.csswg.org/css-images/#gradients>
@@ -244,7 +244,7 @@ impl Image {
244244
input.parse_nested_block(|input| {
245245
Ok(match_ignore_ascii_case! { &function,
246246
#[cfg(feature = "servo")]
247-
"paint" => Self::PaintWorklet(PaintWorklet::parse_args(context, input)?),
247+
"paint" => Self::PaintWorklet(Box::new(<PaintWorklet>::parse_args(context, input)?)),
248248
"cross-fade" if cross_fade_enabled() => Self::CrossFade(Box::new(CrossFade::parse_args(context, input, cors_mode, flags)?)),
249249
#[cfg(feature = "gecko")]
250250
"-moz-element" => Self::Element(Self::parse_element(input)?),

0 commit comments

Comments
 (0)