LibWeb: Implement selectedness algorithm

Implement selectedness setting algorithm in HTMLSelectElement
This commit is contained in:
Timur Sultanov 2024-07-25 21:13:22 +04:00 committed by Sam Atkins
parent 9cbb3fac12
commit f4102b1dc9
Notes: github-actions[bot] 2024-07-26 08:16:49 +00:00
4 changed files with 65 additions and 15 deletions

View file

@ -57,11 +57,16 @@ void HTMLOptionElement::attribute_changed(FlyString const& name, Optional<String
void HTMLOptionElement::set_selected(bool selected)
{
// On setting, it must set the element's selectedness to the new value, set its dirtiness to true, and then cause the element to ask for a reset.
m_selected = selected;
set_selected_internal(selected);
m_dirty = true;
ask_for_a_reset();
}
void HTMLOptionElement::set_selected_internal(bool selected)
{
m_selected = selected;
}
// https://html.spec.whatwg.org/multipage/form-elements.html#dom-option-value
String HTMLOptionElement::value() const
{