mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-11-04 07:10:57 +00:00 
			
		
		
		
	The parser now kinda recognizes immediate child selectors, !important, and various other little things. It's still extremely far from robust and/or correct. :^)
		
			
				
	
	
		
			27 lines
		
	
	
	
		
			630 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
	
		
			630 B
		
	
	
	
		
			C++
		
	
	
	
	
	
#pragma once
 | 
						|
 | 
						|
#include <AK/String.h>
 | 
						|
#include <LibHTML/CSS/StyleValue.h>
 | 
						|
 | 
						|
struct StyleProperty {
 | 
						|
    String name;
 | 
						|
    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;
 | 
						|
};
 |