1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-03 04:52:13 +00:00

LibWeb: Implement HTMLFormControlsCollection

This collection is used in the form element for when element lookup
yields multiple elements.
This commit is contained in:
Shannon Booth 2023-08-20 14:41:51 +12:00 committed by Andreas Kling
parent daefe744ba
commit 27dd2a40ad
6 changed files with 118 additions and 1 deletions

View file

@ -0,0 +1,31 @@
/*
* Copyright (c) 2023, Shannon Booth <shannon@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/DOM/HTMLCollection.h>
#include <LibWeb/DOM/RadioNodeList.h>
namespace Web::DOM {
class HTMLFormControlsCollection : public HTMLCollection {
WEB_PLATFORM_OBJECT(HTMLFormControlsCollection, HTMLCollection);
public:
[[nodiscard]] static JS::NonnullGCPtr<HTMLFormControlsCollection> create(ParentNode& root, Scope, Function<bool(Element const&)> filter);
virtual ~HTMLFormControlsCollection() override;
Variant<Empty, Element*, JS::Handle<RadioNodeList>> named_item_or_radio_node_list(FlyString const& name);
protected:
virtual void initialize(JS::Realm&) override;
private:
HTMLFormControlsCollection(ParentNode& root, Scope, Function<bool(Element const&)> filter);
};
}