mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-23 17:33:12 +00:00
LibWeb: Rename "var_or_attr" to "arbitrary_substitution_function"
This is the spec term, and will apply to many more things than var() and attr().
This commit is contained in:
parent
8f01297182
commit
b5ed910f1f
Notes:
github-actions[bot]
2025-07-09 15:46:26 +00:00
Author: https://github.com/AtkinsSJ
Commit: b5ed910f1f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5226
Reviewed-by: https://github.com/tcl3 ✅
2 changed files with 8 additions and 8 deletions
|
@ -4222,7 +4222,7 @@ NonnullRefPtr<CSSStyleValue const> Parser::resolve_unresolved_style_value(Parsin
|
||||||
{
|
{
|
||||||
// Unresolved always contains a var() or attr(), unless it is a custom property's value, in which case we shouldn't be trying
|
// Unresolved always contains a var() or attr(), unless it is a custom property's value, in which case we shouldn't be trying
|
||||||
// to produce a different CSSStyleValue from it.
|
// to produce a different CSSStyleValue from it.
|
||||||
VERIFY(unresolved.contains_var_or_attr());
|
VERIFY(unresolved.contains_arbitrary_substitution_function());
|
||||||
|
|
||||||
auto parser = Parser::create(context, ""sv);
|
auto parser = Parser::create(context, ""sv);
|
||||||
return parser.resolve_unresolved_style_value(element, pseudo_element, property_id, unresolved);
|
return parser.resolve_unresolved_style_value(element, pseudo_element, property_id, unresolved);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018-2020, Andreas Kling <andreas@ladybird.org>
|
* Copyright (c) 2018-2020, Andreas Kling <andreas@ladybird.org>
|
||||||
* Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
|
* Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
|
||||||
* Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
|
* Copyright (c) 2021-2025, Sam Atkins <sam@ladybird.org>
|
||||||
* Copyright (c) 2022-2023, MacDue <macdue@dueutil.tech>
|
* Copyright (c) 2022-2023, MacDue <macdue@dueutil.tech>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
@ -17,30 +17,30 @@ namespace Web::CSS {
|
||||||
|
|
||||||
class UnresolvedStyleValue final : public CSSStyleValue {
|
class UnresolvedStyleValue final : public CSSStyleValue {
|
||||||
public:
|
public:
|
||||||
static ValueComparingNonnullRefPtr<UnresolvedStyleValue const> create(Vector<Parser::ComponentValue>&& values, bool contains_var_or_attr, Optional<String> original_source_text)
|
static ValueComparingNonnullRefPtr<UnresolvedStyleValue const> create(Vector<Parser::ComponentValue>&& values, bool contains_arbitrary_substitution_function, Optional<String> original_source_text)
|
||||||
{
|
{
|
||||||
return adopt_ref(*new (nothrow) UnresolvedStyleValue(move(values), contains_var_or_attr, move(original_source_text)));
|
return adopt_ref(*new (nothrow) UnresolvedStyleValue(move(values), contains_arbitrary_substitution_function, move(original_source_text)));
|
||||||
}
|
}
|
||||||
virtual ~UnresolvedStyleValue() override = default;
|
virtual ~UnresolvedStyleValue() override = default;
|
||||||
|
|
||||||
virtual String to_string(SerializationMode) const override;
|
virtual String to_string(SerializationMode) const override;
|
||||||
|
|
||||||
Vector<Parser::ComponentValue> const& values() const { return m_values; }
|
Vector<Parser::ComponentValue> const& values() const { return m_values; }
|
||||||
bool contains_var_or_attr() const { return m_contains_var_or_attr; }
|
bool contains_arbitrary_substitution_function() const { return m_contains_arbitrary_substitution_function; }
|
||||||
|
|
||||||
virtual bool equals(CSSStyleValue const& other) const override;
|
virtual bool equals(CSSStyleValue const& other) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
UnresolvedStyleValue(Vector<Parser::ComponentValue>&& values, bool contains_var_or_attr, Optional<String> original_source_text)
|
UnresolvedStyleValue(Vector<Parser::ComponentValue>&& values, bool contains_arbitrary_substitution_function, Optional<String> original_source_text)
|
||||||
: CSSStyleValue(Type::Unresolved)
|
: CSSStyleValue(Type::Unresolved)
|
||||||
, m_values(move(values))
|
, m_values(move(values))
|
||||||
, m_contains_var_or_attr(contains_var_or_attr)
|
, m_contains_arbitrary_substitution_function(contains_arbitrary_substitution_function)
|
||||||
, m_original_source_text(move(original_source_text))
|
, m_original_source_text(move(original_source_text))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector<Parser::ComponentValue> m_values;
|
Vector<Parser::ComponentValue> m_values;
|
||||||
bool m_contains_var_or_attr { false };
|
bool m_contains_arbitrary_substitution_function { false };
|
||||||
Optional<String> m_original_source_text;
|
Optional<String> m_original_source_text;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue