mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 09:09:43 +00:00
LibWeb: Add dumping code for keyframe/keyframes rules
This commit is contained in:
parent
fbdef98307
commit
90d466e7e9
Notes:
github-actions[bot]
2025-05-08 15:22:33 +00:00
Author: https://github.com/AtkinsSJ
Commit: 90d466e7e9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4654
2 changed files with 24 additions and 1 deletions
|
@ -12,6 +12,8 @@
|
||||||
#include <LibWeb/CSS/CSSDescriptors.h>
|
#include <LibWeb/CSS/CSSDescriptors.h>
|
||||||
#include <LibWeb/CSS/CSSFontFaceRule.h>
|
#include <LibWeb/CSS/CSSFontFaceRule.h>
|
||||||
#include <LibWeb/CSS/CSSImportRule.h>
|
#include <LibWeb/CSS/CSSImportRule.h>
|
||||||
|
#include <LibWeb/CSS/CSSKeyframeRule.h>
|
||||||
|
#include <LibWeb/CSS/CSSKeyframesRule.h>
|
||||||
#include <LibWeb/CSS/CSSLayerBlockRule.h>
|
#include <LibWeb/CSS/CSSLayerBlockRule.h>
|
||||||
#include <LibWeb/CSS/CSSLayerStatementRule.h>
|
#include <LibWeb/CSS/CSSLayerStatementRule.h>
|
||||||
#include <LibWeb/CSS/CSSMediaRule.h>
|
#include <LibWeb/CSS/CSSMediaRule.h>
|
||||||
|
@ -673,8 +675,10 @@ void dump_rule(StringBuilder& builder, CSS::CSSRule const& rule, int indent_leve
|
||||||
dump_import_rule(builder, as<CSS::CSSImportRule const>(rule), indent_levels);
|
dump_import_rule(builder, as<CSS::CSSImportRule const>(rule), indent_levels);
|
||||||
break;
|
break;
|
||||||
case CSS::CSSRule::Type::Keyframe:
|
case CSS::CSSRule::Type::Keyframe:
|
||||||
|
dump_keyframe_rule(builder, as<CSS::CSSKeyframeRule const>(rule), indent_levels);
|
||||||
|
break;
|
||||||
case CSS::CSSRule::Type::Keyframes:
|
case CSS::CSSRule::Type::Keyframes:
|
||||||
// TODO: Dump them!
|
dump_keyframes_rule(builder, as<CSS::CSSKeyframesRule const>(rule), indent_levels);
|
||||||
break;
|
break;
|
||||||
case CSS::CSSRule::Type::LayerBlock:
|
case CSS::CSSRule::Type::LayerBlock:
|
||||||
dump_layer_block_rule(builder, as<CSS::CSSLayerBlockRule const>(rule), indent_levels);
|
dump_layer_block_rule(builder, as<CSS::CSSLayerBlockRule const>(rule), indent_levels);
|
||||||
|
@ -716,6 +720,23 @@ void dump_import_rule(StringBuilder& builder, CSS::CSSImportRule const& rule, in
|
||||||
builder.appendff(" Document URL: {}\n", rule.url().to_string());
|
builder.appendff(" Document URL: {}\n", rule.url().to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dump_keyframe_rule(StringBuilder& builder, CSS::CSSKeyframeRule const& keyframe, int indent_levels)
|
||||||
|
{
|
||||||
|
indent(builder, indent_levels + 1);
|
||||||
|
builder.appendff("Key: {}\n"sv, keyframe.key_text());
|
||||||
|
dump_style_properties(builder, keyframe.style(), indent_levels + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void dump_keyframes_rule(StringBuilder& builder, CSS::CSSKeyframesRule const& keyframes, int indent_levels)
|
||||||
|
{
|
||||||
|
indent(builder, indent_levels + 1);
|
||||||
|
builder.appendff("Name: {}\n", keyframes.name());
|
||||||
|
indent(builder, indent_levels + 1);
|
||||||
|
builder.appendff("Keyframes ({}):\n", keyframes.length());
|
||||||
|
for (auto& rule : *keyframes.css_rules())
|
||||||
|
dump_rule(builder, rule, indent_levels + 2);
|
||||||
|
}
|
||||||
|
|
||||||
void dump_layer_block_rule(StringBuilder& builder, CSS::CSSLayerBlockRule const& layer_block, int indent_levels)
|
void dump_layer_block_rule(StringBuilder& builder, CSS::CSSLayerBlockRule const& layer_block, int indent_levels)
|
||||||
{
|
{
|
||||||
indent(builder, indent_levels);
|
indent(builder, indent_levels);
|
||||||
|
|
|
@ -27,6 +27,8 @@ void dump_style_properties(StringBuilder&, CSS::CSSStyleProperties const&, int i
|
||||||
void dump_descriptors(StringBuilder&, CSS::CSSDescriptors const&, int indent_levels = 0);
|
void dump_descriptors(StringBuilder&, CSS::CSSDescriptors const&, int indent_levels = 0);
|
||||||
void dump_font_face_rule(StringBuilder&, CSS::CSSFontFaceRule const&, int indent_levels = 0);
|
void dump_font_face_rule(StringBuilder&, CSS::CSSFontFaceRule const&, int indent_levels = 0);
|
||||||
void dump_import_rule(StringBuilder&, CSS::CSSImportRule const&, int indent_levels = 0);
|
void dump_import_rule(StringBuilder&, CSS::CSSImportRule const&, int indent_levels = 0);
|
||||||
|
void dump_keyframe_rule(StringBuilder&, CSS::CSSKeyframeRule const&, int indent_levels = 0);
|
||||||
|
void dump_keyframes_rule(StringBuilder&, CSS::CSSKeyframesRule const&, int indent_levels = 0);
|
||||||
void dump_media_rule(StringBuilder&, CSS::CSSMediaRule const&, int indent_levels = 0);
|
void dump_media_rule(StringBuilder&, CSS::CSSMediaRule const&, int indent_levels = 0);
|
||||||
void dump_style_rule(StringBuilder&, CSS::CSSStyleRule const&, int indent_levels = 0);
|
void dump_style_rule(StringBuilder&, CSS::CSSStyleRule const&, int indent_levels = 0);
|
||||||
void dump_supports_rule(StringBuilder&, CSS::CSSSupportsRule const&, int indent_levels = 0);
|
void dump_supports_rule(StringBuilder&, CSS::CSSSupportsRule const&, int indent_levels = 0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue