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;
|
|
|
|
|
|
2025-03-19 14:04:15 -03:00
|
|
|
String AngleStyleValue::to_string(SerializationMode serialization_mode) const
|
2023-03-23 14:26:13 -03:00
|
|
|
{
|
2025-05-16 16:02:16 -03:00
|
|
|
return m_angle.to_string(serialization_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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|