| 
									
										
										
										
											2023-03-24 23:53:41 +00:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2024-10-04 13:19:50 +02:00
										 |  |  |  * Copyright (c) 2018-2020, Andreas Kling <andreas@ladybird.org> | 
					
						
							| 
									
										
										
										
											2023-03-24 23:53:41 +00:00
										 |  |  |  * Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org> | 
					
						
							| 
									
										
										
										
											2025-03-06 16:09:18 +00:00
										 |  |  |  * Copyright (c) 2021-2025, Sam Atkins <sam@ladybird.org> | 
					
						
							| 
									
										
										
										
											2023-03-24 23:53:41 +00:00
										 |  |  |  * Copyright (c) 2022-2023, MacDue <macdue@dueutil.tech> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <AK/Vector.h>
 | 
					
						
							|  |  |  | #include <LibWeb/CSS/Parser/ComponentValue.h>
 | 
					
						
							| 
									
										
										
										
											2025-08-08 10:11:51 +01:00
										 |  |  | #include <LibWeb/CSS/StyleValues/StyleValue.h>
 | 
					
						
							| 
									
										
										
										
											2023-03-24 23:53:41 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace Web::CSS { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-08 10:11:51 +01:00
										 |  |  | class UnresolvedStyleValue final : public StyleValue { | 
					
						
							| 
									
										
										
										
											2023-03-24 23:53:41 +00:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2025-07-27 19:40:17 +02:00
										 |  |  |     static ValueComparingNonnullRefPtr<UnresolvedStyleValue const> create(Vector<Parser::ComponentValue>&& values, Optional<Parser::SubstitutionFunctionsPresence> = {}, Optional<String> original_source_text = {}); | 
					
						
							| 
									
										
										
										
											2023-03-24 23:53:41 +00:00
										 |  |  |     virtual ~UnresolvedStyleValue() override = default; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-12-07 00:59:49 +01:00
										 |  |  |     virtual String to_string(SerializationMode) const override; | 
					
						
							| 
									
										
										
										
											2025-07-10 12:17:27 +01:00
										 |  |  |     virtual Vector<Parser::ComponentValue> tokenize() const override { return m_values; } | 
					
						
							| 
									
										
										
										
											2023-03-24 23:53:41 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     Vector<Parser::ComponentValue> const& values() const { return m_values; } | 
					
						
							| 
									
										
										
										
											2025-07-27 19:40:17 +02:00
										 |  |  |     bool contains_arbitrary_substitution_function() const { return m_substitution_functions_presence.has_any(); } | 
					
						
							| 
									
										
										
										
											2025-07-27 19:41:21 +02:00
										 |  |  |     bool includes_attr_function() const { return m_substitution_functions_presence.attr; } | 
					
						
							|  |  |  |     bool includes_var_function() const { return m_substitution_functions_presence.var; } | 
					
						
							| 
									
										
										
										
											2023-03-24 23:53:41 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-08 10:11:51 +01:00
										 |  |  |     virtual bool equals(StyleValue const& other) const override; | 
					
						
							| 
									
										
										
										
											2023-03-24 23:53:41 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-14 17:25:29 +01:00
										 |  |  |     virtual GC::Ref<CSSStyleValue> reify(JS::Realm&, String const& associated_property) const override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-24 23:53:41 +00:00
										 |  |  | private: | 
					
						
							| 
									
										
										
										
											2025-07-27 19:40:17 +02:00
										 |  |  |     UnresolvedStyleValue(Vector<Parser::ComponentValue>&& values, Parser::SubstitutionFunctionsPresence, Optional<String> original_source_text); | 
					
						
							| 
									
										
										
										
											2023-03-24 23:53:41 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     Vector<Parser::ComponentValue> m_values; | 
					
						
							| 
									
										
										
										
											2025-07-27 19:40:17 +02:00
										 |  |  |     Parser::SubstitutionFunctionsPresence m_substitution_functions_presence {}; | 
					
						
							| 
									
										
										
										
											2024-10-14 16:23:35 +01:00
										 |  |  |     Optional<String> m_original_source_text; | 
					
						
							| 
									
										
										
										
											2023-03-24 23:53:41 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |