| 
									
										
										
										
											2020-01-18 09:38:21 +01:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2024-10-04 13:19:50 +02:00
										 |  |  |  * Copyright (c) 2018-2022, Andreas Kling <andreas@ladybird.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 { | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     GC_CELL(ListItemMarkerBox, Box); | 
					
						
							|  |  |  |     GC_DECLARE_ALLOCATOR(ListItemMarkerBox); | 
					
						
							| 
									
										
										
										
											2022-10-17 14:41:50 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-11 23:16:53 +02:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2024-12-20 16:35:12 +01:00
										 |  |  |     explicit ListItemMarkerBox(DOM::Document&, CSS::ListStyleType, CSS::ListStylePosition, size_t index, GC::Ref<CSS::ComputedProperties>); | 
					
						
							| 
									
										
										
										
											2020-11-22 15:53:01 +01:00
										 |  |  |     virtual ~ListItemMarkerBox() override; | 
					
						
							| 
									
										
										
										
											2019-10-11 23:16:53 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-16 17:49:34 +03:30
										 |  |  |     Optional<ByteString> const& text() const { return m_text; } | 
					
						
							| 
									
										
										
										
											2022-02-21 01:43:37 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     virtual GC::Ptr<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; } | 
					
						
							| 
									
										
										
										
											2023-06-02 23:05:15 +02:00
										 |  |  |     CSS::ListStylePosition list_style_position() const { return m_list_style_position; } | 
					
						
							| 
									
										
										
										
											2022-03-10 14:02:25 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											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 }; | 
					
						
							| 
									
										
										
										
											2023-06-02 23:05:15 +02:00
										 |  |  |     CSS::ListStylePosition m_list_style_position { CSS::ListStylePosition::Outside }; | 
					
						
							| 
									
										
										
										
											2021-04-17 23:10:10 +02:00
										 |  |  |     size_t m_index; | 
					
						
							| 
									
										
										
										
											2021-05-11 22:32:54 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-12-16 17:49:34 +03:30
										 |  |  |     Optional<ByteString> 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
										 |  |  | } |