diff --git a/source b/source index b70155a8252..39b3e6c614b 100644 --- a/source +++ b/source @@ -2477,6 +2477,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • ok status
  • navigation request
  • network error
  • +
  • aborted network error
  • `Origin` header
  • `Cross-Origin-Resource-Policy` header
  • process response
  • @@ -100061,22 +100062,44 @@ dictionary EventSourceInit {
  • Set ev's request to request.

  • -
  • Let eventSourceResponse be null.

  • - -
  • Let finalizeEventSourceFetch be to finalize and report timing - with eventSourceResponse, settings's +

  • Let finalizeEventSourceFetch given + response resbe to + finalize and report timing with res, settings's global object, and "other".

  • -

    Run this step in parallel:

    +

    Fetch request with + processResponseEndOfBody set to + finalizeEventSourceFetch and processResponse set + to the following steps given response res:

      -
    1. Fetch request with - processResponse given - response res be to set - eventSourceResponse to res.

    2. +
    3. If res is an aborted network error, then + fail the connection.

    4. + +
    5. Otherwise, if res is a network error, then + reestablish the connection, unless the user agent knows that to be futile, in + which case the user agent may fail the connection.

    6. + +
    7. Otherwise, if res's status is + not 200, or if res's `Content-Type` is not + `text/event-stream`, then fail the connection.

      + + +
    8. Otherwise, announce the connection and + interpret res's + body line by line.

    +
  • Return ev.

  • @@ -100149,55 +100172,6 @@ dictionary EventSourceInit {

    Processing model

    -

    The resource indicated in the argument to the EventSource - constructor is fetched when the constructor is run.

    - -

    As data is received, the tasks queued by the networking - task source to handle the data must act as follows.

    - -

    HTTP 200 OK responses with a `Content-Type` header specifying the type - `text/event-stream`, ignoring any MIME type parameters, must be - processed line by line as described below.

    - -

    When a successful response with a supported MIME type is received, such that the - user agent begins parsing the contents of the stream, the user agent must announce the - connection.

    - -

    The task that the networking task source places - on the task queue once fetching for such a resource (with the correct MIME - type) has completed must cause the user agent to run finalizeEventSourceFetch, - and reestablish the connection in parallel. This applies whether the connection is closed gracefully or unexpectedly - (but does not apply when fetching is canceled by the user agent, e.g., in response to window.stop(), since in those cases the final task is actually discarded). It doesn't apply for the error - conditions listed below except where explicitly specified.

    - -

    HTTP 200 OK responses that have a Content-Type specifying an unsupported type, or - that have no Content-Type at all, must cause the user agent to fail the - connection.

    - -

    Network errors that prevents the connection from - being established in the first place (e.g. DNS errors), should cause the user agent to - run finalizeEventSourceFetch, and reestablish the connection - in parallel, unless the user agent knows that to be futile, in which case the user - agent may fail the connection.

    - -

    Any other HTTP response code not listed here, as well as the - cancelation of the fetch algorithm by the user agent (e.g. in response to window.stop() or the user canceling the network connection - manually) must cause the user agent to run finalizeEventSourceFetch and - fail the connection.

    - -
    -

    When a user agent is to announce the connection, the user agent must queue a task which, if the readyState attribute is set to a value other than CLOSED, sets the