Index: chrome/content/elemHideEmulation.js |
=================================================================== |
--- a/chrome/content/elemHideEmulation.js |
+++ b/chrome/content/elemHideEmulation.js |
@@ -186,16 +186,17 @@ |
*/ |
*getSelectors(prefix, subtree, styles) |
{ |
yield [prefix + this._selector, subtree]; |
} |
}; |
const incompletePrefixRegexp = /[\s>+~]$/; |
+const relativeSelector = /^[\s>+~]/; |
function HasSelector(selectors) |
{ |
this._innerSelectors = selectors; |
} |
HasSelector.prototype = { |
requiresHiding: true, |
@@ -221,18 +222,22 @@ |
{ |
let actualPrefix = (!prefix || incompletePrefixRegexp.test(prefix)) ? |
prefix + "*" : prefix; |
let elements = subtree.querySelectorAll(actualPrefix); |
for (let element of elements) |
{ |
let iter = evaluate(this._innerSelectors, 0, "", element, styles); |
for (let selector of iter) |
+ { |
+ if (relativeSelector.test(selector)) |
+ selector = ":scope" + selector; |
if (element.querySelector(selector)) |
yield element; |
+ } |
} |
} |
}; |
function PropsSelector(propertyExpression) |
{ |
let regexpString; |
if (propertyExpression.length >= 2 && propertyExpression[0] == "/" && |