mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 14:37:43 +00:00
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:
parent
d1e542999c
commit
77ae510319
1 changed files with 4 additions and 2 deletions
|
@ -4146,7 +4146,8 @@ RefPtr<StyleValue> Parser::parse_font_family_value(TokenStream<ComponentValue>&
|
||||||
if (current_name_parts.is_empty())
|
if (current_name_parts.is_empty())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
(void)tokens.next_token(); // Comma
|
(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();
|
current_name_parts.clear();
|
||||||
// Can't have a trailing comma
|
// Can't have a trailing comma
|
||||||
if (!tokens.has_next_token())
|
if (!tokens.has_next_token())
|
||||||
|
@ -4158,7 +4159,8 @@ RefPtr<StyleValue> Parser::parse_font_family_value(TokenStream<ComponentValue>&
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!current_name_parts.is_empty()) {
|
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();
|
current_name_parts.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue