2023-03-24 20:53:41 -03:00
|
|
|
/*
|
2024-10-04 08:19:50 -03:00
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <andreas@ladybird.org>
|
2023-03-24 20:53:41 -03:00
|
|
|
* Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
|
2025-03-06 13:09:18 -03:00
|
|
|
* Copyright (c) 2021-2025, Sam Atkins <sam@ladybird.org>
|
2023-03-24 20:53:41 -03:00
|
|
|
* Copyright (c) 2022-2023, MacDue <macdue@dueutil.tech>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <AK/Vector.h>
|
|
|
|
|
#include <LibWeb/CSS/Parser/ComponentValue.h>
|
2025-08-08 06:11:51 -03:00
|
|
|
#include <LibWeb/CSS/StyleValues/StyleValue.h>
|
2023-03-24 20:53:41 -03:00
|
|
|
|
|
|
|
|
namespace Web::CSS {
|
|
|
|
|
|
2025-08-08 06:11:51 -03:00
|
|
|
class UnresolvedStyleValue final : public StyleValue {
|
2023-03-24 20:53:41 -03:00
|
|
|
public:
|
2026-03-28 06:54:43 -03:00
|
|
|
static ValueComparingNonnullRefPtr<UnresolvedStyleValue const> create(Vector<Parser::ComponentValue>&& values, Parser::SubstitutionFunctionsPresence, Optional<String> original_source_text = {});
|
2023-03-24 20:53:41 -03:00
|
|
|
virtual ~UnresolvedStyleValue() override = default;
|
|
|
|
|
|
2026-01-08 09:02:18 -03:00
|
|
|
virtual void serialize(StringBuilder&, SerializationMode) const override;
|
2025-07-10 08:17:27 -03:00
|
|
|
virtual Vector<Parser::ComponentValue> tokenize() const override { return m_values; }
|
2023-03-24 20:53:41 -03:00
|
|
|
|
|
|
|
|
Vector<Parser::ComponentValue> const& values() const { return m_values; }
|
2025-07-27 14:40:17 -03:00
|
|
|
bool contains_arbitrary_substitution_function() const { return m_substitution_functions_presence.has_any(); }
|
2025-07-27 14:41:21 -03:00
|
|
|
bool includes_attr_function() const { return m_substitution_functions_presence.attr; }
|
2026-03-14 00:04:41 -03:00
|
|
|
bool includes_inherit_function() const { return m_substitution_functions_presence.inherit; }
|
2026-03-02 00:39:11 -03:00
|
|
|
bool includes_if_function() const { return m_substitution_functions_presence.if_; }
|
2025-07-27 14:41:21 -03:00
|
|
|
bool includes_var_function() const { return m_substitution_functions_presence.var; }
|
2023-03-24 20:53:41 -03:00
|
|
|
|
2025-08-08 06:11:51 -03:00
|
|
|
virtual bool equals(StyleValue const& other) const override;
|
2023-03-24 20:53:41 -03:00
|
|
|
|
2025-09-25 09:00:43 -03:00
|
|
|
virtual GC::Ref<CSSStyleValue> reify(JS::Realm&, FlyString const& associated_property) const override;
|
2025-08-14 13:25:29 -03:00
|
|
|
|
2026-03-08 00:19:00 -03:00
|
|
|
virtual bool is_computationally_independent() const override { VERIFY_NOT_REACHED(); }
|
|
|
|
|
|
2023-03-24 20:53:41 -03:00
|
|
|
private:
|
2025-07-27 14:40:17 -03:00
|
|
|
UnresolvedStyleValue(Vector<Parser::ComponentValue>&& values, Parser::SubstitutionFunctionsPresence, Optional<String> original_source_text);
|
2023-03-24 20:53:41 -03:00
|
|
|
|
|
|
|
|
Vector<Parser::ComponentValue> m_values;
|
2025-07-27 14:40:17 -03:00
|
|
|
Parser::SubstitutionFunctionsPresence m_substitution_functions_presence {};
|
2024-10-14 12:23:35 -03:00
|
|
|
Optional<String> m_original_source_text;
|
2023-03-24 20:53:41 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|