| 
									
										
										
										
											2019-06-15 23:41:15 +02:00
										 |  |  | #include <LibHTML/Layout/LayoutDocument.h>
 | 
					
						
							| 
									
										
										
										
											2019-06-15 22:49:44 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-21 15:32:17 +03:00
										 |  |  | LayoutDocument::LayoutDocument(const Document& document, StyleProperties&& style_properties) | 
					
						
							|  |  |  |     : LayoutBlock(&document, move(style_properties)) | 
					
						
							| 
									
										
										
										
											2019-06-15 22:49:44 +02:00
										 |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | LayoutDocument::~LayoutDocument() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2019-06-16 21:35:03 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | void LayoutDocument::layout() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     rect().set_width(style().size().width()); | 
					
						
							| 
									
										
										
										
											2019-09-25 12:29:25 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-16 21:35:03 +02:00
										 |  |  |     LayoutNode::layout(); | 
					
						
							| 
									
										
										
										
											2019-09-25 12:29:25 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |     int lowest_bottom = 0; | 
					
						
							|  |  |  |     for_each_child([&](auto& child) { | 
					
						
							|  |  |  |         if (child.rect().bottom() > lowest_bottom) | 
					
						
							|  |  |  |             lowest_bottom = child.rect().bottom(); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  |     rect().set_bottom(lowest_bottom); | 
					
						
							| 
									
										
										
										
											2019-06-16 21:35:03 +02:00
										 |  |  | } |