From 9c515323ff6cc0dc42b9ee64397f297b7566d0a4 Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Sun, 30 Aug 2020 22:10:17 -0400 Subject: Issue #618 - Don't preload nomodule scripts when modules are enabled (uplift) --- parser/html/nsHtml5SpeculativeLoad.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'parser/html/nsHtml5SpeculativeLoad.h') diff --git a/parser/html/nsHtml5SpeculativeLoad.h b/parser/html/nsHtml5SpeculativeLoad.h index fcc84de4f..1f4a61741 100644 --- a/parser/html/nsHtml5SpeculativeLoad.h +++ b/parser/html/nsHtml5SpeculativeLoad.h @@ -10,7 +10,8 @@ class nsHtml5TreeOpExecutor; -enum eHtml5SpeculativeLoad { +enum eHtml5SpeculativeLoad +{ #ifdef DEBUG eSpeculativeLoadUninitialized, #endif @@ -23,6 +24,8 @@ enum eHtml5SpeculativeLoad { eSpeculativeLoadPictureSource, eSpeculativeLoadScript, eSpeculativeLoadScriptFromHead, + eSpeculativeLoadNoModuleScript, + eSpeculativeLoadNoModuleScriptFromHead, eSpeculativeLoadStyle, eSpeculativeLoadManifest, eSpeculativeLoadSetDocumentCharset, @@ -130,12 +133,18 @@ class nsHtml5SpeculativeLoad { nsHtml5String aIntegrity, bool aParserInHead, bool aAsync, - bool aDefer) + bool aDefer, + bool aNoModule) { NS_PRECONDITION(mOpCode == eSpeculativeLoadUninitialized, "Trying to reinitialize a speculative load!"); - mOpCode = aParserInHead ? - eSpeculativeLoadScriptFromHead : eSpeculativeLoadScript; + if (aNoModule) { + mOpCode = aParserInHead ? eSpeculativeLoadNoModuleScriptFromHead + : eSpeculativeLoadNoModuleScript; + } else { + mOpCode = aParserInHead ? eSpeculativeLoadScriptFromHead + : eSpeculativeLoadScript; + } aUrl.ToString(mUrl); aCharset.ToString(mCharset); aType.ToString(mTypeOrCharsetSourceOrDocumentMode); -- cgit v1.2.3