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/Layout/Box.h>
10
11namespace Web::Layout {
12
13class TableBox final : public Layout::Box {
14 JS_CELL(TableBox, Box);
15
16public:
17 TableBox(DOM::Document&, DOM::Element*, NonnullRefPtr<CSS::StyleProperties>);
18 TableBox(DOM::Document&, DOM::Element*, CSS::ComputedValues);
19 virtual ~TableBox() override;
20
21 static CSS::Display static_display(bool inline_outside)
22 {
23 if (inline_outside)
24 return CSS::Display::from_short(CSS::Display::Short::InlineTable);
25 return CSS::Display::from_short(CSS::Display::Short::Table);
26 }
27
28private:
29 virtual bool is_table() const override { return true; }
30};
31
32template<>
33inline bool Node::fast_is<TableBox>() const { return is_table(); }
34
35}