PageRuleCollector.h [plain text]
#pragma once
#include "StyleResolver.h"
#include "StyleScopeRuleSets.h"
#include <wtf/Forward.h>
namespace WebCore {
class StyleRulePage;
namespace Style {
class PageRuleCollector {
public:
PageRuleCollector(Resolver::State& state, ScopeRuleSets& ruleSets)
: m_state(state)
, m_ruleSets(ruleSets) { }
void matchAllPageRules(int pageIndex);
const MatchResult& matchResult() const { return m_result; }
private:
bool isLeftPage(int pageIndex) const;
bool isRightPage(int pageIndex) const { return !isLeftPage(pageIndex); }
bool isFirstPage(int pageIndex) const;
String pageName(int pageIndex) const;
void matchPageRules(RuleSet* rules, bool isLeftPage, bool isFirstPage, const String& pageName);
void matchPageRulesForList(Vector<StyleRulePage*>& matchedRules, const Vector<StyleRulePage*>& rules, bool isLeftPage, bool isFirstPage, const String& pageName);
const Resolver::State& m_state;
ScopeRuleSets& m_ruleSets;
MatchResult m_result;
};
} }