Index: lib/filterValidation.js |
=================================================================== |
--- a/lib/filterValidation.js |
+++ b/lib/filterValidation.js |
@@ -14,17 +14,17 @@ |
* You should have received a copy of the GNU General Public License |
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
/** @module filterValidation */ |
"use strict"; |
-const {Filter, InvalidFilter, ElemHideBase} = require("filterClasses"); |
+const {Filter, InvalidFilter, ElemHideBase, ElemHideEmulationFilter} = require("filterClasses"); |
const {Utils} = require("utils"); |
/** |
* An error returned by |
* {@link module:filterValidation.parseFilter parseFilter()} or |
* {@link module:filterValidation.parseFilters parseFilters()} |
* indicating that a given filter cannot be parsed, |
* contains an invalid CSS selector or is a filter list header. |
@@ -137,17 +137,19 @@ exports.parseFilter = text => |
filter = Filter.fromText(text); |
if (filter instanceof InvalidFilter) |
{ |
return {error: new FilterParsingError("invalid-filter", |
{reason: filter.reason})}; |
} |
- if (filter instanceof ElemHideBase && !isValidCSSSelector(filter.selector)) |
+ if (filter instanceof ElemHideBase && |
+ !filter instanceof ElemHideEmulationFilter && |
+ !isValidCSSSelector(filter.selector)) |
Sebastian Noack
2017/04/04 10:14:45
When we implemented CSS property filters we delibe
hub
2017/04/05 09:05:53
ok. this will need to have changes in the adblockp
hub
2017/04/05 13:18:43
I suggest that we use something like:
[-abp-selec
Sebastian Noack
2017/04/05 14:58:49
This appears unnecessarily verbose (and potentiall
hub
2017/04/05 15:44:57
How do you express ":has(:has(...))"?
The idea w
Sebastian Noack
2017/04/05 16:08:28
I see, nesting might become ugly, mostly because o
|
{ |
return {error: new FilterParsingError("invalid-css-selector", |
{selector: filter.selector})}; |
} |
} |
return {filter}; |
}; |