mirror of
https://github.com/servo/servo
synced 2026-04-26 01:25:32 +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
@@ -605,10 +605,15 @@ impl VirtualMethods for HTMLTextAreaElement {
|
||||
Some(self.upcast::<HTMLElement>() as &dyn VirtualMethods)
|
||||
}
|
||||
|
||||
fn attribute_mutated(&self, attr: &Attr, mutation: AttributeMutation, can_gc: CanGc) {
|
||||
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);
|
||||
match *attr.local_name() {
|
||||
local_name!("disabled") => {
|
||||
let el = self.upcast::<Element>();
|
||||
@@ -662,7 +667,7 @@ impl VirtualMethods for HTMLTextAreaElement {
|
||||
placeholder.push_str(attr.value().as_ref());
|
||||
}
|
||||
}
|
||||
self.handle_text_content_changed(can_gc);
|
||||
self.handle_text_content_changed(CanGc::from_cx(cx));
|
||||
},
|
||||
local_name!("readonly") => {
|
||||
let el = self.upcast::<Element>();
|
||||
@@ -676,13 +681,13 @@ impl VirtualMethods for HTMLTextAreaElement {
|
||||
}
|
||||
},
|
||||
local_name!("form") => {
|
||||
self.form_attribute_mutated(mutation, can_gc);
|
||||
self.form_attribute_mutated(mutation, CanGc::from_cx(cx));
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
|
||||
self.validity_state(can_gc)
|
||||
.perform_validation_and_update(ValidationFlags::all(), can_gc);
|
||||
self.validity_state(CanGc::from_cx(cx))
|
||||
.perform_validation_and_update(ValidationFlags::all(), CanGc::from_cx(cx));
|
||||
}
|
||||
|
||||
fn bind_to_tree(&self, cx: &mut JSContext, context: &BindContext) {
|
||||
|
||||
Reference in New Issue
Block a user