LibWeb: Add accessors to CSS::DeclarationOrAtRule

This commit is contained in:
Sam Atkins 2021-07-08 21:53:10 +01:00 committed by Andreas Kling
parent 6d14791c40
commit 2c84379846
Notes: sideshowbarker 2024-07-18 09:13:56 +09:00

View File

@ -24,6 +24,21 @@ public:
Declaration,
};
bool is_at_rule() const { return m_type == DeclarationType::At; }
bool is_declaration() const { return m_type == DeclarationType::Declaration; }
StyleRule const& at_rule() const
{
VERIFY(is_at_rule());
return *m_at;
}
StyleDeclarationRule const& declaration() const
{
VERIFY(is_declaration());
return m_declaration;
}
String to_string() const;
private: