2021-03-09 13:36:21 -03:00
|
|
|
/*
|
2021-04-28 17:46:44 -03:00
|
|
|
* Copyright (c) 2020-2021, the SerenityOS developers.
|
2021-03-09 13:36:21 -03:00
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2021-03-09 13:36:21 -03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <AK/String.h>
|
|
|
|
|
#include <AK/Vector.h>
|
2022-02-12 11:53:59 -03:00
|
|
|
#include <LibWeb/CSS/CSSStyleDeclaration.h>
|
2022-03-31 07:43:07 -03:00
|
|
|
#include <LibWeb/CSS/Parser/ComponentValue.h>
|
2021-03-09 13:36:21 -03:00
|
|
|
|
2022-04-12 10:51:19 -03:00
|
|
|
namespace Web::CSS::Parser {
|
2021-03-09 13:36:21 -03:00
|
|
|
|
2022-03-31 10:36:12 -03:00
|
|
|
class Declaration {
|
2021-03-09 13:36:21 -03:00
|
|
|
public:
|
2022-04-12 12:16:55 -03:00
|
|
|
Declaration(FlyString name, Vector<ComponentValue> values, Important);
|
2022-03-31 10:36:12 -03:00
|
|
|
~Declaration();
|
2021-03-09 13:36:21 -03:00
|
|
|
|
2022-04-12 12:09:18 -03:00
|
|
|
StringView name() const { return m_name; }
|
2022-04-12 10:51:19 -03:00
|
|
|
Vector<ComponentValue> const& values() const { return m_values; }
|
2022-03-31 10:41:39 -03:00
|
|
|
Important importance() const { return m_important; }
|
|
|
|
|
|
2021-03-09 13:36:21 -03:00
|
|
|
String to_string() const;
|
|
|
|
|
|
|
|
|
|
private:
|
2022-04-12 12:09:18 -03:00
|
|
|
FlyString m_name;
|
2022-04-12 10:51:19 -03:00
|
|
|
Vector<ComponentValue> m_values;
|
2022-02-12 11:53:59 -03:00
|
|
|
Important m_important { Important::No };
|
2021-03-09 13:36:21 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|