HTMLFormControlsCollection.h 1002 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2023, Shannon Booth <shannon@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/DOM/HTMLCollection.h>
  8. #include <LibWeb/DOM/RadioNodeList.h>
  9. namespace Web::DOM {
  10. class HTMLFormControlsCollection : public HTMLCollection {
  11. WEB_PLATFORM_OBJECT(HTMLFormControlsCollection, HTMLCollection);
  12. JS_DECLARE_ALLOCATOR(HTMLFormControlsCollection);
  13. public:
  14. [[nodiscard]] static JS::NonnullGCPtr<HTMLFormControlsCollection> create(ParentNode& root, Scope, Function<bool(Element const&)> filter);
  15. virtual ~HTMLFormControlsCollection() override;
  16. Variant<Empty, Element*, JS::Handle<RadioNodeList>> named_item_or_radio_node_list(FlyString const& name) const;
  17. protected:
  18. virtual void initialize(JS::Realm&) override;
  19. virtual WebIDL::ExceptionOr<JS::Value> named_item_value(FlyString const& name) const final;
  20. private:
  21. HTMLFormControlsCollection(ParentNode& root, Scope, Function<bool(Element const&)> filter);
  22. };
  23. }