From 37e45becd760c7d47f30a69cb58b07cd6034da7f Mon Sep 17 00:00:00 2001
From: Anne van Kesteren
Let gone async be false.
- -The handle redirects step later in - this algorithm can in certain cases jump back to the step labeled fragments. Since, between those two steps, this - algorithm goes from operating synchronously in the context of the calling task to operating in parallel independent of the event - loop, some of the intervening steps need to be able to handle both being run as part of a - task and running in parallel. The - gone async flag is thus used to make these steps aware of which mode they are - operating in.
- -Fragments: If this is not a - reload-triggered navigation, resource's URL equals browsingContext's - active document's URL with exclude - fragments flag set, and resource's URL's fragment is non-null, then navigate to that fragment and abort these steps.
If gone async is false, cancel any preexisting but not yet mature attempt to navigate browsingContext,
- including canceling any instances of the fetch algorithm
- started by those attempts. If one of those attempts has already created and initialised a new Document
object,
- abort that Document
also. (Navigation
- attempts that have matured already have session
- history entries, and are therefore handled during the update the session history with the
- new page algorithm, later.)
If this is not a reload-triggered navigation, + resource's URL equals + browsingContext's active document's URL with exclude fragments flag set, and + resource's URL's fragment is + non-null, then navigate to that fragment and abort these + steps.
If resource is to be handled using a mechanism that does not affect - browsingContext, e.g., ignoring the navigation request altogether because the - specified scheme is not one of the supported protocols, then abort these steps and proceed with that mechanism instead.
Cancel any preexisting but not yet mature
+ attempt to navigate browsingContext, including canceling any instances of the fetch algorithm started by those attempts. If one of those attempts
+ has already created and initialised a new
+ Document
object, abort that
+ Document
also. (Navigation attempts that have matured already have session history entries, and are
+ therefore handled during the update the session history with the new page algorithm,
+ later.)
If gone async is false, prompt
- to unload the Document
object. If the user refused to allow the
- document to be unloaded, then abort these steps.
Prompt to unload the active + document of browsingContext. If the user refused to allow the document + to be unloaded, then abort these steps.
If this instance of the navigation algorithm gets canceled while this step is running, the prompt to unload a document algorithm must @@ -81810,21 +81791,8 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O
If gone async is false, abort - the active document of browsingContext.
If resource is to be handled by displaying some sort of inline content, e.g., an - error message because the specified scheme is not one of the supported protocols, or an inline - prompt to allow the user to select a - registered handler for the given scheme, then display - the inline content and abort these steps.
- -In the case of a registered handler being used, the algorithm will be reinvoked - with a new URL to handle the request.
- -Abort the active document of + browsingContext.
Return to whatever algorithm invoked the navigation steps and continue running these steps + in parallel.
This is the step that attempts to obtain resource, if necessary. Jump to the first @@ -81850,12 +81821,12 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O
object
element's new child browsing context)Run process a navigate response with resource and + browsingContext, and then abort these steps.
Skip this step. The data is already available.
javascript
Let response be null.
Process result: If Type(result) is not
- String, then the result of obtaining the resource for the URL is a response to a response whose status is 204
.
Otherwise, the result of obtaining the resource for the URL is a response whose header list consists of `Otherwise, set response a response
+ whose header list consists of `
Content-Type
`/`text/html
` and `Referrer-Policy
`/settings's referrer
policy, whose body is result,
@@ -81928,12 +81900,12 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O
not yet specified, pending further investigation into user agent behavior. See issue #1129.
When it comes time to set the document's address in the navigation algorithm, use address as the - override URL.
- +When it comes time to set the document's address, use address as + the override URL.
Run process a navigate response with response and + browsingContext, and then abort these steps.
The task source for this task is the @@ -81984,91 +81956,96 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O -
Set resource's client to the
- source browsing context's active document's relevant settings
- object, target browsing
- context to browsingContext, destination to "document
",
- mode to "navigate
", credentials mode to "include
", use-URL-credentials flag, and redirect mode to "manual
".
Set resource's omit-Origin
-header flag.
-
-
If resource's method is not
- `GET
`, or, if the navigation algorithm
- was invoked as a result of the form submission
- algorithm, then if there is an origin of the active document
- of the source browsing context, unset resource's
- omit-Origin
-header flag.
Otherwise, if browsingContext is a child browsing context, and
- the browsing context container of browsingContext has a
- browsing context scope origin, set resource's origin to that browsing context scope
- origin and unset resource's omit-Origin
-header
- flag.
Fetch resource.
Run process a navigate fetch given resource and + browsingContext.
Run process a navigate URL scheme given resource and + browsingContext.
If gone async is false, return to whatever algorithm invoked the - navigation steps and continue running these steps in parallel.
- -To process a navigate fetch, given a request request and browsing context + browsingContext, run these steps:
-Let gone async be true.
Let response be null.
Wait for one or more bytes to be available or for the user agent to establish that the - resource in question is empty. During this time, the user agent may allow the user to cancel this - navigation attempt or start other navigation attempts.
Set request's client to the
+ source browsing context's active document's relevant settings
+ object, target browsing
+ context to browsingContext, destination to "document
",
+ mode to "navigate
", credentials mode to "include
", use-URL-credentials flag, and redirect mode to "manual
".
Set request's omit-Origin
-header flag.
+
+
If request's method is not `GET
`, or, if the navigation algorithm was invoked
+ as a result of the form submission algorithm, then if
+ there is an origin of the active document of the source browsing
+ context, unset request's omit-Origin
-header
+ flag.
Otherwise, if browsingContext is a child browsing context, and the
+ browsing context container of browsingContext has a browsing
+ context scope origin, set request's origin to that browsing context scope origin
+ and unset request's omit-Origin
-header flag.
Handle redirects: If fetching the resource results in a redirect, then return to the step labeled fragments with the new resource, except - that if the URL of the target of the redirect does not have a fragment and the URL of the resource that led - to the redirect does, then the fragment of the - resource that led to the redirect must be propagated to the URL of the target of - the redirect.
+Fetch request.
So for instance, if the original URL was "http://example.com/#!sample
" and "http://example.com/
" is
- found to redirect to "https://example.com/
", the URL of the new resource
- will be "https://example.com/#!sample
".
Wait for the task on the networking task + source to process response and set response to the + result.
Otherwise, if response has a location URL that is a URL whose scheme is "file
" or "javascript
", then set response to a network error.
Otherwise, if response has a location URL that is a URL whose scheme is a fetch scheme, then run + process a navigate fetch with a new request + whose url is response's location URL. + +
Otherwise, if response has a location URL that is a URL, run the + process a navigate URL scheme given response's location URL and + browsingContext.
Fallback in prefer-online mode: If the resource was not fetched from an
- application cache, and was to be fetched using `GET
`, and
+
Fallback in prefer-online mode: If response was not fetched from
+ an application cache, and was to be fetched using `GET
`, and
there are relevant application caches that are
identified by a URL with the same origin as the URL in question, and that have this
URL as one of their entries, excluding entries marked as foreign, and whose mode is prefer-online, and the user didn't cancel the
- navigation attempt during the earlier step, and the navigation attempt failed (e.g. the server
- returned a 4xx or 5xx status, or there was a DNS error), then:
Let candidate be the resource identified by the URL in question from the most appropriate application cache of those that @@ -82078,7 +82055,7 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O
If candidate is not marked as foreign, then the user agent must discard the failed - load and instead continue along these steps using candidate as the resource. + load and instead continue along these steps using candidate as response. The user agent may indicate to the user that the original page load failed, and that the page used was a previously cached resource.
@@ -82086,19 +82063,20 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON OFallback for fallback entries: If the resource was not fetched from an
- application cache, and was to be fetched using `GET
`, and
+
Fallback for fallback entries: If response was not fetched from
+ an application cache, and was to be fetched using `GET
`, and
its URL matches the fallback namespace
of one or more relevant application caches, and
the most appropriate application cache of those
that match does not have an entry in its online
- safelist that has the same origin as the resource's URL and that is a
- prefix match for the resource's URL, and the user didn't cancel the navigation
- attempt during the earlier step, and the navigation attempt failed (e.g. the server returned a
- 4xx or 5xx status, or there was a DNS error), then:
Let candidate be the fallback
resource specified for the fallback
@@ -82108,16 +82086,24 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O
If candidate is not marked as foreign, then the user agent must discard the failed
- load and instead continue along these steps using candidate as the resource. The
- document's URL, if appropriate, will still be the
+ load and instead continue along these steps using candidate as response.
+ The document's URL, if appropriate, will still be the
originally requested URL, not the fallback URL, but the user agent may indicate to the user that
the original page load failed, that the page used was a fallback resource, and what the URL of
the fallback resource actually is.
Run process a navigate response given response and + browsingContext.
To process a navigate response, given a response response and browsing context + browsingContext, run these steps:
+ +Resource handling: If the resource is a network error, then If response is a network error, then display the inline content with an appropriate error shown to the
user and with the newly created Document
object's origin set to
a new opaque origin.
If the resource's status is +
If response's status is
204
or 205
, then abort these steps.
If the resource has an ` If response has an `Content-Disposition
` header specifying the attachment
disposition type, then handle it as a download.
Let type be the computed type of - the resource.
If the user agent has been configured to process resources of the given type using some mechanism other than rendering the content in a browsing - context, then skip this step. Otherwise, if the type is one of the - following types, jump to the appropriate entry in the following list, and process the resource as - described there:
+If the user agent has been configured to process resources of the given type + using some mechanism other than rendering the content in a browsing context, then + skip this step. Otherwise, if the type is one of the following types, jump to the + appropriate entry in the following list, and process response as described there:
To process a navigate URL scheme, given a URL url and + browsing context browsingContext, run these steps:
+ +If url is to be handled using a mechanism that does not affect + browsingContext, e.g., because url's scheme is handled externally, then proceed with that mechanism instead.
Otherwise, url is to be handled by displaying some sort of inline content, e.g., + an error message because the specified scheme is not one of the supported protocols, or an + inline prompt to allow the user to select a + registered handler for the given scheme, then display + the inline content.
+ +In the case of a registered handler being used, navigate will be + invoked with a new URL.
+When a resource is handled by passing its URL or
data to an external software package separate from the user agent (e.g. handing a mailto:
URL to a mail client, or a Word document to a word