1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 12:15:07 +00:00

LibWeb: Implement HTMLSelectElement.type

This commit is contained in:
Luke Wilde 2022-11-05 04:51:42 +00:00 committed by Andreas Kling
parent c247fefee7
commit c4ee43c5b4
3 changed files with 17 additions and 0 deletions

View file

@ -129,4 +129,17 @@ i32 HTMLSelectElement::default_tab_index_value() const
return 0;
}
// https://html.spec.whatwg.org/multipage/form-elements.html#dom-select-type
String const& HTMLSelectElement::type() const
{
// The type IDL attribute, on getting, must return the string "select-one" if the multiple attribute is absent, and the string "select-multiple" if the multiple attribute is present.
static String select_one = "select-one"sv;
static String select_multiple = "select-multiple"sv;
if (!has_attribute(AttributeNames::multiple))
return select_one;
return select_multiple;
}
}