diff --git a/source b/source index 24f8974201e..4612803583c 100644 --- a/source +++ b/source @@ -3113,7 +3113,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
id
attributetextContent
attributeReturns the script
element, or the SVG script
element,
- that is currently executing. In the case of reentrant script execution, returns the one that
- most recently started executing amongst those that have not yet finished executing.
Returns null if the Document
is not currently executing a script
or SVG script
element (e.g., because the running script is an event
- handler, or a timeout).
script
or SVG
+ script
element represents a module script.
The currentScript
attribute, on
- getting, must return the value to which it was most recently initialised. When the
- Document
is created, the currentScript
must be initialised to null.
Document
+ is created, the currentScript
must be
+ initialised to null.
This API has fallen out of favor in the implementor and standards community, as
+ it globally exposes script
or SVG script
elements. As such,
+ it is not available in newer contexts, such as when running module
+ scripts or when running scripts in a shadow tree. We are looking into creating
+ a new solution for identifying the running script in such contexts, which does not make it
+ globally available: see issue #1013.
Fire a simple event named If the script's type is "
classic
", fire a simple event named beforescriptexecute
that bubbles and is cancelable
at the script
element.
Let old script element be the value to which the script
element's node document's currentScript
object was most recently
- initialised.
Initialise the script
element's node document's currentScript
object to the script
- element.
Let settings object be the environment settings object of the
- script
element's node document's Window
object.
classic
"Run the classic script given by the script's script.
+Set the script
element's node document's currentScript
attribute to the
+ script
element.
Run the classic script given by the script's script.
module
"Run the module script given by the script's script.
+Set the script
element's node document's currentScript
attribute to null.
Run the module script given by the script's script.
Initialise the Set the script
element's node document's currentScript
object to old script
+ script
element's node document's currentScript
attribute to old script
element.
Fire a simple event named If the script's type is "
classic
", fire a simple event named afterscriptexecute
that bubbles (but is not
cancelable) at the script
element.