1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:07:44 +00:00

LibWeb: Port CSS::Parser::ComponentValue to new Strings

This commit is contained in:
Sam Atkins 2023-02-14 19:04:12 +00:00 committed by Tim Flynn
parent 05c1b09621
commit a168cda4a7
4 changed files with 13 additions and 13 deletions

View file

@ -1405,7 +1405,7 @@ Optional<Supports::Feature> Parser::parse_supports_feature(TokenStream<Component
// FIXME: Parsing and then converting back to a string is weird.
StringBuilder builder;
for (auto const& item : first_token.function().values())
builder.append(item.to_deprecated_string());
builder.append(item.to_string().release_value_but_fixme_should_propagate_errors());
transaction.commit();
return Supports::Feature {
Supports::Selector { builder.to_deprecated_string() }
@ -1425,13 +1425,13 @@ Optional<GeneralEnclosed> Parser::parse_general_enclosed(TokenStream<ComponentVa
// `[ <function-token> <any-value>? ) ]`
if (first_token.is_function()) {
transaction.commit();
return GeneralEnclosed { first_token.to_deprecated_string() };
return GeneralEnclosed { first_token.to_string().release_value_but_fixme_should_propagate_errors().to_deprecated_string() };
}
// `( <any-value>? )`
if (first_token.is_block() && first_token.block().is_paren()) {
transaction.commit();
return GeneralEnclosed { first_token.to_deprecated_string() };
return GeneralEnclosed { first_token.to_string().release_value_but_fixme_should_propagate_errors().to_deprecated_string() };
}
return {};
@ -3385,7 +3385,7 @@ Optional<UnicodeRange> Parser::parse_unicode_range(TokenStream<ComponentValue>&
return DeprecatedString::formatted("{:+}", int_value);
}
return component_value.to_deprecated_string();
return component_value.to_string().release_value_but_fixme_should_propagate_errors().to_deprecated_string();
};
auto create_unicode_range = [&](StringView text, auto& local_transaction) -> Optional<UnicodeRange> {