mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 00:12:44 +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.
		
			
				
	
	
		
			43 lines
		
	
	
	
		
			971 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
	
		
			971 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include <LibWeb/CSS/CSSGroupingRule.h>
 | |
| #include <LibWeb/CSS/CSSRuleList.h>
 | |
| 
 | |
| namespace Web::CSS {
 | |
| 
 | |
| CSSGroupingRule::CSSGroupingRule(NonnullRefPtrVector<CSSRule>&& rules)
 | |
|     : m_rules(CSSRuleList::create(move(rules)))
 | |
| {
 | |
| }
 | |
| 
 | |
| CSSGroupingRule::~CSSGroupingRule()
 | |
| {
 | |
| }
 | |
| 
 | |
| size_t CSSGroupingRule::insert_rule(StringView const&, size_t)
 | |
| {
 | |
|     // https://www.w3.org/TR/cssom-1/#insert-a-css-rule
 | |
|     TODO();
 | |
| }
 | |
| 
 | |
| void CSSGroupingRule::delete_rule(size_t)
 | |
| {
 | |
|     // https://www.w3.org/TR/cssom-1/#remove-a-css-rule
 | |
|     TODO();
 | |
| }
 | |
| 
 | |
| void CSSGroupingRule::for_each_effective_style_rule(Function<void(CSSStyleRule const&)> const& callback) const
 | |
| {
 | |
|     m_rules->for_each_effective_style_rule(callback);
 | |
| }
 | |
| 
 | |
| bool CSSGroupingRule::for_first_not_loaded_import_rule(Function<void(CSSImportRule&)> const& callback)
 | |
| {
 | |
|     return m_rules->for_first_not_loaded_import_rule(callback);
 | |
| }
 | |
| 
 | |
| }
 |