Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/content/elemHideEmulation.js

Issue 29760631: Issue 6618 - Prefer CSS selectors for plain emulation filters (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created April 24, 2018, 1:07 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/content/elemHideEmulation.js
===================================================================
--- a/lib/content/elemHideEmulation.js
+++ b/lib/content/elemHideEmulation.js
@@ -222,16 +222,18 @@
function PlainSelector(selector)
{
this._selector = selector;
this.maybeDependsOnAttributes = /[#.]|\[.+\]/.test(selector);
}
PlainSelector.prototype = {
+ preferHideWithSelector: true,
+
/**
* Generator function returning a pair of selector
* string and subtree.
* @param {string} prefix the prefix for the selector.
* @param {Node} subtree the subtree we work on.
* @param {StringifiedStyle[]} styles the stringified style objects.
*/
*getSelectors(prefix, subtree, styles)
@@ -403,17 +405,17 @@
this.text = text;
}
Pattern.prototype = {
isSelectorHidingOnlyPattern()
{
return getCachedPropertyValue(
this, "_selectorHidingOnlyPattern",
- () => this.selectors.some(selector => selector.preferHideWithSelector) &&
+ () => this.selectors.every(selector => selector.preferHideWithSelector) &&
!this.selectors.some(selector => selector.requiresHiding)
);
},
get dependsOnStyles()
{
return getCachedPropertyValue(
this, "_dependsOnStyles",
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld