Skip to content

Commit

Permalink
Editorial: only invoke response's location URL once
Browse files Browse the repository at this point in the history
Complements whatwg/fetch#1149.
  • Loading branch information
annevk authored Feb 3, 2021
1 parent 234e195 commit 4d832b0
Showing 1 changed file with 24 additions and 26 deletions.
50 changes: 24 additions & 26 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -84556,14 +84556,17 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface

<li><p>Let <var>finalSandboxFlags</var> be an empty <span>sandboxing flag set</span>.</p></li>

<li><p>Let <var>locationURL</var> be null.</p></li>

<li><p>Let <var>currentURL</var> be <var>request</var>'s <span
data-x="concept-request-current-url">current URL</span>.</p></li>

<li>
<p>While true:</p>

<ol>
<li><p>Let <var>currentURL</var> be <var>response</var>'s <span
data-x="concept-response-location-url">location URL</span>, if <var>response</var> is not null,
and <var>request</var>'s <span data-x="concept-request-current-url">current URL</span>
otherwise.</p></li>
<li><p>If <var>locationURL</var> is non-null, then set <var>currentURL</var> to
<var>locationURL</var>.</p></li>

<li>
<p>If <var>reservedEnvironment</var> is not null and <var>currentURL</var>'s
Expand Down Expand Up @@ -84695,12 +84698,13 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
embedded content against the parent context, not the navigation source.</p>
</li>

<li><p>Set <var>locationURL</var> to <var>response</var>'s <span
data-x="concept-response-location-url">location URL</span>.</p></li>

<li>
<p>If <var>response</var> does not have a <span
data-x="concept-response-location-url">location URL</span> or the <span
data-x="concept-response-location-url">location URL</span> is not a <span>URL</span> whose
<span data-x="concept-url-scheme">scheme</span> is an <span>HTTP(S) scheme</span>,
then <span>break</span>.</p>
<p>If <var>locationURL</var> is not a <span>URL</span> whose <span
data-x="concept-url-scheme">scheme</span> is an <span>HTTP(S) scheme</span>, then
<span>break</span>.</p>

<p class="note">Navigation handles redirects manually as navigation is the only place in
the web platform that cares for redirects to <code data-x="mailto protocol">mailto:</code>
Expand All @@ -84711,31 +84715,25 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
</ol>
</li>

<li><p>If <var>response</var> has a <span data-x="concept-response-location-url">location
URL</span> that is failure, then set <var>response</var> to a <span>network
<li><p>If <var>locationURL</var> is failure, then set <var>response</var> to a <span>network
error</span>.</p></li>

<li><p>Otherwise, if <var>response</var> has a <span
data-x="concept-response-location-url">location URL</span> that is a <span>URL</span> whose <span
<li><p>Otherwise, if <var>locationURL</var> is a <span>URL</span> whose <span
data-x="concept-url-scheme">scheme</span> is "<code data-x="">blob</code>", "<code
data-x="">file</code>", "<code data-x="">filesystem</code>", or "<code
data-x="">javascript</code>", then set <var>response</var> to a network error.</p></li>

<li><p>Otherwise, if <var>response</var> has a <span
data-x="concept-response-location-url">location URL</span> that is a <span>URL</span> whose <span
<li><p>Otherwise, if <var>locationURL</var> is a <span>URL</span> whose <span
data-x="concept-url-scheme">scheme</span> is a <span>fetch scheme</span>, then run
<span>process a navigate fetch</span> with a new <span data-x="concept-request">request</span>
whose <span data-x="concept-request-url">url</span> is <var>response</var>'s <span
data-x="concept-response-location-url">location URL</span>, <var>sourceBrowsingContext</var>,
<var>browsingContext</var>, <var>navigationType</var>, <var>sandboxFlags</var>,
<var>incumbentNavigationOrigin</var>, <var>activeDocumentNavigationOrigin</var>, and
<var>historyHandling</var>, and return.

<li><p>Otherwise, if <var>response</var> has a <span
data-x="concept-response-location-url">location URL</span> that is a <span>URL</span>, run the
<span>process a navigate URL scheme</span> given <var>response</var>'s <span
data-x="concept-response-location-url">location URL</span> and
<var>browsingContext</var>, and return.</p></li>
whose <span data-x="concept-request-url">url</span> is <var>locationURL</var>,
<var>sourceBrowsingContext</var>, <var>browsingContext</var>, <var>navigationType</var>,
<var>sandboxFlags</var>, <var>incumbentNavigationOrigin</var>,
<var>activeDocumentNavigationOrigin</var>, and <var>historyHandling</var>, and return.

<li><p>Otherwise, if <var>locationURL</var> is a <span>URL</span>, run the <span>process a
navigate URL scheme</span> given <var>locationURL</var> and <var>browsingContext</var>, and
return.</p></li>

<li><p>Let <var>navigationParams</var> be a new <span>navigation params</span> whose <span
data-x="navigation-params-request">request</span> is <var>request</var>, <span
Expand Down

0 comments on commit 4d832b0

Please sign in to comment.