diff options
Diffstat (limited to 'Source/WebCore/css/CSSPageRule.cpp')
-rw-r--r-- | Source/WebCore/css/CSSPageRule.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Source/WebCore/css/CSSPageRule.cpp b/Source/WebCore/css/CSSPageRule.cpp index 4895e8b20..e1012b04c 100644 --- a/Source/WebCore/css/CSSPageRule.cpp +++ b/Source/WebCore/css/CSSPageRule.cpp @@ -29,12 +29,11 @@ #include "PropertySetCSSStyleDeclaration.h" #include "StyleProperties.h" #include "StyleRule.h" -#include <wtf/Vector.h> #include <wtf/text/StringBuilder.h> namespace WebCore { -CSSPageRule::CSSPageRule(StyleRulePage* pageRule, CSSStyleSheet* parent) +CSSPageRule::CSSPageRule(StyleRulePage& pageRule, CSSStyleSheet* parent) : CSSRule(parent) , m_pageRule(pageRule) { @@ -46,11 +45,11 @@ CSSPageRule::~CSSPageRule() m_propertiesCSSOMWrapper->clearParentRule(); } -CSSStyleDeclaration* CSSPageRule::style() +CSSStyleDeclaration& CSSPageRule::style() { if (!m_propertiesCSSOMWrapper) m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_pageRule->mutableProperties(), *this); - return m_propertiesCSSOMWrapper.get(); + return *m_propertiesCSSOMWrapper; } String CSSPageRule::selectorText() const @@ -94,13 +93,11 @@ String CSSPageRule::cssText() const return result.toString(); } -void CSSPageRule::reattach(StyleRuleBase* rule) +void CSSPageRule::reattach(StyleRuleBase& rule) { - ASSERT(rule); - ASSERT_WITH_SECURITY_IMPLICATION(rule->isPageRule()); - m_pageRule = static_cast<StyleRulePage*>(rule); + m_pageRule = downcast<StyleRulePage>(rule); if (m_propertiesCSSOMWrapper) - m_propertiesCSSOMWrapper->reattach(m_pageRule->mutableProperties()); + m_propertiesCSSOMWrapper->reattach(m_pageRule.get().mutableProperties()); } } // namespace WebCore |