diff --git a/fetch.bs b/fetch.bs index adee889ba..80f903aa8 100644 --- a/fetch.bs +++ b/fetch.bs @@ -1666,17 +1666,48 @@ of the target browsing context's active document environment settings object.

A request has an associated -window -("no-window", "client", or an -environment settings object whose -global object is a -{{Window}} object). Unless stated otherwise it is -"client". +window, that is "no-window", +"from-browser-ui", "client", or an environment settings object +whose global object is a {{Window}} object. Unless stated +otherwise it is "client". + +

+

This is used to determine whether and where to show necessary UI for the request, such as + authentication prompts or client certificate dialogs. + +

+
"no-window" +
No UI is shown; usually the request fails with a network error. -

The "client" value is changed to "no-window" or -request's client during fetching. It provides -a convenient way for standards to not have to explicitly set request's -window. +

"from-browser-ui" +
This request was initiated by browser UI, and so any UI shown will not be associated to a + specific window. + +
"client" +
This value will automatically be changed to either "no-window" or the request's + client during fetching. This provides a convenient way + for standards to not have to explicitly set a request's window. + +
an environment settings object +
The UI shown will be associated with the specified {{Window}} object. +
+
+ +

The appropriate user prompt context for a request +request is determined as follows: + +

    +
  1. Assert: request's window is not "client". + +

  2. If the request's window is an environment settings object, then + the prompt should occur in a way attributable to request's window. + +

  3. Otherwise, if request's window is + "from-browser-ui", then the prompt should occur in a neutral context, e.g., on top of + a blank page. + +

  4. Otherwise, there is no appropriate user prompt context. +

A request has an associated boolean keepalive. Unless stated otherwise it is @@ -5919,8 +5950,8 @@ run these steps:

  • If response's status is 401, httpRequest's response tainting is not "cors", includeCredentials is - true, and request's window is an environment settings object, - then: + true, and request's window is either an + environment settings object or "from-browser-ui":

    1. Needs testing: multiple `WWW-Authenticate` headers, missing, @@ -5947,8 +5978,8 @@ run these steps: appropriate network error for fetchParams.

    2. Let username and password be the result of prompting the end user - for a username and password, respectively, in request's - window. + for a username and password, respectively, in the appropriate user prompt context for + request.

    3. Set the username given request's current URL and username. @@ -5975,9 +6006,8 @@ run these steps: appropriate network error for fetchParams.

    4. -

      Prompt the end user as appropriate in request's - window and store the result as a - proxy-authentication entry. [[!HTTP]] +

      Prompt the end user as appropriate, in the appropriate user prompt context for + request, and store the result as a proxy-authentication entry. [[!HTTP]]

      Remaining details surrounding proxy authentication are defined by HTTP. @@ -6156,10 +6186,8 @@ optional boolean forceNewConnection (default false), run these steps:

      If the HTTP request results in a TLS client certificate dialog, then:

        -
      1. If request's window - is an environment settings object, make the dialog - available in request's - window. +

      2. If request has an appropriate user prompt context, then make the + dialog available in request's appropriate user prompt context.

      3. Otherwise, return a network error.