mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +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
|
@ -104,7 +104,7 @@ String CSSPageRule::serialized() const
|
|||
|
||||
StringBuilder builder;
|
||||
|
||||
// AD-HOC: There's no spec for this yet.
|
||||
// AD-HOC: There's no spec for this yet, but Chrome puts declarations before margin rules.
|
||||
builder.append("@page "sv);
|
||||
if (auto selector = selector_text(); !selector.is_empty())
|
||||
builder.appendff("{} ", selector);
|
||||
|
@ -113,6 +113,15 @@ String CSSPageRule::serialized() const
|
|||
builder.append(descriptors.serialized());
|
||||
builder.append(' ');
|
||||
}
|
||||
for (size_t i = 0; i < css_rules().length(); i++) {
|
||||
auto rule = css_rules().item(i);
|
||||
auto result = rule->css_text();
|
||||
|
||||
if (result.is_empty())
|
||||
continue;
|
||||
|
||||
builder.appendff("{} ", result);
|
||||
}
|
||||
builder.append("}"sv);
|
||||
|
||||
return builder.to_string_without_validation();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue