Skip to content

Commit 4dc780a

Browse files
committed
address feedback
1 parent bc9519e commit 4dc780a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/lib/style-defaults.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
get _styleProperties() {
3737
if (!this._properties) {
3838
// force rules to reparse since they may be out of date
39-
styleProperties.decorateStyles(this._styles, this._element);
39+
styleProperties.decorateStyles(this._styles, this);
4040
// NOTE: reset cache for own properties; it may have been set when
4141
// an element in an import applied styles (e.g. custom-style)
4242
this._styles._scopeStyleProperties = null;

src/lib/style-properties.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
// decorates styles with rule info and returns an array of used style
2929
// property names
3030
decorateStyles: function(styles, scope) {
31-
var self = this, props = {}, keyframes = [], styleIndex = 0;
31+
var self = this, props = {}, keyframes = [], ruleIndex = 0;
3232
styleUtil.forRulesInStyles(styles, function(rule, style) {
3333
self.decorateRule(rule);
3434
// 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) {
3737
// we can't cache styles with :host and :root props in @media rules
3838
if (rule.parent.type === styleUtil.ruleTypes.MEDIA_RULE) {
3939
scope._notCacheable = true;
@@ -270,7 +270,7 @@
270270
return {properties: props, key: o};
271271
},
272272

273-
walkHostAndRootProperties: function(scope, rule, style, callback) {
273+
whenHostOrRootRule: function(scope, rule, style, callback) {
274274
if (!rule.propertyInfo) {
275275
self.decorateRule(rule);
276276
}
@@ -327,7 +327,7 @@
327327
// note: active rules excludes non-matching @media rules
328328
styleUtil.forActiveRulesInStyles(scope._styles, function(rule, style) {
329329
// if scope is StyleDefaults, use _element for matchesSelector
330-
self.walkHostAndRootProperties(scope, rule, style, function(info) {
330+
self.whenHostOrRootRule(scope, rule, style, function(info) {
331331
var element = scope._element || scope;
332332
if (matchesSelector.call(element, info.selector)) {
333333
if (info.isHost) {

0 commit comments

Comments
 (0)