mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 11:27:34 +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:
parent
69496f4afd
commit
269810b954
5 changed files with 27 additions and 21 deletions
|
@ -36,7 +36,7 @@ public:
|
|||
Declaration const& declaration() const
|
||||
{
|
||||
VERIFY(is_declaration());
|
||||
return m_declaration;
|
||||
return *m_declaration;
|
||||
}
|
||||
|
||||
String to_string() const;
|
||||
|
@ -44,7 +44,7 @@ public:
|
|||
private:
|
||||
DeclarationType m_type;
|
||||
RefPtr<StyleRule> m_at;
|
||||
Declaration m_declaration;
|
||||
Optional<Declaration> m_declaration;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue