LibWeb: Usefully dump CSS property rules

Sample dump:
```
CSSPropertyRule:
  name: --valid
  syntax: <color> | none
  inherits: false
  initial-value: red
```
This commit is contained in:
Alex Ungurianu 2024-10-15 20:41:04 +01:00 committed by Sam Atkins
parent a4c72f50c0
commit 1dd3865de9
Notes: github-actions[bot] 2024-10-23 05:56:33 +00:00

View file

@ -788,6 +788,23 @@ void dump_supports_rule(StringBuilder& builder, CSS::CSSSupportsRule const& supp
dump_rule(builder, rule, indent_levels + 2);
}
void dump_property_rule(StringBuilder& builder, CSS::CSSPropertyRule const& property, int indent_levels)
{
indent(builder, indent_levels + 1);
builder.appendff("name: {}\n", property.name());
indent(builder, indent_levels + 1);
builder.appendff("syntax: {}\n", property.syntax());
indent(builder, indent_levels + 1);
builder.appendff("inherits: {}\n", property.inherits());
if (property.initial_value().has_value()) {
indent(builder, indent_levels + 1);
builder.appendff("initial-value: {}\n", property.initial_value().value());
}
}
void dump_declaration(StringBuilder& builder, CSS::PropertyOwningCSSStyleDeclaration const& declaration, int indent_levels)
{
indent(builder, indent_levels);
@ -808,13 +825,6 @@ void dump_declaration(StringBuilder& builder, CSS::PropertyOwningCSSStyleDeclara
}
}
void dump_property_rule(StringBuilder& builder, CSS::CSSPropertyRule const& property, int indent_levels)
{
(void)builder;
(void)property;
(void)indent_levels;
}
void dump_style_rule(StringBuilder& builder, CSS::CSSStyleRule const& rule, int indent_levels)
{
for (auto& selector : rule.selectors()) {