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

Unified Diff: include.preload.js

Issue 29894564: Issue 6999 - Remove inlineEmulated flag in content.applyFilters (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created Sept. 28, 2018, 11:44 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 | lib/contentFiltering.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include.preload.js
===================================================================
--- a/include.preload.js
+++ b/include.preload.js
@@ -394,20 +394,19 @@
}
};
function ContentFiltering()
{
this.styles = new Map();
this.tracer = null;
this.inline = true;
- this.inlineEmulated = true;
this.elemHideEmulation = new ElemHideEmulation(
- this.addSelectors.bind(this),
+ () => {},
this.hideElements.bind(this)
);
}
ContentFiltering.prototype = {
selectorGroupSize: 1024,
addSelectorsInline(selectors, groupName, appendOnly = false)
{
@@ -457,17 +456,17 @@
let selector = selectors.slice(i, i + this.selectorGroupSize).join(", ");
style.sheet.insertRule(selector + "{display: none !important;}",
style.sheet.cssRules.length);
}
},
addSelectors(selectors, filters, groupName = "emulated", appendOnly = false)
{
- if (this.inline || this.inlineEmulated)
+ if (this.inline)
{
// Insert the style rules inline if we have been instructed by the
// background page to do so. This is usually the case, except on platforms
// that do support user stylesheets via the browser.tabs.insertCSS API
// (Firefox 53 onwards for now and possibly Chrome in the near future).
// Once all supported platforms have implemented this API, we can remove
// the code below. See issue #5090.
// Related Chrome and Firefox issues:
@@ -517,29 +516,23 @@
if (this.tracer)
this.tracer.disconnect();
this.tracer = null;
if (response.trace)
this.tracer = new ElementHidingTracer();
this.inline = response.inline;
- this.inlineEmulated = !!response.inlineEmulated;
if (this.inline)
this.addSelectorsInline(response.selectors, "standard");
if (this.tracer)
this.tracer.addSelectors(response.selectors);
- // Prefer CSS selectors for -abp-has and -abp-contains unless the
- // background page has asked us to use inline styles.
- this.elemHideEmulation.useInlineStyles = this.inline ||
- this.inlineEmulated;
-
this.elemHideEmulation.apply(response.emulatedPatterns);
});
}
};
if (document instanceof HTMLDocument)
{
checkSitekey();
« no previous file with comments | « no previous file | lib/contentFiltering.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld