Skip to content

Commit 1db13c5

Browse files
committed
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`.
1 parent 180cd4b commit 1db13c5

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Libraries/LibWeb/CSS/CSSSupportsRule.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ void CSSSupportsRule::dump(StringBuilder& builder, int indent_levels) const
6363
{
6464
Base::dump(builder, indent_levels);
6565

66-
dump_indent(builder, indent_levels + 1);
67-
builder.append("Supports:\n"sv);
68-
supports().dump(builder, indent_levels + 2);
66+
supports().dump(builder, indent_levels + 1);
6967

7068
dump_indent(builder, indent_levels + 1);
7169
builder.appendff("Rules ({}):\n", css_rules().length());

Libraries/LibWeb/CSS/Supports.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include <LibJS/Runtime/Realm.h>
88
#include <LibWeb/CSS/Supports.h>
9+
#include <LibWeb/Dump.h>
910

1011
namespace Web::CSS {
1112

@@ -86,7 +87,9 @@ String Supports::to_string() const
8687

8788
void Supports::dump(StringBuilder& builder, int indent_levels) const
8889
{
89-
m_condition->dump(builder, indent_levels);
90+
dump_indent(builder, indent_levels);
91+
builder.appendff("Supports condition: (matches = {})\n", m_matches);
92+
m_condition->dump(builder, indent_levels + 1);
9093
}
9194

9295
}

0 commit comments

Comments
 (0)