refactor: propagate CanGc arguments through callers (#35591)

Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
This commit is contained in:
Auguste Baum 2025-02-23 01:34:51 +01:00 committed by GitHub
parent 02199520f2
commit b0b0289014
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
74 changed files with 403 additions and 275 deletions

View file

@ -221,10 +221,12 @@ impl PaintWorkletGlobalScope {
device_pixel_ratio,
properties,
arguments,
CanGc::note(),
)
}
/// <https://drafts.css-houdini.org/css-paint-api/#invoke-a-paint-callback>
#[allow(clippy::too_many_arguments)]
#[allow(unsafe_code)]
fn invoke_a_paint_callback(
&self,
@ -234,6 +236,7 @@ impl PaintWorkletGlobalScope {
device_pixel_ratio: Scale<f32, CSSPixel, DevicePixel>,
properties: &StylePropertyMapReadOnly,
arguments: &[String],
can_gc: CanGc,
) -> DrawAPaintImageResult {
debug!(
"Invoking a paint callback {}({},{}) at {:?}.",
@ -308,14 +311,14 @@ impl PaintWorkletGlobalScope {
rendering_context.set_bitmap_dimensions(size_in_px, device_pixel_ratio);
// Step 9
let paint_size = PaintSize::new(self, size_in_px, CanGc::note());
let paint_size = PaintSize::new(self, size_in_px, can_gc);
// TODO: Step 10
// Steps 11-12
debug!("Invoking paint function {}.", name);
rooted_vec!(let mut arguments_values);
for argument in arguments {
let style_value = CSSStyleValue::new(self.upcast(), argument.clone(), CanGc::note());
let style_value = CSSStyleValue::new(self.upcast(), argument.clone(), can_gc);
arguments_values.push(ObjectValue(style_value.reflector().get_jsobject().get()));
}
let arguments_value_array = HandleValueArray::from(&arguments_values);