ladybird/Userland/Libraries/LibWeb/CSS/Parser/StyleRule.h
Hendiadyoin1 89086c337c LibWeb: Fix constness of return type from StyleRule::block()
We want to return a view to a constant object, not a constant view,
which we can implicitly copy to get a mutable reference to the object.

Clang-Tidy helpfully pointed this out.
2022-03-21 12:49:00 +01:00

41 lines
876 B
C++

/*
* Copyright (c) 2020-2021, the SerenityOS developers.
* Copyright (c) 2021, Sam Atkins <atkinssj@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/RefCounted.h>
#include <AK/Vector.h>
#include <LibWeb/CSS/Parser/StyleBlockRule.h>
#include <LibWeb/CSS/Parser/StyleComponentValueRule.h>
namespace Web::CSS {
class StyleRule : public RefCounted<StyleRule> {
friend class Parser;
public:
enum class Type {
At,
Qualified,
};
StyleRule(Type);
~StyleRule();
Vector<StyleComponentValueRule> const& prelude() const { return m_prelude; }
RefPtr<StyleBlockRule const> block() const { return m_block; }
String to_string() const;
private:
Type const m_type;
String m_name; // At-rules only
Vector<StyleComponentValueRule> m_prelude;
RefPtr<StyleBlockRule> m_block;
};
}