mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 17:42:43 +00:00 
			
		
		
		
	 f73aa8e2bd
			
		
	
	
		f73aa8e2bd
		
	
	
	
	
		
			
			Per the spec, only a BlockContainer" can have line boxes, so let's not clutter up every Layout::Box with line boxes. This also allows us to establish an invariant that BFC and IFC always operate on a Layout::BlockContainer. Note that if BlockContainer has all block-level children, its line boxes are not used for anything. They are only used in the all inline-level children scenario.
		
			
				
	
	
		
			26 lines
		
	
	
	
		
			616 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
	
		
			616 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/Forward.h>
 | |
| #include <LibWeb/Layout/BlockFormattingContext.h>
 | |
| 
 | |
| namespace Web::Layout {
 | |
| 
 | |
| class TableFormattingContext final : public BlockFormattingContext {
 | |
| public:
 | |
|     explicit TableFormattingContext(BlockContainer&, FormattingContext* parent);
 | |
|     ~TableFormattingContext();
 | |
| 
 | |
|     virtual void run(Box&, LayoutMode) override;
 | |
| 
 | |
| private:
 | |
|     void calculate_column_widths(Box& row, Vector<float>& column_widths);
 | |
|     void layout_row(Box& row, Vector<float>& column_widths);
 | |
| };
 | |
| 
 | |
| }
 |