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.
This commit is contained in:
Sam Atkins 2023-09-12 12:44:59 +01:00 committed by Sam Atkins
parent d1e542999c
commit 77ae510319
Notes: sideshowbarker 2024-07-17 06:29:49 +09:00

View file

@ -4146,7 +4146,8 @@ RefPtr<StyleValue> Parser::parse_font_family_value(TokenStream<ComponentValue>&
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<StyleValue> Parser::parse_font_family_value(TokenStream<ComponentValue>&
}
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();
}