mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:07:34 +00:00
LibWeb: Move Declaration code into Declaration.cpp
This commit is contained in:
parent
3e49036edf
commit
6848a0ef05
3 changed files with 31 additions and 17 deletions
30
Userland/Libraries/LibWeb/CSS/Parser/Declaration.cpp
Normal file
30
Userland/Libraries/LibWeb/CSS/Parser/Declaration.cpp
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* 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/Declaration.h>
|
||||
#include <LibWeb/CSS/Serialize.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
Declaration::Declaration() = default;
|
||||
Declaration::~Declaration() = default;
|
||||
|
||||
String Declaration::to_string() const
|
||||
{
|
||||
StringBuilder builder;
|
||||
|
||||
serialize_an_identifier(builder, m_name);
|
||||
builder.append(": ");
|
||||
builder.join(" ", m_values);
|
||||
|
||||
if (m_important == Important::Yes)
|
||||
builder.append(" !important");
|
||||
|
||||
return builder.to_string();
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue