/* * Copyright (c) 2018-2020, Andreas Kling * Copyright (c) 2021, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include namespace Web::CSS { class CSSStyleRule : public CSSRule { AK_MAKE_NONCOPYABLE(CSSStyleRule); AK_MAKE_NONMOVABLE(CSSStyleRule); public: static NonnullRefPtr create(Vector&& selectors, NonnullRefPtr&& declaration) { return adopt_ref(*new CSSStyleRule(move(selectors), move(declaration))); } ~CSSStyleRule(); const Vector& selectors() const { return m_selectors; } const CSSStyleDeclaration& declaration() const { return m_declaration; } virtual StringView class_name() const { return "CSSStyleRule"; }; virtual Type type() const { return Type::Style; }; private: CSSStyleRule(Vector&&, NonnullRefPtr&&); Vector m_selectors; NonnullRefPtr m_declaration; }; template<> inline bool CSSRule::fast_is() const { return type() == CSSRule::Type::Style; } }