| 
									
										
										
										
											2023-03-23 17:26:13 +00:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2024-10-04 13:19:50 +02:00
										 |  |  |  * Copyright (c) 2018-2020, Andreas Kling <andreas@ladybird.org> | 
					
						
							| 
									
										
										
										
											2024-08-14 16:25:48 +01:00
										 |  |  |  * Copyright (c) 2021-2024, Sam Atkins <sam@ladybird.org> | 
					
						
							| 
									
										
										
										
											2023-03-23 17:26:13 +00:00
										 |  |  |  * Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org> | 
					
						
							|  |  |  |  * Copyright (c) 2022-2023, MacDue <macdue@dueutil.tech> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "AngleStyleValue.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace Web::CSS { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | AngleStyleValue::AngleStyleValue(Angle angle) | 
					
						
							| 
									
										
										
										
											2025-08-08 11:08:54 +01:00
										 |  |  |     : DimensionStyleValue(Type::Angle) | 
					
						
							| 
									
										
										
										
											2023-03-23 17:26:13 +00:00
										 |  |  |     , m_angle(move(angle)) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | AngleStyleValue::~AngleStyleValue() = default; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-19 17:04:15 +00:00
										 |  |  | String AngleStyleValue::to_string(SerializationMode serialization_mode) const | 
					
						
							| 
									
										
										
										
											2023-03-23 17:26:13 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2025-05-16 20:02:16 +01:00
										 |  |  |     return m_angle.to_string(serialization_mode); | 
					
						
							| 
									
										
										
										
											2023-03-23 17:26:13 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-08 10:11:51 +01:00
										 |  |  | bool AngleStyleValue::equals(StyleValue const& other) const | 
					
						
							| 
									
										
										
										
											2023-03-23 17:26:13 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2024-08-14 16:25:48 +01:00
										 |  |  |     if (type() != other.type()) | 
					
						
							|  |  |  |         return false; | 
					
						
							|  |  |  |     auto const& other_angle = other.as_angle(); | 
					
						
							|  |  |  |     return m_angle == other_angle.m_angle; | 
					
						
							| 
									
										
										
										
											2023-03-23 17:26:13 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |