|
28 | 28 | // decorates styles with rule info and returns an array of used style
|
29 | 29 | // property names
|
30 | 30 | decorateStyles: function(styles, scope) {
|
31 |
| - var self = this, props = {}, keyframes = [], styleIndex = 0; |
| 31 | + var self = this, props = {}, keyframes = [], ruleIndex = 0; |
32 | 32 | styleUtil.forRulesInStyles(styles, function(rule, style) {
|
33 | 33 | self.decorateRule(rule);
|
34 | 34 | // mark in-order position of ast rule in styles block, used for cache key
|
35 |
| - rule.index = styleIndex++; |
36 |
| - self.walkHostAndRootProperties(scope, rule, style, function(info) { |
| 35 | + rule.index = ruleIndex++; |
| 36 | + self.whenHostOrRootRule(scope, rule, style, function(info) { |
37 | 37 | // we can't cache styles with :host and :root props in @media rules
|
38 | 38 | if (rule.parent.type === styleUtil.ruleTypes.MEDIA_RULE) {
|
39 | 39 | scope._notCacheable = true;
|
|
270 | 270 | return {properties: props, key: o};
|
271 | 271 | },
|
272 | 272 |
|
273 |
| - walkHostAndRootProperties: function(scope, rule, style, callback) { |
| 273 | + whenHostOrRootRule: function(scope, rule, style, callback) { |
274 | 274 | if (!rule.propertyInfo) {
|
275 | 275 | self.decorateRule(rule);
|
276 | 276 | }
|
|
327 | 327 | // note: active rules excludes non-matching @media rules
|
328 | 328 | styleUtil.forActiveRulesInStyles(scope._styles, function(rule, style) {
|
329 | 329 | // if scope is StyleDefaults, use _element for matchesSelector
|
330 |
| - self.walkHostAndRootProperties(scope, rule, style, function(info) { |
| 330 | + self.whenHostOrRootRule(scope, rule, style, function(info) { |
331 | 331 | var element = scope._element || scope;
|
332 | 332 | if (matchesSelector.call(element, info.selector)) {
|
333 | 333 | if (info.isHost) {
|
|
0 commit comments