mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 16:02:45 +00:00 
			
		
		
		
	 0f88a47e58
			
		
	
	
		0f88a47e58
		
	
	
	
	
		
			
			The `CSSMediaRule::serialized()` code is to spec. The `CSSSupportsRule::serialized()` code has no spec right now, but I'm fairly confident it will be almost identical to media's, so I copied that for now.
		
			
				
	
	
		
			39 lines
		
	
	
	
		
			1,007 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
	
		
			1,007 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/Function.h>
 | |
| #include <AK/NonnullRefPtr.h>
 | |
| #include <LibWeb/CSS/CSSRule.h>
 | |
| #include <LibWeb/CSS/CSSRuleList.h>
 | |
| #include <LibWeb/Forward.h>
 | |
| 
 | |
| namespace Web::CSS {
 | |
| 
 | |
| class CSSGroupingRule : public CSSRule {
 | |
|     AK_MAKE_NONCOPYABLE(CSSGroupingRule);
 | |
|     AK_MAKE_NONMOVABLE(CSSGroupingRule);
 | |
| 
 | |
| public:
 | |
|     ~CSSGroupingRule();
 | |
| 
 | |
|     CSSRuleList const& css_rules() const { return m_rules; }
 | |
|     CSSRuleList& css_rules() { return m_rules; }
 | |
|     size_t insert_rule(StringView const& rule, size_t index = 0);
 | |
|     void delete_rule(size_t index);
 | |
| 
 | |
|     virtual void for_each_effective_style_rule(Function<void(CSSStyleRule const&)> const& callback) const;
 | |
|     virtual bool for_first_not_loaded_import_rule(Function<void(CSSImportRule&)> const& callback);
 | |
| 
 | |
| protected:
 | |
|     explicit CSSGroupingRule(NonnullRefPtrVector<CSSRule>&&);
 | |
| 
 | |
| private:
 | |
|     NonnullRefPtr<CSSRuleList> m_rules;
 | |
| };
 | |
| 
 | |
| }
 |