/src/serenity/Userland/Libraries/LibWeb/Layout/BreakNode.h
Line | Count | Source (jump to first uncovered line) |
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 | | |
12 | | namespace Web::Layout { |
13 | | |
14 | | class BreakNode final : public NodeWithStyleAndBoxModelMetrics { |
15 | | JS_CELL(BreakNode, NodeWithStyleAndBoxModelMetrics); |
16 | | JS_DECLARE_ALLOCATOR(BreakNode); |
17 | | |
18 | | public: |
19 | | BreakNode(DOM::Document&, HTML::HTMLBRElement&, NonnullRefPtr<CSS::StyleProperties>); |
20 | | virtual ~BreakNode() override; |
21 | | |
22 | 0 | const HTML::HTMLBRElement& dom_node() const { return verify_cast<HTML::HTMLBRElement>(*Node::dom_node()); } |
23 | | |
24 | | private: |
25 | 0 | virtual bool is_break_node() const final { return true; } |
26 | 0 | virtual bool can_have_children() const override { return false; } |
27 | | }; |
28 | | |
29 | | template<> |
30 | 0 | inline bool Node::fast_is<BreakNode>() const { return is_break_node(); } |
31 | | |
32 | | } |