mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
61
Libraries/LibWeb/CSS/Parser/ComponentValue.cpp
Normal file
61
Libraries/LibWeb/CSS/Parser/ComponentValue.cpp
Normal file
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* Copyright (c) 2020-2021, the SerenityOS developers.
|
||||
* Copyright (c) 2021-2023, Sam Atkins <atkinssj@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/CSS/Parser/ComponentValue.h>
|
||||
|
||||
namespace Web::CSS::Parser {
|
||||
|
||||
ComponentValue::ComponentValue(Token token)
|
||||
: m_value(token)
|
||||
{
|
||||
}
|
||||
ComponentValue::ComponentValue(Function&& function)
|
||||
: m_value(move(function))
|
||||
{
|
||||
}
|
||||
ComponentValue::ComponentValue(SimpleBlock&& block)
|
||||
: m_value(move(block))
|
||||
{
|
||||
}
|
||||
|
||||
ComponentValue::~ComponentValue() = default;
|
||||
|
||||
bool ComponentValue::is_function(StringView name) const
|
||||
{
|
||||
return is_function() && function().name.equals_ignoring_ascii_case(name);
|
||||
}
|
||||
|
||||
bool ComponentValue::is_ident(StringView ident) const
|
||||
{
|
||||
return is(Token::Type::Ident) && token().ident().equals_ignoring_ascii_case(ident);
|
||||
}
|
||||
|
||||
String ComponentValue::to_string() const
|
||||
{
|
||||
return m_value.visit([](auto const& it) { return it.to_string(); });
|
||||
}
|
||||
|
||||
String ComponentValue::to_debug_string() const
|
||||
{
|
||||
return m_value.visit(
|
||||
[](Token const& token) {
|
||||
return MUST(String::formatted("Token: {}", token.to_debug_string()));
|
||||
},
|
||||
[](SimpleBlock const& block) {
|
||||
return MUST(String::formatted("Block: {}", block.to_string()));
|
||||
},
|
||||
[](Function const& function) {
|
||||
return MUST(String::formatted("Function: {}", function.to_string()));
|
||||
});
|
||||
}
|
||||
|
||||
String ComponentValue::original_source_text() const
|
||||
{
|
||||
return m_value.visit([](auto const& it) { return it.original_source_text(); });
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue