Coverage Report

Created: 2025-03-04 07:22

/src/serenity/Userland/Libraries/LibWeb/CSS/StyleValues/TransitionStyleValue.cpp
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright (c) 2024, Matthew Olsson <mattco@serenityos.org>.
3
 *
4
 * SPDX-License-Identifier: BSD-2-Clause
5
 */
6
7
#include <LibWeb/CSS/PropertyID.h>
8
#include <LibWeb/CSS/StyleValues/TransitionStyleValue.h>
9
10
namespace Web::CSS {
11
12
String TransitionStyleValue::to_string() const
13
0
{
14
0
    StringBuilder builder;
15
0
    bool first = true;
16
0
    for (auto const& transition : m_transitions) {
17
0
        if (!first)
18
0
            builder.append(", "sv);
19
0
        first = false;
20
0
        builder.appendff("{} {} {} {}", transition.property_name->to_string(), transition.duration, transition.easing->to_string(), transition.delay);
21
0
    }
22
23
0
    return MUST(builder.to_string());
24
0
}
25
26
bool TransitionStyleValue::properties_equal(TransitionStyleValue const& other) const
27
0
{
28
0
    if (m_transitions.size() != other.m_transitions.size())
29
0
        return false;
30
31
0
    for (size_t i = 0; i < m_transitions.size(); i++) {
32
0
        if (m_transitions[i] != other.m_transitions[i])
33
0
            return false;
34
0
    }
35
36
0
    return true;
37
0
}
38
39
}