#ifndef PageRuleCollector_h
#define PageRuleCollector_h
#include "core/css/resolver/MatchResult.h"
#include "wtf/Vector.h"
namespace WebCore {
class ElementResolveContext;
class StyleRulePage;
class PageRuleCollector {
STACK_ALLOCATED();
public:
PageRuleCollector(const RenderStyle* rootElementStyle, int pageIndex);
void matchPageRules(RuleSet* rules);
MatchResult& matchedResult() { return m_result; }
private:
bool isLeftPage(const RenderStyle* rootElementStyle, int pageIndex) const;
bool isRightPage(const RenderStyle* rootElementStyle, int pageIndex) const { return !isLeftPage(rootElementStyle, pageIndex); }
bool isFirstPage(int pageIndex) const;
String pageName(int pageIndex) const;
void matchPageRulesForList(WillBeHeapVector<RawPtrWillBeMember<StyleRulePage> >& matchedRules, const WillBeHeapVector<RawPtrWillBeMember<StyleRulePage> >& rules, bool isLeftPage, bool isFirstPage, const String& pageName);
const bool m_isLeftPage;
const bool m_isFirstPage;
const String m_pageName;
MatchResult m_result;
};
}
#endif