From 0e2684b10f2f9dfc1f1c06db9ab8783d64af0508 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Tue, 20 Jun 2023 13:50:49 +0100 Subject: [PATCH] LibWeb: Fix serialization of CSSFontFaceRule - The check for `local()` sources wasn't working, and output `local()` every time. Since we don't parse `local()` yet, let's just always output a regular URL source. - Put a space between the URL and the `format()`. - Stop double-quoting the format string. --- Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp index 50df341ed7..4b498f1135 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp @@ -64,17 +64,14 @@ DeprecatedString CSSFontFaceRule::serialized() const // 2. The result of invoking serialize a comma-separated list on performing serialize a URL or serialize a LOCAL for each source on the source list. serialize_a_comma_separated_list(builder, m_font_face.sources(), [&](StringBuilder& builder, FontFace::Source source) -> ErrorOr { - if (source.url.cannot_be_a_base_url()) { - TRY(serialize_a_url(builder, source.url.to_deprecated_string())); - } else { - TRY(serialize_a_local(builder, source.url.to_deprecated_string())); - } + // FIXME: Serialize locals once we support those + TRY(serialize_a_url(builder, source.url.to_deprecated_string())); // NOTE: No spec currently exists for format() if (source.format.has_value()) { - TRY(builder.try_append("format(\""sv)); + TRY(builder.try_append(" format("sv)); TRY(serialize_a_string(builder, source.format.value())); - TRY(builder.try_append("\")"sv)); + TRY(builder.try_append(")"sv)); } return {}; }).release_value_but_fixme_should_propagate_errors();