2020-01-18 09:38:21 +01:00
|
|
|
/*
|
2024-10-04 13:19:50 +02:00
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <andreas@ladybird.org>
|
2025-09-01 12:51:52 +01:00
|
|
|
* Copyright (c) 2025, Sam Atkins <sam@ladybird.org>
|
2020-01-18 09:38:21 +01:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 09:38:21 +01:00
|
|
|
*/
|
|
|
|
|
2019-07-01 17:17:32 +02:00
|
|
|
#pragma once
|
|
|
|
|
2023-03-30 17:13:37 +01:00
|
|
|
#include <LibWeb/CSS/PercentageOr.h>
|
2019-07-01 17:17:32 +02:00
|
|
|
|
2020-07-26 20:01:35 +02:00
|
|
|
namespace Web::CSS {
|
2020-03-07 10:27:02 +01:00
|
|
|
|
2022-09-13 17:42:39 +02:00
|
|
|
class LengthBox {
|
|
|
|
public:
|
|
|
|
LengthBox();
|
2025-09-01 12:51:52 +01:00
|
|
|
LengthBox(LengthPercentageOrAuto top, LengthPercentageOrAuto right, LengthPercentageOrAuto bottom, LengthPercentageOrAuto left);
|
2022-09-13 17:42:39 +02:00
|
|
|
~LengthBox();
|
|
|
|
|
2025-09-01 12:51:52 +01:00
|
|
|
LengthPercentageOrAuto& top() { return m_top; }
|
|
|
|
LengthPercentageOrAuto& right() { return m_right; }
|
|
|
|
LengthPercentageOrAuto& bottom() { return m_bottom; }
|
|
|
|
LengthPercentageOrAuto& left() { return m_left; }
|
|
|
|
LengthPercentageOrAuto const& top() const { return m_top; }
|
|
|
|
LengthPercentageOrAuto const& right() const { return m_right; }
|
|
|
|
LengthPercentageOrAuto const& bottom() const { return m_bottom; }
|
|
|
|
LengthPercentageOrAuto const& left() const { return m_left; }
|
2022-09-13 17:42:39 +02:00
|
|
|
|
2024-10-27 11:58:52 +11:00
|
|
|
bool operator==(LengthBox const&) const = default;
|
|
|
|
|
2022-09-13 17:42:39 +02:00
|
|
|
private:
|
2025-09-01 12:51:52 +01:00
|
|
|
LengthPercentageOrAuto m_top;
|
|
|
|
LengthPercentageOrAuto m_right;
|
|
|
|
LengthPercentageOrAuto m_bottom;
|
|
|
|
LengthPercentageOrAuto m_left;
|
2019-07-01 17:17:32 +02:00
|
|
|
};
|
2020-03-07 10:27:02 +01:00
|
|
|
|
|
|
|
}
|