Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Jun 10, 2016
1 parent bc9519e commit 4dc780a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/lib/style-defaults.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions src/lib/style-properties.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 4dc780a

Please sign in to comment.