mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 07:32:44 +00:00 
			
		
		
		
	 31ac19543a
			
		
	
	
		31ac19543a
		
	
	
	
	
		
			
			Instead of using string everywhere, have the CSS parser produce enum values, since they are a lot nicer to work with. In the future we should generate most of this code based on a list of supported CSS properties.
		
			
				
	
	
		
			27 lines
		
	
	
	
		
			646 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
	
		
			646 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #pragma once
 | |
| 
 | |
| #include <AK/String.h>
 | |
| #include <LibHTML/CSS/StyleValue.h>
 | |
| 
 | |
| struct StyleProperty {
 | |
|     CSS::PropertyID property_id;
 | |
|     NonnullRefPtr<StyleValue> value;
 | |
|     bool important { false };
 | |
| };
 | |
| 
 | |
| class StyleDeclaration : public RefCounted<StyleDeclaration> {
 | |
| public:
 | |
|     static NonnullRefPtr<StyleDeclaration> create(Vector<StyleProperty>&& properties)
 | |
|     {
 | |
|         return adopt(*new StyleDeclaration(move(properties)));
 | |
|     }
 | |
| 
 | |
|     ~StyleDeclaration();
 | |
| 
 | |
|     const Vector<StyleProperty>& properties() const { return m_properties; }
 | |
| 
 | |
| public:
 | |
|     explicit StyleDeclaration(Vector<StyleProperty>&&);
 | |
| 
 | |
|     Vector<StyleProperty> m_properties;
 | |
| };
 |