Update select shadow tree when contents of selected option change (#36958)

The label that is displayed inside a `<select>` element is that of the
selected option, or it's text contents if the option does not have a
label. Therefore, we need to update the `<select>` shadow tree when the
contents of the selected option change.

Testing: Covered by existing web platform tests
Fixes https://github.com/servo/servo/issues/36926
Fixes https://github.com/servo/servo/issues/36925

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-05-11 18:21:56 +02:00 committed by GitHub
parent fec6778eaa
commit 41283220dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 32 additions and 11 deletions

View file

@ -135,8 +135,8 @@ impl VirtualMethods for HTMLOptGroupElement {
}
fn bind_to_tree(&self, context: &BindContext, can_gc: CanGc) {
if let Some(s) = self.super_type() {
s.bind_to_tree(context, can_gc);
if let Some(super_type) = self.super_type() {
super_type.bind_to_tree(context, can_gc);
}
self.update_select_validity(can_gc);