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