| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 Member<CSSKeyframeRule>& rule = m_childRuleCSSOMWrappers[index]; | 166 Member<CSSKeyframeRule>& rule = m_childRuleCSSOMWrappers[index]; |
| 167 if (!rule) | 167 if (!rule) |
| 168 rule = new CSSKeyframeRule(m_keyframesRule->keyframes()[index].get(), | 168 rule = new CSSKeyframeRule(m_keyframesRule->keyframes()[index].get(), |
| 169 const_cast<CSSKeyframesRule*>(this)); | 169 const_cast<CSSKeyframesRule*>(this)); |
| 170 | 170 |
| 171 return rule.get(); | 171 return rule.get(); |
| 172 } | 172 } |
| 173 | 173 |
| 174 CSSKeyframeRule* CSSKeyframesRule::anonymousIndexedGetter( | 174 CSSKeyframeRule* CSSKeyframesRule::anonymousIndexedGetter( |
| 175 unsigned index) const { | 175 unsigned index) const { |
| 176 if (UseCounter* useCounter = UseCounter::getFrom(parentStyleSheet())) | 176 const Document* parentDocument = |
| 177 useCounter->count(UseCounter::CSSKeyframesRuleAnonymousIndexedGetter); | 177 CSSStyleSheet::singleOwnerDocument(parentStyleSheet()); |
| 178 if (parentDocument) { |
| 179 UseCounter::count(*parentDocument, |
| 180 UseCounter::CSSKeyframesRuleAnonymousIndexedGetter); |
| 181 } |
| 178 return item(index); | 182 return item(index); |
| 179 } | 183 } |
| 180 | 184 |
| 181 CSSRuleList* CSSKeyframesRule::cssRules() const { | 185 CSSRuleList* CSSKeyframesRule::cssRules() const { |
| 182 if (!m_ruleListCSSOMWrapper) | 186 if (!m_ruleListCSSOMWrapper) |
| 183 m_ruleListCSSOMWrapper = LiveCSSRuleList<CSSKeyframesRule>::create( | 187 m_ruleListCSSOMWrapper = LiveCSSRuleList<CSSKeyframesRule>::create( |
| 184 const_cast<CSSKeyframesRule*>(this)); | 188 const_cast<CSSKeyframesRule*>(this)); |
| 185 return m_ruleListCSSOMWrapper.get(); | 189 return m_ruleListCSSOMWrapper.get(); |
| 186 } | 190 } |
| 187 | 191 |
| 188 void CSSKeyframesRule::reattach(StyleRuleBase* rule) { | 192 void CSSKeyframesRule::reattach(StyleRuleBase* rule) { |
| 189 ASSERT(rule); | 193 ASSERT(rule); |
| 190 m_keyframesRule = toStyleRuleKeyframes(rule); | 194 m_keyframesRule = toStyleRuleKeyframes(rule); |
| 191 } | 195 } |
| 192 | 196 |
| 193 DEFINE_TRACE(CSSKeyframesRule) { | 197 DEFINE_TRACE(CSSKeyframesRule) { |
| 194 CSSRule::trace(visitor); | 198 CSSRule::trace(visitor); |
| 195 visitor->trace(m_childRuleCSSOMWrappers); | 199 visitor->trace(m_childRuleCSSOMWrappers); |
| 196 visitor->trace(m_keyframesRule); | 200 visitor->trace(m_keyframesRule); |
| 197 visitor->trace(m_ruleListCSSOMWrapper); | 201 visitor->trace(m_ruleListCSSOMWrapper); |
| 198 } | 202 } |
| 199 | 203 |
| 200 } // namespace blink | 204 } // namespace blink |
| OLD | NEW |