diff --git a/src/lib/style-defaults.html b/src/lib/style-defaults.html
index 3a111ca78c..d2cd2db40e 100644
--- a/src/lib/style-defaults.html
+++ b/src/lib/style-defaults.html
@@ -36,7 +36,7 @@
get _styleProperties() {
if (!this._properties) {
// force rules to reparse since they may be out of date
- styleProperties.decorateStyles(this._styles, this._element);
+ styleProperties.decorateStyles(this._styles, this);
// NOTE: reset cache for own properties; it may have been set when
// an element in an import applied styles (e.g. custom-style)
this._styles._scopeStyleProperties = null;
diff --git a/src/lib/style-properties.html b/src/lib/style-properties.html
index 94c6a698b9..13576b751a 100644
--- a/src/lib/style-properties.html
+++ b/src/lib/style-properties.html
@@ -28,12 +28,12 @@
// decorates styles with rule info and returns an array of used style
// property names
decorateStyles: function(styles, scope) {
- var self = this, props = {}, keyframes = [], styleIndex = 0;
+ var self = this, props = {}, keyframes = [], ruleIndex = 0;
styleUtil.forRulesInStyles(styles, function(rule, style) {
self.decorateRule(rule);
// mark in-order position of ast rule in styles block, used for cache key
- rule.index = styleIndex++;
- self.walkHostAndRootProperties(scope, rule, style, function(info) {
+ rule.index = ruleIndex++;
+ self.whenHostOrRootRule(scope, rule, style, function(info) {
// we can't cache styles with :host and :root props in @media rules
if (rule.parent.type === styleUtil.ruleTypes.MEDIA_RULE) {
scope._notCacheable = true;
@@ -270,7 +270,7 @@
return {properties: props, key: o};
},
- walkHostAndRootProperties: function(scope, rule, style, callback) {
+ whenHostOrRootRule: function(scope, rule, style, callback) {
if (!rule.propertyInfo) {
self.decorateRule(rule);
}
@@ -327,7 +327,7 @@
// note: active rules excludes non-matching @media rules
styleUtil.forActiveRulesInStyles(scope._styles, function(rule, style) {
// if scope is StyleDefaults, use _element for matchesSelector
- self.walkHostAndRootProperties(scope, rule, style, function(info) {
+ self.whenHostOrRootRule(scope, rule, style, function(info) {
var element = scope._element || scope;
if (matchesSelector.call(element, info.selector)) {
if (info.isHost) {