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:
parent
daefe744ba
commit
27dd2a40ad
6 changed files with 118 additions and 1 deletions
31
Userland/Libraries/LibWeb/DOM/HTMLFormControlsCollection.h
Normal file
31
Userland/Libraries/LibWeb/DOM/HTMLFormControlsCollection.h
Normal 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);
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue