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

Unified Diff: lib/filterListener.js

Issue 29324599: Issue 2392/2393 - Created container for CSS property filters (Closed)
Patch Set: Rebased and addressed comments Created Nov. 25, 2015, 11:12 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
« lib/cssRules.js ('K') | « lib/filterClasses.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterListener.js
===================================================================
--- a/lib/filterListener.js
+++ b/lib/filterListener.js
@@ -25,8 +25,10 @@
let {FilterStorage} = require("filterStorage");
let {FilterNotifier} = require("filterNotifier");
let {ElemHide} = require("elemHide");
+let {CSSRules} = require("cssRules");
let {defaultMatcher} = require("matcher");
-let {ActiveFilter, RegExpFilter, ElemHideBase} = require("filterClasses");
+let {ActiveFilter, RegExpFilter, ElemHideBase, CSSPropertyFilter} =
+ require("filterClasses");
let {Prefs} = require("prefs");
/**
@@ -156,7 +158,12 @@
if (filter instanceof RegExpFilter)
defaultMatcher.add(filter);
else if (filter instanceof ElemHideBase)
- ElemHide.add(filter);
+ {
+ if (filter instanceof CSSPropertyFilter)
+ CSSRules.add(filter);
+ else
+ ElemHide.add(filter);
+ }
}
/**
@@ -182,7 +189,12 @@
if (filter instanceof RegExpFilter)
defaultMatcher.remove(filter);
else if (filter instanceof ElemHideBase)
- ElemHide.remove(filter);
+ {
+ if (filter instanceof CSSPropertyFilter)
+ CSSRules.remove(filter);
+ else
+ ElemHide.remove(filter);
+ }
}
/**
@@ -264,6 +276,7 @@
defaultMatcher.clear();
ElemHide.clear();
+ CSSRules.clear();
for (let subscription of FilterStorage.subscriptions)
if (!subscription.disabled)
subscription.filters.forEach(addFilter);
« lib/cssRules.js ('K') | « lib/filterClasses.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld