Coverage Report

Created: 2025-03-04 07:22

/src/serenity/Userland/Libraries/LibWeb/CSS/LengthBox.h
Line
Count
Source (jump to first uncovered line)
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/PercentageOr.h>
10
11
namespace Web::CSS {
12
13
class LengthBox {
14
public:
15
    LengthBox();
16
    LengthBox(LengthPercentage top, LengthPercentage right, LengthPercentage bottom, LengthPercentage left);
17
    ~LengthBox();
18
19
    // Length (and thus LengthPercentage) includes a RefPtr<CSSMathValue> member, but we can't include the header CSSStyleValue.h as it includes
20
    // this file already. To break the cyclic dependency, we must initialize these members in the constructor.
21
0
    LengthPercentage& top() { return m_top; }
22
0
    LengthPercentage& right() { return m_right; }
23
0
    LengthPercentage& bottom() { return m_bottom; }
24
0
    LengthPercentage& left() { return m_left; }
25
0
    LengthPercentage const& top() const { return m_top; }
26
0
    LengthPercentage const& right() const { return m_right; }
27
0
    LengthPercentage const& bottom() const { return m_bottom; }
28
0
    LengthPercentage const& left() const { return m_left; }
29
30
private:
31
    LengthPercentage m_top;
32
    LengthPercentage m_right;
33
    LengthPercentage m_bottom;
34
    LengthPercentage m_left;
35
};
36
37
}