Skip to content

Commit

Permalink
re-support selectors like :host[inline] since this was previously s…
Browse files Browse the repository at this point in the history
…upported under shady-dom.
  • Loading branch information
Steven Orvell committed Jun 28, 2016
1 parent 645bcd0 commit 4e51ef6
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/lib/style-transformer.html
Original file line number Diff line number Diff line change
Expand Up @@ -237,19 +237,24 @@
_transformHostSelector: function(selector, hostScope) {
var m = selector.match(HOST_PAREN);
var paren = m && m[2].trim() || '';
if (paren && !paren[0].match(SIMPLE_SELECTOR_PREFIX)) {
// paren starts with a type selector
var typeSelector = paren.split(SIMPLE_SELECTOR_PREFIX)[0];
// if the type selector is our hostScope then avoid pre-pending it
if (typeSelector === hostScope) {
return paren;
// otherwise, this selector should not match in this scope so
// output a bogus selector.
if (paren) {
if (!paren[0].match(SIMPLE_SELECTOR_PREFIX)) {
// paren starts with a type selector
var typeSelector = paren.split(SIMPLE_SELECTOR_PREFIX)[0];
// if the type selector is our hostScope then avoid pre-pending it
if (typeSelector === hostScope) {
return paren;
// otherwise, this selector should not match in this scope so
// output a bogus selector.
} else {
return SELECTOR_NO_MATCH;
}
} else {
return SELECTOR_NO_MATCH;
return hostScope + paren;
}
} else {
return selector.replace(HOST, hostScope);
}
return hostScope + paren;
},

documentRule: function(rule) {
Expand Down

0 comments on commit 4e51ef6

Please sign in to comment.