mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +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
|
@ -1375,6 +1375,8 @@ Vector<Descriptor> Parser::parse_as_descriptor_declaration_block(AtRuleID at_rul
|
|||
switch (at_rule_id) {
|
||||
case AtRuleID::FontFace:
|
||||
return RuleContext::AtFontFace;
|
||||
case AtRuleID::Page:
|
||||
return RuleContext::AtPage;
|
||||
case AtRuleID::Property:
|
||||
return RuleContext::AtProperty;
|
||||
}
|
||||
|
@ -1434,8 +1436,9 @@ bool Parser::is_valid_in_the_current_context(Declaration const&) const
|
|||
return m_rule_context.contains_slow(RuleContext::Style);
|
||||
|
||||
case RuleContext::AtFontFace:
|
||||
case RuleContext::AtPage:
|
||||
case RuleContext::AtProperty:
|
||||
// @font-face and @property have descriptor declarations
|
||||
// @font-face, @page, and @property have descriptor declarations
|
||||
return true;
|
||||
|
||||
case RuleContext::AtKeyframes:
|
||||
|
@ -1482,8 +1485,10 @@ bool Parser::is_valid_in_the_current_context(AtRule const& at_rule) const
|
|||
case RuleContext::AtFontFace:
|
||||
case RuleContext::AtKeyframes:
|
||||
case RuleContext::Keyframe:
|
||||
case RuleContext::AtPage:
|
||||
case RuleContext::AtProperty:
|
||||
// These can't contain any at-rules
|
||||
// FIXME: Eventually @page can contain margin-box at-rules: https://drafts.csswg.org/css-page-3/#margin-at-rules
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1522,6 +1527,7 @@ bool Parser::is_valid_in_the_current_context(QualifiedRule const&) const
|
|||
return false;
|
||||
|
||||
case RuleContext::AtFontFace:
|
||||
case RuleContext::AtPage:
|
||||
case RuleContext::AtProperty:
|
||||
case RuleContext::Keyframe:
|
||||
// These can't contain qualified rules
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue