| 
									
										
										
										
											2023-03-24 17:40:28 +00:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2022-2023, Sam Atkins <atkinssj@serenityos.org> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <LibWeb/CSS/Resolution.h>
 | 
					
						
							|  |  |  | #include <LibWeb/CSS/StyleValue.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace Web::CSS { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class ResolutionStyleValue : public StyleValueWithDefaultOperators<ResolutionStyleValue> { | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2023-08-19 14:00:10 +01:00
										 |  |  |     static ValueComparingNonnullRefPtr<ResolutionStyleValue> create(Resolution resolution) | 
					
						
							| 
									
										
										
										
											2023-03-24 17:40:28 +00:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2023-08-19 14:00:10 +01:00
										 |  |  |         return adopt_ref(*new (nothrow) ResolutionStyleValue(move(resolution))); | 
					
						
							| 
									
										
										
										
											2023-03-24 17:40:28 +00:00
										 |  |  |     } | 
					
						
							|  |  |  |     virtual ~ResolutionStyleValue() override = default; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     Resolution const& resolution() const { return m_resolution; } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     virtual ErrorOr<String> to_string() const override { return m_resolution.to_string(); } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     bool properties_equal(ResolutionStyleValue const& other) const { return m_resolution == other.m_resolution; } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     explicit ResolutionStyleValue(Resolution resolution) | 
					
						
							|  |  |  |         : StyleValueWithDefaultOperators(Type::Resolution) | 
					
						
							|  |  |  |         , m_resolution(move(resolution)) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     Resolution m_resolution; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |