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:
Sam Atkins 2025-05-13 12:17:41 +01:00
commit aaf07ae30d
Notes: github-actions[bot] 2025-05-15 08:54:53 +00:00
27 changed files with 471 additions and 20 deletions

View file

@ -27,6 +27,8 @@ RuleContext rule_context_type_for_rule(CSSRule::Type rule_type)
return RuleContext::AtLayer;
case CSSRule::Type::NestedDeclarations:
return RuleContext::Style;
case CSSRule::Type::Page:
return RuleContext::AtPage;
case CSSRule::Type::Property:
return RuleContext::AtProperty;
// Other types shouldn't be trying to create a context.
@ -52,6 +54,8 @@ RuleContext rule_context_type_for_at_rule(FlyString const& name)
return RuleContext::AtLayer;
if (name == "property")
return RuleContext::AtProperty;
if (name == "page")
return RuleContext::AtPage;
return RuleContext::Unknown;
}