HTMLFieldSetElement.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright (c) 2020, the SerenityOS developers.
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/ARIA/Roles.h>
  8. #include <LibWeb/DOM/HTMLCollection.h>
  9. #include <LibWeb/HTML/FormAssociatedElement.h>
  10. #include <LibWeb/HTML/HTMLElement.h>
  11. namespace Web::HTML {
  12. class HTMLFieldSetElement final
  13. : public HTMLElement
  14. , public FormAssociatedElement {
  15. WEB_PLATFORM_OBJECT(HTMLFieldSetElement, HTMLElement);
  16. GC_DECLARE_ALLOCATOR(HTMLFieldSetElement);
  17. FORM_ASSOCIATED_ELEMENT(HTMLElement, HTMLFieldSetElement)
  18. public:
  19. virtual ~HTMLFieldSetElement() override;
  20. String const& type() const
  21. {
  22. static String const fieldset = "fieldset"_string;
  23. return fieldset;
  24. }
  25. bool is_disabled() const;
  26. GC::Ptr<DOM::HTMLCollection> const& elements();
  27. // ^FormAssociatedElement
  28. // https://html.spec.whatwg.org/multipage/forms.html#category-listed
  29. virtual bool is_listed() const override { return true; }
  30. // https://html.spec.whatwg.org/multipage/forms.html#category-autocapitalize
  31. virtual bool is_auto_capitalize_inheriting() const override { return true; }
  32. virtual Optional<ARIA::Role> default_role() const override { return ARIA::Role::group; }
  33. virtual GC::Ptr<Layout::Node> create_layout_node(CSS::StyleProperties) override;
  34. Layout::FieldSetBox* layout_node();
  35. Layout::FieldSetBox const* layout_node() const;
  36. private:
  37. HTMLFieldSetElement(DOM::Document&, DOM::QualifiedName);
  38. virtual void initialize(JS::Realm&) override;
  39. virtual void visit_edges(Cell::Visitor&) override;
  40. GC::Ptr<DOM::HTMLCollection> m_elements;
  41. };
  42. }