DocumentRuleSets.h [plain text]
#ifndef DocumentRuleSets_h
#define DocumentRuleSets_h
#include "RuleFeature.h"
#include "RuleSet.h"
#include <memory>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
namespace WebCore {
class CSSStyleRule;
class CSSStyleSheet;
class DocumentStyleSheetCollection;
class InspectorCSSOMWrappers;
class MediaQueryEvaluator;
class RuleSet;
class DocumentRuleSets {
public:
DocumentRuleSets();
~DocumentRuleSets();
RuleSet* authorStyle() const { return m_authorStyle.get(); }
RuleSet* userStyle() const { return m_userStyle.get(); }
RuleFeatureSet& features() { return m_features; }
const RuleFeatureSet& features() const { return m_features; }
RuleSet* sibling() const { return m_siblingRuleSet.get(); }
RuleSet* uncommonAttribute() const { return m_uncommonAttributeRuleSet.get(); }
void initUserStyle(DocumentStyleSheetCollection&, const MediaQueryEvaluator&, StyleResolver&);
void resetAuthorStyle();
void appendAuthorStyleSheets(unsigned firstNew, const Vector<RefPtr<CSSStyleSheet>>&, MediaQueryEvaluator*, InspectorCSSOMWrappers&, StyleResolver*);
void collectFeatures();
private:
void collectRulesFromUserStyleSheets(const Vector<RefPtr<CSSStyleSheet>>&, RuleSet& userStyle, const MediaQueryEvaluator&, StyleResolver&);
std::unique_ptr<RuleSet> m_authorStyle;
std::unique_ptr<RuleSet> m_userStyle;
RuleFeatureSet m_features;
std::unique_ptr<RuleSet> m_siblingRuleSet;
std::unique_ptr<RuleSet> m_uncommonAttributeRuleSet;
};
}
#endif // DocumentRuleSets_h