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

@@ -412,7 +412,7 @@ impl Node {
// This needs to be in its own loop, because unbind_from_tree may
// rely on the state of IS_IN_DOC of the context node's descendants,
// e.g. when removing a <form>.
vtable_for(node).unbind_from_tree(context, CanGc::from_cx(cx));
vtable_for(node).unbind_from_tree(cx, context);
// Step 12 & 14.2. Enqueue disconnected custom element reactions.
if is_parent_connected {
@@ -4759,8 +4759,8 @@ impl VirtualMethods for Node {
// This handles the ranges mentioned in steps 2-3 when removing a node.
/// <https://dom.spec.whatwg.org/#concept-node-remove>
fn unbind_from_tree(&self, context: &UnbindContext, can_gc: CanGc) {
self.super_type().unwrap().unbind_from_tree(context, can_gc);
fn unbind_from_tree(&self, cx: &mut js::context::JSContext, context: &UnbindContext) {
self.super_type().unwrap().unbind_from_tree(cx, context);
// Ranges should only drain to the parent from inclusive non-shadow
// including descendants. If we're in a shadow tree at this point then the