script: propagate VirtualMethods::unbind_from_tree with &mut JSContext (#44422)

Propagate `&mut JSContext` in `VirtualMethods::unbind_from_tree`

Testing: Successful build is enough
Fixes: #42837

---------

Signed-off-by: Emmanuel Paul Elom <elomemmanuel007@gmail.com>
This commit is contained in:
elomscansio
2026-04-23 15:09:11 +01:00
committed by GitHub
parent ff0e9655a8
commit aa7eca43b7
25 changed files with 71 additions and 92 deletions

View File

@@ -16,7 +16,6 @@ use js::rust::HandleObject;
use net_traits::ReferrerPolicy;
use net_traits::request::Destination;
use profile_traits::ipc as ProfiledIpc;
use script_bindings::script_runtime::temp_cx;
use script_traits::{NewPipelineInfo, UpdatePipelineIdReason};
use servo_base::id::{BrowsingContextId, PipelineId, WebViewId};
use servo_constellation_traits::{
@@ -1239,15 +1238,11 @@ impl VirtualMethods for HTMLIFrameElement {
}
/// <https://html.spec.whatwg.org/multipage/#the-iframe-element:html-element-removing-steps>
#[expect(unsafe_code)]
fn unbind_from_tree(&self, context: &UnbindContext, can_gc: CanGc) {
self.super_type().unwrap().unbind_from_tree(context, can_gc);
// TODO: https://github.com/servo/servo/issues/42837
let mut cx = unsafe { temp_cx() };
fn unbind_from_tree(&self, cx: &mut js::context::JSContext, context: &UnbindContext) {
self.super_type().unwrap().unbind_from_tree(cx, context);
// The iframe HTML element removing steps, given removedNode, are to destroy a child navigable given removedNode
self.destroy_child_navigable(&mut cx);
self.destroy_child_navigable(cx);
self.owner_document().invalidate_iframes_collection();
}