mirror of
https://github.com/servo/servo
synced 2026-04-26 17:45:19 +02:00
script: Pass &mut JSContext to attribute_mutated (#43383)
It pushes the `temp_cx` 1 level up to `element.rs` where the calling chain begins. Other than that this was purely a mechanical change where I used regexes to replace all patterns with the new ones. Part of #42812 Testing: It compiles Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
committed by
GitHub
parent
d3ca63c514
commit
479a9b6be3
@@ -1188,15 +1188,15 @@ impl VirtualMethods for HTMLScriptElement {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
#[expect(unsafe_code)]
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation, can_gc: CanGc) {
|
||||
// TODO: https://github.com/servo/servo/issues/42812
|
||||
let mut cx = unsafe { script_bindings::script_runtime::temp_cx() };
|
||||
let cx = &mut cx;
|
||||
|
||||
fn attribute_mutated(
|
||||
&self,
|
||||
cx: &mut js::context::JSContext,
|
||||
attr: &Attr,
|
||||
mutation: AttributeMutation,
|
||||
) {
|
||||
self.super_type()
|
||||
.unwrap()
|
||||
.attribute_mutated(attr, mutation, can_gc);
|
||||
.attribute_mutated(cx, attr, mutation);
|
||||
if *attr.local_name() == local_name!("src") {
|
||||
if let AttributeMutation::Set(..) = mutation {
|
||||
if !self.parser_inserted.get() && self.upcast::<Node>().is_connected() {
|
||||
|
||||
Reference in New Issue
Block a user