mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 16:19:23 +00:00
LibWeb/CSS: Don't serialize empty rules in CSSStyleRule
This is a recent spec change: https://github.com/w3c/csswg-drafts/pull/10974
This commit is contained in:
parent
8003d63ff9
commit
592cf556a1
Notes:
github-actions[bot]
2024-10-14 12:44:12 +00:00
Author: https://github.com/ronak69
Commit: 592cf556a1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1783
Reviewed-by: https://github.com/AtkinsSJ ✅
1 changed files with 5 additions and 0 deletions
|
@ -94,6 +94,11 @@ String CSSStyleRule::serialized() const
|
||||||
|
|
||||||
// 2. For each rule in rules:
|
// 2. For each rule in rules:
|
||||||
for (auto& rule : rules) {
|
for (auto& rule : rules) {
|
||||||
|
// * If rule is the empty string, do nothing.
|
||||||
|
if (rule.is_empty())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// * Otherwise:
|
||||||
// 1. Append a newline followed by two spaces to s.
|
// 1. Append a newline followed by two spaces to s.
|
||||||
// 2. Append rule to s.
|
// 2. Append rule to s.
|
||||||
builder.appendff("\n {}", rule);
|
builder.appendff("\n {}", rule);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue