2020-01-18 09:38:21 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 09:38:21 +01:00
|
|
|
*/
|
|
|
|
|
|
2019-10-17 23:09:41 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
2023-01-09 07:25:05 +03:00
|
|
|
#include <LibWeb/Layout/Box.h>
|
2019-10-17 23:09:41 +02:00
|
|
|
|
2020-11-22 15:53:01 +01:00
|
|
|
namespace Web::Layout {
|
2020-03-07 10:27:02 +01:00
|
|
|
|
2023-01-09 07:25:05 +03:00
|
|
|
class TableBox final : public Layout::Box {
|
|
|
|
|
JS_CELL(TableBox, Box);
|
2022-10-17 14:41:50 +02:00
|
|
|
|
2019-10-17 23:09:41 +02:00
|
|
|
public:
|
2021-01-07 16:37:51 +01:00
|
|
|
TableBox(DOM::Document&, DOM::Element*, NonnullRefPtr<CSS::StyleProperties>);
|
|
|
|
|
TableBox(DOM::Document&, DOM::Element*, CSS::ComputedValues);
|
2020-11-22 15:53:01 +01:00
|
|
|
virtual ~TableBox() override;
|
2021-01-07 18:00:51 +01:00
|
|
|
|
2023-01-16 13:13:31 +01:00
|
|
|
static CSS::Display static_display(bool inline_outside)
|
|
|
|
|
{
|
|
|
|
|
if (inline_outside)
|
|
|
|
|
return CSS::Display::from_short(CSS::Display::Short::InlineTable);
|
|
|
|
|
return CSS::Display::from_short(CSS::Display::Short::Table);
|
|
|
|
|
}
|
2023-01-23 17:24:34 +01:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
virtual bool is_table() const override { return true; }
|
2019-10-17 23:09:41 +02:00
|
|
|
};
|
2019-10-17 23:34:12 +02:00
|
|
|
|
2023-01-23 17:24:34 +01:00
|
|
|
template<>
|
|
|
|
|
inline bool Node::fast_is<TableBox>() const { return is_table(); }
|
|
|
|
|
|
2019-10-17 23:34:12 +02:00
|
|
|
}
|