LibWeb: Make dump_sheet() indentable

Not all style sheets are top-level, so this will help make that
hierarchy clearer.
This commit is contained in:
Sam Atkins 2025-12-04 12:58:28 +00:00
parent 5343c9bd2e
commit 2a716eaf48
Notes: github-actions[bot] 2025-12-04 16:25:30 +00:00
2 changed files with 4 additions and 4 deletions

View file

@ -702,14 +702,14 @@ void dump_sheet(CSS::StyleSheet const& sheet)
dbgln("{}", builder.string_view());
}
void dump_sheet(StringBuilder& builder, CSS::StyleSheet const& sheet)
void dump_sheet(StringBuilder& builder, CSS::StyleSheet const& sheet, int indent_levels)
{
dump_indent(builder, indent_levels);
auto& css_stylesheet = as<CSS::CSSStyleSheet>(sheet);
builder.appendff("CSSStyleSheet{{{}}}: {} rule(s)\n", &sheet, css_stylesheet.rules().length());
for (auto& rule : css_stylesheet.rules())
dump_rule(builder, rule);
dump_rule(builder, rule, indent_levels + 1);
}
void dump_tree(Painting::Paintable const& paintable)