summaryrefslogtreecommitdiffstats
path: root/parser/html/nsHtml5SpeculativeLoad.h
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-08-24 11:11:17 +0000
committerMoonchild <moonchild@palemoon.org>2020-08-30 09:47:49 +0000
commitd58cb8e11b15c054f0773918cd7fd89ce2a7464e (patch)
tree380d82f3b0ad12222da2338da83408b97b402634 /parser/html/nsHtml5SpeculativeLoad.h
parent429a7bdb93e443236f4a4b04afc9a12c78f54247 (diff)
downloadUXP-d58cb8e11b15c054f0773918cd7fd89ce2a7464e.tar
UXP-d58cb8e11b15c054f0773918cd7fd89ce2a7464e.tar.gz
UXP-d58cb8e11b15c054f0773918cd7fd89ce2a7464e.tar.lz
UXP-d58cb8e11b15c054f0773918cd7fd89ce2a7464e.tar.xz
UXP-d58cb8e11b15c054f0773918cd7fd89ce2a7464e.zip
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.
Diffstat (limited to 'parser/html/nsHtml5SpeculativeLoad.h')
-rw-r--r--parser/html/nsHtml5SpeculativeLoad.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/parser/html/nsHtml5SpeculativeLoad.h b/parser/html/nsHtml5SpeculativeLoad.h
index 6f1365bcf..fcc84de4f 100644
--- a/parser/html/nsHtml5SpeculativeLoad.h
+++ b/parser/html/nsHtml5SpeculativeLoad.h
@@ -128,7 +128,9 @@ class nsHtml5SpeculativeLoad {
nsHtml5String aType,
nsHtml5String aCrossOrigin,
nsHtml5String aIntegrity,
- bool aParserInHead)
+ bool aParserInHead,
+ bool aAsync,
+ bool aDefer)
{
NS_PRECONDITION(mOpCode == eSpeculativeLoadUninitialized,
"Trying to reinitialize a speculative load!");
@@ -139,6 +141,8 @@ class nsHtml5SpeculativeLoad {
aType.ToString(mTypeOrCharsetSourceOrDocumentMode);
aCrossOrigin.ToString(mCrossOrigin);
aIntegrity.ToString(mIntegrity);
+ mIsAsync = aAsync;
+ mIsDefer = aDefer;
}
inline void InitStyle(nsHtml5String aUrl,
@@ -221,6 +225,13 @@ class nsHtml5SpeculativeLoad {
private:
eHtml5SpeculativeLoad mOpCode;
+
+ /**
+ * Whether the refering element has async and/or defer attributes.
+ */
+ bool mIsAsync;
+ bool mIsDefer;
+
nsString mUrl;
nsString mReferrerPolicy;
nsString mMetaCSP;