HTMLFormControlsCollection.h 986 B

123456789101112131415161718192021222324252627282930313233
  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. namespace Web::HTML {
  9. class HTMLFormControlsCollection : public DOM::HTMLCollection {
  10. WEB_PLATFORM_OBJECT(HTMLFormControlsCollection, DOM::HTMLCollection);
  11. GC_DECLARE_ALLOCATOR(HTMLFormControlsCollection);
  12. public:
  13. [[nodiscard]] static GC::Ref<HTMLFormControlsCollection> create(DOM::ParentNode& root, Scope, ESCAPING Function<bool(DOM::Element const&)> filter);
  14. virtual ~HTMLFormControlsCollection() override;
  15. Variant<Empty, DOM::Element*, GC::Root<RadioNodeList>> named_item_or_radio_node_list(FlyString const& name) const;
  16. protected:
  17. virtual void initialize(JS::Realm&) override;
  18. virtual JS::Value named_item_value(FlyString const& name) const final;
  19. private:
  20. HTMLFormControlsCollection(DOM::ParentNode& root, Scope, ESCAPING Function<bool(DOM::Element const&)> filter);
  21. };
  22. }