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

LibWeb: Move/rename StyleFunctionRule to Parser::Function

This commit is contained in:
Sam Atkins 2022-04-12 13:35:55 +01:00 committed by Andreas Kling
parent 084780a0a2
commit e0b2ebcc7b
11 changed files with 59 additions and 58 deletions

View file

@ -0,0 +1,38 @@
/*
* Copyright (c) 2020-2021, the SerenityOS developers.
* Copyright (c) 2021-2022, Sam Atkins <atkinssj@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/CSS/Parser/Function.h>
#include <LibWeb/CSS/Serialize.h>
namespace Web::CSS::Parser {
Function::Function(String name)
: m_name(move(name))
{
}
Function::Function(String name, Vector<ComponentValue>&& values)
: m_name(move(name))
, m_values(move(values))
{
}
Function::~Function() = default;
String Function::to_string() const
{
StringBuilder builder;
serialize_an_identifier(builder, m_name);
builder.append("(");
builder.join(" ", m_values);
builder.append(")");
return builder.to_string();
}
}