[Pkg-mozext-commits] [adblock-plus] 65/98: Issue 4658 - Incorporate element hiding emulation filters

David Prévot taffit at moszumanska.debian.org
Tue Oct 24 01:30:21 UTC 2017


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository adblock-plus.

commit 9a42447eb8ae46fe0d0d4babc0f2b2dedcfd20b0
Author: Felix Dahlke <felix at adblockplus.org>
Date:   Tue Dec 13 20:31:44 2016 +0100

    Issue 4658 - Incorporate element hiding emulation filters
---
 chrome/content/ui/filters-backup.js                  |  2 +-
 chrome/content/ui/filters-filterview.js              |  2 +-
 chrome/content/ui/sidebar.js                         |  2 +-
 chrome/content/ui/utils.js                           |  2 +-
 chrome/locale/en-US/global.properties                |  2 +-
 chrome/skin/filters.css                              |  4 ++--
 dependencies                                         |  4 ++--
 lib/child/{cssProperties.js => elemHideEmulation.js} | 14 +++++++-------
 lib/child/main.js                                    |  2 +-
 lib/child/requestNotifier.js                         |  4 ++--
 lib/{cssProperties.js => elemHideEmulation.js}       |  0
 lib/main.js                                          |  2 +-
 metadata.gecko                                       |  5 +++--
 13 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/chrome/content/ui/filters-backup.js b/chrome/content/ui/filters-backup.js
index 09005f2..46256fa 100644
--- a/chrome/content/ui/filters-backup.js
+++ b/chrome/content/ui/filters-backup.js
@@ -317,7 +317,7 @@ var Backup =
         if (filter instanceof RegExpFilter && filter.contentType & (RegExpFilter.typeMap.GENERICHIDE | RegExpFilter.typeMap.GENERICBLOCK) && Services.vc.compare(minVersion, "2.6.12") < 0)
           minVersion = "2.6.12";
 
-        if (filter instanceof CSSPropertyFilter && Services.vc.compare(minVersion, "2.7.3") < 0)
+        if (filter instanceof ElemHideEmulationFilter && Services.vc.compare(minVersion, "2.7.3") < 0)
           minVersion = "2.7.3";
 
         if (filter instanceof RegExpFilter &&
diff --git a/chrome/content/ui/filters-filterview.js b/chrome/content/ui/filters-filterview.js
index 2a824bc..4b8c94f 100644
--- a/chrome/content/ui/filters-filterview.js
+++ b/chrome/content/ui/filters-filterview.js
@@ -652,7 +652,7 @@ var FilterView =
     this.editDummy = {filter: {text: ""}};
 
     let atomService = Cc["@mozilla.org/atom-service;1"].getService(Ci.nsIAtomService);
-    let stringAtoms = ["col-filter", "col-enabled", "col-hitcount", "col-lasthit", "type-invalid", "type-comment", "type-blocking", "type-whitelist", "type-elemhide", "type-elemhideexception", "type-cssproperty"];
+    let stringAtoms = ["col-filter", "col-enabled", "col-hitcount", "col-lasthit", "type-invalid", "type-comment", "type-blocking", "type-whitelist", "type-elemhide", "type-elemhideexception", "type-elemhideemulation"];
     let boolAtoms = ["selected", "dummy", "slow", "disabled"];
 
     this.atoms = {};
diff --git a/chrome/content/ui/sidebar.js b/chrome/content/ui/sidebar.js
index 21ba382..3cf66bb 100644
--- a/chrome/content/ui/sidebar.js
+++ b/chrome/content/ui/sidebar.js
@@ -1001,7 +1001,7 @@ var treeView = {
           state = "state-whitelisted";
         else if (filter instanceof BlockingFilter)
           state = "state-filtered";
-        else if (filter instanceof ElemHideFilter || filter instanceof CSSPropertyFilter)
+        else if (filter instanceof ElemHideFilter || filter instanceof ElemHideEmulationFilter)
           state = "state-hidden";
         else if (filter instanceof ElemHideException)
           state = "state-hiddenexception";
diff --git a/chrome/content/ui/utils.js b/chrome/content/ui/utils.js
index bff3969..937ab25 100644
--- a/chrome/content/ui/utils.js
+++ b/chrome/content/ui/utils.js
@@ -36,7 +36,7 @@ function require(/**String*/ module)
 var {Policy} = require("contentPolicy");
 var {Filter, InvalidFilter, CommentFilter, ActiveFilter, RegExpFilter,
      BlockingFilter, WhitelistFilter, ElemHideBase, ElemHideFilter,
-     ElemHideException, CSSPropertyFilter} = require("filterClasses");
+     ElemHideException, ElemHideEmulationFilter} = require("filterClasses");
 var {FilterNotifier} = require("filterNotifier");
 var {FilterStorage} = require("filterStorage");
 var {IO} = require("io");
diff --git a/chrome/locale/en-US/global.properties b/chrome/locale/en-US/global.properties
index 4130d1b..9f67ff0 100644
--- a/chrome/locale/en-US/global.properties
+++ b/chrome/locale/en-US/global.properties
@@ -32,7 +32,7 @@ filter_unknown_option=Unknown filter option
 filter_invalid_regexp=Invalid regular expression
 filter_elemhide_duplicate_id=Only one ID of the element to be hidden can be specified
 filter_elemhide_nocriteria=No criteria specified to recognize the element to be hidden
-filter_cssproperty_nodomain=No active domain specified for CSS property filter
+filter_elemhideemulation_nodomain=No active domain specified for extended element hiding filter
 
 subscription_invalid_location=Filter list location is neither a valid URL nor a valid file name.
 
diff --git a/chrome/skin/filters.css b/chrome/skin/filters.css
index 344245d..48cb582 100644
--- a/chrome/skin/filters.css
+++ b/chrome/skin/filters.css
@@ -157,7 +157,7 @@ treechildren:-moz-locale-dir(rtl)::-moz-tree-cell(col-filter, type-blocking),
 treechildren:-moz-locale-dir(rtl)::-moz-tree-cell(col-filter, type-whitelist),
 treechildren:-moz-locale-dir(rtl)::-moz-tree-cell(col-filter, type-elemhide),
 treechildren:-moz-locale-dir(rtl)::-moz-tree-cell(col-filter, type-elemhideexception),
-treechildren:-moz-locale-dir(rtl)::-moz-tree-cell(col-filter, type-cssproperty)
+treechildren:-moz-locale-dir(rtl)::-moz-tree-cell(col-filter, type-elemhideemulation)
 {
   direction: ltr;
   text-align: end;
@@ -175,7 +175,7 @@ treechildren::-moz-tree-cell-text(col-filter, type-elemhideexception, selected-f
 }
 
 treechildren::-moz-tree-cell-text(col-filter, type-elemhide, selected-false),
-treechildren::-moz-tree-cell-text(col-filter, type-cssproperty, selected-false)
+treechildren::-moz-tree-cell-text(col-filter, type-elemhideemulation, selected-false)
 {
   color: #000080;
 }
diff --git a/dependencies b/dependencies
index aa31622..8620f2f 100644
--- a/dependencies
+++ b/dependencies
@@ -1,5 +1,5 @@
 _root = hg:https://hg.adblockplus.org/ git:https://github.com/adblockplus/
 _self = buildtools/ensure_dependencies.py
 buildtools = buildtools hg:dadad687f607 git:c5d65cb
-adblockpluscore = adblockpluscore hg:69040cb75a3b git:244493e
-adblockplusui = adblockplusui hg:253faf3ccf79 git:ebc5d8a
+adblockpluscore = adblockpluscore hg:b1e70036624f git:44e6d2d
+adblockplusui = adblockplusui hg:4286b54830e5 git:dd8888e
diff --git a/lib/child/cssProperties.js b/lib/child/elemHideEmulation.js
similarity index 91%
rename from lib/child/cssProperties.js
rename to lib/child/elemHideEmulation.js
index 279a900..68b4a82 100644
--- a/lib/child/cssProperties.js
+++ b/lib/child/elemHideEmulation.js
@@ -31,7 +31,7 @@
       frames: getFrames(window),
       payload: {
         type: "filters.get",
-        what: "cssproperties"
+        what: "elemhideemulation"
       }
     };
     port.emitWithResponse("ext_message", message).then(callback);
@@ -46,11 +46,11 @@
     utils.loadSheet(uri, Ci.nsIDOMWindowUtils.USER_SHEET);
   }
 
-  function initCSSPropertyFilters()
+  function initElemHideEmulation()
   {
-    let scope = {};
+    let scope = Object.assign({}, require("common"));
     Services.scriptloader.loadSubScript(
-        "chrome://adblockplus/content/cssProperties.js", scope);
+        "chrome://adblockplus/content/elemHideEmulation.js", scope);
 
     let onContentWindow = (subject, topic, data) =>
     {
@@ -60,7 +60,7 @@
       let onReady = event =>
       {
         subject.removeEventListener("load", onReady);
-        let handler = new scope.CSSPropertyFilters(
+        let handler = new scope.ElemHideEmulation(
           subject, getFilters.bind(null, subject), (selectors, filters) =>
           {
             if (selectors.length == 0)
@@ -94,7 +94,7 @@
                 // TODO: Show the actual matching selector here?
                 location: filter.replace(/^.*?##/, ""),
                 filter: filter,
-                filterType: "cssproperty"
+                filterType: "elemhideemulation"
               });
             }
           }
@@ -115,5 +115,5 @@
     });
   }
 
-  initCSSPropertyFilters();
+  initElemHideEmulation();
 })();
diff --git a/lib/child/main.js b/lib/child/main.js
index f751db3..ccae0d3 100644
--- a/lib/child/main.js
+++ b/lib/child/main.js
@@ -26,6 +26,6 @@ port.emitWithResponse("ping").then(() =>
   require("child/contentPolicy");
   require("child/contextMenu");
   require("child/dataCollector");
-  require("child/cssProperties");
+  require("child/elemHideEmulation");
   require("child/subscribeLinks");
 }).catch(e => Cu.reportError(e));
diff --git a/lib/child/requestNotifier.js b/lib/child/requestNotifier.js
index d8eb94b..57afdbd 100644
--- a/lib/child/requestNotifier.js
+++ b/lib/child/requestNotifier.js
@@ -362,7 +362,7 @@ RequestNotifier.addNodeData = function(node, topWnd, {contentType, docDomain, th
   }
 
   let stats = windowStats.get(topWnd.document);
-  if (filterType != "elemhide" && filterType != "elemhideexception" && filterType != "cssproperty")
+  if (filterType != "elemhide" && filterType != "elemhideexception" && filterType != "elemhideemulation")
     stats.items++;
   if (filter)
   {
@@ -370,7 +370,7 @@ RequestNotifier.addNodeData = function(node, topWnd, {contentType, docDomain, th
       stats.blocked++;
     else if (filterType == "whitelist" || filterType == "elemhideexception")
       stats.whitelisted++;
-    else if (filterType == "elemhide" || filterType == "cssproperty")
+    else if (filterType == "elemhide" || filterType == "elemhideemulation")
       stats.hidden++;
 
     if (filter in stats.filters)
diff --git a/lib/cssProperties.js b/lib/elemHideEmulation.js
similarity index 100%
rename from lib/cssProperties.js
rename to lib/elemHideEmulation.js
diff --git a/lib/main.js b/lib/main.js
index 8738375..e19dd17 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -33,7 +33,7 @@ require("messageResponder");
 require("ui");
 require("objectTabs");
 require("elemHideFF");
-require("cssProperties");
+require("elemHideEmulation");
 
 function bootstrapChildProcesses()
 {
diff --git a/metadata.gecko b/metadata.gecko
index 8033f0e..03f0ced 100644
--- a/metadata.gecko
+++ b/metadata.gecko
@@ -60,15 +60,16 @@ chrome/content/ui/skin/social/weibo.png = adblockplusui/skin/social/weibo.png
 chrome/content/ui/ext/common.js = ext/common.js
 chrome/content/ui/ext/content.js = ext/content.js
 chrome/content/ui/subscriptions.xml = adblockpluscore/chrome/content/ui/subscriptions.xml
-chrome/content/cssProperties.js = adblockpluscore/chrome/content/cssProperties.js
+chrome/content/elemHideEmulation.js = adblockpluscore/chrome/content/elemHideEmulation.js
 lib/ext_background.js = ext/background.js
 lib/ext_common.js = ext/common.js
 lib/messageResponder.js = adblockplusui/messageResponder.js
 lib/antiadblockInit.js = adblockpluscore/lib/antiadblockInit.js
+lib/common.js = adblockpluscore/lib/common.js
 lib/coreUtils.js = adblockpluscore/lib/coreUtils.js
-lib/cssRules.js = adblockpluscore/lib/cssRules.js
 lib/downloader.js = adblockpluscore/lib/downloader.js
 lib/elemHide.js = adblockpluscore/lib/elemHide.js
+lib/elemHideEmulation.js = adblockpluscore/lib/elemHideEmulation.js
 lib/events.js = adblockpluscore/lib/events.js
 lib/filterClasses.js = adblockpluscore/lib/filterClasses.js
 lib/filterListener.js = adblockpluscore/lib/filterListener.js

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git



More information about the Pkg-mozext-commits mailing list