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

Side by Side Diff: Source/core/css/CSSKeyframeRule.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 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 10 matching lines...) Expand all
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #include "config.h" 26 #include "config.h"
27 #include "core/css/CSSKeyframeRule.h" 27 #include "core/css/CSSKeyframeRule.h"
28 28
29 #include "bindings/core/v8/ExceptionState.h" 29 #include "bindings/core/v8/ExceptionState.h"
30 #include "core/css/CSSKeyframesRule.h" 30 #include "core/css/CSSKeyframesRule.h"
31 #include "core/css/CSSStyleSheet.h"
31 #include "core/css/PropertySetCSSStyleDeclaration.h" 32 #include "core/css/PropertySetCSSStyleDeclaration.h"
32 #include "core/dom/ExceptionCode.h" 33 #include "core/dom/ExceptionCode.h"
33 34
34 namespace blink { 35 namespace blink {
35 36
36 CSSKeyframeRule::CSSKeyframeRule(StyleRuleKeyframe* keyframe, CSSKeyframesRule* parent) 37 CSSKeyframeRule::CSSKeyframeRule(StyleRuleKeyframe* keyframe, CSSKeyframesRule* parent)
37 : CSSRule(0) 38 : CSSRule(0)
38 , m_keyframe(keyframe) 39 , m_keyframe(keyframe)
39 { 40 {
40 setParentRule(parent); 41 setParentRule(parent);
41 } 42 }
42 43
43 CSSKeyframeRule::~CSSKeyframeRule() 44 CSSKeyframeRule::~CSSKeyframeRule()
44 { 45 {
45 #if !ENABLE(OILPAN) 46 #if !ENABLE(OILPAN)
46 if (m_propertiesCSSOMWrapper) 47 if (m_propertiesCSSOMWrapper)
47 m_propertiesCSSOMWrapper->clearParentRule(); 48 m_propertiesCSSOMWrapper->clearParentRule();
48 #endif 49 #endif
49 } 50 }
50 51
51 void CSSKeyframeRule::setKeyText(const String& keyText, ExceptionState& exceptio nState) 52 void CSSKeyframeRule::setKeyText(const String& keyText, ExceptionState& exceptio nState)
52 { 53 {
53 if (!m_keyframe->setKeyText(keyText)) 54 if (!m_keyframe->setKeyText(keyText))
54 exceptionState.throwDOMException(SyntaxError, "The key '" + keyText + "' is invalid and cannot be parsed"); 55 exceptionState.throwDOMException(SyntaxError, "The key '" + keyText + "' is invalid and cannot be parsed");
56
57 CSSKeyframesRule* parent = toCSSKeyframesRule(parentRule());
58 parent->m_keyframesRule->styleChanged();
55 } 59 }
56 60
57 CSSStyleDeclaration* CSSKeyframeRule::style() const 61 CSSStyleDeclaration* CSSKeyframeRule::style() const
58 { 62 {
59 if (!m_propertiesCSSOMWrapper) 63 if (!m_propertiesCSSOMWrapper)
60 m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_keyfra me->mutableProperties(), const_cast<CSSKeyframeRule*>(this)); 64 m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_keyfra me->mutableProperties(), const_cast<CSSKeyframeRule*>(this));
61 return m_propertiesCSSOMWrapper.get(); 65 return m_propertiesCSSOMWrapper.get();
62 } 66 }
63 67
64 void CSSKeyframeRule::reattach(StyleRuleBase*) 68 void CSSKeyframeRule::reattach(StyleRuleBase*)
65 { 69 {
66 // No need to reattach, the underlying data is shareable on mutation. 70 // No need to reattach, the underlying data is shareable on mutation.
67 ASSERT_NOT_REACHED(); 71 ASSERT_NOT_REACHED();
68 } 72 }
69 73
70 void CSSKeyframeRule::trace(Visitor* visitor) 74 void CSSKeyframeRule::trace(Visitor* visitor)
71 { 75 {
72 visitor->trace(m_keyframe); 76 visitor->trace(m_keyframe);
73 visitor->trace(m_propertiesCSSOMWrapper); 77 visitor->trace(m_propertiesCSSOMWrapper);
74 CSSRule::trace(visitor); 78 CSSRule::trace(visitor);
75 } 79 }
76 80
77 } // namespace blink 81 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698