mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-25 22:08:59 +00:00
Things were getting a little crowded in the project root, so this patch moves the Lib*/ directories into Libraries/.
31 lines
937 B
C++
31 lines
937 B
C++
#pragma once
|
|
|
|
#include <AK/NonnullRefPtrVector.h>
|
|
#include <LibHTML/CSS/Selector.h>
|
|
#include <LibHTML/CSS/StyleDeclaration.h>
|
|
|
|
class StyleRule : public RefCounted<StyleRule> {
|
|
public:
|
|
static NonnullRefPtr<StyleRule> create(Vector<Selector>&& selectors, NonnullRefPtrVector<StyleDeclaration>&& declarations)
|
|
{
|
|
return adopt(*new StyleRule(move(selectors), move(declarations)));
|
|
}
|
|
|
|
~StyleRule();
|
|
|
|
const Vector<Selector>& selectors() const { return m_selectors; }
|
|
const NonnullRefPtrVector<StyleDeclaration>& declarations() const { return m_declarations; }
|
|
|
|
template<typename C>
|
|
void for_each_declaration(C callback) const
|
|
{
|
|
for (auto& declaration : m_declarations)
|
|
callback(declaration);
|
|
}
|
|
|
|
private:
|
|
StyleRule(Vector<Selector>&&, NonnullRefPtrVector<StyleDeclaration>&&);
|
|
|
|
Vector<Selector> m_selectors;
|
|
NonnullRefPtrVector<StyleDeclaration> m_declarations;
|
|
};
|