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: Updated to use the latest version of the core patch Created June 1, 2017, 6:25 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 | « 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};
};
« no previous file with comments | « include.preload.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld