| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 , m_name(o.m_name) | 46 , m_name(o.m_name) |
| 47 , m_version(o.m_version) | 47 , m_version(o.m_version) |
| 48 , m_isPrefixed(o.m_isPrefixed) | 48 , m_isPrefixed(o.m_isPrefixed) |
| 49 { | 49 { |
| 50 } | 50 } |
| 51 | 51 |
| 52 StyleRuleKeyframes::~StyleRuleKeyframes() | 52 StyleRuleKeyframes::~StyleRuleKeyframes() |
| 53 { | 53 { |
| 54 } | 54 } |
| 55 | 55 |
| 56 void StyleRuleKeyframes::parserAppendKeyframe(PassRefPtrWillBeRawPtr<StyleRuleKe
yframe> keyframe) | 56 void StyleRuleKeyframes::parserAppendKeyframe(RawPtr<StyleRuleKeyframe> keyframe
) |
| 57 { | 57 { |
| 58 if (!keyframe) | 58 if (!keyframe) |
| 59 return; | 59 return; |
| 60 m_keyframes.append(keyframe); | 60 m_keyframes.append(keyframe); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void StyleRuleKeyframes::wrapperAppendKeyframe(PassRefPtrWillBeRawPtr<StyleRuleK
eyframe> keyframe) | 63 void StyleRuleKeyframes::wrapperAppendKeyframe(RawPtr<StyleRuleKeyframe> keyfram
e) |
| 64 { | 64 { |
| 65 m_keyframes.append(keyframe); | 65 m_keyframes.append(keyframe); |
| 66 styleChanged(); | 66 styleChanged(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void StyleRuleKeyframes::wrapperRemoveKeyframe(unsigned index) | 69 void StyleRuleKeyframes::wrapperRemoveKeyframe(unsigned index) |
| 70 { | 70 { |
| 71 m_keyframes.remove(index); | 71 m_keyframes.remove(index); |
| 72 styleChanged(); | 72 styleChanged(); |
| 73 } | 73 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 m_keyframesRule->setName(name); | 116 m_keyframesRule->setName(name); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void CSSKeyframesRule::appendRule(const String& ruleText) | 119 void CSSKeyframesRule::appendRule(const String& ruleText) |
| 120 { | 120 { |
| 121 ASSERT(m_childRuleCSSOMWrappers.size() == m_keyframesRule->keyframes().size(
)); | 121 ASSERT(m_childRuleCSSOMWrappers.size() == m_keyframesRule->keyframes().size(
)); |
| 122 | 122 |
| 123 CSSStyleSheet* styleSheet = parentStyleSheet(); | 123 CSSStyleSheet* styleSheet = parentStyleSheet(); |
| 124 CSSParserContext context(parserContext(), UseCounter::getFrom(styleSheet)); | 124 CSSParserContext context(parserContext(), UseCounter::getFrom(styleSheet)); |
| 125 RefPtrWillBeRawPtr<StyleRuleKeyframe> keyframe = CSSParser::parseKeyframeRul
e(context, ruleText); | 125 RawPtr<StyleRuleKeyframe> keyframe = CSSParser::parseKeyframeRule(context, r
uleText); |
| 126 if (!keyframe) | 126 if (!keyframe) |
| 127 return; | 127 return; |
| 128 | 128 |
| 129 CSSStyleSheet::RuleMutationScope mutationScope(this); | 129 CSSStyleSheet::RuleMutationScope mutationScope(this); |
| 130 | 130 |
| 131 m_keyframesRule->wrapperAppendKeyframe(keyframe); | 131 m_keyframesRule->wrapperAppendKeyframe(keyframe); |
| 132 | 132 |
| 133 m_childRuleCSSOMWrappers.grow(length()); | 133 m_childRuleCSSOMWrappers.grow(length()); |
| 134 } | 134 } |
| 135 | 135 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 { | 180 { |
| 181 return m_keyframesRule->keyframes().size(); | 181 return m_keyframesRule->keyframes().size(); |
| 182 } | 182 } |
| 183 | 183 |
| 184 CSSKeyframeRule* CSSKeyframesRule::item(unsigned index) const | 184 CSSKeyframeRule* CSSKeyframesRule::item(unsigned index) const |
| 185 { | 185 { |
| 186 if (index >= length()) | 186 if (index >= length()) |
| 187 return nullptr; | 187 return nullptr; |
| 188 | 188 |
| 189 ASSERT(m_childRuleCSSOMWrappers.size() == m_keyframesRule->keyframes().size(
)); | 189 ASSERT(m_childRuleCSSOMWrappers.size() == m_keyframesRule->keyframes().size(
)); |
| 190 RefPtrWillBeMember<CSSKeyframeRule>& rule = m_childRuleCSSOMWrappers[index]; | 190 Member<CSSKeyframeRule>& rule = m_childRuleCSSOMWrappers[index]; |
| 191 if (!rule) | 191 if (!rule) |
| 192 rule = adoptRefWillBeNoop(new CSSKeyframeRule(m_keyframesRule->keyframes
()[index].get(), const_cast<CSSKeyframesRule*>(this))); | 192 rule = (new CSSKeyframeRule(m_keyframesRule->keyframes()[index].get(), c
onst_cast<CSSKeyframesRule*>(this))); |
| 193 | 193 |
| 194 return rule.get(); | 194 return rule.get(); |
| 195 } | 195 } |
| 196 | 196 |
| 197 CSSKeyframeRule* CSSKeyframesRule::anonymousIndexedGetter(unsigned index) const | 197 CSSKeyframeRule* CSSKeyframesRule::anonymousIndexedGetter(unsigned index) const |
| 198 { | 198 { |
| 199 if (UseCounter* useCounter = UseCounter::getFrom(parentStyleSheet())) | 199 if (UseCounter* useCounter = UseCounter::getFrom(parentStyleSheet())) |
| 200 useCounter->count(UseCounter::CSSKeyframesRuleAnonymousIndexedGetter); | 200 useCounter->count(UseCounter::CSSKeyframesRuleAnonymousIndexedGetter); |
| 201 return item(index); | 201 return item(index); |
| 202 } | 202 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 218 { | 218 { |
| 219 CSSRule::trace(visitor); | 219 CSSRule::trace(visitor); |
| 220 #if ENABLE(OILPAN) | 220 #if ENABLE(OILPAN) |
| 221 visitor->trace(m_childRuleCSSOMWrappers); | 221 visitor->trace(m_childRuleCSSOMWrappers); |
| 222 #endif | 222 #endif |
| 223 visitor->trace(m_keyframesRule); | 223 visitor->trace(m_keyframesRule); |
| 224 visitor->trace(m_ruleListCSSOMWrapper); | 224 visitor->trace(m_ruleListCSSOMWrapper); |
| 225 } | 225 } |
| 226 | 226 |
| 227 } // namespace blink | 227 } // namespace blink |
| OLD | NEW |