LibWeb/CSS: Make Supports responsible for dumping itself entirely

This will reduce the boilerplate for other things that want to dump a
Supports, such as `@import`.
This commit is contained in:
Sam Atkins
2025-12-04 12:23:20 +00:00
parent 180cd4b799
commit 1db13c52be
Notes: github-actions[bot] 2025-12-04 16:25:45 +00:00
2 changed files with 5 additions and 4 deletions

View File

@@ -63,9 +63,7 @@ void CSSSupportsRule::dump(StringBuilder& builder, int indent_levels) const
{
Base::dump(builder, indent_levels);
dump_indent(builder, indent_levels + 1);
builder.append("Supports:\n"sv);
supports().dump(builder, indent_levels + 2);
supports().dump(builder, indent_levels + 1);
dump_indent(builder, indent_levels + 1);
builder.appendff("Rules ({}):\n", css_rules().length());

View File

@@ -6,6 +6,7 @@
#include <LibJS/Runtime/Realm.h>
#include <LibWeb/CSS/Supports.h>
#include <LibWeb/Dump.h>
namespace Web::CSS {
@@ -86,7 +87,9 @@ String Supports::to_string() const
void Supports::dump(StringBuilder& builder, int indent_levels) const
{
m_condition->dump(builder, indent_levels);
dump_indent(builder, indent_levels);
builder.appendff("Supports condition: (matches = {})\n", m_matches);
m_condition->dump(builder, indent_levels + 1);
}
}