FormAssociatedLabelableNode.h 959 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (c) 2022, sin-ack <sin-ack@protonmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/Forward.h>
  8. #include <LibWeb/HTML/FormAssociatedElement.h>
  9. #include <LibWeb/HTML/HTMLElement.h>
  10. #include <LibWeb/Layout/LabelableNode.h>
  11. namespace Web::Layout {
  12. class FormAssociatedLabelableNode : public LabelableNode {
  13. public:
  14. const HTML::FormAssociatedElement& dom_node() const { return dynamic_cast<const HTML::FormAssociatedElement&>(LabelableNode::dom_node()); }
  15. HTML::FormAssociatedElement& dom_node() { return dynamic_cast<HTML::FormAssociatedElement&>(LabelableNode::dom_node()); }
  16. protected:
  17. FormAssociatedLabelableNode(DOM::Document& document, HTML::FormAssociatedElement& element, NonnullRefPtr<CSS::StyleProperties> style)
  18. : LabelableNode(document, element.form_associated_element_to_html_element(), move(style))
  19. {
  20. }
  21. virtual ~FormAssociatedLabelableNode() = default;
  22. };
  23. }