2019-06-20 18:25:25 -03:00
|
|
|
#pragma once
|
|
|
|
|
|
2019-09-06 10:34:26 -03:00
|
|
|
#include <AK/String.h>
|
2019-06-20 18:25:25 -03:00
|
|
|
#include <LibHTML/CSS/StyleValue.h>
|
|
|
|
|
|
2019-09-30 15:06:17 -03:00
|
|
|
struct StyleProperty {
|
2019-10-08 10:34:19 -03:00
|
|
|
CSS::PropertyID property_id;
|
2019-09-30 15:06:17 -03:00
|
|
|
NonnullRefPtr<StyleValue> value;
|
2019-10-06 04:28:10 -03:00
|
|
|
bool important { false };
|
2019-09-30 15:06:17 -03:00
|
|
|
};
|
|
|
|
|
|
2019-06-21 14:19:49 -03:00
|
|
|
class StyleDeclaration : public RefCounted<StyleDeclaration> {
|
2019-06-20 18:25:25 -03:00
|
|
|
public:
|
2019-09-30 15:06:17 -03:00
|
|
|
static NonnullRefPtr<StyleDeclaration> create(Vector<StyleProperty>&& properties)
|
2019-06-21 14:19:49 -03:00
|
|
|
{
|
2019-09-30 15:06:17 -03:00
|
|
|
return adopt(*new StyleDeclaration(move(properties)));
|
2019-06-21 14:19:49 -03:00
|
|
|
}
|
|
|
|
|
|
2019-06-20 18:25:25 -03:00
|
|
|
~StyleDeclaration();
|
|
|
|
|
|
2019-09-30 15:06:17 -03:00
|
|
|
const Vector<StyleProperty>& properties() const { return m_properties; }
|
2019-06-20 18:25:25 -03:00
|
|
|
|
|
|
|
|
public:
|
2019-09-30 15:06:17 -03:00
|
|
|
explicit StyleDeclaration(Vector<StyleProperty>&&);
|
2019-06-21 14:19:49 -03:00
|
|
|
|
2019-09-30 15:06:17 -03:00
|
|
|
Vector<StyleProperty> m_properties;
|
2019-06-20 18:25:25 -03:00
|
|
|
};
|