#ifndef TreeBoundaryCrossingRules_h
#define TreeBoundaryCrossingRules_h
#include "core/css/RuleSet.h"
#include "core/dom/DocumentOrderedList.h"
#include "wtf/OwnPtr.h"
#include "wtf/RefPtr.h"
#include "wtf/Vector.h"
namespace WebCore {
class ContainerNode;
class RuleFeatureSet;
class TreeBoundaryCrossingRules {
DISALLOW_ALLOCATION();
public:
void addRule(StyleRule*, size_t selectorIndex, ContainerNode* scopingNode, AddRuleFlags);
void clear() { m_treeBoundaryCrossingRuleSetMap.clear(); }
void reset(const ContainerNode* scopingNode);
bool isEmpty() const { return m_treeBoundaryCrossingRuleSetMap.isEmpty(); }
void collectFeaturesTo(RuleFeatureSet&);
DocumentOrderedList::iterator begin() { return m_scopingNodes.begin(); }
DocumentOrderedList::iterator end() { return m_scopingNodes.end(); }
size_t size() const { return m_scopingNodes.size(); }
RuleSet* ruleSetScopedBy(const ContainerNode* scopingNode) { return m_treeBoundaryCrossingRuleSetMap.get(scopingNode); }
void trace(Visitor* visitor) { visitor->trace(m_treeBoundaryCrossingRuleSetMap); }
private:
DocumentOrderedList m_scopingNodes;
typedef WillBeHeapHashMap<const ContainerNode*, OwnPtrWillBeMember<RuleSet> > TreeBoundaryCrossingRuleSetMap;
TreeBoundaryCrossingRuleSetMap m_treeBoundaryCrossingRuleSetMap;
};
}
#endif