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 attribute
  • textContent attribute
  • -
  • The tree concept
  • +
  • The tree and shadow tree concepts
  • The tree order concept
  • The root concept
  • The inclusive ancestor concept
  • @@ -8536,7 +8536,7 @@ partial /*sealed*/ interface Document { [SameObject] readonly attribute HTMLCollection forms; [SameObject] readonly attribute HTMLCollection scripts; NodeList getElementsByName(DOMString elementName); - readonly attribute HTMLOrSVGScriptElement? currentScript; + readonly attribute HTMLOrSVGScriptElement? currentScript; // classic scripts in a document only // dynamic markup insertion Document open(optional DOMString type = "text/html", optional DOMString replace = ""); @@ -9053,12 +9053,14 @@ partial /*sealed*/ interface Document {

    Returns 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.

    + that is currently executing, as long as the element represents a classic script. + 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).

    + handler, or a timeout), or if the currently executing script or SVG + script element represents a module script.

    @@ -9067,12 +9069,19 @@ partial /*sealed*/ interface Document {

    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.

    + getting, must return the value to which it was most recently set. When the 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.

    +

    @@ -59012,7 +59021,8 @@ o............A....e
  • -

    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.

    @@ -59035,22 +59045,7 @@ o............A....e

    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.

    + set.

  • @@ -59061,14 +59056,25 @@ o............A....e
    "classic"
    -

    Run the classic script given by the script's script.

    +
      +
    1. Set the script element's node document's currentScript attribute to the + script element.

    2. + +
    3. Run the classic script given by the script's script.

    4. +
    "module"
    -

    Run the module script given by the script's script.

    +
      +
    1. Set the script element's node document's currentScript attribute to null.

    2. + +
    3. Run the module script given by the script's script.

    4. +
    @@ -59076,8 +59082,8 @@ o............A....e
  • -

    Initialise the script element's node document's currentScript object to old script +

    Set the script element's node document's currentScript attribute to old script element.

  • @@ -59090,7 +59096,8 @@ o............A....e
  • -

    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.