1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:37:35 +00:00

LibWeb: Split CSS::StyleSheet into StyleSheet and CSSStyleSheet

This is a little convoluted but matches the CSSOM specification.
This commit is contained in:
Andreas Kling 2021-03-07 16:14:04 +01:00
parent 0af4762662
commit fefb05f6f3
17 changed files with 162 additions and 82 deletions

View file

@ -31,8 +31,8 @@
#include <LibWeb/CSS/CSSImportRule.h>
#include <LibWeb/CSS/CSSRule.h>
#include <LibWeb/CSS/CSSStyleRule.h>
#include <LibWeb/CSS/CSSStyleSheet.h>
#include <LibWeb/CSS/PropertyID.h>
#include <LibWeb/CSS/StyleSheet.h>
#include <LibWeb/DOM/Comment.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/Element.h>
@ -440,9 +440,11 @@ void dump_sheet(const CSS::StyleSheet& sheet)
void dump_sheet(StringBuilder& builder, const CSS::StyleSheet& sheet)
{
builder.appendff("StyleSheet{{{}}}: {} rule(s)\n", &sheet, sheet.rules().size());
VERIFY(is<CSS::CSSStyleSheet>(sheet));
for (auto& rule : sheet.rules()) {
builder.appendff("CSSStyleSheet{{{}}}: {} rule(s)\n", &sheet, static_cast<const CSS::CSSStyleSheet&>(sheet).rules().size());
for (auto& rule : static_cast<const CSS::CSSStyleSheet&>(sheet).rules()) {
dump_rule(builder, rule);
}
}