summaryrefslogtreecommitdiff
path: root/parser/html/nsHtml5SpeculativeLoad.h
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2020-08-26 11:19:42 -0400
committerGaming4JC <g4jc@hyperbola.info>2020-08-26 11:19:42 -0400
commit38d13e2779f9bfbf8620ead68a9bf0ffbed5762a (patch)
treec5aa35810edee4cd678441df73ff8fbfd4ed3e5f /parser/html/nsHtml5SpeculativeLoad.h
parentb78f53ffb09a6aae6dbdc069c7cdd42d11b5eed2 (diff)
downloaduxp-38d13e2779f9bfbf8620ead68a9bf0ffbed5762a.tar.gz
Issue #618 - Don't preload nomodule scripts when modules are enabled
Ref: BZ 1382020
Diffstat (limited to 'parser/html/nsHtml5SpeculativeLoad.h')
-rw-r--r--parser/html/nsHtml5SpeculativeLoad.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/parser/html/nsHtml5SpeculativeLoad.h b/parser/html/nsHtml5SpeculativeLoad.h
index fcc84de4f6..1f4a617416 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);