1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:28:11 +00:00

LibWeb: Break friendship between CSS Declaration and Parser

This means deviating slightly from the spec in order to construct a
fully-initialized Declaration instead of creating an empty one and then
poking at its internals.

DeclarationOrAtRule should probably use a Variant, but for now, making
its Declaration member optional is quick and easy.
This commit is contained in:
Sam Atkins 2022-04-12 16:16:55 +01:00 committed by Andreas Kling
parent 69496f4afd
commit 269810b954
5 changed files with 27 additions and 21 deletions

View file

@ -10,7 +10,13 @@
namespace Web::CSS::Parser {
Declaration::Declaration() = default;
Declaration::Declaration(FlyString name, Vector<ComponentValue> values, Important important)
: m_name(move(name))
, m_values(move(values))
, m_important(move(important))
{
}
Declaration::~Declaration() = default;
String Declaration::to_string() const