mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 08:39:22 +00:00
LibWeb: Add basic implementation of @page
This doesn't support selectors, and the only descriptors for now are for margins.
This commit is contained in:
parent
1002464322
commit
aaf07ae30d
Notes:
github-actions[bot]
2025-05-15 08:54:53 +00:00
Author: https://github.com/AtkinsSJ
Commit: aaf07ae30d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4735
27 changed files with 471 additions and 20 deletions
|
@ -19,6 +19,7 @@
|
|||
#include <LibWeb/CSS/CSSMediaRule.h>
|
||||
#include <LibWeb/CSS/CSSNamespaceRule.h>
|
||||
#include <LibWeb/CSS/CSSNestedDeclarations.h>
|
||||
#include <LibWeb/CSS/CSSPageRule.h>
|
||||
#include <LibWeb/CSS/CSSPropertyRule.h>
|
||||
#include <LibWeb/CSS/CSSRule.h>
|
||||
#include <LibWeb/CSS/CSSStyleProperties.h>
|
||||
|
@ -695,15 +696,18 @@ void dump_rule(StringBuilder& builder, CSS::CSSRule const& rule, int indent_leve
|
|||
case CSS::CSSRule::Type::NestedDeclarations:
|
||||
dump_nested_declarations(builder, as<CSS::CSSNestedDeclarations const>(rule), indent_levels);
|
||||
break;
|
||||
case CSS::CSSRule::Type::Page:
|
||||
dump_page_rule(builder, as<CSS::CSSPageRule const>(rule), indent_levels);
|
||||
break;
|
||||
case CSS::CSSRule::Type::Property:
|
||||
dump_property_rule(builder, as<CSS::CSSPropertyRule const>(rule), indent_levels);
|
||||
break;
|
||||
case CSS::CSSRule::Type::Style:
|
||||
dump_style_rule(builder, as<CSS::CSSStyleRule const>(rule), indent_levels);
|
||||
break;
|
||||
case CSS::CSSRule::Type::Supports:
|
||||
dump_supports_rule(builder, as<CSS::CSSSupportsRule const>(rule), indent_levels);
|
||||
break;
|
||||
case CSS::CSSRule::Type::Property:
|
||||
dump_property_rule(builder, as<CSS::CSSPropertyRule const>(rule), indent_levels);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -765,6 +769,13 @@ void dump_media_rule(StringBuilder& builder, CSS::CSSMediaRule const& media, int
|
|||
dump_rule(builder, rule, indent_levels + 2);
|
||||
}
|
||||
|
||||
void dump_page_rule(StringBuilder& builder, CSS::CSSPageRule const& page, int indent_levels)
|
||||
{
|
||||
indent(builder, indent_levels + 1);
|
||||
builder.appendff("selector: {}\n", page.selector_text());
|
||||
dump_descriptors(builder, page.descriptors(), indent_levels + 1);
|
||||
}
|
||||
|
||||
void dump_supports_rule(StringBuilder& builder, CSS::CSSSupportsRule const& supports, int indent_levels)
|
||||
{
|
||||
indent(builder, indent_levels);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue