mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-05 01:10:24 +00:00
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:
Notes:
github-actions[bot]
2025-12-04 16:25:45 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/1db13c52be9 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7018
@@ -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());
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user