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