Skip to content
Permalink
Browse files

Add "environment discarding steps" hook

These are run when navigation or worker start fails, and will be used by
w3c/ServiceWorker#1315.
  • Loading branch information...
mattto authored and domenic committed Jun 6, 2018
1 parent b3c7c89 commit 9592eb5e25acde62b8832ca5fd47d87805a2acbc
Showing with 21 additions and 6 deletions.
  1. +21 −6 source
27 source
<p>If any of the following are true, then <span data-x="navigate-ua-inline">display the inline
content with an appropriate error shown to the user</span>, with the newly created
<code>Document</code> object's <span>origin</span> set to a new <span
data-x="concept-origin-opaque">opaque origin</span>, and return.</p>
data-x="concept-origin-opaque">opaque origin</span>, run the <span data-x="environment
discarding steps">environment discarding steps</span> for <var>reservedEnvironment</var>, and
return.</p>

<ul>
<li><p><var>response</var> is a network error.</p></li>
unset.</p></dd>
</dl>

<p>Specifications may define <dfn data-export="">environment discarding steps</dfn> for
environments. The steps take an <span>environment</span> as input.</p>

<p class="note">The <span data-x="environment discarding steps">environment discarding
steps</span> are run for only a select few environments: the ones that will
never become execution ready because, for example, they failed to load.</p>

<p>An <dfn data-export="">environment settings object</dfn> is an <span>environment</span> that
additionally specifies algorithms for:</p>

fetch</span> steps with <var>response</var>.</p></li>
</ol>

<p>If the algorithm asynchronously completes with null, <span>queue a task</span> to <span
data-x="concept-event-fire">fire an event</span> named <code data-x="event-error">error</code>
at <var>worker</var>, and return. Otherwise, continue the rest of these steps after
the algorithm's asynchronous completion, with <var>script</var> being the asynchronous
completion value.</p>
<p>If the algorithm asynchronously completes with null, then:</p>
<ol>
<li><p><span>Queue a task</span> to <span data-x="concept-event-fire">fire an event</span> named
<code data-x="event-error">error</code> at <var>worker</var>.</p></li>
<li><p>Run the <span data-x="environment discarding steps">environment discarding steps</span>
for <var>inside settings</var>.</p></li>
<li><p>Return.</p></li>
</ol>

<p>Otherwise, continue the rest of these steps after the algorithm's asynchronous completion,
with <var>script</var> being the asynchronous completion value.</p>
</li>

<li><p>Associate <var>worker</var> with <var>worker global scope</var>.</p></li>

0 comments on commit 9592eb5

Please sign in to comment.
You can’t perform that action at this time.