Index: chrome/content/elemHideEmulation.js |
=================================================================== |
--- a/chrome/content/elemHideEmulation.js |
+++ b/chrome/content/elemHideEmulation.js |
@@ -45,23 +45,23 @@ |
if (chr == '"' || chr == "'") |
sep = chr; |
else if (chr == "(") // don't split between parentheses |
level++; // e.g. :matches(div,span) |
else if (chr == ")") |
level = Math.max(0, level - 1); |
else if (chr == "," && level == 0) |
{ |
- selectors.push(selector.substring(start, i)); |
+ selectors.push(selector.substring(start, i).trim()); |
start = i + 1; |
} |
} |
} |
- selectors.push(selector.substring(start)); |
+ selectors.push(selector.substring(start).trim()); |
return selectors; |
} |
/** Return position of node from parent. |
* @param {Node} node the node to find the position of. |
* @return {number} One-based index like for :nth-child(), or 0 on error. |
*/ |
function positionInParent(node) |
@@ -276,20 +276,26 @@ |
} |
PropsSelector.prototype = { |
preferHideWithSelector: true, |
dependsOnStyles: true, |
*findPropsSelectors(styles, prefix, regexp) |
{ |
+ let actualPrefix = (prefix && !incompletePrefixRegexp.test(prefix)) ? |
+ prefix + " " : prefix; |
for (let style of styles) |
if (regexp.test(style.style)) |
for (let subSelector of style.subSelectors) |
- yield prefix + subSelector; |
+ { |
+ if (subSelector == "*") |
+ subSelector = ""; |
+ yield actualPrefix + subSelector; |
+ } |
}, |
*getSelectors(prefix, subtree, styles) |
{ |
for (let selector of this.findPropsSelectors(styles, prefix, this._regexp)) |
yield [selector, subtree]; |
} |
}; |