From d3c0785d64f0186a31f38308d31c6eee4b577210 Mon Sep 17 00:00:00 2001 From: webbeef Date: Mon, 7 Oct 2024 19:30:04 -0700 Subject: Various CanGc fixes in components/script/dom (#33706) * Propagate 'can_gc' in IFrame DOM code Signed-off-by: webbeef * Propagate 'can_gc' in HTML video and image elements Signed-off-by: webbeef * Propagate 'can_gc' in Blob and dependencies Signed-off-by: webbeef * Leftover can_gc fixes for HTMLMediaElement Signed-off-by: webbeef * Address comment Signed-off-by: webbeef --------- Signed-off-by: webbeef --- components/script/dom/blob.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'components/script/dom/blob.rs') diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs index 4b3aceb150b..7f0307a5a2d 100644 --- a/components/script/dom/blob.rs +++ b/components/script/dom/blob.rs @@ -41,8 +41,8 @@ pub struct Blob { } impl Blob { - pub fn new(global: &GlobalScope, blob_impl: BlobImpl) -> DomRoot { - Self::new_with_proto(global, None, blob_impl, CanGc::note()) + pub fn new(global: &GlobalScope, blob_impl: BlobImpl, can_gc: CanGc) -> DomRoot { + Self::new_with_proto(global, None, blob_impl, can_gc) } fn new_with_proto( @@ -162,7 +162,7 @@ impl Serializable for Blob { *blob_impls = None; } - let deserialized_blob = Blob::new(owner, blob_impl); + let deserialized_blob = Blob::new(owner, blob_impl, CanGc::note()); let blobs = blobs.get_or_insert_with(HashMap::new); blobs.insert(storage_key, deserialized_blob); @@ -251,7 +251,7 @@ impl BlobMethods for Blob { normalize_type_string(content_type.unwrap_or(DOMString::from("")).as_ref()); let rel_pos = RelativePos::from_opts(start, end); let blob_impl = BlobImpl::new_sliced(rel_pos, self.blob_id, type_string); - Blob::new(&self.global(), blob_impl) + Blob::new(&self.global(), blob_impl, CanGc::note()) } // https://w3c.github.io/FileAPI/#text-method-algo -- cgit v1.2.3