2023-03-24 21:02:50 -03:00
|
|
|
/*
|
2024-10-04 08:19:50 -03:00
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <andreas@ladybird.org>
|
2023-03-24 21:02:50 -03:00
|
|
|
* Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
|
|
|
|
|
* Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
|
|
|
|
|
* Copyright (c) 2022-2023, MacDue <macdue@dueutil.tech>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2023-03-30 10:22:39 -03:00
|
|
|
#include <LibWeb/CSS/EdgeRect.h>
|
2025-08-08 06:11:51 -03:00
|
|
|
#include <LibWeb/CSS/StyleValues/StyleValue.h>
|
2023-03-24 21:02:50 -03:00
|
|
|
|
|
|
|
|
namespace Web::CSS {
|
|
|
|
|
|
|
|
|
|
class RectStyleValue : public StyleValueWithDefaultOperators<RectStyleValue> {
|
|
|
|
|
public:
|
2025-04-15 18:18:27 -03:00
|
|
|
static ValueComparingNonnullRefPtr<RectStyleValue const> create(EdgeRect rect);
|
2023-03-24 21:02:50 -03:00
|
|
|
virtual ~RectStyleValue() override = default;
|
|
|
|
|
|
|
|
|
|
EdgeRect rect() const { return m_rect; }
|
2024-12-06 20:59:49 -03:00
|
|
|
virtual String to_string(SerializationMode) const override;
|
2023-03-24 21:02:50 -03:00
|
|
|
|
|
|
|
|
bool properties_equal(RectStyleValue const& other) const { return m_rect == other.m_rect; }
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
explicit RectStyleValue(EdgeRect rect)
|
|
|
|
|
: StyleValueWithDefaultOperators(Type::Rect)
|
2023-05-05 11:02:03 -03:00
|
|
|
, m_rect(move(rect))
|
2023-03-24 21:02:50 -03:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EdgeRect m_rect;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|