mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 21:20:18 +00:00
Not every user of this requires an `auto` state, but most do. This has quite a big diff but most of that is mechanical: LengthPercentageOrAuto has `resolved_or_auto()` instead of `resolved()`, and `to_px_or_zero()` instead of `to_px()`, to make their output clearer.
38 lines
1.1 KiB
C++
38 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2018-2020, Andreas Kling <andreas@ladybird.org>
|
|
* Copyright (c) 2025, Sam Atkins <sam@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/CSS/PercentageOr.h>
|
|
|
|
namespace Web::CSS {
|
|
|
|
class LengthBox {
|
|
public:
|
|
LengthBox();
|
|
LengthBox(LengthPercentageOrAuto top, LengthPercentageOrAuto right, LengthPercentageOrAuto bottom, LengthPercentageOrAuto left);
|
|
~LengthBox();
|
|
|
|
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; }
|
|
|
|
bool operator==(LengthBox const&) const = default;
|
|
|
|
private:
|
|
LengthPercentageOrAuto m_top;
|
|
LengthPercentageOrAuto m_right;
|
|
LengthPercentageOrAuto m_bottom;
|
|
LengthPercentageOrAuto m_left;
|
|
};
|
|
|
|
}
|