mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 10:02:43 +00:00 
			
		
		
		
	 92266d2247
			
		
	
	
		92266d2247
		
	
	
	
	
		
			
			Previously, these were added during layout. This didn't fit into the new world where layout doesn't mutate the tree incrementally, so this patch adds logic to Layout::TreeBuilder for adding a marker to each list-item box after its children have been constructed.
		
			
				
	
	
		
			33 lines
		
	
	
	
		
			840 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
	
		
			840 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org>
 | |
|  * Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <LibWeb/Layout/Box.h>
 | |
| 
 | |
| namespace Web::Layout {
 | |
| 
 | |
| class ListItemMarkerBox final : public Box {
 | |
| public:
 | |
|     explicit ListItemMarkerBox(DOM::Document&, CSS::ListStyleType, size_t index, NonnullRefPtr<CSS::StyleProperties>);
 | |
|     virtual ~ListItemMarkerBox() override;
 | |
| 
 | |
|     virtual void paint(PaintContext&, PaintPhase) override;
 | |
| 
 | |
|     Gfx::Bitmap const* list_style_image_bitmap() const;
 | |
|     String const& text() const { return m_text; }
 | |
| 
 | |
| private:
 | |
|     virtual bool can_have_children() const override { return false; }
 | |
| 
 | |
|     CSS::ListStyleType m_list_style_type { CSS::ListStyleType::None };
 | |
|     size_t m_index;
 | |
| 
 | |
|     String m_text {};
 | |
| };
 | |
| 
 | |
| }
 |