/* * Copyright (c) 2020-2021, the SerenityOS developers. * Copyright (c) 2021, Sam Atkins * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include namespace Web::CSS { class StyleRule : public RefCounted { friend class Parser::Parser; public: enum class Type { At, Qualified, }; StyleRule(Type); ~StyleRule(); bool is_qualified_rule() const { return m_type == Type::Qualified; } bool is_at_rule() const { return m_type == Type::At; } Vector const& prelude() const { return m_prelude; } RefPtr block() const { return m_block; } String const& at_rule_name() const { return m_at_rule_name; } String to_string() const; private: Type const m_type; String m_at_rule_name; Vector m_prelude; RefPtr m_block; }; }