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

Unified Diff: lib/content/elemHideEmulation.js

Issue 29884580: Issue 6504 - Remove element hiding emulation code related to style sheets (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Remove first parameter to constructor Created Sept. 29, 2018, 1:07 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
« no previous file with comments | « no previous file | test/browser/elemHideEmulation.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/content/elemHideEmulation.js
===================================================================
--- a/lib/content/elemHideEmulation.js
+++ b/lib/content/elemHideEmulation.js
@@ -600,24 +600,23 @@
function shouldObserveCharacterData(patterns)
{
return patterns.some(pattern => pattern.dependsOnCharacterData);
}
class ElemHideEmulation
{
- constructor(addSelectorsFunc, hideElemsFunc)
+ constructor(hideElemsFunc)
{
this._filteringInProgress = false;
this._lastInvocation = -MIN_INVOCATION_INTERVAL;
this._scheduledProcessing = null;
this.document = document;
- this.addSelectorsFunc = addSelectorsFunc;
this.hideElemsFunc = hideElemsFunc;
this.observer = new MutationObserver(this.observe.bind(this));
}
isSameOrigin(stylesheet)
{
try
{
@@ -710,19 +709,16 @@
*/
_addSelectors(stylesheets, mutations, done)
{
if (testInfo)
testInfo.lastProcessedElements.clear();
let patterns = filterPatterns(this.patterns, {stylesheets, mutations});
- let selectors = [];
- let selectorFilters = [];
-
let elements = [];
let elementFilters = [];
let cssStyles = [];
// If neither any style sheets nor any DOM mutations have been specified,
// do full processing.
if (!stylesheets && !mutations)
@@ -778,18 +774,16 @@
let processPatterns = () =>
{
let cycleStart = performance.now();
if (!pattern)
{
if (!patterns.length)
{
- if (selectors.length > 0)
- this.addSelectorsFunc(selectors, selectorFilters);
if (elements.length > 0)
this.hideElemsFunc(elements, elementFilters);
if (typeof done == "function")
done();
return;
}
pattern = patterns.shift();
« no previous file with comments | « no previous file | test/browser/elemHideEmulation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld