2020-01-18 09:38:21 +01:00
|
|
|
/*
|
2021-10-06 20:02:41 +02:00
|
|
|
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
2020-01-18 09:38:21 +01:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 09:38:21 +01:00
|
|
|
*/
|
|
|
|
|
2019-06-15 22:49:44 +02:00
|
|
|
#pragma once
|
|
|
|
|
2020-11-22 15:53:01 +01:00
|
|
|
#include <LibWeb/Layout/Box.h>
|
2020-03-07 10:32:51 +01:00
|
|
|
#include <LibWeb/Layout/LineBox.h>
|
2019-06-15 22:49:44 +02:00
|
|
|
|
2020-11-22 15:53:01 +01:00
|
|
|
namespace Web::Layout {
|
2020-03-07 10:27:02 +01:00
|
|
|
|
2021-10-15 19:52:10 +01:00
|
|
|
// https://www.w3.org/TR/css-display/#block-container
|
2021-10-06 20:02:41 +02:00
|
|
|
class BlockContainer : public Box {
|
2022-10-17 14:41:50 +02:00
|
|
|
JS_CELL(BlockContainer, Box);
|
|
|
|
|
2019-06-15 22:49:44 +02:00
|
|
|
public:
|
2021-10-06 20:02:41 +02:00
|
|
|
BlockContainer(DOM::Document&, DOM::Node*, NonnullRefPtr<CSS::StyleProperties>);
|
|
|
|
BlockContainer(DOM::Document&, DOM::Node*, CSS::ComputedValues);
|
|
|
|
virtual ~BlockContainer() override;
|
2019-06-15 22:49:44 +02:00
|
|
|
|
2022-03-10 11:26:01 +01:00
|
|
|
Painting::PaintableWithLines const* paint_box() const;
|
2022-03-10 11:12:06 +01:00
|
|
|
|
2023-01-11 12:51:49 +01:00
|
|
|
virtual JS::GCPtr<Painting::Paintable> create_paintable() const override;
|
2022-03-10 14:02:25 +01:00
|
|
|
|
2021-01-17 09:34:01 +01:00
|
|
|
private:
|
2021-10-06 20:07:13 +02:00
|
|
|
virtual bool is_block_container() const final { return true; }
|
2019-06-15 22:49:44 +02:00
|
|
|
};
|
2019-10-09 21:25:29 +02:00
|
|
|
|
2021-01-17 09:34:01 +01:00
|
|
|
template<>
|
2021-10-06 20:07:13 +02:00
|
|
|
inline bool Node::fast_is<BlockContainer>() const { return is_block_container(); }
|
2021-01-17 09:34:01 +01:00
|
|
|
|
2019-10-15 14:19:52 +02:00
|
|
|
}
|