script: Pass &mut JSContext to VirtualMethods::cloning_steps and Node::clone (#43130)

Continuation of #43108, two new `temp_cx()` calls were required:
- inside `maybe_clone_an_option_into_selectedcontent` since it's part of
a markup5ever trait
- inside `serialize_and_cache_subtree` replacing a `CanGc::note()` call,
propagating it inside reflow code will require even more effort.

Testing: No behaviour change, a successful build is enough.
Part of #40600

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
This commit is contained in:
Gae24
2026-03-10 18:05:34 +01:00
committed by GitHub
parent bc1cd2ceeb
commit 4ef22ed227
14 changed files with 163 additions and 111 deletions

View File

@@ -1205,13 +1205,13 @@ impl VirtualMethods for HTMLScriptElement {
fn cloning_steps(
&self,
cx: &mut JSContext,
copy: &Node,
maybe_doc: Option<&Document>,
clone_children: CloneChildrenFlag,
can_gc: CanGc,
) {
if let Some(s) = self.super_type() {
s.cloning_steps(copy, maybe_doc, clone_children, can_gc);
s.cloning_steps(cx, copy, maybe_doc, clone_children);
}
// https://html.spec.whatwg.org/multipage/#already-started