| 
									
										
										
										
											2020-11-22 13:38:18 +01:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2022-01-17 15:07:19 +01:00
										 |  |  |  * Copyright (c) 2020-2022, Andreas Kling <kling@serenityos.org> | 
					
						
							| 
									
										
										
										
											2020-11-22 13:38:18 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2021-04-22 01:24:48 -07:00
										 |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							| 
									
										
										
										
											2020-11-22 13:38:18 +01:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-06 19:48:02 +01:00
										 |  |  | #include <AK/Types.h>
 | 
					
						
							| 
									
										
										
										
											2020-11-22 13:38:18 +01:00
										 |  |  | #include <LibWeb/Forward.h>
 | 
					
						
							| 
									
										
										
										
											2021-10-06 21:53:25 +02:00
										 |  |  | #include <LibWeb/Layout/BlockContainer.h>
 | 
					
						
							| 
									
										
										
										
											2020-11-22 13:38:18 +01:00
										 |  |  | #include <LibWeb/Layout/FormattingContext.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace Web::Layout { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class InlineFormattingContext final : public FormattingContext { | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2022-02-20 15:51:24 +01:00
										 |  |  |     InlineFormattingContext(FormattingState&, BlockContainer const& containing_block, BlockFormattingContext& parent); | 
					
						
							| 
									
										
										
										
											2020-11-22 13:38:18 +01:00
										 |  |  |     ~InlineFormattingContext(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-23 15:22:18 +01:00
										 |  |  |     BlockFormattingContext& parent(); | 
					
						
							|  |  |  |     BlockFormattingContext const& parent() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-06 21:53:25 +02:00
										 |  |  |     BlockContainer const& containing_block() const { return static_cast<BlockContainer const&>(context_box()); } | 
					
						
							| 
									
										
										
										
											2020-12-06 19:48:02 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-20 15:51:24 +01:00
										 |  |  |     virtual void run(Box const&, LayoutMode) override; | 
					
						
							| 
									
										
										
										
											2020-11-22 13:38:18 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-20 15:51:24 +01:00
										 |  |  |     void dimension_box_on_line(Box const&, LayoutMode); | 
					
						
							| 
									
										
										
										
											2022-01-17 15:07:19 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-18 14:44:36 +01:00
										 |  |  |     float leftmost_x_offset_at(float y) const; | 
					
						
							|  |  |  |     float available_space_for_line(float y) const; | 
					
						
							| 
									
										
										
										
											2022-01-18 11:00:25 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-19 11:59:44 +01:00
										 |  |  | private: | 
					
						
							| 
									
										
										
										
											2022-01-17 15:07:19 +01:00
										 |  |  |     void generate_line_boxes(LayoutMode); | 
					
						
							| 
									
										
										
										
											2022-03-12 19:32:03 +00:00
										 |  |  |     void apply_justification_to_fragments(FormattingState::NodeState const& containing_block_state, CSS::TextJustify, LineBox&, bool is_last_line); | 
					
						
							| 
									
										
										
										
											2020-11-22 13:38:18 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |