summaryrefslogtreecommitdiff
path: root/Source/WebCore/css/WebKitCSSKeyframesRule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/css/WebKitCSSKeyframesRule.cpp')
-rw-r--r--Source/WebCore/css/WebKitCSSKeyframesRule.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/Source/WebCore/css/WebKitCSSKeyframesRule.cpp b/Source/WebCore/css/WebKitCSSKeyframesRule.cpp
index cbf97d5fa..dcd79034f 100644
--- a/Source/WebCore/css/WebKitCSSKeyframesRule.cpp
+++ b/Source/WebCore/css/WebKitCSSKeyframesRule.cpp
@@ -28,6 +28,7 @@
#include "CSSParser.h"
#include "CSSRuleList.h"
+#include "CSSStyleSheet.h"
#include "StylePropertySet.h"
#include "StyleSheet.h"
#include "WebKitCSSKeyframeRule.h"
@@ -104,12 +105,9 @@ WebKitCSSKeyframesRule::~WebKitCSSKeyframesRule()
void WebKitCSSKeyframesRule::setName(const String& name)
{
- m_keyframesRule->setName(name);
+ CSSStyleSheet::RuleMutationScope mutationScope(this);
- // Since the name is used in the keyframe map list in StyleResolver, we need
- // to recompute the style sheet to get the updated name.
- if (CSSStyleSheet* styleSheet = parentStyleSheet())
- styleSheet->styleSheetChanged();
+ m_keyframesRule->setName(name);
}
void WebKitCSSKeyframesRule::insertRule(const String& ruleText)
@@ -122,6 +120,8 @@ void WebKitCSSKeyframesRule::insertRule(const String& ruleText)
if (!keyframe)
return;
+ CSSStyleSheet::RuleMutationScope mutationScope(this);
+
m_keyframesRule->wrapperAppendKeyframe(keyframe);
m_childRuleCSSOMWrappers.grow(length());
@@ -135,6 +135,8 @@ void WebKitCSSKeyframesRule::deleteRule(const String& s)
if (i < 0)
return;
+ CSSStyleSheet::RuleMutationScope mutationScope(this);
+
m_keyframesRule->wrapperRemoveKeyframe(i);
if (m_childRuleCSSOMWrappers[i])
@@ -190,4 +192,10 @@ CSSRuleList* WebKitCSSKeyframesRule::cssRules()
return m_ruleListCSSOMWrapper.get();
}
+void WebKitCSSKeyframesRule::reattach(StyleRuleKeyframes* rule)
+{
+ ASSERT(rule);
+ m_keyframesRule = rule;
+}
+
} // namespace WebCore