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

Unified Diff: chrome/content/cssProperties.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
« no previous file with comments | « no previous file | lib/elemHideEmulation.js » ('j') | lib/filterClasses.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/cssProperties.js
===================================================================
--- a/chrome/content/cssProperties.js
+++ b/chrome/content/cssProperties.js
@@ -123,17 +123,28 @@
if (stylesheet)
this.addSelectors([stylesheet]);
},
load: function(callback)
{
this.getFiltersFunc(function(patterns)
{
- this.patterns = patterns;
+ // We currently don't support any element hiding emulation feature except
kzar 2016/09/25 14:52:06 Shouldn't it be up to the callback to decide which
Felix Dahlke 2016/09/30 10:22:26 Yeah, that's a good point. My thinking was that we
kzar 2016/10/05 11:58:14 How about adding an extra parameter to the CSSProp
Felix Dahlke 2016/11/03 16:14:13 My thinking on this was that we don't have to pass
+ // for property selectors, so we remove rules that use other features.
+ // See https://issues.adblockplus.org/ticket/3143.
+ this.patterns = [];
+ for (var i = 0; i < patterns.length; i++)
+ {
+ var pattern = patterns[i];
+ if (pattern.features.length == 1 &&
+ pattern.features[0] == "PROPERTY_SELECTOR")
+ this.patterns.push(pattern);
+ }
+
callback();
}.bind(this));
},
apply: function()
{
if (this.patterns.length > 0)
{
« no previous file with comments | « no previous file | lib/elemHideEmulation.js » ('j') | lib/filterClasses.js » ('J')

Powered by Google App Engine
This is Rietveld