| Index: chrome/content/elemHideEmulation.js |
| =================================================================== |
| --- a/chrome/content/elemHideEmulation.js |
| +++ b/chrome/content/elemHideEmulation.js |
| @@ -44,23 +44,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) |
| @@ -268,20 +268,26 @@ |
| this._regexp = new RegExp(regexpString, "i"); |
| } |
| PropsSelector.prototype = { |
| preferHideWithSelector: true, |
| *findPropsSelectors(styles, prefix, regexp) |
| { |
| + let actualPrefix = (prefix && !incompletePrefixRegexp.test(prefix)) ? |
| + prefix + " " : prefix; |
|
Wladimir Palant
2017/08/16 08:37:02
No, this is not what we want. Consider .abp-testsu
hub
2017/08/16 19:50:32
Acknowledged.
|
| for (let style of styles) |
| if (regexp.test(style.style)) |
| for (let subSelector of style.subSelectors) |
| - yield prefix + subSelector; |
| + { |
| + if (subSelector == "*") |
| + subSelector = ""; |
|
Wladimir Palant
2017/08/16 08:37:02
What if we have a filter like `:-abp-properties(fo
hub
2017/08/16 19:50:32
Done.
|
| + yield actualPrefix + subSelector; |
| + } |
| }, |
| *getSelectors(prefix, subtree, styles) |
| { |
| for (let selector of this.findPropsSelectors(styles, prefix, this._regexp)) |
| yield [selector, subtree]; |
| } |
| }; |