mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb/CSS: Include guaranteed-invalid value in ComponentValue
Treating these like any other ComponentValue means not having to convert between different types of Vector, and that we will be able to use TokenStream to parse the "argument grammars" of arbitrary substitution functions.
This commit is contained in:
committed by
Tim Ledbetter
parent
b5ed910f1f
commit
9079be850b
Notes:
github-actions[bot]
2025-07-09 15:46:20 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/9079be850b3 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5226 Reviewed-by: https://github.com/tcl3 ✅
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2020-2021, the SerenityOS developers.
|
||||
* Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
|
||||
* Copyright (c) 2021-2025, Sam Atkins <sam@ladybird.org>
|
||||
* Copyright (c) 2023, Andreas Kling <andreas@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
@@ -24,6 +24,7 @@ public:
|
||||
ComponentValue(Token);
|
||||
explicit ComponentValue(Function&&);
|
||||
explicit ComponentValue(SimpleBlock&&);
|
||||
explicit ComponentValue(GuaranteedInvalidValue&&);
|
||||
~ComponentValue();
|
||||
|
||||
bool is_block() const { return m_value.has<SimpleBlock>(); }
|
||||
@@ -40,12 +41,15 @@ public:
|
||||
Token const& token() const { return m_value.get<Token>(); }
|
||||
operator Token() const { return m_value.get<Token>(); }
|
||||
|
||||
bool is_guaranteed_invalid() const { return m_value.has<GuaranteedInvalidValue>(); }
|
||||
bool contains_guaranteed_invalid_value() const;
|
||||
|
||||
String to_string() const;
|
||||
String to_debug_string() const;
|
||||
String original_source_text() const;
|
||||
|
||||
private:
|
||||
Variant<Token, Function, SimpleBlock> m_value;
|
||||
Variant<Token, Function, SimpleBlock, GuaranteedInvalidValue> m_value;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user