diff options
author | Simon Wanner <skyrising@pvpctutorials.de> | 2022-03-16 12:58:28 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-16 14:25:09 +0100 |
commit | 624527f15ecef66b4b6ba4821e6c9e112cd81e99 (patch) | |
tree | 6678cb936f5d249eeb1fa143752fcf4be9a24982 /Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.h | |
parent | 6f4dde253fb157602486ed503453ad642adc5ce1 (diff) | |
download | serenity-624527f15ecef66b4b6ba4821e6c9e112cd81e99.zip |
LibWeb: Add stub implementation of HTMLOptionsCollection
This is a subtype of `DOM::HTMLCollection` that only holds
`HTMLOptionElement`s. In this stub implementation only `item`,
`namedItem` and `length`, inherited from HTMLCollection, are exposed.
This is good enough for applications that only read the collection.
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.h')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.h b/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.h new file mode 100644 index 0000000000..1d2bfcd2c5 --- /dev/null +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022, the SerenityOS developers. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include <LibWeb/DOM/HTMLCollection.h> + +namespace Web::HTML { + +class HTMLOptionsCollection final : public DOM::HTMLCollection { +public: + using WrapperType = Bindings::HTMLOptionsCollectionWrapper; + + static NonnullRefPtr<HTMLOptionsCollection> create(DOM::ParentNode& root, Function<bool(DOM::Element const&)> filter) + { + return adopt_ref(*new HTMLOptionsCollection(root, move(filter))); + } + +protected: + HTMLOptionsCollection(DOM::ParentNode& root, Function<bool(DOM::Element const&)> filter); +}; + +} + +namespace Web::Bindings { + +HTMLOptionsCollectionWrapper* wrap(JS::GlobalObject&, HTML::HTMLOptionsCollection&); + +} |