Issue #618 - (async, preload) Correctly pass info about async/defer to parser.

This makes sure we don't block body-referred sub-resources by head-referenced
defer and async scripts. This is important for all script loads, not just
modules, but is added here because it was run into while implementing modules.
This commit is contained in:
Moonchild 2020-08-24 11:11:17 +00:00 committed by Roy Tam
commit 3fa4aabfad
7 changed files with 53 additions and 15 deletions

View file

@ -76,6 +76,8 @@ public:
mHasSourceMapURL(false),
mInDeferList(false),
mInAsyncList(false),
mPreloadAsAsync(false),
mPreloadAsDefer(false),
mIsNonAsyncScriptInserted(false),
mIsXSLT(false),
mIsCanceled(false),
@ -161,6 +163,8 @@ public:
bool mHasSourceMapURL; // Does the HTTP header have a source map url?
bool mInDeferList; // True if we live in mDeferRequests.
bool mInAsyncList; // True if we live in mLoadingAsyncRequests or mLoadedAsyncRequests.
bool mPreloadAsAsync; // True if this is a preload request and the script is async
bool mPreloadAsDefer; // True if this is a preload request and the script is defer
bool mIsNonAsyncScriptInserted; // True if we live in mNonAsyncExternalScriptInsertedRequests
bool mIsXSLT; // True if we live in mXSLTRequests.
bool mIsCanceled; // True if we have been explicitly canceled.
@ -459,6 +463,8 @@ public:
const nsAString &aCrossOrigin,
const nsAString& aIntegrity,
bool aScriptFromHead,
bool aAsync,
bool aDefer,
const mozilla::net::ReferrerPolicy aReferrerPolicy);
/**