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)

View file

@ -21,7 +21,7 @@ WEB_API void dump_tree(StringBuilder&, Layout::Node const&, bool show_cascaded_p
WEB_API void dump_tree(Layout::Node const&, bool show_cascaded_properties = false);
WEB_API void dump_tree(StringBuilder&, Painting::Paintable const&, bool colorize = false, int indent = 0);
WEB_API void dump_tree(Painting::Paintable const&);
void dump_sheet(StringBuilder&, CSS::StyleSheet const&);
void dump_sheet(StringBuilder&, CSS::StyleSheet const&, int indent_levels = 0);
WEB_API void dump_sheet(CSS::StyleSheet const&);
void dump_rule(StringBuilder&, CSS::CSSRule const&, int indent_levels = 0);
void dump_rule(CSS::CSSRule const&);