1
Fork 0
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:
Sam Atkins 2021-10-08 16:40:50 +01:00 committed by Andreas Kling
parent bc0ef5f69d
commit df08b25b3f
4 changed files with 40 additions and 24 deletions

View file

@ -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>&&);