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

Unified Diff: lib/filterValidation.js

Issue 29401596: Issue 5094 - Implement support for :has() in chrome extension (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Rebased. With the proper revision in dependencies. Created June 14, 2017, 2:21 a.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
« include.preload.js ('K') | « include.preload.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterValidation.js
===================================================================
--- a/lib/filterValidation.js
+++ b/lib/filterValidation.js
@@ -14,17 +14,18 @@
* 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 +138,19 @@
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))
{
return {error: new FilterParsingError("invalid-css-selector",
{selector: filter.selector})};
}
}
return {filter};
};
« include.preload.js ('K') | « include.preload.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld