mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-19 10:20:22 +00:00
Previously, some StyleValues created a large number of intermediate strings during serialization. Passing a StringBUilder into the serialization function allows us to avoid a large number of these unnecessary allocations.
29 lines
719 B
C++
29 lines
719 B
C++
/*
|
|
* Copyright (c) 2025, Sam Atkins <sam@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibWeb/CSS/StyleValues/UnicodeRangeStyleValue.h>
|
|
|
|
namespace Web::CSS {
|
|
|
|
UnicodeRangeStyleValue::UnicodeRangeStyleValue(Gfx::UnicodeRange unicode_range)
|
|
: StyleValueWithDefaultOperators(Type::UnicodeRange)
|
|
, m_unicode_range(unicode_range)
|
|
{
|
|
}
|
|
|
|
UnicodeRangeStyleValue::~UnicodeRangeStyleValue() = default;
|
|
|
|
void UnicodeRangeStyleValue::serialize(StringBuilder& builder, SerializationMode) const
|
|
{
|
|
builder.append(m_unicode_range.to_string());
|
|
}
|
|
|
|
bool UnicodeRangeStyleValue::properties_equal(UnicodeRangeStyleValue const& other) const
|
|
{
|
|
return m_unicode_range == other.m_unicode_range;
|
|
}
|
|
|
|
}
|