Coverage Report

Created: 2026-05-16 07:03

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/serenity/Userland/Libraries/LibWeb/CSS/StyleValues/ScrollbarGutterStyleValue.h
Line
Count
Source
1
/*
2
 * Copyright (c) 2024, the Ladybird developers.
3
 *
4
 * SPDX-License-Identifier: BSD-2-Clause
5
 */
6
7
#pragma once
8
9
#include <LibWeb/CSS/CSSStyleValue.h>
10
11
namespace Web::CSS {
12
13
class ScrollbarGutterStyleValue final : public StyleValueWithDefaultOperators<ScrollbarGutterStyleValue> {
14
public:
15
    static ValueComparingNonnullRefPtr<ScrollbarGutterStyleValue> create(ScrollbarGutter value)
16
0
    {
17
0
        return adopt_ref(*new (nothrow) ScrollbarGutterStyleValue(value));
18
0
    }
19
    virtual ~ScrollbarGutterStyleValue() override = default;
20
21
0
    ScrollbarGutter value() const { return m_value; }
22
23
    virtual String to_string() const override
24
0
    {
25
0
        switch (m_value) {
26
0
        case ScrollbarGutter::Auto:
27
0
            return "auto"_string;
28
0
        case ScrollbarGutter::Stable:
29
0
            return "stable"_string;
30
0
        case ScrollbarGutter::BothEdges:
31
0
            return "stable both-edges"_string;
32
0
        default:
33
0
            VERIFY_NOT_REACHED();
34
0
        }
35
0
    }
36
37
0
    bool properties_equal(ScrollbarGutterStyleValue const& other) const { return m_value == other.m_value; }
38
39
private:
40
    ScrollbarGutterStyleValue(ScrollbarGutter value)
41
0
        : StyleValueWithDefaultOperators(Type::ScrollbarGutter)
42
0
        , m_value(value)
43
0
    {
44
0
    }
45
46
    ScrollbarGutter m_value;
47
};
48
49
}