ladybird/Libraries/LibWeb/CSS/CSSLayerStatementRule.h
Sam Atkins 180cd4b799 LibWeb: Move CSSRule dumping code into CSSRule classes
Having the dumping code in a separate Dump.cpp meant that it was often
overlooked when the rules gained new features, and also limits dumping
to publicly-accessible information.
2025-12-04 16:24:04 +00:00

37 lines
1 KiB
C++

/*
* Copyright (c) 2024, Sam Atkins <sam@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/CSS/CSSRule.h>
namespace Web::CSS {
// https://drafts.csswg.org/css-cascade-5/#the-csslayerstatementrule-interface
class CSSLayerStatementRule final : public CSSRule {
WEB_PLATFORM_OBJECT(CSSLayerStatementRule, CSSRule);
GC_DECLARE_ALLOCATOR(CSSLayerStatementRule);
public:
[[nodiscard]] static GC::Ref<CSSLayerStatementRule> create(JS::Realm&, Vector<FlyString> name_list);
virtual ~CSSLayerStatementRule() = default;
// FIXME: Should be FrozenArray
ReadonlySpan<FlyString> name_list() const { return m_name_list; }
Vector<FlyString> internal_qualified_name_list(Badge<StyleScope>) const;
private:
CSSLayerStatementRule(JS::Realm&, Vector<FlyString> name_list);
virtual void initialize(JS::Realm&) override;
virtual String serialized() const override;
virtual void dump(StringBuilder&, int indent_levels) const override;
Vector<FlyString> m_name_list;
};
}