LibWeb: Improve HTMLOptionElement spec compliance

Implement ask_for_a_reset() function
This commit is contained in:
Timur Sultanov 2024-07-25 21:15:07 +04:00 committed by Sam Atkins
parent f4102b1dc9
commit 9d4f3c938f
Notes: github-actions[bot] 2024-07-26 08:16:45 +00:00

View file

@ -137,7 +137,10 @@ int HTMLOptionElement::index() const
// https://html.spec.whatwg.org/multipage/form-elements.html#ask-for-a-reset
void HTMLOptionElement::ask_for_a_reset()
{
// FIXME: Implement this operation.
// If an option element in the list of options asks for a reset, then run that select element's selectedness setting algorithm.
if (is<HTMLSelectElement>(parent_element())) {
static_cast<HTMLSelectElement*>(parent())->update_selectedness();
}
}
// https://html.spec.whatwg.org/multipage/form-elements.html#concept-option-disabled