1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:38:11 +00:00

LibWeb+WebContent: Use new String class in CSS::StyleValue

Converts uses of DeprecatedString to String in StyleValue, and patches
surrounding files that depend on these functions.
This commit is contained in:
martinfalisse 2023-01-06 19:02:26 +01:00 committed by Andreas Kling
parent 1c2e7b1e47
commit ce0f41b9fb
37 changed files with 335 additions and 330 deletions

View file

@ -3966,7 +3966,7 @@ RefPtr<StyleValue> Parser::parse_color_value(ComponentValue const& component_val
RefPtr<StyleValue> Parser::parse_string_value(ComponentValue const& component_value)
{
if (component_value.is(Token::Type::String))
return StringStyleValue::create(component_value.token().string());
return StringStyleValue::create(String::from_utf8(component_value.token().string()).release_value_but_fixme_should_propagate_errors());
return {};
}
@ -5238,7 +5238,7 @@ RefPtr<StyleValue> Parser::parse_font_family_value(Vector<ComponentValue> const&
return nullptr;
if (!is_comma_or_eof(i + 1))
return nullptr;
font_families.append(StringStyleValue::create(part.token().string()));
font_families.append(StringStyleValue::create(String::from_utf8(part.token().string()).release_value_but_fixme_should_propagate_errors()));
i++;
continue;
}
@ -5266,7 +5266,7 @@ RefPtr<StyleValue> Parser::parse_font_family_value(Vector<ComponentValue> const&
if (part.is(Token::Type::Comma)) {
if (current_name_parts.is_empty())
return nullptr;
font_families.append(StringStyleValue::create(DeprecatedString::join(' ', current_name_parts)));
font_families.append(StringStyleValue::create(String::from_utf8(DeprecatedString::join(' ', current_name_parts)).release_value_but_fixme_should_propagate_errors()));
current_name_parts.clear();
// Can't have a trailing comma
if (i + 1 == component_values.size())
@ -5276,7 +5276,7 @@ RefPtr<StyleValue> Parser::parse_font_family_value(Vector<ComponentValue> const&
}
if (!current_name_parts.is_empty()) {
font_families.append(StringStyleValue::create(DeprecatedString::join(' ', current_name_parts)));
font_families.append(StringStyleValue::create(String::from_utf8(DeprecatedString::join(' ', current_name_parts)).release_value_but_fixme_should_propagate_errors()));
current_name_parts.clear();
}