LibWeb: Prefer serialize() to to_string() when serializing at-rules

This commit is contained in:
Tim Ledbetter
2026-01-08 21:11:43 +00:00
committed by Sam Atkins
parent bcc8e6ca60
commit 7335b90c40
Notes: github-actions[bot] 2026-01-09 15:21:26 +00:00
2 changed files with 11 additions and 9 deletions

View File

@@ -80,11 +80,13 @@ String CSSPropertyRule::serialized() const
builder.appendff("inherits: {}; ", inherits());
// 8. If the rules initial-value is present, follow these substeps:
if (initial_value().has_value()) {
if (m_initial_value) {
// 1. The string "initial-value:".
// 2. The result of performing serialize a CSS value in the rules initial-value followed by a single SEMICOLON
// (U+003B), followed by a SPACE (U+0020).
builder.appendff("initial-value: {}; ", initial_value());
builder.append("initial-value: "sv);
m_initial_value->serialize(builder, SerializationMode::Normal);
builder.append("; "sv);
}
// 9. A single RIGHT CURLY BRACKET (U+007D).
builder.append("}"sv);