Index: Source/core/css/PropertySetCSSStyleDeclaration.cpp |
diff --git a/Source/core/css/PropertySetCSSStyleDeclaration.cpp b/Source/core/css/PropertySetCSSStyleDeclaration.cpp |
index bfa8e76d7c3947729cf02ed99567dc937cf006d2..0ceef7c01cfcd0490c96e72210acb5256dd8c73e 100644 |
--- a/Source/core/css/PropertySetCSSStyleDeclaration.cpp |
+++ b/Source/core/css/PropertySetCSSStyleDeclaration.cpp |
@@ -24,6 +24,7 @@ |
#include "bindings/core/v8/ExceptionState.h" |
#include "core/HTMLNames.h" |
+#include "core/css/CSSKeyframesRule.h" |
#include "core/css/CSSStyleSheet.h" |
#include "core/css/StylePropertySet.h" |
#include "core/css/parser/CSSParser.h" |
@@ -393,4 +394,73 @@ void InlineCSSStyleDeclaration::trace(Visitor* visitor) |
AbstractPropertySetCSSStyleDeclaration::trace(visitor); |
} |
+KeyframeStyleRuleCSSStyleDeclaration::KeyframeStyleRuleCSSStyleDeclaration(MutableStylePropertySet& propertySetArg, CSSKeyframeRule* parentRule) |
+ : PropertySetCSSStyleDeclaration(propertySetArg) |
+#if !ENABLE(OILPAN) |
+ , m_refCount(1) |
+#endif |
+ , m_parentRule(parentRule) |
+{ |
+#if !ENABLE(OILPAN) |
+ m_propertySet->ref(); |
+#endif |
+} |
+ |
+KeyframeStyleRuleCSSStyleDeclaration::~KeyframeStyleRuleCSSStyleDeclaration() |
+{ |
+#if !ENABLE(OILPAN) |
+ m_propertySet->deref(); |
+#endif |
+} |
+ |
+#if !ENABLE(OILPAN) |
+void KeyframeStyleRuleCSSStyleDeclaration::ref() |
+{ |
+ ++m_refCount; |
+} |
+ |
+void KeyframeStyleRuleCSSStyleDeclaration::deref() |
+{ |
+ ASSERT(m_refCount); |
+ if (!--m_refCount) |
+ delete this; |
+} |
+#endif |
+ |
+void KeyframeStyleRuleCSSStyleDeclaration::willMutate() |
+{ |
+ if (m_parentRule && m_parentRule->parentStyleSheet()) |
+ m_parentRule->parentStyleSheet()->willMutateRules(); |
+} |
+ |
+void KeyframeStyleRuleCSSStyleDeclaration::didMutate(MutationType type) |
+{ |
+ // Style sheet mutation needs to be signaled even if the change failed. willMutateRules/didMutateRules must pair. |
+ if (m_parentRule && m_parentRule->parentStyleSheet()) |
+ m_parentRule->parentStyleSheet()->didMutateRules(); |
+ toCSSKeyframesRule(m_parentRule->parentRule())->styleChanged(); |
+} |
+ |
+CSSStyleSheet* KeyframeStyleRuleCSSStyleDeclaration::parentStyleSheet() const |
+{ |
+ return m_parentRule ? m_parentRule->parentStyleSheet() : 0; |
+} |
+ |
+void KeyframeStyleRuleCSSStyleDeclaration::reattach(MutableStylePropertySet& propertySet) |
+{ |
+#if !ENABLE(OILPAN) |
+ m_propertySet->deref(); |
+#endif |
+ m_propertySet = &propertySet; |
+#if !ENABLE(OILPAN) |
+ m_propertySet->ref(); |
+#endif |
+} |
+ |
+void KeyframeStyleRuleCSSStyleDeclaration::trace(Visitor* visitor) |
+{ |
+ visitor->trace(m_parentRule); |
+ PropertySetCSSStyleDeclaration::trace(visitor); |
+} |
+ |
} // namespace blink |