mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:27:43 +00:00
LibWeb: Move CSSRule iteration to CSSRuleList
CSSStyleSheet is no longer the only class that contains a list of rules, so this will save duplicating the logic in multiple places.
This commit is contained in:
parent
bc0ef5f69d
commit
df08b25b3f
4 changed files with 40 additions and 24 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Function.h>
|
||||
#include <AK/Iterator.h>
|
||||
#include <AK/NonnullRefPtrVector.h>
|
||||
#include <AK/RefCounted.h>
|
||||
|
@ -50,6 +51,9 @@ public:
|
|||
DOM::ExceptionOr<void> remove_a_css_rule(u32 index);
|
||||
DOM::ExceptionOr<unsigned> insert_a_css_rule(NonnullRefPtr<CSSRule>, u32 index);
|
||||
|
||||
void for_each_effective_style_rule(Function<void(CSSStyleRule const&)> const& callback) const;
|
||||
bool for_first_not_loaded_import_rule(Function<void(CSSImportRule&)> const& callback);
|
||||
|
||||
private:
|
||||
explicit CSSRuleList(NonnullRefPtrVector<CSSRule>&&);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue