Serenity Operating System
1/*
2 * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#pragma once
8
9#include <LibWeb/HTML/HTMLBRElement.h>
10#include <LibWeb/Layout/Node.h>
11
12namespace Web::Layout {
13
14class BreakNode final : public NodeWithStyleAndBoxModelMetrics {
15 JS_CELL(BreakNode, NodeWithStyleAndBoxModelMetrics);
16
17public:
18 BreakNode(DOM::Document&, HTML::HTMLBRElement&, NonnullRefPtr<CSS::StyleProperties>);
19 virtual ~BreakNode() override;
20
21 const HTML::HTMLBRElement& dom_node() const { return verify_cast<HTML::HTMLBRElement>(*Node::dom_node()); }
22
23private:
24 virtual bool is_break_node() const final { return true; }
25};
26
27template<>
28inline bool Node::fast_is<BreakNode>() const { return is_break_node(); }
29
30}