Skip to content

Commit

Permalink
Fix css shady build mistakenly matching root rules as host rules
Browse files Browse the repository at this point in the history
Fixes tests in polymer-css-build
  • Loading branch information
dfreedm committed Jul 8, 2016
1 parent d8bab9c commit 5dfb9c9
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 5dfb9c9

Please sign in to comment.