Index: lib/content/elemHideEmulation.js |
=================================================================== |
--- a/lib/content/elemHideEmulation.js |
+++ b/lib/content/elemHideEmulation.js |
@@ -31,17 +31,17 @@ |
{ |
let {children} = node.parentNode; |
for (let i = 0; i < children.length; i++) |
if (children[i] == node) |
return i + 1; |
return 0; |
} |
-function makeSelector(node, selector) |
+function makeSelector(node, selector = "") |
{ |
if (node == null) |
return null; |
if (!node.parentElement) |
{ |
let newSelector = ":root"; |
if (selector) |
newSelector += " > " + selector; |
@@ -262,17 +262,17 @@ |
return this._innerSelectors.some( |
selector => selector.maybeDependsOnAttributes |
); |
}, |
*getSelectors(prefix, subtree, styles) |
{ |
for (let element of this.getElements(prefix, subtree, styles)) |
- yield [makeSelector(element, ""), element]; |
+ yield [makeSelector(element), element]; |
}, |
/** |
* Generator function returning selected elements. |
* @param {string} prefix the prefix for the selector. |
* @param {Node} subtree the subtree we work on. |
* @param {StringifiedStyle[]} styles the stringified style objects. |
*/ |
@@ -306,17 +306,17 @@ |
ContainsSelector.prototype = { |
requiresHiding: true, |
dependsOnCharacterData: true, |
*getSelectors(prefix, subtree, styles) |
{ |
for (let element of this.getElements(prefix, subtree, styles)) |
- yield [makeSelector(element, ""), subtree]; |
+ yield [makeSelector(element), subtree]; |
}, |
*getElements(prefix, subtree, styles) |
{ |
let actualPrefix = (!prefix || incompletePrefixRegexp.test(prefix)) ? |
prefix + "*" : prefix; |
let elements = scopedQuerySelectorAll(subtree, actualPrefix); |