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

Unified Diff: lib/elemHide.js

Issue 29470687: Issue 5344 - Element hiding emulation exceptions (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created June 21, 2017, 6:50 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 | lib/filterClasses.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/elemHide.js
===================================================================
--- a/lib/elemHide.js
+++ b/lib/elemHide.js
@@ -16,17 +16,17 @@
*/
"use strict";
/**
* @fileOverview Element hiding implementation.
*/
-const {ElemHideException} = require("filterClasses");
+const {ElemHideExceptionBase} = require("filterClasses");
const {FilterNotifier} = require("filterNotifier");
/**
* Lookup table, filters by their associated key
* @type {Object}
*/
let filterByKey = [];
@@ -118,17 +118,17 @@
},
/**
* Add a new element hiding filter
* @param {ElemHideFilter} filter
*/
add(filter)
{
- if (filter instanceof ElemHideException)
+ if (filter instanceof ElemHideExceptionBase)
{
if (filter.text in knownExceptions)
return;
let {selector} = filter;
if (!(selector in exceptions))
exceptions[selector] = [];
exceptions[selector].push(filter);
@@ -191,17 +191,17 @@
},
/**
* Removes an element hiding filter
* @param {ElemHideFilter} filter
*/
remove(filter)
{
- if (filter instanceof ElemHideException)
+ if (filter instanceof ElemHideExceptionBase)
{
if (!(filter.text in knownExceptions))
return;
let list = exceptions[filter.selector];
let index = list.indexOf(filter);
if (index >= 0)
list.splice(index, 1);
@@ -221,17 +221,17 @@
FilterNotifier.emit("elemhideupdate");
},
/**
* Checks whether an exception rule is registered for a filter on a particular
* domain.
* @param {Filter} filter
* @param {string} docDomain
- * @return {ElemHideException}
+ * @return {ElemHideExceptionBase}
*/
getException(filter, docDomain)
{
if (!(filter.selector in exceptions))
return null;
let list = exceptions[filter.selector];
for (let i = list.length - 1; i >= 0; i--)
« no previous file with comments | « no previous file | lib/filterClasses.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld