mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-04 02:08:53 +00:00
LibWeb: Add select and options collection remove method
This commit is contained in:
parent
5decf4b33c
commit
7372c01786
Notes:
sideshowbarker
2024-07-17 14:36:19 +09:00
Author: https://github.com/bplaat
Commit: 7372c01786
Pull-request: https://github.com/SerenityOS/serenity/pull/23895
Reviewed-by: https://github.com/shannonbooth
8 changed files with 62 additions and 3 deletions
|
@ -133,6 +133,19 @@ WebIDL::ExceptionOr<void> HTMLSelectElement::add(HTMLOptionOrOptGroupElement ele
|
|||
return const_cast<HTMLOptionsCollection&>(*options()).add(move(element), move(before));
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-elements.html#dom-select-remove
|
||||
void HTMLSelectElement::remove()
|
||||
{
|
||||
// The remove() method must act like its namesake method on that same options collection when it has arguments,
|
||||
// and like its namesake method on the ChildNode interface implemented by the HTMLSelectElement ancestor interface Element when it has no arguments.
|
||||
ChildNode::remove_binding();
|
||||
}
|
||||
|
||||
void HTMLSelectElement::remove(WebIDL::Long index)
|
||||
{
|
||||
const_cast<HTMLOptionsCollection&>(*options()).remove(index);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-elements.html#concept-select-option-list
|
||||
Vector<JS::Handle<HTMLOptionElement>> HTMLSelectElement::list_of_options() const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue