mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
Currently there are multiple style values which are essentially the same thing, a function holding a value, just with different names. This commit adds a generic style value to replace them with and the following commits will do so.
30 lines
694 B
C++
30 lines
694 B
C++
/*
|
|
* Copyright (c) 2026, Callum Law <callumlaw1709@outlook.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include "FunctionStyleValue.h"
|
|
|
|
namespace Web::CSS {
|
|
|
|
ValueComparingNonnullRefPtr<StyleValue const> FunctionStyleValue::absolutized(ComputationContext const& context) const
|
|
{
|
|
auto absolutized_value = m_value->absolutized(context);
|
|
|
|
if (absolutized_value == m_value)
|
|
return *this;
|
|
|
|
return FunctionStyleValue::create(m_name, absolutized_value);
|
|
}
|
|
|
|
void FunctionStyleValue::serialize(StringBuilder& builder, SerializationMode mode) const
|
|
{
|
|
builder.append(m_name);
|
|
builder.append('(');
|
|
m_value->serialize(builder, mode);
|
|
builder.append(')');
|
|
}
|
|
|
|
}
|