Bug 1436743 - Dispatch events via the docgroup rather than the tabgroup when possible. r=mystor
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user