mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 02:27:19 +02:00
LibWeb/HTML: Fix behavior when removing multiple from select element
This change ensures correct behavior when the `multiple` attribute is removed from a `select` element, reducing the number of selected `option` elements to one. Fixes a failing WPT test: https://wpt.live/html/semantics/forms/the-select-element/select-multiple.html
This commit is contained in:
committed by
Shannon Booth
parent
937994cfaa
commit
9a071c9e89
Notes:
github-actions[bot]
2025-05-27 06:59:29 +00:00
Author: https://github.com/khaledev Commit: https://github.com/LadybirdBrowser/ladybird/commit/9a071c9e893 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4882 Reviewed-by: https://github.com/shannonbooth ✅
@@ -574,6 +574,16 @@ void HTMLSelectElement::form_associated_element_was_inserted()
|
||||
create_shadow_tree_if_needed();
|
||||
}
|
||||
|
||||
void HTMLSelectElement::form_associated_element_attribute_changed(FlyString const& name, Optional<String> const& value, Optional<FlyString> const&)
|
||||
{
|
||||
if (name == HTML::AttributeNames::multiple) {
|
||||
// If the multiple attribute is absent then update the selectedness of the option elements.
|
||||
if (!value.has_value()) {
|
||||
update_selectedness();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HTMLSelectElement::computed_properties_changed()
|
||||
{
|
||||
// Hide chevron icon when appearance is none
|
||||
|
||||
Reference in New Issue
Block a user