/src/serenity/Userland/Libraries/LibWeb/CSS/StyleValues/UnresolvedStyleValue.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> |
3 | | * Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org> |
4 | | * Copyright (c) 2021-2024, Sam Atkins <sam@ladybird.org> |
5 | | * Copyright (c) 2022-2023, MacDue <macdue@dueutil.tech> |
6 | | * |
7 | | * SPDX-License-Identifier: BSD-2-Clause |
8 | | */ |
9 | | |
10 | | #include "UnresolvedStyleValue.h" |
11 | | #include <AK/StringBuilder.h> |
12 | | |
13 | | namespace Web::CSS { |
14 | | |
15 | | String UnresolvedStyleValue::to_string() const |
16 | 0 | { |
17 | 0 | if (m_original_source_text.has_value()) |
18 | 0 | return *m_original_source_text; |
19 | | |
20 | 0 | return MUST(String::join(' ', m_values)); |
21 | 0 | } |
22 | | |
23 | | bool UnresolvedStyleValue::equals(CSSStyleValue const& other) const |
24 | 0 | { |
25 | 0 | if (type() != other.type()) |
26 | 0 | return false; |
27 | | // This is a case where comparing the strings actually makes sense. |
28 | 0 | return to_string() == other.to_string(); |
29 | 0 | } |
30 | | |
31 | | } |