/* * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include namespace Web::HTML { using HTMLOptionOrOptGroupElement = Variant, NonnullRefPtr>; using HTMLElementOrElementIndex = Variant, i32>; class HTMLOptionsCollection final : public DOM::HTMLCollection { public: using WrapperType = Bindings::HTMLOptionsCollectionWrapper; static NonnullRefPtr create(DOM::ParentNode& root, Function filter) { return adopt_ref(*new HTMLOptionsCollection(root, move(filter))); } DOM::ExceptionOr add(HTMLOptionOrOptGroupElement element, Optional before = {}); protected: HTMLOptionsCollection(DOM::ParentNode& root, Function filter); }; } namespace Web::Bindings { HTMLOptionsCollectionWrapper* wrap(JS::GlobalObject&, HTML::HTMLOptionsCollection&); }