summaryrefslogtreecommitdiffstats
path: root/dom/script/nsIScriptElement.h
diff options
context:
space:
mode:
Diffstat (limited to 'dom/script/nsIScriptElement.h')
-rw-r--r--dom/script/nsIScriptElement.h29
1 files changed, 25 insertions, 4 deletions
diff --git a/dom/script/nsIScriptElement.h b/dom/script/nsIScriptElement.h
index 470d51c94..e3e1bc49a 100644
--- a/dom/script/nsIScriptElement.h
+++ b/dom/script/nsIScriptElement.h
@@ -13,6 +13,7 @@
#include "nsIScriptLoaderObserver.h"
#include "nsWeakPtr.h"
#include "nsIParser.h"
+#include "nsIDocument.h"
#include "nsContentCreatorFunctions.h"
#include "nsIDOMHTMLScriptElement.h"
#include "mozilla/CORSMode.h"
@@ -37,6 +38,7 @@ public:
mForceAsync(aFromParser == mozilla::dom::NOT_FROM_PARSER ||
aFromParser == mozilla::dom::FROM_PARSER_FRAGMENT),
mFrozen(false),
+ mIsModule(false),
mDefer(false),
mAsync(false),
mExternal(false),
@@ -73,11 +75,25 @@ public:
virtual void GetScriptCharset(nsAString& charset) = 0;
/**
- * Freezes the return values of GetScriptDeferred(), GetScriptAsync() and
- * GetScriptURI() so that subsequent modifications to the attributes don't
- * change execution behavior.
+ * Freezes the return values of the following methods so that subsequent
+ * modifications to the attributes don't change execution behavior:
+ * - GetScriptIsModule()
+ * - GetScriptDeferred()
+ * - GetScriptAsync()
+ * - GetScriptURI()
+ * - GetScriptExternal()
*/
- virtual void FreezeUriAsyncDefer() = 0;
+ virtual void FreezeExecutionAttrs(nsIDocument* aOwnerDoc) = 0;
+
+ /**
+ * Is the script a module script?
+ * Currently only supported by HTML scripts.
+ */
+ bool GetScriptIsModule()
+ {
+ NS_PRECONDITION(mFrozen, "Execution attributes not yet frozen: Not ready for this call!");
+ return mIsModule;
+ }
/**
* Is the script deferred. Currently only supported by HTML scripts.
@@ -293,6 +309,11 @@ protected:
bool mFrozen;
/**
+ * The effective moduleness.
+ */
+ bool mIsModule;
+
+ /**
* The effective deferredness.
*/
bool mDefer;