Bug 1436743 - Dispatch events via the docgroup rather than the tabgroup when possible. r=mystor

This commit is contained in:
Josh Matthews
2018-02-08 15:54:00 -05:00
parent d7f5390591
commit d169301c59
8 changed files with 28 additions and 13 deletions

View File

@@ -1376,10 +1376,15 @@ ScriptLoader::ProcessExternalScript(nsIScriptElement* aElement,
ReportErrorToConsole(request, rv);
// Asynchronously report the load failure
NS_DispatchToCurrentThread(
nsCOMPtr<nsIRunnable> runnable =
NewRunnableMethod("nsIScriptElement::FireErrorEvent",
aElement,
&nsIScriptElement::FireErrorEvent));
&nsIScriptElement::FireErrorEvent);
if (mDocument) {
mDocument->Dispatch(TaskCategory::Other, runnable.forget());
} else {
NS_DispatchToCurrentThread(runnable);
}
return false;
}
}