mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb: Move CSSRule dumping code into CSSRule classes
Having the dumping code in a separate Dump.cpp meant that it was often overlooked when the rules gained new features, and also limits dumping to publicly-accessible information.
This commit is contained in:
parent
285892b5dd
commit
180cd4b799
Notes:
github-actions[bot]
2025-12-04 16:25:53 +00:00
Author: https://github.com/AtkinsSJ
Commit: 180cd4b799
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7018
32 changed files with 211 additions and 204 deletions
|
|
@ -13,6 +13,7 @@
|
|||
#include <LibWeb/CSS/Parser/Parser.h>
|
||||
#include <LibWeb/CSS/StyleComputer.h>
|
||||
#include <LibWeb/CSS/StylePropertyMap.h>
|
||||
#include <LibWeb/Dump.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
|
|
@ -239,4 +240,19 @@ CSSStyleRule const* CSSStyleRule::parent_style_rule() const
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
void CSSStyleRule::dump(StringBuilder& builder, int indent_levels) const
|
||||
{
|
||||
Base::dump(builder, indent_levels);
|
||||
|
||||
for (auto& selector : selectors()) {
|
||||
dump_selector(builder, selector, indent_levels + 1);
|
||||
}
|
||||
dump_style_properties(builder, declaration(), indent_levels + 1);
|
||||
|
||||
dump_indent(builder, indent_levels + 1);
|
||||
builder.appendff("Child rules ({}):\n", css_rules().length());
|
||||
for (auto& child_rule : css_rules())
|
||||
dump_rule(builder, child_rule, indent_levels + 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue