PageRuleCollector.h [plain text]
#ifndef PageRuleCollector_h
#define PageRuleCollector_h
#include "DocumentRuleSets.h"
#include "StyleResolver.h"
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
namespace WebCore {
class StyleRulePage;
class PageRuleCollector {
public:
PageRuleCollector(StyleResolver::State& state, DocumentRuleSets& ruleSets)
: m_state(state)
, m_ruleSets(ruleSets) { }
void matchAllPageRules(int pageIndex);
StyleResolver::MatchResult& matchedResult() { 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 StyleResolver::State& m_state;
DocumentRuleSets& m_ruleSets;
StyleResolver::MatchResult m_result;
};
}
#endif // PageRuleCollector_h