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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSKeyframesRule.cpp

Issue 2671173002: Change CSSParserContext to have a Document handle (vs UseCounter). (Closed)
Patch Set: fix todo style Created 3 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSStyleSheet.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSStyleSheet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698