mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 20:22:45 +00:00 
			
		
		
		
	LibWeb: Let CSS::Size contain a CalculatedStyleValue
Technically this was already true, but now we explicitly allow it instead of that calc value being hidden inside a Length or Percentage.
This commit is contained in:
		
							parent
							
								
									ac4350748e
								
							
						
					
					
						commit
						62a8cf2bb8
					
				
					 4 changed files with 19 additions and 1 deletions
				
			
		|  | @ -41,6 +41,11 @@ Size Size::make_percentage(Percentage percentage) | |||
|     return Size { Type::Percentage, move(percentage) }; | ||||
| } | ||||
| 
 | ||||
| Size Size::make_calculated(NonnullRefPtr<Web::CSS::CalculatedStyleValue> calculated) | ||||
| { | ||||
|     return Size { Type::Calculated, move(calculated) }; | ||||
| } | ||||
| 
 | ||||
| Size Size::make_min_content() | ||||
| { | ||||
|     return Size { Type::MinContent, Length::make_auto() }; | ||||
|  | @ -79,6 +84,7 @@ ErrorOr<String> Size::to_string() const | |||
|     switch (m_type) { | ||||
|     case Type::Auto: | ||||
|         return "auto"_string; | ||||
|     case Type::Calculated: | ||||
|     case Type::Length: | ||||
|     case Type::Percentage: | ||||
|         return m_length_percentage.to_string(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Sam Atkins
						Sam Atkins