#ifndef CSSStyleRule_h
#define CSSStyleRule_h
#include "core/css/CSSRule.h"
#include "heap/Handle.h"
namespace WebCore {
class CSSStyleDeclaration;
class StyleRuleCSSStyleDeclaration;
class StyleRule;
class CSSStyleRule FINAL : public CSSRule {
public:
static PassRefPtrWillBeRawPtr<CSSStyleRule> create(StyleRule* rule, CSSStyleSheet* sheet)
{
return adoptRefWillBeNoop(new CSSStyleRule(rule, sheet));
}
virtual ~CSSStyleRule();
virtual CSSRule::Type type() const OVERRIDE { return STYLE_RULE; }
virtual String cssText() const OVERRIDE;
virtual void reattach(StyleRuleBase*) OVERRIDE;
String selectorText() const;
void setSelectorText(const String&);
CSSStyleDeclaration* style() const;
StyleRule* styleRule() const { return m_styleRule.get(); }
virtual void trace(Visitor*) OVERRIDE;
private:
CSSStyleRule(StyleRule*, CSSStyleSheet*);
String generateSelectorText() const;
RefPtrWillBeMember<StyleRule> m_styleRule;
mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
};
DEFINE_CSS_RULE_TYPE_CASTS(CSSStyleRule, STYLE_RULE);
}
#endif