mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:42:43 +00:00 
			
		
		
		
	LibWeb: Account for box-sizing:border-box in layout-less definite sizes
When we determine that a size is definite because it can be resolved now without performing layout, we also need to account for the box-sizing property. This lets us remove a hack from flex layout where box-sizing:border-box was manually undone at one point in the layout algorithm.
This commit is contained in:
		
							parent
							
								
									deea7cbc11
								
							
						
					
					
						commit
						00e3e82bbd
					
				
					 4 changed files with 53 additions and 13 deletions
				
			
		|  | @ -1088,15 +1088,7 @@ void FlexFormattingContext::determine_hypothetical_cross_size_of_item(FlexItem& | |||
|             return; | ||||
|         } | ||||
| 
 | ||||
|         auto cross_size = [&]() { | ||||
|             if (item.box->computed_values().box_sizing() == CSS::BoxSizing::BorderBox && !should_treat_cross_size_as_auto(item.box)) { | ||||
|                 return max(CSSPixels(0.0f), inner_cross_size(item.box) - item.padding.cross_before - item.padding.cross_after - item.borders.cross_before - item.borders.cross_after); | ||||
|             } | ||||
| 
 | ||||
|             return inner_cross_size(item.box); | ||||
|         }(); | ||||
| 
 | ||||
|         item.hypothetical_cross_size = css_clamp(cross_size, clamp_min, clamp_max); | ||||
|         item.hypothetical_cross_size = css_clamp(inner_cross_size(item.box), clamp_min, clamp_max); | ||||
|         return; | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling