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

Side by Side Diff: sky/engine/core/animation/css/CSSAnimations.cpp

Issue 810893002: Remove global set of ScopedStyleResolvers. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 | sky/engine/core/css/resolver/ScopedStyleResolver.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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 } 189 }
190 ASSERT(startKeyframe->properties().size() == allProperties.size()); 190 ASSERT(startKeyframe->properties().size() == allProperties.size());
191 ASSERT(endKeyframe->properties().size() == allProperties.size()); 191 ASSERT(endKeyframe->properties().size() == allProperties.size());
192 } 192 }
193 193
194 } // namespace 194 } // namespace
195 195
196 const StyleRuleKeyframes* CSSAnimations::matchScopedKeyframesRule(StyleResolver* resolver, const Element* element, const StringImpl* animationName) 196 const StyleRuleKeyframes* CSSAnimations::matchScopedKeyframesRule(StyleResolver* resolver, const Element* element, const StringImpl* animationName)
197 { 197 {
198 // FIXME: This is all implementation detail of style resolver, CSSAnimations shouldn't be reaching into any of it. 198 // FIXME: This is all implementation detail of style resolver, CSSAnimations shouldn't be reaching into any of it.
199 if (resolver->document().styleEngine()->hasOnlyScopedResolverForDocument())
200 return element->document().scopedStyleResolver()->keyframeStylesForAnima tion(animationName);
201
202 Vector<RawPtr<ScopedStyleResolver>, 8> stack; 199 Vector<RawPtr<ScopedStyleResolver>, 8> stack;
203 resolver->styleTreeResolveScopedKeyframesRules(element, stack); 200 resolver->styleTreeResolveScopedKeyframesRules(element, stack);
204 if (stack.isEmpty()) 201 if (stack.isEmpty())
205 return 0; 202 return 0;
206 203
207 for (size_t i = 0; i < stack.size(); ++i) { 204 for (size_t i = 0; i < stack.size(); ++i) {
208 if (const StyleRuleKeyframes* keyframesRule = stack.at(i)->keyframeStyle sForAnimation(animationName)) 205 if (const StyleRuleKeyframes* keyframesRule = stack.at(i)->keyframeStyle sForAnimation(animationName))
209 return keyframesRule; 206 return keyframesRule;
210 } 207 }
211 return 0; 208 return 0;
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 case CSSPropertyTransitionDuration: 639 case CSSPropertyTransitionDuration:
643 case CSSPropertyTransitionProperty: 640 case CSSPropertyTransitionProperty:
644 case CSSPropertyTransitionTimingFunction: 641 case CSSPropertyTransitionTimingFunction:
645 return false; 642 return false;
646 default: 643 default:
647 return true; 644 return true;
648 } 645 }
649 } 646 }
650 647
651 } // namespace blink 648 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/css/resolver/ScopedStyleResolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698