2020-01-18 09:38:21 +01:00
|
|
|
/*
|
2022-02-21 01:43:37 +01:00
|
|
|
* Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org>
|
2021-08-09 21:28:56 +02:00
|
|
|
* Copyright (c) 2021, Tobias Christiansen <tobyase@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-10-11 23:16:53 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
2020-11-22 15:53:01 +01:00
|
|
|
#include <LibWeb/Layout/Box.h>
|
2019-10-11 23:16:53 +02:00
|
|
|
|
2020-11-22 15:53:01 +01:00
|
|
|
namespace Web::Layout {
|
2020-03-07 10:27:02 +01:00
|
|
|
|
2020-11-22 15:53:01 +01:00
|
|
|
class ListItemMarkerBox final : public Box {
|
2022-10-17 14:41:50 +02:00
|
|
|
JS_CELL(ListItemMarkerBox, Box);
|
|
|
|
|
|
2019-10-11 23:16:53 +02:00
|
|
|
public:
|
2021-09-23 19:47:53 +02:00
|
|
|
explicit ListItemMarkerBox(DOM::Document&, CSS::ListStyleType, size_t index, NonnullRefPtr<CSS::StyleProperties>);
|
2020-11-22 15:53:01 +01:00
|
|
|
virtual ~ListItemMarkerBox() override;
|
2019-10-11 23:16:53 +02:00
|
|
|
|
2022-12-04 18:02:33 +00:00
|
|
|
DeprecatedString const& text() const { return m_text; }
|
2022-02-21 01:43:37 +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
|
|
|
|
|
|
|
|
CSS::ListStyleType list_style_type() const { return m_list_style_type; }
|
|
|
|
|
|
2021-04-17 23:10:10 +02:00
|
|
|
private:
|
2022-03-13 17:21:27 +01:00
|
|
|
virtual bool is_list_item_marker_box() const final { return true; }
|
2021-10-06 21:49:09 +02:00
|
|
|
virtual bool can_have_children() const override { return false; }
|
|
|
|
|
|
2021-04-17 23:10:10 +02:00
|
|
|
CSS::ListStyleType m_list_style_type { CSS::ListStyleType::None };
|
|
|
|
|
size_t m_index;
|
2021-05-11 22:32:54 +02:00
|
|
|
|
2022-12-04 18:02:33 +00:00
|
|
|
DeprecatedString m_text {};
|
2019-10-11 23:16:53 +02:00
|
|
|
};
|
2020-03-07 10:27:02 +01:00
|
|
|
|
2022-03-13 17:21:27 +01:00
|
|
|
template<>
|
|
|
|
|
inline bool Node::fast_is<ListItemMarkerBox>() const { return is_list_item_marker_box(); }
|
|
|
|
|
|
2020-03-07 10:27:02 +01:00
|
|
|
}
|