LibWeb: Rename show_cascaded_properties flag in dump_tree()

This flag actually controls dumping of computed properties, so let's
rename it to reflect that.
This commit is contained in:
Tim Ledbetter 2026-05-03 13:02:47 +01:00 committed by Andreas Kling
parent c7e24fce2f
commit 6a64a55a41
2 changed files with 9 additions and 9 deletions

View file

@ -146,14 +146,14 @@ void dump_tree(StringBuilder& builder, DOM::Node const& node)
--indent;
}
void dump_tree(Layout::Node const& layout_node, bool show_cascaded_properties)
void dump_tree(Layout::Node const& layout_node, bool show_computed_properties)
{
StringBuilder builder;
dump_tree(builder, layout_node, show_cascaded_properties, true);
dump_tree(builder, layout_node, show_computed_properties, true);
dbgln("{}", builder.string_view());
}
void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool show_cascaded_properties, bool interactive)
void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool show_computed_properties, bool interactive)
{
static size_t indent = 0;
builder.append_repeated(" "sv, indent);
@ -333,7 +333,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho
builder.append("\n"sv);
if (auto const* nested_layout_root = document->layout_node()) {
++indent;
dump_tree(builder, *nested_layout_root, show_cascaded_properties, interactive);
dump_tree(builder, *nested_layout_root, show_computed_properties, interactive);
--indent;
}
}
@ -357,7 +357,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho
builder.append(" "sv);
builder.append("(SVG-as-image isolated context)\n"sv);
dump_tree(builder, *svg_data.svg_document().unsafe_layout_node(), show_cascaded_properties, interactive);
dump_tree(builder, *svg_data.svg_document().unsafe_layout_node(), show_computed_properties, interactive);
--indent;
}
}
@ -401,7 +401,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho
}
}
if (show_cascaded_properties && layout_node.dom_node() && layout_node.dom_node()->is_element() && as<DOM::Element>(layout_node.dom_node())->computed_properties()) {
if (show_computed_properties && layout_node.dom_node() && layout_node.dom_node()->is_element() && as<DOM::Element>(layout_node.dom_node())->computed_properties()) {
struct NameAndValue {
FlyString name;
String value;
@ -420,7 +420,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho
++indent;
layout_node.for_each_child([&](auto& child) {
dump_tree(builder, child, show_cascaded_properties, interactive);
dump_tree(builder, child, show_computed_properties, interactive);
return IterationDecision::Continue;
});
--indent;

View file

@ -17,8 +17,8 @@ namespace Web {
WEB_API void dump_tree(HTML::TraversableNavigable&);
void dump_tree(StringBuilder&, DOM::Node const&);
WEB_API void dump_tree(DOM::Node const&);
WEB_API void dump_tree(StringBuilder&, Layout::Node const&, bool show_cascaded_properties = false, bool colorize = false);
WEB_API void dump_tree(Layout::Node const&, bool show_cascaded_properties = false);
WEB_API void dump_tree(StringBuilder&, Layout::Node const&, bool show_computed_properties = false, bool colorize = false);
WEB_API void dump_tree(Layout::Node const&, bool show_computed_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&, int indent_levels = 0);