script: add CanGc as argument to VirtualMethods::children_changed (#40325)

script: add CanGc as argument to VirtualMethods::children_changed

Testing: These changes do not require tests because they are a refactor.
Addresses part of https://github.com/servo/servo/issues/34573

Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
This commit is contained in:
Yerkebulan Tulibergenov
2025-10-31 17:20:25 -07:00
committed by GitHub
parent 9ca18ad121
commit 5cc786a98e
13 changed files with 68 additions and 56 deletions

View File

@@ -385,9 +385,9 @@ impl VirtualMethods for HTMLOptionElement {
}
}
fn children_changed(&self, mutation: &ChildrenMutation) {
fn children_changed(&self, mutation: &ChildrenMutation, can_gc: CanGc) {
if let Some(super_type) = self.super_type() {
super_type.children_changed(mutation);
super_type.children_changed(mutation, can_gc);
}
// Changing the descendants of a selected option can change it's displayed label
@@ -401,7 +401,7 @@ impl VirtualMethods for HTMLOptionElement {
.selected_option()
.is_some_and(|selected_option| self == &*selected_option)
{
owner_select.update_shadow_tree(CanGc::note());
owner_select.update_shadow_tree(can_gc);
}
}
}