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

Unified Diff: lib/elemHideEmulation.js

Issue 29354827: Issue 4394 - Create a filter class for element hiding emulation filters [WIP] (Closed)
Patch Set: Created Sept. 23, 2016, 4:21 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
Index: lib/elemHideEmulation.js
===================================================================
rename from lib/cssRules.js
rename to lib/elemHideEmulation.js
--- a/lib/cssRules.js
+++ b/lib/elemHideEmulation.js
@@ -11,60 +11,60 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
/**
- * @fileOverview CSS property filtering implementation.
+ * @fileOverview Element hiding emulation implementation.
*/
let {ElemHide} = require("elemHide");
let {Filter} = require("filterClasses");
var filters = Object.create(null);
/**
- * CSS rules component
+ * Container for element hiding emulation filters
* @class
*/
-let CSSRules = exports.CSSRules =
+let ElemHideEmulation = exports.ElemHideEmulation =
{
/**
* Removes all known filters
*/
clear: function()
{
filters = Object.create(null);
},
/**
- * Add a new CSS property filter
- * @param {CSSPropertyFilter} filter
+ * Add a new element hiding emulation filter
+ * @param {ElemHideEmulationFilter} filter
*/
add: function(filter)
{
filters[filter.text] = true;
},
/**
- * Removes a CSS property filter
- * @param {CSSPropertyFilter} filter
+ * Removes an element hiding emulation filter
+ * @param {ElemHideEmulationFilter} filter
*/
remove: function(filter)
{
delete filters[filter.text];
},
/**
* Returns a list of all rules active on a particular domain
* @param {String} domain
- * @return {CSSPropertyFilter[]}
+ * @return {ElemHideEmulationFilter[]}
*/
getRulesForDomain: function(domain)
{
let result = [];
let keys = Object.getOwnPropertyNames(filters);
for (let key of keys)
{
let filter = Filter.fromText(key);

Powered by Google App Engine
This is Rietveld