2023-03-23 14:26:13 -03:00
|
|
|
/*
|
2024-10-04 08:19:50 -03:00
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <andreas@ladybird.org>
|
2024-08-14 12:25:48 -03:00
|
|
|
* Copyright (c) 2021-2024, Sam Atkins <sam@ladybird.org>
|
2023-03-23 14:26:13 -03:00
|
|
|
* Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
|
|
|
|
|
* Copyright (c) 2022-2023, MacDue <macdue@dueutil.tech>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "AngleStyleValue.h"
|
|
|
|
|
|
|
|
|
|
namespace Web::CSS {
|
|
|
|
|
|
|
|
|
|
AngleStyleValue::AngleStyleValue(Angle angle)
|
2025-08-08 07:08:54 -03:00
|
|
|
: DimensionStyleValue(Type::Angle)
|
2023-03-23 14:26:13 -03:00
|
|
|
, m_angle(move(angle))
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AngleStyleValue::~AngleStyleValue() = default;
|
|
|
|
|
|
2026-01-08 09:02:18 -03:00
|
|
|
void AngleStyleValue::serialize(StringBuilder& builder, SerializationMode mode) const
|
2023-03-23 14:26:13 -03:00
|
|
|
{
|
2026-01-08 11:55:48 -03:00
|
|
|
m_angle.serialize(builder, mode);
|
2023-03-23 14:26:13 -03:00
|
|
|
}
|
|
|
|
|
|
2025-08-08 06:11:51 -03:00
|
|
|
bool AngleStyleValue::equals(StyleValue const& other) const
|
2023-03-23 14:26:13 -03:00
|
|
|
{
|
2024-08-14 12:25:48 -03:00
|
|
|
if (type() != other.type())
|
|
|
|
|
return false;
|
|
|
|
|
auto const& other_angle = other.as_angle();
|
|
|
|
|
return m_angle == other_angle.m_angle;
|
2023-03-23 14:26:13 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|