mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +00:00
LibWeb: Add select and option collection set length
This commit is contained in:
committed by
Andreas Kling
parent
4e5ce7b63e
commit
5c277144d8
@@ -100,12 +100,18 @@ JS::GCPtr<HTMLOptionsCollection> const& HTMLSelectElement::options()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-elements.html#dom-select-length
|
||||
size_t HTMLSelectElement::length()
|
||||
WebIDL::UnsignedLong HTMLSelectElement::length()
|
||||
{
|
||||
// The length IDL attribute must return the number of nodes represented by the options collection. On setting, it must act like the attribute of the same name on the options collection.
|
||||
return const_cast<HTMLOptionsCollection&>(*options()).length();
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<void> HTMLSelectElement::set_length(WebIDL::UnsignedLong length)
|
||||
{
|
||||
// On setting, it must act like the attribute of the same name on the options collection.
|
||||
return const_cast<HTMLOptionsCollection&>(*options()).set_length(length);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-elements.html#dom-select-item
|
||||
DOM::Element* HTMLSelectElement::item(size_t index)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user