mirror of
https://github.com/RGBCube/serenity
synced 2025-07-13 19:37:34 +00:00
LibWeb: Use a CSSRuleList inside CSSStyleSheet
This better matches the spec. :^)
This commit is contained in:
parent
97a78cdd28
commit
eb83d2617c
2 changed files with 5 additions and 4 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <AK/TypeCasts.h>
|
||||
#include <LibWeb/CSS/CSSImportRule.h>
|
||||
#include <LibWeb/CSS/CSSRule.h>
|
||||
#include <LibWeb/CSS/CSSRuleList.h>
|
||||
#include <LibWeb/CSS/StyleSheet.h>
|
||||
#include <LibWeb/Loader/Resource.h>
|
||||
|
||||
|
@ -28,8 +29,8 @@ public:
|
|||
|
||||
virtual String type() const override { return "text/css"; }
|
||||
|
||||
const NonnullRefPtrVector<CSSRule>& rules() const { return m_rules; }
|
||||
NonnullRefPtrVector<CSSRule>& rules() { return m_rules; }
|
||||
CSSRuleList const& rules() const { return m_rules; }
|
||||
CSSRuleList& rules() { return m_rules; }
|
||||
|
||||
template<typename Callback>
|
||||
void for_each_effective_style_rule(Callback callback) const
|
||||
|
@ -66,7 +67,7 @@ public:
|
|||
private:
|
||||
explicit CSSStyleSheet(NonnullRefPtrVector<CSSRule>);
|
||||
|
||||
NonnullRefPtrVector<CSSRule> m_rules;
|
||||
CSSRuleList m_rules;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -523,7 +523,7 @@ void dump_sheet(StringBuilder& builder, CSS::StyleSheet const& sheet)
|
|||
{
|
||||
auto& css_stylesheet = verify_cast<CSS::CSSStyleSheet>(sheet);
|
||||
|
||||
builder.appendff("CSSStyleSheet{{{}}}: {} rule(s)\n", &sheet, css_stylesheet.rules().size());
|
||||
builder.appendff("CSSStyleSheet{{{}}}: {} rule(s)\n", &sheet, css_stylesheet.rules().length());
|
||||
|
||||
for (auto& rule : css_stylesheet.rules()) {
|
||||
dump_rule(builder, rule);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue