#ifndef RuleFeature_h
#define RuleFeature_h
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/text/AtomicString.h>
namespace WebCore {
class StyleRule;
class CSSSelector;
struct RuleFeature {
RuleFeature(StyleRule* rule, unsigned selectorIndex, bool hasDocumentSecurityOrigin)
: rule(rule)
, selectorIndex(selectorIndex)
, hasDocumentSecurityOrigin(hasDocumentSecurityOrigin)
{
}
StyleRule* rule;
unsigned selectorIndex;
bool hasDocumentSecurityOrigin;
};
struct RuleFeatureSet {
RuleFeatureSet()
: usesFirstLineRules(false)
, usesBeforeAfterRules(false)
{ }
void add(const RuleFeatureSet&);
void clear();
void collectFeaturesFromSelector(const CSSSelector*);
HashSet<AtomicStringImpl*> idsInRules;
HashSet<AtomicStringImpl*> classesInRules;
HashSet<AtomicStringImpl*> attrsInRules;
Vector<RuleFeature> siblingRules;
Vector<RuleFeature> uncommonAttributeRules;
bool usesFirstLineRules;
bool usesBeforeAfterRules;
};
}
#endif // RuleFeature_h