diff --git a/src/lib/style-transformer.html b/src/lib/style-transformer.html index fc493f9521..db3e996e66 100644 --- a/src/lib/style-transformer.html +++ b/src/lib/style-transformer.html @@ -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) {