mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 13:12:46 +00:00 
			
		
		
		
	LibWeb: Reorganize layout system in terms of formatting contexts
This is a first (huge) step towards modernizing the layout architecture and bringing it closer to spec language. Layout is now performed by a stack of formatting contexts, operating on the box tree (or layout tree, if you will.) There are currently three types of formatting context: - BlockFormattingContext (BFC) - InlineFormattingContext (IFC) - TableFormattingContext (TFC) Document::layout() creates the initial BlockFormattingContext (BFC) which lays out the initial containing block (ICB), and then we recurse through the tree, creating BFC, IFC or TFC as appropriate and handing over control at the context boundaries. The majority of this patch is just refactoring the old logic spread out in LayoutBlock and LayoutTableRowGroup, and turning into these context classes instead. A lot more cleanup will be needed. There are many architectural wins here, the main one being that layout is no longer performed by boxes themselves, which gives us much greater flexibility in the outer/inner layout of a given box.
This commit is contained in:
		
							parent
							
								
									00aac65af5
								
							
						
					
					
						commit
						e1a24edfa9
					
				
					 46 changed files with 1360 additions and 882 deletions
				
			
		|  | @ -26,6 +26,10 @@ | |||
| 
 | ||||
| #pragma once | ||||
| 
 | ||||
| namespace Web { | ||||
| enum class LayoutMode; | ||||
| } | ||||
| 
 | ||||
| namespace Web::CSS { | ||||
| class Selector; | ||||
| class StyleProperties; | ||||
|  | @ -146,12 +150,19 @@ class SVGPathElement; | |||
| class SVGSVGElement; | ||||
| } | ||||
| 
 | ||||
| namespace Web::Layout { | ||||
| class BlockFormattingContext; | ||||
| class FormattingContext; | ||||
| class InlineFormattingContext; | ||||
| } | ||||
| 
 | ||||
| namespace Web { | ||||
| class EventHandler; | ||||
| class Frame; | ||||
| class FrameLoader; | ||||
| class InProcessWebView; | ||||
| class LayoutBlock; | ||||
| class LayoutBox; | ||||
| class LayoutButton; | ||||
| class LayoutCheckBox; | ||||
| class LayoutDocument; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling