Index: lib/content/elemHideEmulation.js |
=================================================================== |
--- a/lib/content/elemHideEmulation.js |
+++ b/lib/content/elemHideEmulation.js |
@@ -243,17 +243,16 @@ |
const incompletePrefixRegexp = /[\s>+~]$/; |
function HasSelector(selectors) |
{ |
this._innerSelectors = selectors; |
} |
HasSelector.prototype = { |
- requiresHiding: true, |
dependsOnDOM: true, |
get dependsOnStyles() |
{ |
return this._innerSelectors.some(selector => selector.dependsOnStyles); |
}, |
get dependsOnCharacterData() |
@@ -306,17 +305,16 @@ |
}; |
function ContainsSelector(textContent) |
{ |
this._regexp = makeRegExpParameter(textContent); |
} |
ContainsSelector.prototype = { |
- requiresHiding: true, |
dependsOnDOM: true, |
dependsOnCharacterData: true, |
*getSelectors(prefix, subtree, styles) |
{ |
for (let element of this.getElements(prefix, subtree, styles)) |
yield [makeSelector(element), subtree]; |
}, |
@@ -364,17 +362,16 @@ |
} |
else |
regexpString = filterToRegExp(propertyExpression); |
this._regexp = new RegExp(regexpString, "i"); |
} |
PropsSelector.prototype = { |
- preferHideWithSelector: true, |
dependsOnStyles: true, |
*findPropsSelectors(styles, prefix, regexp) |
{ |
for (let style of styles) |
if (regexp.test(style.style)) |
for (let subSelector of style.subSelectors) |
{ |
@@ -399,25 +396,16 @@ |
function Pattern(selectors, text) |
{ |
this.selectors = selectors; |
this.text = text; |
} |
Pattern.prototype = { |
- isSelectorHidingOnlyPattern() |
- { |
- return getCachedPropertyValue( |
- this, "_selectorHidingOnlyPattern", |
- () => this.selectors.some(selector => selector.preferHideWithSelector) && |
- !this.selectors.some(selector => selector.requiresHiding) |
- ); |
- }, |
- |
get dependsOnStyles() |
{ |
return getCachedPropertyValue( |
this, "_dependsOnStyles", |
() => this.selectors.some(selector => selector.dependsOnStyles) |
); |
}, |
@@ -671,18 +659,17 @@ |
generator = evaluate(pattern.selectors, 0, "", |
this.document, cssStyles); |
} |
for (let selector of generator) |
{ |
if (selector != null) |
{ |
- if (!this.useInlineStyles || |
- pattern.isSelectorHidingOnlyPattern()) |
+ if (!this.useInlineStyles) |
{ |
selectors.push(selector); |
selectorFilters.push(pattern.text); |
} |
else |
{ |
for (let element of this.document.querySelectorAll(selector)) |
{ |