FormAssociatedElement.h 708 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/WeakPtr.h>
  8. #include <LibWeb/Forward.h>
  9. #include <LibWeb/HTML/HTMLElement.h>
  10. namespace Web::HTML {
  11. class FormAssociatedElement : public HTMLElement {
  12. public:
  13. HTMLFormElement* form() { return m_form; }
  14. HTMLFormElement const* form() const { return m_form; }
  15. void set_form(HTMLFormElement*);
  16. protected:
  17. FormAssociatedElement(DOM::Document& document, DOM::QualifiedName qualified_name)
  18. : HTMLElement(document, move(qualified_name))
  19. {
  20. }
  21. virtual ~FormAssociatedElement() = default;
  22. private:
  23. WeakPtr<HTMLFormElement> m_form;
  24. };
  25. }