FormAssociatedLabelableNode.h 1017 B

1234567891011121314151617181920212223242526272829303132
  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. JS_CELL(FormAssociatedLabelableNode, LabelableNode);
  14. public:
  15. const HTML::FormAssociatedElement& dom_node() const { return dynamic_cast<const HTML::FormAssociatedElement&>(LabelableNode::dom_node()); }
  16. HTML::FormAssociatedElement& dom_node() { return dynamic_cast<HTML::FormAssociatedElement&>(LabelableNode::dom_node()); }
  17. protected:
  18. FormAssociatedLabelableNode(DOM::Document& document, HTML::FormAssociatedElement& element, NonnullRefPtr<CSS::StyleProperties> style)
  19. : LabelableNode(document, element.form_associated_element_to_html_element(), move(style))
  20. {
  21. }
  22. virtual ~FormAssociatedLabelableNode() = default;
  23. };
  24. }