Propagate CanGc arguments through callers in constructors (#35541)

Signed-off-by: Auguste Baum <auguste.apple@gmail.com>
This commit is contained in:
Auguste Baum 2025-02-20 17:17:45 +01:00 committed by GitHub
parent 5465bfc2af
commit 863d2ce871
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
260 changed files with 986 additions and 603 deletions

View file

@ -276,7 +276,8 @@ impl HTMLCanvasElement {
let window = self.owner_window();
let size = self.get_size();
let context = CanvasRenderingContext2D::new(window.as_global_scope(), self, size);
let context =
CanvasRenderingContext2D::new(window.as_global_scope(), self, size, CanGc::note());
*self.context.borrow_mut() = Some(CanvasContext::Context2d(Dom::from_ref(&*context)));
Some(context)
}
@ -356,7 +357,7 @@ impl HTMLCanvasElement {
.recv()
.expect("Failed to get WebGPU channel")
.map(|channel| {
let context = GPUCanvasContext::new(&global_scope, self, channel);
let context = GPUCanvasContext::new(&global_scope, self, channel, CanGc::note());
*self.context.borrow_mut() = Some(CanvasContext::WebGPU(Dom::from_ref(&*context)));
context
})
@ -717,7 +718,12 @@ impl HTMLCanvasElementMethods<crate::DomTypeHolder> for HTMLCanvasElement {
) -> DomRoot<MediaStream> {
let global = self.global();
let stream = MediaStream::new(&global, can_gc);
let track = MediaStreamTrack::new(&global, MediaStreamId::new(), MediaStreamType::Video);
let track = MediaStreamTrack::new(
&global,
MediaStreamId::new(),
MediaStreamType::Video,
can_gc,
);
stream.AddTrack(&track);
stream
}