mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +00:00
LibWeb: Port CSS::Parser::Function to new Strings
This commit is contained in:
parent
86d23c63a4
commit
05c1b09621
5 changed files with 20 additions and 19 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2020-2021, the SerenityOS developers.
|
||||
* Copyright (c) 2021-2022, Sam Atkins <atkinssj@serenityos.org>
|
||||
* Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -10,7 +10,7 @@
|
|||
|
||||
namespace Web::CSS::Parser {
|
||||
|
||||
Function::Function(DeprecatedFlyString name, Vector<ComponentValue>&& values)
|
||||
Function::Function(FlyString name, Vector<ComponentValue>&& values)
|
||||
: m_name(move(name))
|
||||
, m_values(move(values))
|
||||
{
|
||||
|
@ -18,16 +18,16 @@ Function::Function(DeprecatedFlyString name, Vector<ComponentValue>&& values)
|
|||
|
||||
Function::~Function() = default;
|
||||
|
||||
DeprecatedString Function::to_deprecated_string() const
|
||||
ErrorOr<String> Function::to_string() const
|
||||
{
|
||||
StringBuilder builder;
|
||||
|
||||
serialize_an_identifier(builder, m_name);
|
||||
builder.append('(');
|
||||
builder.join(' ', m_values);
|
||||
builder.append(')');
|
||||
TRY(builder.try_append('('));
|
||||
TRY(builder.try_join(' ', m_values));
|
||||
TRY(builder.try_append(')'));
|
||||
|
||||
return builder.to_deprecated_string();
|
||||
return builder.to_string();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue