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.
This commit is contained in:
parent
c808f6c637
commit
0e2684b10f
Notes:
sideshowbarker
2024-07-17 01:46:43 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/0e2684b10f Pull-request: https://github.com/SerenityOS/serenity/pull/19510 Reviewed-by: https://github.com/awesomekling ✅
1 changed files with 4 additions and 7 deletions
|
@ -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<void> {
|
||||
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();
|
||||
|
|
Loading…
Add table
Reference in a new issue