OLD | NEW |
---|---|
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 Loading... | |
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/css/StylePropertySet.h" | 33 #include "core/css/StylePropertySet.h" |
33 #include "core/css/parser/CSSParser.h" | 34 #include "core/css/parser/CSSParser.h" |
34 #include "core/dom/ExceptionCode.h" | 35 #include "core/dom/ExceptionCode.h" |
35 #include "core/frame/UseCounter.h" | 36 #include "core/frame/UseCounter.h" |
36 #include "wtf/text/StringBuilder.h" | 37 #include "wtf/text/StringBuilder.h" |
37 | 38 |
38 namespace blink { | 39 namespace blink { |
39 | 40 |
40 StyleKeyframe::StyleKeyframe() | 41 StyleKeyframe::StyleKeyframe() |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
145 #if !ENABLE(OILPAN) | 146 #if !ENABLE(OILPAN) |
146 if (m_propertiesCSSOMWrapper) | 147 if (m_propertiesCSSOMWrapper) |
147 m_propertiesCSSOMWrapper->clearParentRule(); | 148 m_propertiesCSSOMWrapper->clearParentRule(); |
148 #endif | 149 #endif |
149 } | 150 } |
150 | 151 |
151 void CSSKeyframeRule::setKeyText(const String& keyText, ExceptionState& exceptio nState) | 152 void CSSKeyframeRule::setKeyText(const String& keyText, ExceptionState& exceptio nState) |
152 { | 153 { |
153 if (!m_keyframe->setKeyText(keyText)) | 154 if (!m_keyframe->setKeyText(keyText)) |
154 exceptionState.throwDOMException(SyntaxError, "The key '" + keyText + "' is invalid and cannot be parsed"); | 155 exceptionState.throwDOMException(SyntaxError, "The key '" + keyText + "' is invalid and cannot be parsed"); |
156 | |
157 CSSStyleSheet::RuleMutationScope mutationScope(this); | |
dstockwell
2015/01/07 00:18:33
Is this needed? If it is, appears as though it sho
shend
2015/01/08 05:05:29
Oops, you're right.
| |
158 | |
159 CSSKeyframesRule* parent = toCSSKeyframesRule(parentRule()); | |
160 parent->m_keyframesRule->styleChanged(); | |
shend
2015/01/06 00:36:18
Should we move this logic into StyleKeyframe so th
| |
155 } | 161 } |
156 | 162 |
157 CSSStyleDeclaration* CSSKeyframeRule::style() const | 163 CSSStyleDeclaration* CSSKeyframeRule::style() const |
158 { | 164 { |
159 if (!m_propertiesCSSOMWrapper) | 165 if (!m_propertiesCSSOMWrapper) |
160 m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_keyfra me->mutableProperties(), const_cast<CSSKeyframeRule*>(this)); | 166 m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_keyfra me->mutableProperties(), const_cast<CSSKeyframeRule*>(this)); |
161 return m_propertiesCSSOMWrapper.get(); | 167 return m_propertiesCSSOMWrapper.get(); |
162 } | 168 } |
163 | 169 |
164 void CSSKeyframeRule::reattach(StyleRuleBase*) | 170 void CSSKeyframeRule::reattach(StyleRuleBase*) |
165 { | 171 { |
166 // No need to reattach, the underlying data is shareable on mutation. | 172 // No need to reattach, the underlying data is shareable on mutation. |
167 ASSERT_NOT_REACHED(); | 173 ASSERT_NOT_REACHED(); |
168 } | 174 } |
169 | 175 |
170 void CSSKeyframeRule::trace(Visitor* visitor) | 176 void CSSKeyframeRule::trace(Visitor* visitor) |
171 { | 177 { |
172 visitor->trace(m_keyframe); | 178 visitor->trace(m_keyframe); |
173 visitor->trace(m_propertiesCSSOMWrapper); | 179 visitor->trace(m_propertiesCSSOMWrapper); |
174 CSSRule::trace(visitor); | 180 CSSRule::trace(visitor); |
175 } | 181 } |
176 | 182 |
177 } // namespace blink | 183 } // namespace blink |
OLD | NEW |