mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-24 02:09:28 +00:00
LibWeb: Add HTMLOptionsCollection selected index property
This commit is contained in:
committed by
Andreas Kling
parent
5c277144d8
commit
5decf4b33c
@@ -111,4 +111,17 @@ WebIDL::ExceptionOr<void> HTMLOptionsCollection::add(HTMLOptionOrOptGroupElement
|
||||
return {};
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/#dom-htmloptionscollection-selectedindex
|
||||
WebIDL::Long HTMLOptionsCollection::selected_index() const
|
||||
{
|
||||
// The selectedIndex IDL attribute must act like the identically named attribute
|
||||
// on the select element on which the HTMLOptionsCollection is rooted.
|
||||
return verify_cast<HTMLSelectElement>(*root()).selected_index();
|
||||
}
|
||||
|
||||
void HTMLOptionsCollection::set_selected_index(WebIDL::Long index)
|
||||
{
|
||||
verify_cast<HTMLSelectElement>(*root()).set_selected_index(index);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user