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

Unified Diff: lib/content/elemHideEmulation.js

Issue 29596576: Issue 5956 - Fix intermittent element hiding emulation failures in Firefox (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Nov. 3, 2017, 8:53 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 | no next file » | 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
@@ -546,16 +546,29 @@ ElemHideEmulation.prototype = {
{
let newStylesheets = this._scheduledProcessing.stylesheets;
this._filteringInProgress = true;
this._scheduledProcessing = null;
this._addSelectors(newStylesheets, completion);
},
MIN_INVOCATION_INTERVAL - (performance.now() - this._lastInvocation));
}
+ else if (this.document.readyState == "loading")
+ {
+ this._scheduledProcessing = {stylesheets};
+ let handler = () =>
+ {
+ document.removeEventListener("DOMContentLoaded", handler);
+ let newStylesheets = this._scheduledProcessing.stylesheets;
+ this._filteringInProgress = true;
+ this._scheduledProcessing = null;
+ this._addSelectors(newStylesheets, completion);
+ };
+ document.addEventListener("DOMContentLoaded", handler);
+ }
else
{
this._filteringInProgress = true;
this._addSelectors(stylesheets, completion);
}
},
onLoad(event)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld