Skip to content

Commit

Permalink
Meta: export worker definitions for auto-cross-spec-linking
Browse files Browse the repository at this point in the history
This adds the appropriate data attributes, per
https://github.com/tabatkins/bikeshed/blob/master/docs/dfn-contract.md,
to worker-related <dfn>s. This will allow specs using that contract,
such as those written in Bikeshed, to automatically link to these terms.

Part of #998.
  • Loading branch information
annevk authored and domenic committed May 2, 2016
1 parent 3dc7638 commit 6bc91fa
Showing 1 changed file with 51 additions and 44 deletions.
95 changes: 51 additions & 44 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -96168,25 +96168,26 @@ interface <dfn>WorkerGlobalScope</dfn> : <span>EventTarget</span> {
attribute <span>EventHandler</span> <span data-x="handler-WorkerGlobalScope-onunhandledrejection">onunhandledrejection</span>;
};</pre>

<p>A <code>WorkerGlobalScope</code> object has an associated <dfn data-dfn-for="WorkerGlobalScope"
data-x="concept-WorkerGlobalScope-type">type</dfn> ("<code data-x="">classic</code>" or "<code
data-x="">module</code>"). It is set during creation.
<p>A <code>WorkerGlobalScope</code> object has an associated <dfn data-export=""
data-dfn-for="WorkerGlobalScope" data-x="concept-WorkerGlobalScope-type">type</dfn> ("<code
data-x="">classic</code>" or "<code data-x="">module</code>"). It is set during creation.

<p>A <code>WorkerGlobalScope</code> object has an associated <dfn data-dfn-for="WorkerGlobalScope"
data-x="concept-WorkerGlobalScope-url">url</dfn> (null or a <span>URL</span>). It is initially
null.
<p>A <code>WorkerGlobalScope</code> object has an associated <dfn data-export=""
data-dfn-for="WorkerGlobalScope" data-x="concept-WorkerGlobalScope-url">url</dfn> (null or a
<span>URL</span>). It is initially null.

<p>A <code>WorkerGlobalScope</code> object has an associated <dfn data-dfn-for="WorkerGlobalScope"
data-x="concept-WorkerGlobalScope-https-state">HTTPS state</dfn> ("<code data-x="">modern</code>",
"<code data-x="">deprecated</code>", or "<code data-x="">none</code>"). It is initially "<code
data-x="">none</code>".
<p>A <code>WorkerGlobalScope</code> object has an associated <dfn data-export=""
data-dfn-for="WorkerGlobalScope" data-x="concept-WorkerGlobalScope-https-state">HTTPS state</dfn>
("<code data-x="">modern</code>", "<code data-x="">deprecated</code>", or "<code
data-x="">none</code>"). It is initially "<code data-x="">none</code>".

<p>A <code>WorkerGlobalScope</code> object has an associated <dfn data-dfn-for="WorkerGlobalScope"
data-x="concept-WorkerGlobalScope-csp-list">CSP list</dfn>. It is initially an empty list.
<p>A <code>WorkerGlobalScope</code> object has an associated <dfn data-export=""
data-dfn-for="WorkerGlobalScope" data-x="concept-WorkerGlobalScope-csp-list">CSP list</dfn>. It is
initially an empty list.

<p>A <code>WorkerGlobalScope</code> object has an associated <dfn data-dfn-for="WorkerGlobalScope"
data-x="concept-WorkerGlobalScope-module-map">module map</dfn>. It is a <span>module map</span>,
initially empty.</p>
<p>A <code>WorkerGlobalScope</code> object has an associated <dfn data-export=""
data-dfn-for="WorkerGlobalScope" data-x="concept-WorkerGlobalScope-module-map">module map</dfn>.
It is a <span>module map</span>, initially empty.</p>

<dl class="domintro">
<dt><var>workerGlobal</var> . <code subdfn data-x="dom-WorkerGlobalScope-self">self</code></dt>
Expand Down Expand Up @@ -96277,7 +96278,8 @@ interface <dfn>WorkerGlobalScope</dfn> : <span>EventTarget</span> {

<div w-nodev>

<p>To <dfn>close a worker</dfn>, given a <var>workerGlobal</var>, run these steps:</p>
<p>To <dfn data-export="">close a worker</dfn>, given a <var>workerGlobal</var>, run these
steps:</p>

<ol>
<li><p>Discard any <span data-x="concept-task">tasks</span> that have been added to
Expand Down Expand Up @@ -96413,22 +96415,22 @@ interface <dfn>WorkerGlobalScope</dfn> : <span>EventTarget</span> {
<code>MessagePort</code> objects.</p>

<p>Each <code>WorkerGlobalScope</code> <var>worker global scope</var> has a list of
<dfn>the worker's ports</dfn>, which consists of all the <code>MessagePort</code> objects that are
entangled with another port and that have one (but only one) port owned by <var>worker
global scope</var>. This list includes <!--all the <code>MessagePort</code> objects that are in
events pending in the <code>WorkerGlobalScope</code> object's <span>event loop</span>, as well as
(commented out because in practice it makes no difference either way as far as I can tell, and it
would be hard to strictly implement since these ports might not yet be across the thread
boundary)--> the implicit <code>MessagePort</code> in the case of <span
<dfn data-export="">the worker's ports</dfn>, which consists of all the <code>MessagePort</code>
objects that are entangled with another port and that have one (but only one) port owned by
<var>worker global scope</var>. This list includes <!--all the <code>MessagePort</code> objects
that are in events pending in the <code>WorkerGlobalScope</code> object's <span>event loop</span>,
as well as (commented out because in practice it makes no difference either way as far as I can
tell, and it would be hard to strictly implement since these ports might not yet be across the
thread boundary)--> the implicit <code>MessagePort</code> in the case of <span
data-x="DedicatedWorkerGlobalScope">dedicated workers</span>.</p>

<p>Each <code>WorkerGlobalScope</code> also has a list of <dfn>the worker's workers</dfn>.
Initially this list is empty; it is populated when the worker creates or obtains further
workers.</p>
<p>Each <code>WorkerGlobalScope</code> also has a list of <dfn data-export="">the worker's
workers</dfn>. Initially this list is empty; it is populated when the worker creates or obtains
further workers.</p>

<p>Finally, each <code>WorkerGlobalScope</code> also has a list of <dfn>the worker's
<code>Document</code>s</dfn>. Initially this list is empty; it is populated when the worker is
created.</p>
<p>Finally, each <code>WorkerGlobalScope</code> also has a list of <dfn data-export="">the
worker's <code>Document</code>s</dfn>. Initially this list is empty; it is populated when the
worker is created.</p>

<p>Whenever a <code>Document</code> <var>d</var> is <dfn data-x="add a document to the
worker's Documents">added to the worker's <code>Document</code>s</dfn>, the user agent must, for
Expand Down Expand Up @@ -96482,11 +96484,11 @@ interface <dfn>WorkerGlobalScope</dfn> : <span>EventTarget</span> {

<h4 id="worker-processing-model"><span id="processing-model-10"></span>Processing model</h4>

<p>When a user agent is to <dfn>run a worker</dfn> for a script with <code>Worker</code> or
<code>SharedWorker</code> object <var>worker</var>, <span>URL</span> <var>url</var>,
<span>URL</span> <var>referrer</var>, <code>MessagePort</code> <var>outside port</var>,
<span>list of relevant <code>Document</code> objects to add</span> <var>docs</var>, possible
<code>WorkerGlobalScope</code> <var>parent worker global scope</var>, and a
<p>When a user agent is to <dfn data-export="">run a worker</dfn> for a script with
<code>Worker</code> or <code>SharedWorker</code> object <var>worker</var>, <span>URL</span>
<var>url</var>, <span>URL</span> <var>referrer</var>, <code>MessagePort</code> <var>outside
port</var>, <span>list of relevant <code>Document</code> objects to add</span> <var>docs</var>,
possible <code>WorkerGlobalScope</code> <var>parent worker global scope</var>, and a
<code>WorkerOptions</code> dictionary <var>options</var>, it must run the following steps:</p>

<ol>
Expand All @@ -96496,8 +96498,8 @@ interface <dfn>WorkerGlobalScope</dfn> : <span>EventTarget</span> {
<p>Create a separate parallel execution environment (i.e. a separate thread or process or
equivalent construct), and run the rest of these steps in that context.</p>

<p>For the purposes of timing APIs, this is the <dfn>official moment of creation</dfn> of the
worker.</p>
<p>For the purposes of timing APIs, this is the <dfn data-export="">official moment of
creation</dfn> of the worker.</p>

</li>

Expand Down Expand Up @@ -96690,9 +96692,9 @@ interface <dfn>WorkerGlobalScope</dfn> : <span>EventTarget</span> {

<hr>

<p>When a user agent is to <dfn>kill a worker</dfn> it must run the following steps <span>in
parallel</span> with the worker's main loop (the "<span>run a worker</span>" processing model
defined above):</p>
<p>When a user agent is to <dfn data-export="">kill a worker</dfn> it must run the following steps
<span>in parallel</span> with the worker's main loop (the "<span>run a worker</span>" processing
model defined above):</p>

<ol>

Expand All @@ -96717,9 +96719,9 @@ interface <dfn>WorkerGlobalScope</dfn> : <span>EventTarget</span> {

<hr>

<p>When a user agent is to <dfn>terminate a worker</dfn> it must run the following steps <span>in
parallel</span> with the worker's main loop (the "<span>run a worker</span>" processing model
defined above):</p>
<p>When a user agent is to <dfn data-export="">terminate a worker</dfn> it must run the following
steps <span>in parallel</span> with the worker's main loop (the "<span>run a worker</span>"
processing model defined above):</p>

<ol>

Expand Down Expand Up @@ -97310,9 +97312,14 @@ interface <dfn>NavigatorConcurrentHardware</dfn> {

</ul>

<p>The <span>import scripts into worker global scope</span> algorithm has three hooks for algorithm steps that may be customized by any callers: <dfn data-x="validate the state">validate the state</dfn>, <dfn data-x="get a fetch result">get a fetch result</dfn>, and <dfn data-x="postprocess the fetch result">postprocess the fetch result</dfn>.</p>
<p>The <span>import scripts into worker global scope</span> algorithm has three hooks for
algorithm steps that may be customized by any callers: <dfn data-export="" data-x="validate the
state">validate the state</dfn>, <dfn data-export="" data-x="get a fetch result">get a fetch
result</dfn>, and <dfn data-export="" data-x="postprocess the fetch result">postprocess the fetch
result</dfn>.</p>

<p>To <dfn>import scripts into worker global scope</dfn>, the user agent must run the following steps:</p>
<p>To <dfn data-export="">import scripts into worker global scope</dfn>, the user agent must run
the following steps:</p>

<ol>
<li><p>If this <code>WorkerGlobalScope</code> object's <span data-x="concept-WorkerGlobalScope-type">type</span> is
Expand Down

0 comments on commit 6bc91fa

Please sign in to comment.