script: Pass &mut JSContext to reflect_node_with_proto (#43952)

A lot (and I mean, really a lot) depends on these constructors.
Therefore, this is the one spaghetti ball that I could extract and
convert all `can_gc` to `cx`. There are some new introductions of
`temp_cx` in the callbacks of the servo parser, but we already had some
in other callbacks.

Part of #40600

Testing: It compiles

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
Tim van der Lippe
2026-04-05 20:07:30 +02:00
committed by GitHub
parent 621f6b0cf7
commit a1c8896eda
97 changed files with 354 additions and 414 deletions

View File

@@ -11,7 +11,6 @@ use script_bindings::codegen::GenericBindings::DocumentBinding::DocumentMethods;
use script_bindings::codegen::GenericBindings::NodeBinding::NodeMethods;
use script_bindings::inheritance::Castable;
use script_bindings::root::{Dom, DomRoot};
use script_bindings::script_runtime::CanGc;
use style::selector_parser::PseudoElement;
use crate::dom::bindings::cell::DomRefCell;
@@ -243,7 +242,7 @@ fn create_ua_widget_div_with_text_node(
.unwrap();
el.upcast::<Node>()
.set_implemented_pseudo_element(implemented_pseudo);
let text_node = document.CreateTextNode("".into(), CanGc::from_cx(cx));
let text_node = document.CreateTextNode(cx, "".into());
if !as_first_child {
el.upcast::<Node>()