From 77ae510319f65a8334bac068873c3fe39e756c20 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Tue, 12 Sep 2023 12:44:59 +0100 Subject: [PATCH] LibWeb: Parse each unquoted font-family name as a single CustomIdentSV Previously we made StringStyleValues from these, but once we start actually quoting StringStyleValues when serializing them, this will break the font-family serialization. --- Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index 9fe7d9f5c2..148e7b1bd3 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -4146,7 +4146,8 @@ RefPtr Parser::parse_font_family_value(TokenStream& if (current_name_parts.is_empty()) return nullptr; (void)tokens.next_token(); // Comma - font_families.append(StringStyleValue::create(MUST(String::join(' ', current_name_parts)))); + // This is really a series of custom-idents, not just one. But for the sake of simplicity we'll make it one. + font_families.append(CustomIdentStyleValue::create(MUST(String::join(' ', current_name_parts)))); current_name_parts.clear(); // Can't have a trailing comma if (!tokens.has_next_token()) @@ -4158,7 +4159,8 @@ RefPtr Parser::parse_font_family_value(TokenStream& } if (!current_name_parts.is_empty()) { - font_families.append(StringStyleValue::create(MUST(String::join(' ', current_name_parts)))); + // This is really a series of custom-idents, not just one. But for the sake of simplicity we'll make it one. + font_families.append(CustomIdentStyleValue::create(MUST(String::join(' ', current_name_parts)))); current_name_parts.clear(); }