diff --git a/source b/source index 49ab997c711..d853c4c0d8e 100644 --- a/source +++ b/source @@ -2944,6 +2944,17 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • The TypedArray Constructors table
  • +

    Users agents that support JavaScript must also implement the import() proposal. + The following terms are defined there, and used in this specification:

    + + + +

    This feature is not quite integrated yet, but will be + shortly. In the meantime there are some parts of the script processing model that have been + updated to support it, which might appear pointless until that integration is complete.

    + @@ -58087,11 +58098,19 @@ o............A....e -
  • Let parser state be "parser-inserted" if the +

  • Let parser metadata be "parser-inserted" if the script element has been flagged as "parser-inserted", and - "not parser-inserted" otherwise.

  • + "not-parser-inserted" otherwise.

    -
  • Let settings be the element's node document's +

  • Let options be a script fetch options whose cryptographic nonce is cryptographic + nonce, integrity metadata is + integrity metadata, parser + metadata is parser metadata, and credentials mode is module script + credentials mode.

    + +
  • Let settings object be the element's node document's Window object's environment settings object.

  • @@ -58124,16 +58143,14 @@ o............A....e
    "classic"
    -

    Fetch a classic script given url, settings, - cryptographic nonce, integrity metadata, parser state, - CORS setting, and encoding.

    +

    Fetch a classic script given url, settings object, + options, CORS setting, and encoding.

    "module"
    -

    Fetch a module script graph given url, settings, - "script", cryptographic nonce, parser state, - and module script credentials mode.

    +

    Fetch a module script graph given url, settings + object, "script", and options.

    @@ -58177,7 +58194,7 @@ o............A....e
    1. Let script be the result of creating a classic script using - source text and settings.

    2. + source text, settings object, and options.

    3. Set the script's script to script.

    4. @@ -58193,9 +58210,8 @@ o............A....e document's document base URL.

    5. Let script be the result of creating a module script using - source text, settings, base URL, cryptographic - nonce, parser state, and module script credentials - mode.

    6. + source text, settings object, base URL, and + options.

    7. If this returns null, set the script's script to null and abort these substeps; the script is ready.

    8. @@ -81967,7 +81983,8 @@ interface Location { // but see also running the classic script script. If evaluation was unsuccessful, let @@ -86305,6 +86322,12 @@ interface NavigatorOnLine {

      A JavaScript value, which has meaning only if the record is null.

      + +
      Fetch options
      + +
      A script fetch options, containing various options related to fetching this + script or module scripts that it imports.
      @@ -86320,7 +86343,7 @@ interface NavigatorOnLine {

      A module script is a script - that has the following additional items:

      + that has the following additional item:

      A base URL
      @@ -86334,33 +86357,6 @@ interface NavigatorOnLine {
    -
    A credentials mode
    - -
    - -

    A credentials mode used to fetch - imported modules.

    - -
    - -
    A cryptographic nonce
    - -
    - -

    A cryptographic nonce used to fetch - imported modules.

    - -
    - -
    A parser state
    - -
    - -

    The parser metadata used to fetch - imported modules.

    - -
    -

    We say that a module script is @@ -86564,6 +86560,79 @@ interface NavigatorOnLine { inputs and resulting in classic or module scripts.

    +
    + +

    We define script fetch options to be a struct with the following items:

    + +
    +
    cryptographic nonce
    + +

    The cryptographic nonce metadata used + for the initial fetch and for fetching any imported modules

    + +
    integrity metadata
    + +

    The integrity metadata used for + the initial fetch

    + +
    parser metadata
    + +

    The parser metadata used for the + initial fetch and for fetching any imported modules.

    + +
    credentials mode
    + +

    The credentials mode used for the + initial fetch (for module scripts) and for fetching any + imported modules (for both module scripts and classic scripts).

    +
    + +

    Recall that via the import() feature, classic scripts can import module scripts.

    + +

    The default classic script fetch options are a script fetch options + whose cryptographic nonce is the empty + string, integrity metadata is the + empty string, parser metadata is "not-parser-inserted", and credentials mode is "omit".

    + +

    Given a request request and a script + fetch options options, we define:

    + +
    +
    set up the classic script request

    Set request's cryptographic nonce metadata to + options's cryptographic + nonce, its integrity metadata to + options's integrity + metadata, and its parser metadata to + options's parser + metadata.

    + +
    set up the module script request

    Set request's + cryptographic nonce metadata to + options's cryptographic + nonce, its integrity metadata to + options's integrity + metadata, its parser metadata to + options's parser metadata, + and its credentials mode to + options's credentials + mode.

    +
    + +

    For any given script fetch options options, the descendant script + fetch options are a new script fetch options whose items all have the same values, except for the integrity metadata, which is instead the + empty string.

    + +
    +

    The algorithms below can be customized by optionally supplying a custom perform the fetch hook, which takes a request and an NavigatorOnLine {

    Service Workers is an example of a specification that runs these algorithms with its own options for the hook.

    +
    + +

    Now for the algorithms themselves.

    +

    To fetch a classic script given a url, a settings - object, a cryptographic nonce, an integrity metadata, a parser - state, a CORS setting, and a character encoding, run these steps. The - algorithm will asynchronously complete with either null (on failure) or a new classic - script (on success).

    + object, some options, a CORS setting, and a character + encoding, run these steps. The algorithm will asynchronously complete with either null (on + failure) or a new classic script (on success).

    1. Let request be the result of script", and CORS setting.

    2. Set request's client to - settings object, its cryptographic nonce - metadata to cryptographic nonce, its integrity metadata to integrity - metadata and its parser metadata to - parser state.

    3. + settings object.

      + +
    4. Set up the classic script request given request and + options.

    5. @@ -86658,7 +86729,8 @@ interface NavigatorOnLine { CORS-cross-origin, and false otherwise.

    6. Let script be the result of creating a classic script given - source text, settings object, and muted errors.

    7. + source text, settings object, options, and muted + errors.

    8. Asynchronously complete this algorithm with script.
    @@ -86704,7 +86776,8 @@ interface NavigatorOnLine { decoding response's body.

  • Let script be the result of creating a classic script using - source text and script settings object.

  • + source text, script settings object, and the default classic script + fetch options.

  • Asynchronously complete this algorithm with script.
  • @@ -86717,7 +86790,7 @@ interface NavigatorOnLine {
  • Let request be a new request whose url is url, client is settings object, destination is "script", destination is "script", parser metadata is "not parser-inserted", synchronous flag is set, and whose use-URL-credentials flag is set.

  • @@ -86751,25 +86824,24 @@ interface NavigatorOnLine { CORS-cross-origin, and false otherwise.

  • Let script be the result of creating a classic script given - source text, settings object, and muted errors.

  • + source text, settings object, the default classic script fetch + options, and muted errors.

  • Return script.

  • To fetch a module script graph given - a url, a settings object, a destination, a cryptographic - nonce, a parser state, and a credentials mode, run these steps. The - algorithm will asynchronously complete with either null (on failure) or a module - script (on success).

    + a url, a settings object, a destination, and some + options, run these steps. The algorithm will asynchronously complete with either null + (on failure) or a module script (on success).

    1. Let visited set be « url ».

    2. Perform the internal module script graph fetching procedure given - url, settings object, destination, cryptographic - nonce, parser state, credentials mode, settings object, - visited set, "client", and with the top-level module fetch - flag set. If the caller of this algorithm specified custom url, settings object, destination, options, + settings object, visited set, "client", and with the + top-level module fetch flag set. If the caller of this algorithm specified custom perform the fetch steps, pass those along as well.

      @@ -86787,13 +86859,20 @@ interface NavigatorOnLine {
      1. Let visited set be « url ».

      2. +
      3. Let options be a script fetch options whose cryptographic nonce is the empty string, integrity metadata is the empty string, + parser metadata is "not-parser-inserted", and credentials mode is credentials + mode.

        +
      4. Perform the internal module script graph fetching procedure given - url, fetch client settings object, destination, the empty - string, "not parser-inserted", credentials mode, module - map settings object, visited set, "client", and with the - top-level module fetch flag set. If the caller of this algorithm specified custom - perform the fetch steps, pass those along as - well.

        + url, fetch client settings object, destination, + options, module map settings object, visited set, "client", and with the top-level module fetch flag set. If the caller + of this algorithm specified custom perform the + fetch steps, pass those along as well.

      5. When the internal module script graph fetching procedure asynchronously completes with result, asynchronously complete this algorithm with @@ -86807,22 +86886,22 @@ interface NavigatorOnLine { a script">preparing a script, and should not be used directly by other specifications.

        To perform the internal module script graph fetching procedure given a - url, a fetch client settings object, a destination, a - cryptographic nonce, a parser state, a credentials mode, a - module map settings object, a visited set, a referrer, and a - top-level module fetch flag, perform these steps. The algorithm will asynchronously - complete with either null (on failure) or a module script (on success).

        + url, a fetch client settings object, a destination, a some + options, a module map settings object, a visited set, a + referrer, and a top-level module fetch flag, perform these steps. The + algorithm will asynchronously complete with either null (on failure) or a module + script (on success).

        1. Assert: visited set contains url.

        2. Fetch a single module script given url, fetch client settings - object, destination, cryptographic nonce, parser state, - credentials mode, module map settings object, referrer, and the - top-level module fetch flag. If the caller of this algorithm specified custom perform the fetch steps, pass those along while - fetching a single module script.

          + object, destination, options, module map settings object, + referrer, and the top-level module fetch flag. If the caller of this + algorithm specified custom perform the fetch + steps, pass those along while fetching a single + module script.

        3. Return from this algorithm, and run the following steps when fetching a single module script asynchronously completes with @@ -86846,11 +86925,10 @@ interface NavigatorOnLine {

        To fetch a single module script, given a url, a fetch client - settings object, a destination, a cryptographic nonce, a parser - state, a credentials mode, a module map settings object, a - referrer, and a top-level module fetch flag, run these steps. The algorithm - will asynchronously complete with either null (on failure) or a module script (on - success).

        + settings object, a destination, some options, a module map + settings object, a referrer, and a top-level module fetch flag, run + these steps. The algorithm will asynchronously complete with either null (on failure) or a + module script (on success).

        1. Let moduleMap be module map settings object's NavigatorOnLine { url is url, destination is destination, mode is "cors", credentials mode is credentials - mode, cryptographic nonce metadata is - cryptographic nonce, parser - metadata is parser state, referrer is referrer, and client is fetch client settings object.

        2. +
        3. Set up the module script request given request and + options.

        4. +
        5. If the caller specified custom steps to perform @@ -86924,8 +87001,7 @@ interface NavigatorOnLine {

        6. Let module script be the result of creating a module script given source text, module map settings object, response's url, cryptographic - nonce, parser state, and credentials mode.

        7. + data-x="concept-response-url">url, and options.

        8. Set moduleMap[url] to module @@ -86985,18 +87061,18 @@ interface NavigatorOnLine {

      6. +
      7. Let options be the descendant script fetch options for module + script's fetch options.

      8. +
      9. For each url in urls, perform the - internal module script graph fetching procedure given url, module - script's credentials mode, - module script's cryptographic - nonce, module script's parser - state, destination, module script's settings object, - module script's settings object, visited set, module - script's base URL, and with the - top-level module fetch flag unset. If the caller of this algorithm specified custom - perform the fetch steps, pass those along - while performing the internal module script graph fetching procedure.

        + internal module script graph fetching procedure given url, + options, destination, module script's settings + object, module script's settings object, visited set, + module script's base URL, and + with the top-level module fetch flag unset. If the caller of this algorithm specified + custom perform the fetch steps, pass those + along while performing the internal module script graph fetching procedure.

        These invocations of the internal module script graph fetching procedure should be performed in parallel to each other.

        @@ -87081,7 +87157,8 @@ interface NavigatorOnLine {

        To create a classic script, given a JavaScript string source, an environment settings object - settings, and an optional muted errors boolean:

        + settings, some script fetch options options, and an optional + muted errors boolean:

        1. If muted errors was not provided, let it be false.

        2. @@ -87106,22 +87183,30 @@ interface NavigatorOnLine { result.[[HostDefined]] will be script.

          -
        3. If result is a List of errors, then set script's parse error to result[0].

        4. +
        5. +

          If result is a List of errors, then:

          + +
            +
          1. Set script's parse error to + result[0].

          2. -
          3. Otherwise, set script's record to +

          4. Return script.

          5. +
          +
        6. + +
        7. Set script's record to result.

        8. +
        9. Set script's fetch + options to options.

        10. +
        11. Return script.

        To create a module script, given a JavaScript string source, an environment settings object - settings, a URL baseURL, a cryptographic nonce - cryptographicNonce, a parser - metadata parserState, and a credentials mode credentialsMode:

        + settings, a URL baseURL, and some script fetch + options options:

        1. If scripting is disabled for @@ -87187,14 +87272,8 @@ interface NavigatorOnLine {

        2. Set script's base URL to baseURL.

        3. -
        4. Set script's cryptographic - nonce to cryptographicNonce.

        5. - -
        6. Set script's parser state - to parserState.

        7. - -
        8. Set script's credentials - mode to credentialsMode.

        9. +
        10. Set script's fetch + options to options.

        11. Return script.

        @@ -90942,7 +91021,8 @@ document.body.appendChild(frame) settings object.

      10. Let script be the result of creating a classic script given - script source and settings object.

      11. + script source, settings object, and the default classic script + fetch options.

      12. Run the classic script script.

      13. @@ -119972,6 +120052,9 @@ INSERT INTERFACES HERE
        [JPEG]
        JPEG File Interchange Format, E. Hamilton.
        +
        [JSIMPORT]
        +
        import(). Ecma International.
        +
        [JSINTL]
        ECMAScript Internationalization API Specification. Ecma International.