mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:38:13 +00:00
LibWeb: Rename CompositeStyleValue -> ShorthandStyleValue
It's a shorthand, so let's call it that. :^)
This commit is contained in:
parent
69482f1f14
commit
d20254f1bc
9 changed files with 24 additions and 24 deletions
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Ali Mohammad Pur <mpfard@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "ShorthandStyleValue.h"
|
||||
#include <LibWeb/CSS/StyleValues/StyleValueList.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
ShorthandStyleValue::ShorthandStyleValue(Vector<PropertyID> sub_properties, Vector<ValueComparingNonnullRefPtr<StyleValue const>> values)
|
||||
: StyleValueWithDefaultOperators(Type::Shorthand)
|
||||
, m_properties { move(sub_properties), move(values) }
|
||||
{
|
||||
if (m_properties.sub_properties.size() != m_properties.values.size()) {
|
||||
dbgln("ShorthandStyleValue: sub_properties and values must be the same size! {} != {}", m_properties.sub_properties.size(), m_properties.values.size());
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
ShorthandStyleValue::~ShorthandStyleValue() = default;
|
||||
|
||||
String ShorthandStyleValue::to_string() const
|
||||
{
|
||||
StringBuilder builder;
|
||||
auto first = true;
|
||||
for (auto& value : m_properties.values) {
|
||||
if (first)
|
||||
first = false;
|
||||
else
|
||||
builder.append(' ');
|
||||
builder.append(value->to_string());
|
||||
}
|
||||
return MUST(builder.to_string());
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue