/src/serenity/Userland/Libraries/LibWeb/Layout/BlockContainer.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org> |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #pragma once |
8 | | |
9 | | #include <LibWeb/Layout/Box.h> |
10 | | #include <LibWeb/Layout/LineBox.h> |
11 | | |
12 | | namespace Web::Layout { |
13 | | |
14 | | // https://www.w3.org/TR/css-display/#block-container |
15 | | class BlockContainer : public Box { |
16 | | JS_CELL(BlockContainer, Box); |
17 | | |
18 | | public: |
19 | | BlockContainer(DOM::Document&, DOM::Node*, NonnullRefPtr<CSS::StyleProperties>); |
20 | | BlockContainer(DOM::Document&, DOM::Node*, NonnullOwnPtr<CSS::ComputedValues>); |
21 | | virtual ~BlockContainer() override; |
22 | | |
23 | | Painting::PaintableWithLines const* paintable_with_lines() const; |
24 | | |
25 | | virtual JS::GCPtr<Painting::Paintable> create_paintable() const override; |
26 | | |
27 | | private: |
28 | 0 | virtual bool is_block_container() const final { return true; } |
29 | | }; |
30 | | |
31 | | template<> |
32 | 0 | inline bool Node::fast_is<BlockContainer>() const { return is_block_container(); } |
33 | | |
34 | | } |