blob: 780401e580b4322ef2e07f260ac1999ac3311d83 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/*
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Variant.h>
#include <LibWeb/DOM/ExceptionOr.h>
#include <LibWeb/DOM/HTMLCollection.h>
namespace Web::HTML {
using HTMLOptionOrOptGroupElement = Variant<JS::Handle<HTMLOptionElement>, JS::Handle<HTMLOptGroupElement>>;
using HTMLElementOrElementIndex = Variant<JS::Handle<HTMLElement>, i32>;
class HTMLOptionsCollection final : public DOM::HTMLCollection {
WEB_PLATFORM_OBJECT(HTMLOptionsCollection, DOM::HTMLCollection);
public:
static JS::NonnullGCPtr<HTMLOptionsCollection> create(DOM::ParentNode& root, Function<bool(DOM::Element const&)> filter);
virtual ~HTMLOptionsCollection() override;
DOM::ExceptionOr<void> add(HTMLOptionOrOptGroupElement element, Optional<HTMLElementOrElementIndex> before = {});
private:
HTMLOptionsCollection(DOM::ParentNode& root, Function<bool(DOM::Element const&)> filter);
};
}
WRAPPER_HACK(HTMLOptionsCollection, Web::HTML)
|