Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(385)

Unified Diff: Source/core/css/PropertySetCSSStyleDeclaration.cpp

Issue 814083003: Update animation when changes in animation keyframes are detected. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase and address comments Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698