| Index: lib/content/elemHideEmulation.js |
| =================================================================== |
| --- a/lib/content/elemHideEmulation.js |
| +++ b/lib/content/elemHideEmulation.js |
| @@ -602,22 +602,28 @@ |
| { |
| return patterns.some(pattern => pattern.dependsOnCharacterData); |
| } |
| class ElemHideEmulation |
| { |
| constructor(addSelectorsFunc, hideElemsFunc) |
| { |
| + // Note: The first parameter to this constructor was previously used for |
| + // injecting style sheets into the document for :-abp-properties() but this |
| + // code has since moved on to use inline styles for all types of emulation |
| + // filters (#6610). Nevertheless, there is a plan to go back to using style |
| + // sheets on platforms that support the tabs.removeCSS API (#6504); hence |
| + // this first parameter remains for now. |
| + |
| 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 +716,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 +781,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(); |