From 63433c8a6b178297b103b0ab3467cc2ecca66595 Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Fri, 23 Sep 2016 17:49:09 -0700 Subject: [PATCH] no need for :root to be first in the selector --- src/lib/style-properties.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/style-properties.html b/src/lib/style-properties.html index 20b2077be2..1c86c48d5c 100644 --- a/src/lib/style-properties.html +++ b/src/lib/style-properties.html @@ -285,11 +285,11 @@ return {properties: props, key: o}; }, - _rootSelector: /(?:^:root)|(?::host\s*>\s*\*)/, + _rootSelector: /:root|:host\s*>\s*\*/, _checkRoot: function(hostScope, selector) { return Boolean(selector.match(this._rootSelector)) || - (hostScope === 'html' && selector.indexOf('html') === 0); + (hostScope === 'html' && selector.indexOf('html') > -1); }, whenHostOrRootRule: function(scope, rule, style, callback) { @@ -311,7 +311,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; }