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) --- dom/script/ScriptLoader.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'dom/script/ScriptLoader.h') diff --git a/dom/script/ScriptLoader.h b/dom/script/ScriptLoader.h index ed1e6acbc..20e76970f 100644 --- a/dom/script/ScriptLoader.h +++ b/dom/script/ScriptLoader.h @@ -479,13 +479,15 @@ public: * @param aIntegrity The expect hash url, if avail, of the request * @param aScriptFromHead Whether or not the script was a child of head */ - virtual void PreloadURI(nsIURI *aURI, const nsAString &aCharset, + virtual void PreloadURI(nsIURI *aURI, + const nsAString &aCharset, const nsAString &aType, const nsAString &aCrossOrigin, const nsAString& aIntegrity, bool aScriptFromHead, bool aAsync, bool aDefer, + bool aNoModule, const mozilla::net::ReferrerPolicy aReferrerPolicy); /** -- cgit v1.2.3 From ddc43bf9d7009a5d3b2ff84688450540b8eff84e Mon Sep 17 00:00:00 2001 From: Moonchild Date: Thu, 27 Aug 2020 15:44:53 +0000 Subject: Issue #618 - Implement preloading of module scripts. This hooks up module scripts to the existing preload mechanism. --- dom/script/ScriptLoader.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'dom/script/ScriptLoader.h') diff --git a/dom/script/ScriptLoader.h b/dom/script/ScriptLoader.h index 20e76970f..2c5b683e7 100644 --- a/dom/script/ScriptLoader.h +++ b/dom/script/ScriptLoader.h @@ -173,6 +173,12 @@ public: return mScriptMode == ScriptMode::eAsync; } + virtual bool IsTopLevel() const + { + // Classic scripts are always top level. + return true; + } + void MaybeCancelOffThreadScript(); using super::getNext; -- cgit v1.2.3 From d49fb8a6919dfa446951bf83e14939ff2fc95db1 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Tue, 8 Sep 2020 11:00:27 +0000 Subject: Issue #618 - Clear the module map when changing a Document's global and add release build assertions for mismatching compartments. --- dom/script/ScriptLoader.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'dom/script/ScriptLoader.h') diff --git a/dom/script/ScriptLoader.h b/dom/script/ScriptLoader.h index 2c5b683e7..73f2a9258 100644 --- a/dom/script/ScriptLoader.h +++ b/dom/script/ScriptLoader.h @@ -506,6 +506,12 @@ public: return mPendingChildLoaders.AppendElement(aChild) != nullptr; } + /* + * Clear the map of loaded modules. Called when a Document object is reused + * for a different global. + */ + void ClearModuleMap(); + private: virtual ~ScriptLoader(); -- cgit v1.2.3