| 
									
										
										
										
											2025-04-02 17:01:16 +01:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2025, Sam Atkins <sam@ladybird.org> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <AK/FlyString.h>
 | 
					
						
							| 
									
										
										
										
											2025-06-03 12:32:05 +01:00
										 |  |  | #include <LibWeb/CSS/Enums.h>
 | 
					
						
							| 
									
										
										
										
											2025-08-08 10:11:51 +01:00
										 |  |  | #include <LibWeb/CSS/StyleValues/StyleValue.h>
 | 
					
						
							| 
									
										
										
										
											2025-05-02 12:07:22 +01:00
										 |  |  | #include <LibWeb/CSS/URL.h>
 | 
					
						
							| 
									
										
										
										
											2025-04-02 17:01:16 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace Web::CSS { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class FontSourceStyleValue final : public StyleValueWithDefaultOperators<FontSourceStyleValue> { | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     struct Local { | 
					
						
							| 
									
										
										
										
											2025-08-08 10:11:51 +01:00
										 |  |  |         NonnullRefPtr<StyleValue const> name; | 
					
						
							| 
									
										
										
										
											2025-04-02 17:01:16 +01:00
										 |  |  |     }; | 
					
						
							| 
									
										
										
										
											2025-05-02 12:07:22 +01:00
										 |  |  |     using Source = Variant<Local, URL>; | 
					
						
							| 
									
										
										
										
											2025-04-02 17:01:16 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-06-03 12:32:05 +01:00
										 |  |  |     static ValueComparingNonnullRefPtr<FontSourceStyleValue const> create(Source source, Optional<FlyString> format, Vector<FontTech> tech) | 
					
						
							| 
									
										
										
										
											2025-04-02 17:01:16 +01:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2025-06-03 12:32:05 +01:00
										 |  |  |         return adopt_ref(*new (nothrow) FontSourceStyleValue(move(source), move(format), move(tech))); | 
					
						
							| 
									
										
										
										
											2025-04-02 17:01:16 +01:00
										 |  |  |     } | 
					
						
							|  |  |  |     virtual ~FontSourceStyleValue() override; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     Source const& source() const { return m_source; } | 
					
						
							|  |  |  |     Optional<FlyString> const& format() const { return m_format; } | 
					
						
							| 
									
										
										
										
											2025-06-03 12:32:05 +01:00
										 |  |  |     Vector<FontTech> const& tech() const { return m_tech; } | 
					
						
							| 
									
										
										
										
											2025-04-02 17:01:16 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     virtual String to_string(SerializationMode) const override; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     bool properties_equal(FontSourceStyleValue const&) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							| 
									
										
										
										
											2025-06-03 12:32:05 +01:00
										 |  |  |     FontSourceStyleValue(Source source, Optional<FlyString> format, Vector<FontTech> tech); | 
					
						
							| 
									
										
										
										
											2025-04-02 17:01:16 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     Source m_source; | 
					
						
							|  |  |  |     Optional<FlyString> m_format; | 
					
						
							| 
									
										
										
										
											2025-06-03 12:32:05 +01:00
										 |  |  |     Vector<FontTech> m_tech; | 
					
						
							| 
									
										
										
										
											2025-04-02 17:01:16 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |