Skip to content

Commit

Permalink
Compute "allowed to download" synchronously in navigation
Browse files Browse the repository at this point in the history
Helps with #1130 by removing a deep-in-the-algorithm-tree usage of source browsing context. Does not close #5597, but fixes the actual problems posed by the current architecture.
  • Loading branch information
domenic committed Mar 15, 2021
1 parent e0b554b commit 75cd4b4
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -84617,6 +84617,10 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
flags</span> given <var>browsingContext</var> and <var>browsingContext</var>'s <span
data-x="bc-container">container</span>.</p></li>

<li><p>Let <var>allowedToDownload</var> be the result of running the <span>allowed to
download</span> algorithm given the <span>source browsing context</span> and
<var>browsingContext</var>.</p></li>

<li><p>Return to whatever algorithm invoked the navigation steps and continue running these steps
<span>in parallel</span>.</p></li>

Expand Down Expand Up @@ -84670,8 +84674,8 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
<var>browsingContext</var>, and <span data-x="navigation-params-hh">history
handling</span> is <var>historyHandling</var>.</p></li>

<li><p>Run <span>process a navigate response</span> with <var>navigationType</var>, the
<span>source browsing context</span>, and <var>navigationParams</var>.</p></li>
<li><p>Run <span>process a navigate response</span> with <var>navigationType</var>,
<var>allowedToDownload</var>, and <var>navigationParams</var>.</p></li>
</ol>
</dd>

Expand Down Expand Up @@ -84721,8 +84725,8 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
<var>browsingContext</var>, and <span data-x="navigation-params-hh">history
handling</span> is <var>historyHandling</var>.</p></li>

<li><p>Run <span>process a navigate response</span> with <var>navigationType</var>, the
<span>source browsing context</span>, and <var>navigationParams</var>.</p></li>
<li><p>Run <span>process a navigate response</span> with <var>navigationType</var>,
<var>allowedToDownload</var>, and <var>navigationParams</var>.</p></li>
</ol>

<p class="example">So for example a <span data-x="javascript
Expand All @@ -84741,7 +84745,7 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
is a <span>fetch scheme</span></dt>
<dd><p>Run <span>process a navigate fetch</span> given <var>resource</var>, the <span>source
browsing context</span>, <var>browsingContext</var>, <var>navigationType</var>,
<var>sandboxFlags</var>, <var>incumbentNavigationOrigin</var>,
<var>sandboxFlags</var>, <var>allowedToDownload</var>, <var>incumbentNavigationOrigin</var>,
<var>activeDocumentNavigationOrigin</var>, and <var>historyHandling</var>.</p></dd>

<dt>Otherwise, <var>resource</var> is a <span data-x="concept-request">request</span> whose
Expand All @@ -84757,10 +84761,10 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
<p>To <dfn export>process a navigate fetch</dfn>, given a <span
data-x="concept-request">request</span> <var>request</var>, two <span data-x="browsing
context">browsing contexts</span> <var>sourceBrowsingContext</var> and <var>browsingContext</var>,
a string <var>navigationType</var>, a <span>sandboxing flag set</span> <var>sandboxFlags</var>,
two <span data-x="origin">origins</span> <var>incumbentNavigationOrigin</var> and
<var>activeDocumentNavigationOrigin</var>, and a <span>history handling behavior</span>
<var>historyHandling</var>:</p>
a string <var>navigationType</var>, a <span>sandboxing flag set</span> <var>sandboxFlags</var>, a
boolean <var>allowedToDownload</var>, two <span data-x="origin">origins</span>
<var>incumbentNavigationOrigin</var> and <var>activeDocumentNavigationOrigin</var>, and a
<span>history handling behavior</span> <var>historyHandling</var>:</p>

<ol>
<li><p>Let <var>response</var> be null.</p></li>
Expand Down Expand Up @@ -84993,7 +84997,7 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
<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>locationURL</var>,
<var>sourceBrowsingContext</var>, <var>browsingContext</var>, <var>navigationType</var>,
<var>sandboxFlags</var>, <var>incumbentNavigationOrigin</var>,
<var>allowedToDownload</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
Expand All @@ -85015,12 +85019,12 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
<var>browsingContext</var>, and <span data-x="navigation-params-hh">history handling</span> is
<var>historyHandling</var>.</p></li>

<li><p>Run <span>process a navigate response</span> with <var>navigationType</var>, the
<span>source browsing context</span>, and <var>navigationParams</var>.</p></li>
<li><p>Run <span>process a navigate response</span> with <var>navigationType</var>,
<var>allowedToDownload</var>, and <var>navigationParams</var>.</p></li>
</ol>

<p>To <dfn export>process a navigate response</dfn>, given a string <var>navigationType</var>, a
<span>browsing context</span> <var>source</var>, and a <span>navigation params</span>
boolean <var>allowedToDownload</var>, and a <span>navigation params</span>
<var>navigationParams</var>:</p>

<ol>
Expand Down Expand Up @@ -85087,8 +85091,7 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface
data-x="">attachment</code> disposition type, then:</p>

<ol>
<li><p>If the result of running the <span>allowed to download</span> given <var>source</var>
and <var>browsingContext</var> is true, then handle <var>response</var> <span>as a
<li><p>If <var>allowedToDownload</var> is true, then handle <var>response</var> <span>as a
download</span>.</p></li>

<li><p>Return.</p></li>
Expand Down

0 comments on commit 75cd4b4

Please sign in to comment.