| 
									
										
										
										
											2020-01-18 09:38:21 +01:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2021-04-22 01:24:48 -07:00
										 |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							| 
									
										
										
										
											2020-01-18 09:38:21 +01:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-22 15:53:01 +01:00
										 |  |  | #include <LibWeb/Layout/BlockBox.h>
 | 
					
						
							|  |  |  | #include <LibWeb/Layout/BreakNode.h>
 | 
					
						
							| 
									
										
										
										
											2020-12-05 20:10:39 +01:00
										 |  |  | #include <LibWeb/Layout/InlineFormattingContext.h>
 | 
					
						
							| 
									
										
										
										
											2019-10-12 13:47:49 +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
										 |  |  | BreakNode::BreakNode(DOM::Document& document, HTML::HTMLBRElement& element) | 
					
						
							|  |  |  |     : Layout::NodeWithStyleAndBoxModelMetrics(document, &element, CSS::StyleProperties::create()) | 
					
						
							| 
									
										
										
										
											2019-10-12 13:47:49 +02:00
										 |  |  | { | 
					
						
							|  |  |  |     set_inline(true); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-22 15:53:01 +01:00
										 |  |  | BreakNode::~BreakNode() | 
					
						
							| 
									
										
										
										
											2019-10-12 13:47:49 +02:00
										 |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-06 19:48:02 +01:00
										 |  |  | void BreakNode::split_into_lines(InlineFormattingContext& context, LayoutMode) | 
					
						
							| 
									
										
										
										
											2019-10-12 13:47:49 +02:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2021-04-02 13:32:28 -04:00
										 |  |  |     auto& line_box = context.containing_block().add_line_box(); | 
					
						
							|  |  |  |     line_box.add_fragment(*this, 0, 0, 0, context.containing_block().line_height()); | 
					
						
							| 
									
										
										
										
											2019-10-12 13:47:49 +02:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2020-03-07 10:27:02 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | } |