Skip to content

Commit

Permalink
Merge pull request #3772 from Polymer/cssbuild-shady-root-rule-fix
Browse files Browse the repository at this point in the history
Fix css shady build mistakenly matching root rules as host rules
  • Loading branch information
dfreedm authored Jul 8, 2016
2 parents 1256301 + 266bb36 commit e579f58
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/style-properties.html
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
var cssBuild = scope.__cssBuild || style.__cssBuild;
if (cssBuild === 'shady') {
// :root -> x-foo > *.x-foo for elements and html for custom-style
isRoot = parsedSelector === (hostScope + '> *.' + hostScope) || parsedSelector.indexOf('html') !== -1;
isRoot = parsedSelector === (hostScope + ' > *.' + hostScope) || parsedSelector.indexOf('html') !== -1;
// :host -> x-foo for elements, but sub-rules have .x-foo in them
isHost = !isRoot && parsedSelector.indexOf(hostScope) === 0;
}
Expand All @@ -314,7 +314,8 @@
hostScope
);
}
selectorToMatch = rule.transformedSelector || hostScope;
// parsedSelector fallback for 'shady' css build
selectorToMatch = rule.transformedSelector || rule.parsedSelector;
}
callback({
selector: selectorToMatch,
Expand Down

0 comments on commit e579f58

Please sign in to comment.