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

Unified Diff: lib/elemHideEmulation.js

Issue 29587914: Issue 5142 - Convert Element Hiding to C++ (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: mFiltersByDomain is now an OwnedStringMap Created Jan. 26, 2018, 8:41 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 | « lib/elemHide.js ('k') | meson.build » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/elemHideEmulation.js
===================================================================
--- a/lib/elemHideEmulation.js
+++ b/lib/elemHideEmulation.js
@@ -16,17 +16,16 @@
*/
"use strict";
/**
* @fileOverview Element hiding emulation implementation.
*/
-const {ElemHide} = require("elemHide");
const {Filter} = require("filterClasses");
let filters = Object.create(null);
/**
* Container for element hiding emulation filters
* @class
*/
@@ -55,27 +54,28 @@
remove(filter)
{
delete filters[filter.text];
},
/**
* Returns a list of all rules active on a particular domain
* @param {string} domain
+ * @param {Object} elemHide the ElemHide instance
* @return {ElemHideEmulationFilter[]}
*/
- getRulesForDomain(domain)
+ getRulesForDomain(domain, elemHide)
{
let result = [];
let keys = Object.getOwnPropertyNames(filters);
for (let key of keys)
{
let filter = Filter.fromText(key);
if (filter.isActiveOnDomain(domain) &&
- !ElemHide.getException(filter, domain))
+ !elemHide.getException(filter, domain))
{
result.push(filter);
}
}
return result;
}
};
exports.ElemHideEmulation = ElemHideEmulation;
« no previous file with comments | « lib/elemHide.js ('k') | meson.build » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld