зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1281366. Ensure that when unblocking the scriptloader we try to process scripts if we have _any_ scripts to process, not just parser-blocking ones. r=smaug
This commit is contained in:
Родитель
6ef497660b
Коммит
2a3c63b8e7
|
@ -2028,7 +2028,12 @@ nsScriptLoader::EvaluateScript(nsScriptLoadRequest* aRequest)
|
|||
void
|
||||
nsScriptLoader::ProcessPendingRequestsAsync()
|
||||
{
|
||||
if (mParserBlockingRequest || !mPendingChildLoaders.IsEmpty()) {
|
||||
if (mParserBlockingRequest ||
|
||||
!mXSLTRequests.isEmpty() ||
|
||||
!mLoadedAsyncRequests.isEmpty() ||
|
||||
!mNonAsyncExternalScriptInsertedRequests.isEmpty() ||
|
||||
!mDeferRequests.isEmpty() ||
|
||||
!mPendingChildLoaders.IsEmpty()) {
|
||||
NS_DispatchToCurrentThread(NewRunnableMethod(this,
|
||||
&nsScriptLoader::ProcessPendingRequests));
|
||||
}
|
||||
|
|
|
@ -36006,6 +36006,12 @@
|
|||
"url": "/XMLHttpRequest/xmlhttprequest-sync-block-scripts.html"
|
||||
}
|
||||
],
|
||||
"XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader.html": [
|
||||
{
|
||||
"path": "XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader.html",
|
||||
"url": "/XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader.html"
|
||||
}
|
||||
],
|
||||
"dom/events/EventListener-incumbent-global-1.sub.html": [
|
||||
{
|
||||
"path": "dom/events/EventListener-incumbent-global-1.sub.html",
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<script>
|
||||
function secondScriptRan() {
|
||||
parent.postMessage("done", "*");
|
||||
}
|
||||
|
||||
function createSecondScript() {
|
||||
var script = document.createElement("script");
|
||||
script.src = "data:application/javascript,secondScriptRan()";
|
||||
document.head.appendChild(script);
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "data:,", false);
|
||||
xhr.send();
|
||||
}
|
||||
</script>
|
||||
<script src="data:application/javascript,createSecondScript()" defer></script>
|
|
@ -0,0 +1,16 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>Ensure that an async script added during a defer script that then does a
|
||||
sync XHR still runs</title>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<!--
|
||||
We run the test in a subframe, because something in the testharness stuff
|
||||
interferes with defer scripts -->
|
||||
<script>
|
||||
var t = async_test();
|
||||
onmessage = t.step_func_done(function(e) {
|
||||
assert_equals(e.data, "done");
|
||||
});
|
||||
</script>
|
||||
<iframe src="xmlhttprequest-sync-not-hang-scriptloader-subframe.html"></iframe>
|
Загрузка…
Ссылка в новой задаче