mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 00:38:48 +00:00
LibWeb: Ensure selected options collection is created prior to access
This commit is contained in:
parent
dccb374876
commit
8b2de413ae
Notes:
github-actions[bot]
2025-02-08 12:33:22 +00:00
Author: https://github.com/tcl3
Commit: 8b2de413ae
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3477
4 changed files with 111 additions and 1 deletions
Libraries/LibWeb/HTML
|
@ -718,7 +718,8 @@ bool HTMLSelectElement::suffering_from_being_missing() const
|
|||
// If the element has its required attribute specified, and either none of the option elements in the select element's list of options have their selectedness
|
||||
// set to true, or the only option element in the select element's list of options with its selectedness set to true is the placeholder label option, then the element is suffering from being
|
||||
// missing.
|
||||
return has_attribute(HTML::AttributeNames::required) && (m_selected_options->length() == 0 || (m_selected_options->length() == 1 && m_selected_options->item(0) == placeholder_label_option()));
|
||||
auto selected_options = this->selected_options();
|
||||
return has_attribute(HTML::AttributeNames::required) && (selected_options->length() == 0 || (selected_options->length() == 1 && selected_options->item(0) == placeholder_label_option()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue