mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 07:09:47 +00:00
LibWeb/CSS: Add basic implementation of CSSMarginRule
This is a bit under-specced, specifically there's no definition of CSSMarginDescriptors so I've gone with CSSStyleProperties for now. Gets us 17 WPT subtests.
This commit is contained in:
parent
aa9fa88428
commit
870f24f181
Notes:
github-actions[bot]
2025-05-16 10:02:36 +00:00
Author: https://github.com/AtkinsSJ
Commit: 870f24f181
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4746
21 changed files with 233 additions and 32 deletions
|
@ -4,6 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/CSS/CSSMarginRule.h>
|
||||
#include <LibWeb/CSS/Parser/RuleContext.h>
|
||||
|
||||
namespace Web::CSS::Parser {
|
||||
|
@ -25,6 +26,8 @@ RuleContext rule_context_type_for_rule(CSSRule::Type rule_type)
|
|||
return RuleContext::AtSupports;
|
||||
case CSSRule::Type::LayerBlock:
|
||||
return RuleContext::AtLayer;
|
||||
case CSSRule::Type::Margin:
|
||||
return RuleContext::Margin;
|
||||
case CSSRule::Type::NestedDeclarations:
|
||||
return RuleContext::Style;
|
||||
case CSSRule::Type::Page:
|
||||
|
@ -56,6 +59,8 @@ RuleContext rule_context_type_for_at_rule(FlyString const& name)
|
|||
return RuleContext::AtProperty;
|
||||
if (name.equals_ignoring_ascii_case("page"sv))
|
||||
return RuleContext::AtPage;
|
||||
if (is_margin_rule_name(name))
|
||||
return RuleContext::Margin;
|
||||
return RuleContext::Unknown;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue