/* * Copyright (c) 2020, the SerenityOS developers. * Copyright (c) 2021, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include namespace Web::HTML { HTMLSelectElement::HTMLSelectElement(DOM::Document& document, DOM::QualifiedName qualified_name) : FormAssociatedElement(document, move(qualified_name)) { } HTMLSelectElement::~HTMLSelectElement() { } // https://html.spec.whatwg.org/multipage/form-elements.html#dom-select-options RefPtr const& HTMLSelectElement::options() { if (!m_options) { m_options = HTMLOptionsCollection::create(*this, [](DOM::Element const& element) { // https://html.spec.whatwg.org/multipage/form-elements.html#concept-select-option-list // The list of options for a select element consists of all the option element children of // the select element, and all the option element children of all the optgroup element children // of the select element, in tree order. return is(element); }); } return m_options; } }