script: pass down &mut JSContext in post_connection_steps (#42679)

Pass down `&mut JSContext` in `post_connection_steps` 

Testing: No functionality 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-02-17 14:20:52 +01:00
committed by GitHub
parent 92e2d00083
commit 8a3738dc43
5 changed files with 15 additions and 12 deletions

View File

@@ -13,6 +13,7 @@ use base::id::WebViewId;
use dom_struct::dom_struct;
use encoding_rs::Encoding;
use html5ever::{LocalName, Prefix, local_name, ns};
use js::context::JSContext;
use js::jsval::UndefinedValue;
use js::rust::{HandleObject, Stencil};
use net_traits::http_status::HttpStatus;
@@ -1232,13 +1233,13 @@ impl VirtualMethods for HTMLScriptElement {
}
/// <https://html.spec.whatwg.org/multipage/#script-processing-model:the-script-element-20>
fn post_connection_steps(&self, can_gc: CanGc) {
fn post_connection_steps(&self, cx: &mut JSContext) {
if let Some(s) = self.super_type() {
s.post_connection_steps(can_gc);
s.post_connection_steps(cx);
}
if self.upcast::<Node>().is_connected() && !self.parser_inserted.get() {
self.prepare(Some(IntroductionType::INJECTED_SCRIPT), can_gc);
self.prepare(Some(IntroductionType::INJECTED_SCRIPT), CanGc::from_cx(cx));
}
}