mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-11-03 23:00:58 +00:00 
			
		
		
		
	The end goal here is to make the two classes mostly interchangeable, as the CSS spec requires that the various parser algorithms can take a stream of either class, and we want to have that functionality without needing to duplicate all of the code.
		
			
				
	
	
		
			36 lines
		
	
	
	
		
			892 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
	
		
			892 B
		
	
	
	
		
			C++
		
	
	
	
	
	
/*
 | 
						|
 * Copyright (c) 2020-2021, the SerenityOS developers.
 | 
						|
 * Copyright (c) 2021, Sam Atkins <atkinssj@gmail.com>
 | 
						|
 *
 | 
						|
 * SPDX-License-Identifier: BSD-2-Clause
 | 
						|
 */
 | 
						|
 | 
						|
#pragma once
 | 
						|
 | 
						|
#include <AK/RefCounted.h>
 | 
						|
#include <AK/Vector.h>
 | 
						|
#include <LibWeb/CSS/Parser/StyleComponentValueRule.h>
 | 
						|
#include <LibWeb/CSS/Parser/Token.h>
 | 
						|
 | 
						|
namespace Web::CSS {
 | 
						|
 | 
						|
class StyleBlockRule : public RefCounted<StyleBlockRule> {
 | 
						|
    friend class Parser;
 | 
						|
 | 
						|
public:
 | 
						|
    StyleBlockRule();
 | 
						|
    ~StyleBlockRule();
 | 
						|
 | 
						|
    bool is_curly() const { return m_token.is(Token::Type::OpenCurly); }
 | 
						|
    bool is_paren() const { return m_token.is(Token::Type::OpenParen); }
 | 
						|
    bool is_square() const { return m_token.is(Token::Type::OpenSquare); }
 | 
						|
 | 
						|
    Vector<StyleComponentValueRule> const& values() const { return m_values; }
 | 
						|
 | 
						|
    String to_string() const;
 | 
						|
 | 
						|
private:
 | 
						|
    Token m_token;
 | 
						|
    Vector<StyleComponentValueRule> m_values;
 | 
						|
};
 | 
						|
}
 |