2021-03-09 17:36:21 +01:00
|
|
|
/*
|
2021-04-28 22:46:44 +02:00
|
|
|
* Copyright (c) 2020-2021, the SerenityOS developers.
|
2021-06-30 16:27:37 +01:00
|
|
|
* Copyright (c) 2021, Sam Atkins <atkinssj@gmail.com>
|
2021-03-09 17:36:21 +01:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2021-03-09 17:36:21 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AK/String.h>
|
|
|
|
#include <AK/Vector.h>
|
|
|
|
|
|
|
|
namespace Web::CSS {
|
|
|
|
|
|
|
|
class StyleComponentValueRule;
|
|
|
|
|
|
|
|
class StyleFunctionRule {
|
|
|
|
friend class Parser;
|
|
|
|
|
|
|
|
public:
|
|
|
|
StyleFunctionRule();
|
|
|
|
~StyleFunctionRule();
|
|
|
|
|
2021-06-30 16:27:37 +01:00
|
|
|
String const& name() const { return m_name; }
|
|
|
|
Vector<String> const& values() const { return m_values; }
|
|
|
|
// FIXME: This method is a temporary hack while much of the parser still expects a string, rather than tokens.
|
|
|
|
String values_as_string() const
|
|
|
|
{
|
|
|
|
StringBuilder builder;
|
|
|
|
for (auto& value : m_values)
|
|
|
|
builder.append(value);
|
|
|
|
return builder.to_string();
|
|
|
|
}
|
|
|
|
|
2021-03-09 17:36:21 +01:00
|
|
|
String to_string() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
String m_name;
|
|
|
|
Vector<String> m_values;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|