diff --git a/fetch.bs b/fetch.bs index 7dc74cf3c..0e199a8d7 100644 --- a/fetch.bs +++ b/fetch.bs @@ -2850,16 +2850,7 @@ steps: connection. -
  • -

    Let proxies be the result of finding proxies for url in an - implementation-defined manner. If there are no proxies, let proxies be - « "DIRECT" ». - -

    This is where non-standard technology such as - Web Proxy Auto-Discovery Protocol (WPAD) - and proxy auto-config (PAC) come - into play. The "DIRECT" value means to not use a proxy for this particular - url. +

  • Let proxies be the result of calling resolve proxies given url.

  • Let timingInfo be a new connection timing info. @@ -2916,6 +2907,20 @@ reused across connections whose credentials are fal


    +
    +

    To resolve proxies given a URL url, return the result of +finding proxies for url in an implementation-defined manner. If there are no +proxies, return « "DIRECT" ». + +

    This is where non-standard technology such as +Web Proxy Auto-Discovery Protocol (WPAD) +and proxy auto-config (PAC) come +into play. The "DIRECT" value means to not use a proxy for this particular +url. +

    + +
    +

    To create a connection, given a network partition key key, origin origin, boolean credentials, string proxy, @@ -3027,6 +3032,76 @@ details of reused connections are not exposed and time values are coarsened.

    +

    Preemptive connections

    + +
    +

    To preemptively obtain a connection, given an +environment settings object environment, a URL url, and a +boolean credentials, run these steps: + +

      +
    1. Let key be the result of determining the network partition key given + environment. + +

    2. +

      Run determine if Content Security Policy allows connection with + environment and url. If that returns true, + obtain a connection with key, url, and credentials. + +

      This connection is obtained but not used directly. It will remain in the + connection pool for subsequent use. + +

      The user agent can attempt to initiate a preconnect and perform the full + connection handshake (DNS+TCP for HTTP, and DNS+TCP+TLS for HTTPS origins) whenever possible, but + is allowed to elect to perform a partial handshake (DNS only for HTTP, and DNS or DNS+TCP for + HTTPS origins), or skip it entirely, due to resource constraints or other reasons.

      + +

      The optimal number of connections per origin is dependent on the negotiated + protocol, users current connectivity profile, available device resources, global connection + limits, and other context specific variables. As a result, the decision for how many connections + should be opened is deferred to the user agent.

      +
    +
    + +
    +

    To preemptively resolve an origin, given an +environment settings object environment and a URL url, run +these steps: + +

      +
    1. Let key be the result of determining the network partition key given + environment. + +

    2. Run

      determine if Content Security Policy allows connection with + environment and url. If that returns false, then return. + +

    3. Let proxies be the result of calling resolve proxies. + +

    4. +

      If proxies contains "DIRECT", then + resolve an origin given key and url's origin. + +

      As the results of this algorithm can be cached, future fetches could be faster. +

    +
    + +
    +

    To determine if Content Security Policy allows connection, given an +environment settings object environment, and a URL url: + +

      +
    1. Let request be a request whose URL is + url, initiator is "prefetch", and whose + client is environment. + +

    2. Let result be the result of running + should request be blocked by Content Security Policy? given request. + +

    3. Return true if result is allowed; otherwise false. +

    +
    + +

    Network partition keys

    A network partition key is a tuple consisting of a site and null or