Serenity Operating System
1/*
2 * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#pragma once
8
9#include <LibWeb/CSS/Percentage.h>
10
11namespace Web::CSS {
12
13class LengthBox {
14public:
15 LengthBox();
16 LengthBox(LengthPercentage top, LengthPercentage right, LengthPercentage bottom, LengthPercentage left);
17 ~LengthBox();
18
19 // Length (and thus LengthPercentage) includes a RefPtr<CalculatedStyleValue> member, but we can't include the header StyleValue.h as it includes
20 // this file already. To break the cyclic dependency, we must initialize these members in the constructor.
21 LengthPercentage& top() { return m_top; }
22 LengthPercentage& right() { return m_right; }
23 LengthPercentage& bottom() { return m_bottom; }
24 LengthPercentage& left() { return m_left; };
25 LengthPercentage const& top() const { return m_top; }
26 LengthPercentage const& right() const { return m_right; }
27 LengthPercentage const& bottom() const { return m_bottom; }
28 LengthPercentage const& left() const { return m_left; };
29
30private:
31 LengthPercentage m_top;
32 LengthPercentage m_right;
33 LengthPercentage m_bottom;
34 LengthPercentage m_left;
35};
36
37}