/[suikacvs]/markup/html/html5/spec-ja/data/workers.dat
Suika

Contents of /markup/html/html5/spec-ja/data/workers.dat

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.23 - (hide annotations) (download)
Mon Jul 21 16:04:24 2008 UTC (17 years, 9 months ago) by apache
Branch: MAIN
Changes since 1.22: +31 -0 lines
by remote user 'guest'

1 apache 1.2 #en
2     This specification defines an API that allows Web application authors to
3     spawn background workers running scripts in parallel to their main page.
4     This allows for thread-like operation with message-passing as the
5     coordination mechanism.
6     #ja
7 apache 1.13 この仕様書は、 Web アプリケーションで、主たる頁とは並列に、
8 apache 1.14 背景労働者スクリプトを走らせるための API を定義します。
9 apache 1.13 これにより、メッセージ・パッシングによるスレッド的操作を協調機構として利用できるようになります。
10 apache 1.2
11     #en
12     The current focus is in developing a first draft proposal.
13     #ja
14     現在の焦点は、第1案の開発です。
15    
16     #pattern
17 apache 1.11 <span class=secno>* </span>Tutorial
18     #ja
19     <span class=secno>$1 </span>解説
20    
21     #pattern
22 apache 1.4 <span class=secno>* </span>Requirements
23     #ja
24     <span class=secno>$1 </span>要件
25    
26     #en
27     This specification aims to address the following use cases and
28     requirements:
29     #ja
30     この仕様書は、次に示す利用事例と要件に取り組むことを目指します。
31    
32     #en
33     Background workers: A Web application needs to keep its data
34     synchronised with the server, both sending updates to the server and
35     receiving updates from the server, including handling buffering of
36     updates for when the application goes offline. The code to do this would
37     ideally be independent of the UI code.
38     #ja
39     背景労働者: Web アプリケーションは、そのデータを鯖と同期しておく必要があります。
40     これは、鯖への更新の送信と鯖からの更新の両方を含み、
41     アプリケーションがオフラインとなった時の更新のバッファリングの取扱いも含みます。
42     そのための符号は利用者界面の符号とは独立しているのが理想でしょう。
43    
44     #en
45     URLs: Workers should be spawned from URLs, not from strings, since
46     script rarely has access to its own source.
47     #ja
48     URL: 労働者は、文字列からではなく、 URL から生み出される[[SHOULD:べきです]]。
49 apache 1.13 スクリプトはそれ自体の出典へのアクセスを滅多に有しないからです。
50 apache 1.4
51     #en
52     Message queuing: Messages sent to a worker before the worker has
53     initialised should not be lost.
54     #ja
55     メッセージ・キューイング: 労働者が初期化される前に送信されたメッセージが失われるべきでは[[SHOULD NOT:ありません]]。
56    
57     #en
58     Workers should have access to timers.
59     #ja
60     労働者はタイマーへのアクセスを有する[[SHOULD:べきです]]。
61    
62     #en
63     Workers should have access to the network.
64     #ja
65     労働者はネットワークへのアクセスを有する[[SHOULD:べきです]]。
66    
67     #en
68     Workers should be able to use libraries.
69     #ja
70     労働者はライブラリを使える[[SHOULD:べきです]]。
71    
72     #en
73     Implementations should not have to expose <code>Node</code> or
74     <code>Document</code> objects to workers.
75     #ja
76     実装は労働者に <code>Node</code> オブジェクトや
77     <code>Document</code> オブジェクトを晒さなければならない[[SHOULD NOT:べきではありません]]。
78    
79     #en
80     Workers should not share anything with the outside world. The objects
81     representing the worker in the worker itself and in the context that
82     created the worker should be different, for instance.
83     #ja
84     労働者は外界と何も共有する[[SHOULD NOT:べきではありません]]。
85     例えば、労働者自体の中で労働者を現すオブジェクトと労働者を作成した文脈で労働者を表すオブジェクトは異なる[[SHOULD:べきです]]。
86    
87     #en
88     Shared workers: Multiple instances of the same Web application would
89     want to keep just one connection back to the server.
90     #ja
91     共有労働者: 同じ Web アプリケーションの複数の実現値は鯖に対する接続を1つだけ維持したいでしょう。
92    
93     #en
94     Capabilities granting: It should be possible for code running in one
95     iframe to negotiate a connection to another iframe, with that connection
96     granting certain rights (e.g. adding to an address book but not reading
97     from it).
98     #ja
99 apache 1.14 能力保証: ある iframe で走っている符号が他の iframe と何らかの権限 (例えば、
100 apache 1.4 住所録へは追加するが読まない) を保証する接続を折衝することが可能である[[SHOULD:べきです]]。
101    
102     #en
103     Delegation: It should be possible for one worker to spawn another
104     worker and efficiently delagate a request to that worker, without the
105     caller being aware of the delagate and without the original worker having
106     to proxy all the messages.
107     #ja
108 apache 1.13 委譲: ある労働者が別の労働者を生み出した上で、呼び出し元が委譲に気づかず、
109 apache 1.4 かつ元の労働者がすべてのメッセージを仲介せずに、
110 apache 1.13 元の労働者に対する要求を効率的に委譲することができる[[SHOULD:べきです]]。
111 apache 1.10
112 apache 1.11 #pattern
113 apache 1.13 <span class=secno>* </span>Infrastructure
114 apache 1.11 #ja
115 apache 1.13 <span class=secno>$1 </span>基盤
116 apache 1.11
117 apache 1.10 #en
118 apache 1.13 The <dfn id=url title=dom-WindowWorker-URL><code>URL</code></dfn>
119     attribute must return the value it was assigned when the <code><a
120     href="#windowworker">WindowWorker</a></code> object was created by the "<a
121     href="#run-a">run a worker</a>" algorithm. It gives the <span>absolute
122     URL</span> of the script that was used to initialize the worker.
123 apache 1.10 #ja
124 apache 1.13 <dfn id=url title=dom-WindowWorker-URL><code>URL</code></dfn>
125     属性は、 <code><a
126     href="#windowworker">WindowWorker</a></code>
127     オブジェクトが「<a
128 apache 1.14 href="#run-a">労働者を走らせる</a>」算法で作成された時に割り当てられた値を返さなければ[[MUST:なりません]]。
129 apache 1.13 その値は、労働者を初期化するために使用されたスクリプトの絶対 URL を表します。
130 apache 1.10
131     #en
132 apache 1.13 The <dfn id=name title=dom-WindowWorker-name><code>name</code></dfn>
133 apache 1.10 attribute must return the value it was assigned when the <code><a
134     href="#windowworker">WindowWorker</a></code> object was created by the "<a
135 apache 1.13 href="#run-a">run a worker</a>" algorithm. If it has a value that isn't
136     the empty string, its value represents the name that can be used to obtain
137     a reference to the worker using the <code
138     title=dom-WindowWorkerCreators-createNamedWorker><a
139     href="#createnamedworker">createNamedWorker()</a></code> method.
140 apache 1.10 #ja
141     <dfn id=name title=dom-windowworker-name><code>name</code></dfn>
142     属性は、<code><a
143     href="#windowworker">WindowWorker</a></code> オブジェクトが「<a
144 apache 1.14 href="#run-a">労働者を走らせる</a>」算法で作成された時に割り当てられた値を返さなければ[[MUST:なりません]]。この値が空文字列でなければ、
145 apache 1.13 その値は、 <code
146     title=dom-WindowWorkerCreators-createNamedWorker><a
147     href="#createnamedworker">createNamedWorker()</a></code>
148     メソッドを使って労働者への参照を得るために使うことができる名前を表します。
149 apache 1.10
150     #en
151     The <dfn id=closing
152     title=dom-windowworker-closing><code>closing</code></dfn> attribute must
153     return false until the "<a href="#kill-a">kill a worker</a>" processing
154     model defined below sets it to true.
155     #ja
156     <dfn id=closing
157     title=dom-windowworker-closing><code>closing</code></dfn>
158 apache 1.11 属性は、後述の「<a href="#kill-a">労働者を殺す</a>」処理モデルがこれを真に設定するまで、
159 apache 1.10 偽を返さなければ[[MUST:なりません]]。
160    
161 apache 1.11 #en
162     The following are the <span>event handler DOM attributes</span> that
163     must be supported by objects implementing the <code><a
164     href="#windowworker">WindowWorker</a></code> interface:
165     #ja
166     次に示すのは、 <code><a
167     href="#windowworker">WindowWorker</a></code>
168     界面を実装するオブジェクトが対応しなければ[[MUST:ならない]]事象取扱器 DOM 属性です。
169    
170     #pattern
171     Must be invoked whenever a * event is targeted at or
172     bubbles through the * object.
173     #ja
174     $1 事象が当該 $2 オブジェクトを対象としているか、泡立って当該オブジェクトを通過する時に、
175     呼び出されなければなりません。
176    
177 apache 1.10 #pattern
178 apache 1.23 <span class=secno>* </span>Base URLs and origins of
179     workers
180     #ja
181     <span class=secno>$1 </span>労働者の基底 URL と起源
182    
183     #en
184     The <span>base URL</span> of a <span>URL</span> passed to an API in a
185     worker is the <span>absolute URL</span> given by the value of the <code
186     title=dom-WindowWorker-URL><a href="#url">URL</a></code> attribute of the
187     worker's <code><a href="#windowworker">WindowWorker</a></code> object.
188     #ja
189     労働者中で API に渡された <span>URL</span> の<span>基底 URL</span>は、
190     労働者の <code><a href="#windowworker">WindowWorker</a></code>
191     オブジェクトの <code
192     title=dom-WindowWorker-URL><a href="#url">URL</a></code> 属性により与えられる<span>絶対 URL</span>
193     です。
194    
195     #en
196     The <span>origin</span> and <span>effective script origin</span> of
197     scripts running in workers are both the <span>origin</span> of the
198     <span>absolute URL</span> given by the value of the <code
199     title=dom-WindowWorker-URL><a href="#url">URL</a></code> attribute of the
200     worker's <code><a href="#windowworker">WindowWorker</a></code> object.
201     #ja
202     労働者中で走っているスクリプトの<span>起源</span>と<span>実効スクリプト起源</span>は、
203     共に、労働者の <code><a href="#windowworker">WindowWorker</a></code>
204     オブジェクトの <code
205     title=dom-WindowWorker-URL><a href="#url">URL</a></code>
206     属性の値により与えられる<span>絶対 URL</span> の<span>起源</span>です。
207    
208     #pattern
209 apache 1.10 <span class=secno>* </span>The queue of events
210     #ja
211     <span class=secno>$1 </span>事象の待ち行列
212    
213     #en
214     Each <code><a href="#windowworker">WindowWorker</a></code> object is
215     asssociated with a <dfn id=queue>queue of events</dfn>, which is initially
216     empty.
217     #ja
218     各 <code><a href="#windowworker">WindowWorker</a></code> オブジェクトは、
219     <dfn id=queue>事象の待ち行列</dfn> (はじめは空) と関連付けられています。
220    
221     #en
222     An event in the queue can be a DOM event or a timeout callback.
223     #ja
224 apache 1.11 待ち行列中の事象は、 DOM 事象か小休止呼び戻しのいずれかです。
225    
226     #en
227     All asynchronous callbacks and events that would be called or dispatched
228     in the worker must be added to the worker's queue, with the "<a
229     href="#run-a">run a worker</a>" processing model below taking care of
230     actually calling the callbacks or dispatching the events.
231     #ja
232     労働者中で呼び出しまたは発送されるすべての非同期の呼び戻しと事象は、
233 apache 1.22 労働者の待ち行列に追加されなければなりません。
234 apache 1.11 ただし、実際の呼び戻しの呼び出しや事象の発送は、後述の「<a
235 apache 1.14 href="#run-a">労働者を走らせる</a>」処理モデルに従い処理されます。
236 apache 1.11
237     #en
238     Once the <code><a href="#windowworker">WindowWorker</a></code>'s <code
239 apache 1.13 title=dom-WindowWorker-closing><a href="#closing">closing</a></code>
240 apache 1.11 attribute is set to true, the queue must discard anything else that would
241     be added to it. Effectively, once the <code
242 apache 1.13 title=dom-WindowWorker-closing><a href="#closing">closing</a></code>
243 apache 1.11 attribute is true, timers stop firing, notifications for all pending
244     asynchronous operations are dropped, etc.
245     #ja
246     一旦 <code><a href="#windowworker">WindowWorker</a></code> の <code
247     title=dom-windowworker-closing><a href="#closing">closing</a></code>
248     属性が真に設定されると、待ち行列は、以後追加されるべきものがあっても、
249     すべて捨てなければ[[MUST:なりません]]。実効的には、一旦 <code
250     title=dom-windowworker-closing><a href="#closing">closing</a></code>
251     属性が真となると、タイマーが発火を停止したり、
252 apache 1.13 すべての未決の非同期処理に関する通知は捨てられたりするようになるなどします。
253 apache 1.11
254     #pattern
255     <span class=secno>* </span>The worker's ports
256     #ja
257 apache 1.13 <span class=secno>$1 </span>労働者のポート
258 apache 1.11
259     #en
260     Workers communicate with other workers and with <span title="browsing
261     context">browsing contexts</span> through <span title="channel
262     messaging">message channels</span> and their <code>MessagePort</code>
263     objects.
264     #ja
265 apache 1.13 労働者は、メッセージ通信路とその <code>MessagePort</code>
266 apache 1.11 オブジェクトを通じて、他の労働者や閲覧文脈と通信します。
267    
268     #en
269     Each <code><a href="#windowworker">WindowWorker</a></code> <var
270     title="">worker</var> has a list of <dfn id=the-workers0>the worker's
271     ports</dfn>, which consists of all the <code>MessagePort</code> objects
272     that are entangled with another port and that have one (but only one) port
273     whose <code title=dom-MessagePort-ownerWindow>ownerWindow</code> is <var
274     title="">worker</var>. This list includes all the <code>MessagePort</code>
275     objects that are in events pending in the <a href="#queue">queue of
276     events</a>.
277     #ja
278     各 <code><a href="#windowworker">WindowWorker</a></code> <var
279     title="">worker</var> は、<dfn id=the-workers0>労働者のポート</dfn>の並びを持ちます。
280     これは、他のポートと絡められており、かつ <code title=dom-MessagePort-ownerWindow>ownerWindow</code>
281     が <var
282     title="">worker</var> であるポートを1つ (だけ) 持つような <code>MessagePort</code>
283     オブジェクトすべてを含むものです。この並びは<a href="#queue">事象の待ち行列</a>中で未決の事象中にある
284     <code>MessagePort</code> オブジェクトすべてを含みます。
285 apache 1.10
286 apache 1.17 #en
287     For each <code>MessagePort</code> object that is entangled with
288     another port and that has one (but only one) port whose <code
289     title=dom-MessagePort-ownerWindow>ownerWindow</code> is the <code><a
290     href="#windowworker">WindowWorker</a></code> object on which the method
291     was invoked, run the following substeps:
292     #ja
293     他のポートと絡められており、かつ <code
294     title=dom-MessagePort-ownerWindow>ownerWindow</code>
295     がメソッドの呼び出された <code><a
296     href="#windowworker">WindowWorker</a></code> オブジェクトであるポートを1つ
297     (だけ) 持つような <code>MessagePort</code> について、それぞれ次の部分段階を走らせます。
298    
299 apache 1.10 #pattern
300     <span class=secno>* </span>Processing model
301     #ja
302     <span class=secno>$1 </span>処理モデル
303 apache 1.11
304     #en
305     When a user agent is to <dfn id=run-a>run a worker</dfn> named <var
306     title="">name</var> for a script with <span>URL</span> <var
307     title="">url</var>, a browsing context <var title="">owner browsing
308     context</var> and a <code>Document</code> <var title="">owner
309     document</var>, it must run the following steps in a completely separate
310     and parallel execution environment:
311     #ja
312     利用者エージェントが、<span>URL</span> <var
313     title="">url</var>、閲覧文脈 <var title="">owner browsing
314     context</var>、<code>Document</code> <var title="">owner
315     document</var> のスクリプトに対する、 <var
316 apache 1.14 title="">name</var> と名付けられた<dfn id=run-a>労働者を走らせる</dfn>、
317 apache 1.11 という時には、利用者エージェントは、次の段階を、完全に分離された並列実行環境で実行しなければ[[MUST:なりません]]。
318    
319     #en
320 apache 1.20 In a parallel execution context (i.e. a separate thread or process or
321     equivalent construct), <a href="#run-a">run a worker</a> named <var
322     title="">name</var> for the script with <span>URL</span> <var
323     title="">url</var>, with the <span>script browsing context</span> of the
324     script that invoked the method as the <var title="">owner browsing
325     context</var> and with the <span>script document context</span> of the
326     script that invoked the method as the <var title="">owner
327     document</var>.
328     #ja
329     並列実行文脈において (つまり、別のスレッドやプロセスや同様の構造において)、 <var title="">owner browsing
330     context</var> をメソッドを呼び出したスクリプトのスクリプト閲覧文脈、 <var title="">owner
331     document</var> をメソッドを呼び出したスクリプトのスクリプト文書文脈として、
332     URL
333     <var
334     title="">url</var> のスクリプトのための <var
335     title="">name</var> という名前の<a href="#run-a">労働者を走らせます</a>。
336    
337     #en
338 apache 1.11 Attempt to <span>fetch</span><!-- XXX --> the resource identified by
339     <var title="">url</var>.
340     #ja
341     <var title="">url</var> で識別される資源を取って来ようと試みます。
342    
343     #en
344     If the attempt fails, then abort these steps and invoke the <a
345 apache 1.13 href="#worker" title="worker creation failed">error handling steps</a>
346 apache 1.11 defined by the algorithm that called this one.
347     #ja
348     この試みが失敗した場合、これらの段階を停止し、この段階を呼び出した算法が定義する<a
349 apache 1.13 href="#worker" title="worker creation failed">誤り取扱段階</a>を呼び出します。
350 apache 1.11
351     #en
352     If the attempt succeeds, then let <var title="">script</var> be the
353     resource that was obtained.
354     #ja
355     この試みが成功した場合、 <var title="">script</var>
356     を得られた資源とします。
357    
358     #en
359     As with <code>script</code> elements, the MIME type of the
360     script is ignored. Unlike with <code>script</code> elements, there is no
361     way to override the type. It's always assumed to be JavaScript.
362     #ja
363     <code>script</code> 要素と同様に、スクリプトの MIME 型は無視します。
364 apache 1.12 <code>script</code> 要素とは異なり、
365 apache 1.11 型を上書きする方法はありません。スクリプトは常に JavaScript
366     と仮定します。
367    
368     #en
369     Create a new <code><a href="#windowworker">WindowWorker</a></code>
370     object, <var title="">window</var>.
371     #ja
372     新しい <code><a href="#windowworker">WindowWorker</a></code>
373     オブジェクト <var title="">window</var> を作成します。
374    
375     #en
376 apache 1.13 Set the <code title=dom-WindowWorker-URL><a href="#url">URL</a></code>
377     attribute of <var title="">window</var> to the value of <var
378     title="">url</var>.
379     #ja
380     <var title="">window</var> の
381     <code title=dom-WindowWorker-URL><a href="#url">URL</a></code>
382     属性を <var
383     title="">url</var> の値に設定します。
384    
385     #en
386     Set the <code title=dom-WindowWorker-name><a
387 apache 1.11 href="#name">name</a></code> attribute of <var title="">window</var> to
388     the value of <var title="">name</var>.
389     #ja
390 apache 1.13 <var title="">window</var> の <code title=dom-WindowWorker-name><a
391 apache 1.11 href="#name">name</a></code>
392     属性を <var title="">name</var> の値に設定します。
393    
394     #en
395     Let <var title="">script</var>'s <span>script execution context</span>
396     (and thus also <span>global object</span>) be <var
397     title="">window</var>.
398     #ja
399     <var title="">script</var> のスクリプト実行文脈 (と大域オブジェクトも)
400     を <var
401     title="">window</var> とします。
402    
403     #en
404     Let <var title="">script</var>'s <span>script browsing context</span>
405     be <var title="">owner browsing context</var>.
406     #ja
407     <var title="">script</var> のスクリプト閲覧文脈を <var title="">owner browsing context</var>
408     とします。
409    
410     #en
411     Let <var title="">script</var>'s <span>script document context</span>
412    
413     be <var title="">owner document</var>.
414     #ja
415     <var title="">script</var> のスクリプト文書文脈を <var title="">owner document</var>
416     とします。
417    
418     #en
419 apache 1.13 Invoke the <a href="#success" title="worker creation
420     succeeded">success steps</a> defined by the algorithm that called this
421     one. (This will add an event to the <a href="#queue">queue of
422     events</a>.)
423 apache 1.11 #ja
424 apache 1.13 この段階を呼び出す算法が定義する<a href="#success" title="worker creation
425     succeeded">成功段階</a>を呼び出します。
426 apache 1.11 (これは、<a href="#queue">事象の待ち行列</a>)
427     に事象を追加します。)
428    
429     #en
430     Start monitoring <var title="">worker</var>, such that whenever the
431     <var title="">window</var> object's <code
432 apache 1.13 title=dom-WindowWorker-closing><a href="#closing">closing</a></code>
433 apache 1.11 attribute is false and all <a href="#the-workers0">the worker's
434     ports</a> have their <code title=dom-MessagePort-active>active</code>
435     attributes set to false, the user agent suspends execution of script in
436     that worker until such time as either the <code
437 apache 1.13 title=dom-WindowWorker-closing><a href="#closing">closing</a></code>
438 apache 1.11 attribute switches to true or one of the <code>MessagePort</code>
439     objects in the list of <a href="#the-workers0">the worker's ports</a>
440     has an <code title=dom-MessagePort-active>active</code> attribute with
441     the value true.
442     #ja
443     <var title="">worker</var> の監視を開始し、
444     <var title="">window</var> オブジェクトの <code
445 apache 1.13 title=dom-WindowWorker-closing><a href="#closing">closing</a></code>
446 apache 1.16 属性が偽であって、かつすべての<a href="#the-workers0">労働者のポート</a>の
447 apache 1.11 <code title=dom-MessagePort-active>active</code>
448 apache 1.16 属性が偽に設定されているという時に、 <code
449 apache 1.13 title=dom-WindowWorker-closing><a href="#closing">closing</a></code>
450 apache 1.16 属性が真に切り替わるまで、
451     または<a href="#the-workers0">労働者のポート</a>の並びのいずれか1つの
452 apache 1.11 <code>MessagePort</code> オブジェクトの <code title=dom-MessagePort-active>active</code>
453 apache 1.16 属性の値が真となるまでのいずれかの間、
454     利用者エージェントがスクリプトを一時停止するようにします。
455 apache 1.13
456     #en
457     Start monitoring <var title="">worker</var>, such that as soon as the
458     list of <a href="#the-workers0">the worker's ports</a> becomes empty,
459     the <var title="">window</var> object's <code
460     title=dom-WindowWorker-closing><a href="#closing">closing</a></code>
461     attribute is set to true.
462     #ja
463     <var title="">worker</var> の監視を開始し、<a href="#the-workers0">労働者のポート</a>の並びが空になると即座に
464     <var title="">window</var> オブジェクトの <code
465     title=dom-WindowWorker-closing><a href="#closing">closing</a></code>
466     属性が真に設定されるようにします。
467    
468     #en
469     Run <var title="">script</var> until it either returns, fails to catch
470     an exception, or gets prematurely aborted by the "<a href="#kill-a">kill
471     a worker</a>" algorithm below.
472     #ja
473 apache 1.14 <var title="">script</var> を、返るか、例外の捕獲に失敗するか、後述の「<a href="#kill-a">労働者を殺す</a>」算法により早々に停止させられるかのいずれかまで走らせます。
474 apache 1.11
475 apache 1.15 #en
476     If the script gets aborted by the "<a href="#kill-a">kill a
477     worker</a>" algorithm, then that same algorithm will cause there to only
478     be a single event in the <a href="#queue">queue of events</a> at the
479     next step, namely the <code title=message-unload>unload</code> event.
480     However, if the event is ignored then it will become true as soon as
481     that port is garbage collected.
482     #ja
483     スクリプトが「<a href="#kill-a">労働者を殺す</a>」算法で停止させられる場合には、
484     その同じ算法が、次の段階で、<a href="#queue">事象の待ち行列</a>には唯一
485     <code title=message-unload>unload</code> 事象だけが含まれるようにします。
486     しかし、この事象が無視された場合には、これは、ポートがごみ収集される際に真となります。
487    
488     #en
489     <i>Event loop</i>: Wait until either there is an event in the <a
490     href="#queue">queue of events</a> associated with <var
491     title="">window</var> or the <var title="">window</var> object's <code
492     title=dom-WindowWorker-closing><a href="#closing">closing</a></code>
493     attribute is set to true.
494     #ja
495     <i>事象ループ</i>: <var
496     title="">window</var> に関連付けられた<a
497     href="#queue">事象の待ち行列</a>に事象が存在するようになるか、または
498     <var title="">window</var> オブジェクトの <code
499     title=dom-WindowWorker-closing><a href="#closing">closing</a></code>
500     属性が真に設定されるまで待ちます。
501    
502     #en
503     Dispatch the oldest event or callback in the <a href="#queue">queue of
504     events</a>, if any. The handling of this event or the execution of this
505     callback might get prematurely aborted by the "<a href="#kill-a">kill a
506     worker</a>" algorithm below.
507     #ja
508     <a href="#queue">事象の待ち行列</a>中で最古の事象か呼び戻しがあれば、
509     これを発送します。この事象の取扱いや呼び戻しの実行は、後述の「<a href="#kill-a">労働者を殺す</a>」
510     算法により、早々に停止させられるかもしれません。
511    
512     #en
513     If there are any more events in the <a href="#queue">queue of
514     events</a> or if the <var title="">window</var> object's <code
515     title=dom-WindowWorker-closing><a href="#closing">closing</a></code>
516     attribute is set to false, then jump back to the step above labeled
517     <i>event loop</i>.
518     #ja
519     <a href="#queue">事象の待ち行列</a>中に更に事象が存在する場合、
520     または <var title="">window</var> オブジェクトの <code
521     title=dom-WindowWorker-closing><a href="#closing">closing</a></code>
522     属性が偽に設定されている場合、前述の<i>事象ループ</i>との名札のある段階に飛んで戻ります。
523    
524     #en
525     timers, intervals, XMLHttpRequests, database
526     transactions, etc, must be killed; ports must be deactivated and
527     unentangled (do not send unload)
528     #ja
529     タイマー、休憩、 XMLHttpRequest、データベース取引、その他を殺さなければ[[MUST:なりません]]。
530     ポートを非活性化し、ほどかなければ[[MUST:なりません]] (unload を送りません)。
531    
532     #en
533     When a user agent is to <dfn id=kill-a>kill a worker</dfn>, it must run
534     the following steps in parallel with the worker's main loop (the "<a
535     href="#run-a">run a worker</a>" processing model defined above):
536     #ja
537     利用者エージェントが<dfn id=kill-a>労働者を殺す</dfn>という時には、
538     利用者エージェントは、次の段階を労働者の主たるループ (先に定義した「<a
539     href="#run-a">労働者を走らせる</a>」処理モデル) と並列に走らせなければ[[MUST:なりません]]。
540    
541     #en
542     Create an <code>Event</code> object with the event name <code
543     title=event-unload>unload</code>, which does not bubble and is not
544     cancelable, and add it to the worker's <code><a
545     href="#windowworker">WindowWorker</a></code> object's <a
546     href="#queue">queue of events</a>, targetted at the <code><a
547     href="#windowworker">WindowWorker</a></code> object itself.
548     #ja
549     事象名が <code
550     title=event-unload>unload</code> であり、
551     泡立たず、取消可能ではない
552     <code>Event</code> オブジェクトを作成し、労働者の <code><a
553     href="#windowworker">WindowWorker</a></code>
554     オブジェクトの<a
555     href="#queue">事象の待ち行列</a>に追加し、 <code><a
556     href="#windowworker">WindowWorker</a></code>
557     オブジェクト自体を対象とします。
558    
559     #en
560 apache 1.17 Create an <code>Event</code> object with the event name <code
561     title=event-unload>unload</code>, which does not bubble and is not
562     cancelable, and add it to the <code><a
563     href="#windowworker">WindowWorker</a></code> object's <a
564     href="#queue">queue of events</a>, targetted at the <code><a
565     href="#windowworker">WindowWorker</a></code> object itself.
566     #ja
567     事象名が <code
568     title=event-unload>unload</code> であり、
569     泡立たず、取消可能ではない
570     <code>Event</code> オブジェクトを作成し、 <code><a
571     href="#windowworker">WindowWorker</a></code>
572     オブジェクトの<a
573     href="#queue">事象の待ち行列</a>に追加し、 <code><a
574     href="#windowworker">WindowWorker</a></code>
575     オブジェクト自体を対象とします。
576    
577     #en
578 apache 1.15 Set the worker's <code><a href="#windowworker">WindowWorker</a></code>
579     object's <code title=dom-WindowWorker-closing><a
580     href="#closing">closing</a></code> attribute to true.
581     #ja
582     労働者の <code><a href="#windowworker">WindowWorker</a></code>
583     オブジェクトの
584     <code title=dom-WindowWorker-closing><a
585     href="#closing">closing</a></code>
586     属性を真に設定します。
587    
588     #en
589     Wait a user-agent-defined amount of time. If the "<a href="#run-a">run
590     a worker</a>" processing model defined above immediately starts running
591     event listeners registered for <code title=event-unload>unload</code>
592     event, this time should not be zero &mdash; the idea is that the <code
593     title=event-unload>unload</code> event can be used to clean up when
594     shutting down unexpectedly.
595     #ja
596     利用者エージェント定義の時間、待ちます。先に定義した「<a href="#run-a">労働者を走らせる</a>」
597     処理モデルが <code title=event-unload>unload</code>
598     事象に登録された事象聴取器を即座に走らせ始める場合には、この時間は零である[[SHOULD NOT:べきではありません]]。
599     というのは、予期せず停止させる時に浄化するために <code
600     title=event-unload>unload</code> 事象を使えるようにするのが目的だからです。
601    
602     #en
603     If there are any events in the <a href="#queue">queue of events</a>
604     other than the <code title=event-unload>unload</code> event that this
605     algorithm just added, discard them without dispatching them.
606     #ja
607     <a href="#queue">事象の待ち行列</a>中にこの算法が追加した
608     <code title=event-unload>unload</code>
609     事象以外の事象が存在する場合には、それらを発送せずに捨てます。
610    
611     #en
612     If the <code title=event-unload>unload</code> event that this
613     algorithm just added hasn't yet been dispatched, then abort the script
614     currently running in the worker.
615     #ja
616     この算法が追加した <code title=event-unload>unload</code>
617     事象がまだ発送されていなければ、現在労働者中で走っているスクリプトを停止します。
618    
619     #en
620     Wait a user-agent-defined amount of time.
621     #ja
622     利用者エージェント定義の時間、待ちます。
623    
624     #en
625     Abort the script currently running in the worker (if any script is
626     running, then it will be a handler for the <code
627     title=event-unload>unload</code> event).
628     #ja
629     現在労働者中で走っているスクリプト (スクリプトが走っているとすると、
630     これは <code
631     title=event-unload>unload</code>
632     事象の取扱器です。) を停止します。
633    
634     #en
635     When a script invokes the <dfn id=close
636     title=dom-WindowWorker-close><code>close()</code></dfn> method on a
637     <code><a href="#windowworker">WindowWorker</a></code> object, the user
638     agent must run the following steps:
639     #ja
640     スクリプトが <code><a href="#windowworker">WindowWorker</a></code>
641     オブジェクトで <dfn id=close
642     title=dom-WindowWorker-close><code>close()</code></dfn>
643     メソッドを呼び出した場合、利用者エージェントは、次の段階を走らせなければ[[MUST:なりません]]。
644 apache 1.17
645     #en
646     Unentangle the two ports.
647     #ja
648     2つのポートをほどきます。
649    
650     #en
651     Set both ports' <code title=dom-MessagePort-active>active</code>
652     attribute to false.
653     #ja
654     両ポートの <code title=dom-MessagePort-active>active</code>
655     属性を偽に設定します。
656    
657     #en
658     At the next available opportunity, after any scripts have finished
659     executing<!-- XXX queue -->, <span>fire a simple event</span> called
660     <code title=event-unload>unload</code> at the other port (the one
661     whose <code title=dom-MessagePort-ownerWindow>ownerWindow</code> is
662     not the <code><a href="#windowworker">WindowWorker</a></code> object
663     on which the <code title=dom-WindowWorker-close><a
664     href="#close">close()</a></code> method was called).
665     #ja
666 apache 1.20 次の利用可能な機会、何らかのスクリプトが実行し終えた後に、
667 apache 1.17 他方のポート (<code title=dom-MessagePort-ownerWindow>ownerWindow</code>
668     が <code title=dom-WindowWorker-close><a
669     href="#close">close()</a></code>
670     メソッドが呼ばれた <code><a href="#windowworker">WindowWorker</a></code>
671 apache 1.20 オブジェクトではない方) で <code title=event-unload>unload</code>
672 apache 1.17 と呼ばれる単純事象を発火します。
673    
674     #pattern
675     <span class=secno>* </span>Creating workers
676     #ja
677     <span class=secno>$1 </span>労働者の作成
678    
679     #pattern
680     Objects that implement the * interface must also
681     implement the * interface.
682     #ja
683     $1 界面を実装するオブジェクトは、 $2 界面も実装しなければ[[MUST:なりません]]。
684    
685 apache 1.19 #pattern
686     When the * method is invoked, the user agent
687 apache 1.17 must run the following steps:
688     #ja
689 apache 1.19 利用者エージェントは、 $1 メソッドが呼び出された時、
690 apache 1.17 次の段階を走らせなければ[[MUST:なりません]]。
691 apache 1.15
692 apache 1.18 #en
693     <span title="resolve a url">Resolve</span> the <var
694     title="">scriptURL</var> argument.
695     #ja
696     <var
697     title="">scriptURL</var> 引数を<span title="resolve a url">解決</span>します。
698    
699     #en
700     If this fails, throw a <code>SYNTAX_ERR</code> exception.
701     #ja
702     これが失敗した場合、 <code>SYNTAX_ERR</code>
703     例外を投げます。
704    
705     #en
706     If the <span>origin</span> of the resulting <span>absolute URL</span>
707     is not the <span title="same origin">same</span> as the origin of the
708     script that invoked the method, then throw a <span>security
709     exception</span>.
710     #ja
711     得られた絶対 URL の起源がメソッドを呼び出したスクリプトの起源と<span title="same origin">同じ</span>でない場合、
712     保安性例外を投げます。
713    
714     #en
715     <a href="#create">Create a worker</a> from the resulting
716     <span>absolute URL</span> whose name is the empty string.
717     #ja
718     得られた絶対 URL から、名前が空文字列である<a href="#create">労働者を作成</a>します。
719    
720     #en
721     Return the <code>MessagePort</code> object returned from the <a
722     href="#create">create a worker</a> algorithm.
723     #ja
724     <a
725     href="#create">労働者を作成</a>する算法が返した
726     <code>MessagePort</code> オブジェクトを返します。
727 apache 1.19
728     #en
729     If the <var title="">name</var> argument is the empty string, <a
730     href="#create">create a worker</a> from the resulting <span>absolute
731     URL</span>, whose name is the empty string, and return the
732     <code>MessagePort</code> object returned from the <a
733     href="#create">create a worker</a> algorithm. Then, abort these steps.
734     #ja
735     <var title="">name</var> 引数が空文字列の場合、得られた絶対 URL から、
736     名前が空文字列である<a
737     href="#create">労働者を作成</a>し、<a
738     href="#create">労働者を作成</a>する算法が返した <code>MessagePort</code>
739     オブジェクトを返します。そして、これらの段階を停止します。
740    
741     #en
742     If there exists a worker whose <code title=dom-WindowWorker-closing><a
743     href="#closing">closing</a></code> attribute is false, whose <code
744     title=dom-WindowWorker-name><a href="#name">name</a></code> attribute is
745     exactly equal to the <var title="">name</var> argument, and whose <code
746     title=dom-WindowWorker-URL><a href="#url">URL</a></code> attribute has
747     the <span>same origin</span> as the resulting <span>absolute URL</span>,
748     then run these substeps:
749     #ja
750     <code title=dom-WindowWorker-closing><a
751     href="#closing">closing</a></code> 属性が偽で、 <code
752     title=dom-WindowWorker-name><a href="#name">name</a></code>
753     属性が <var title="">name</var> 引数と全く等しく、 <code
754     title=dom-WindowWorker-URL><a href="#url">URL</a></code>
755     属性が得られた絶対 URL と同じ起源を持つ労働者が存在する場合、
756     次の部分段階を走らせます。
757    
758     #en
759     If that worker's <code title=dom-WindowWorker-URL><a
760     href="#url">URL</a></code> attribute is not exactly equal to the
761     resulting <span>absolute URL</span>, then throw a
762     <code>URL_MISMATCH_ERR</code> exception and abort these steps. <span
763     class=big-issue>code 19</span>
764     #ja
765     当該労働者の <code title=dom-WindowWorker-URL><a
766     href="#url">URL</a></code>
767     属性が得られた絶対 URL と全く等しくはない場合、 <code>URL_MISMATCH_ERR</code>
768     例外を投げ、これらの段階を停止します。 <span
769     class=big-issue>code 19</span>
770    
771     #en
772     <span>Create a new <code>MessagePort</code> object</span> owned by
773     the <span>script execution context</span> of the script that invoked
774     the method.
775     #ja
776     メソッドを呼び出したスクリプトのスクリプト実行文脈が所有する新しい <code>MessagePort</code>
777     オブジェクトを作成します。
778    
779     #en
780     Return that port.
781     #ja
782     そのポートを返します。
783    
784     #en
785     Asynchronously, <a href="#attach" title="attach to a
786     worker">attach</a> to this preexisting worker, with the newly created
787     port.
788     #ja
789     非同期に、この既存の労働者を新しく作成されたポートに<a href="#attach" title="attach to a
790     worker">添付</a>します。
791    
792     #en
793     Otherwise, <a href="#create">create a worker</a> from the resulting
794     <span>absolute URL</span>, whose name is the value of the <var
795     title="">name</var> argument, and return the <code>MessagePort</code>
796     object returned from the <a href="#create">create a worker</a>
797     algorithm.
798     #ja
799     そうでない場合、得られた絶対 URL から、名前が <var
800     title="">name</var> 引数の値である<a href="#create">労働者を作成</a>し、
801     <a href="#create">労働者を作成</a>する算法が返した <code>MessagePort</code>
802     オブジェクトを返します。
803    
804     #en
805     The steps to <dfn id=create>create a worker</dfn> from a
806     <span>URL</span> <var title="">url</var> and whose name is <var
807     title="">name</var>, in the context of a method call, are as follows:
808     #ja
809     メソッド呼び出しの文脈において、 URL <var title="">url</var> から名前 <var
810     title="">name</var> の<dfn id=create>労働者を作成</dfn>する段階は、次の通りです。
811 apache 1.18
812 apache 1.20 #en
813     If that algorithm invokes the steps for <dfn id=success title="worker
814     creation succeeded">success steps</dfn>, then <a href="#attach"
815     title="attach to a worker">attach</a> to this new worker, with the newly
816     created port.
817     #ja
818     その算法が<dfn id=success title="worker
819     creation succeeded">成功段階</dfn>の段階を呼び出す場合は、
820     この新しい労働者に、新しく作成されたポートと共に<a href="#attach"
821     title="attach to a worker">添付</a>します。
822    
823     #en
824     Otherwise, if the <dfn id=worker>worker creation failed</dfn>, then at
825     the next available opportunity, after any scripts have finished
826     executing<!-- XXX queue -->, <span>fire a simple event</span> called
827     <code title=event-error>error</code> at the newly created port.
828     #ja
829     そうでない場合、<dfn id=worker>労働者作成が失敗</dfn>した場合、次の利用可能な機会、
830     何らかのスクリプトが実行し終えた後に、新しく作成されたポートで
831     <code title=event-error>error</code>
832     と呼ばれる単純事象を発火します。
833    
834     #en
835     The steps to <dfn id=attach>attach to a worker</dfn> given a
836     <code>MessagePort</code> object <var title="">port</var> are as follows:
837     #ja
838     <code>MessagePort</code> オブジェクト <var title="">port</var>
839     に<dfn id=attach>労働者を添付</dfn>する段階は次の通りです。
840    
841     #en
842     If <var title="">port</var> would have been garbage collected, or if
843     the <span>active document</span> of the <code
844     title=dom-MessagePort-ownerWindow>ownerWindow</code> of <var
845     title="">port</var> is no longer the same <code>Document</code> object
846     as when <var title="">port</var> was created, then do nothing. Abort
847     these steps. If the worker was just created, it'll get killed
848     immediately.
849     #ja
850     <var title="">port</var> がごみ収集されている場合、あるいは <var
851     title="">port</var> の <code
852     title=dom-MessagePort-ownerWindow>ownerWindow</code> の活性文書が既に
853     <var title="">port</var> が作成された時と同じ <code>Document</code>
854     オブジェクトでない場合には、何もしません。これらの段階を停止します。
855     労働者が丁度作成されたばかりの場合には、これはすぐに殺されることになります。
856    
857     #en
858     <span>Create a new <code>MessagePort</code> object</span> owned by the
859     <code><a href="#windowworker">WindowWorker</a></code> of the worker.
860     #ja
861     労働者の <code><a href="#windowworker">WindowWorker</a></code>
862     が所有する新しい <code>MessagePort</code> object</span>
863     オブジェクトを作成します。
864    
865     #en
866     <span>Entangle</span> this newly created port and the port <var
867     title="">port</var> that was passed to these steps.
868     #ja
869     この新しく作成されたポートとこれらの段階に渡されたポート <var
870     title="">port</var> を絡めます。
871    
872     #en
873     Set the <code title=dom-MessagePort-active>active</code> attribute of
874     both ports to true.
875     #ja
876     両ポートの
877     <code title=dom-MessagePort-active>active</code>
878     属性を真に設定します。
879    
880     #en
881     At the next available opportunity, after any scripts have finished
882     executing<!-- XXX queue -->, <span>fire a simple event</span> called
883     <code title=event-load>load</code> at <var title="">port</var>.
884     #ja
885     次の利用可能な機会、何らかのスクリプトが実行し終えた後に、
886     <var title="">port</var> において <code title=event-load>load</code>
887     と呼ばれる単純事象を発火します。
888    
889     #en
890     Create an event that uses the <code>MessageEvent</code> interface,
891     with the name <code title=event-attach>attach</code>, which does not
892     bubble, is cancelable, has no default action, has a <code
893     title=dom-MessageEvent-data>data</code> attribute whose value is the
894     empty string and has a <code
895     title=dom-MessageEvent-messagePort>messagePort</code> attribute whose
896     value is the newly created port, and add it to the worker's <code><a
897     href="#windowworker">WindowWorker</a></code> object's <a
898     href="#queue">queue of events</a>, targetted at the <code><a
899     href="#windowworker">WindowWorker</a></code> object itself.
900     #ja
901     <code>MessageEvent</code> 界面を使った、名前 <code title=event-attach>attach</code>
902     の泡立たず、取消し可能で、既定作用を持たず、 <code
903     title=dom-MessageEvent-data>data</code> 属性の値が空文字列で、 <code
904     title=dom-MessageEvent-messagePort>messagePort</code> 属性の値が新たに作成されたポートである事象を作成し、
905     これを労働者の <code><a
906     href="#windowworker">WindowWorker</a></code> オブジェクトの<a
907     href="#queue">事象の待ち行列</a>に、 <code><a
908     href="#windowworker">WindowWorker</a></code>
909     オブジェクト自体を対象として追加します。
910    
911     #pattern
912     <span class=secno>* </span>APIs available to workers
913     #ja
914     <span class=secno>$1 </span>労働者が利用可能な API
915    
916     #en
917     Objects that implement the <code><a
918     href="#windowworker">WindowWorker</a></code> interface must also implement
919     the following interfaces:
920     #ja
921     <code><a
922     href="#windowworker">WindowWorker</a></code> 事象を実装するオブジェクトは、
923     次の界面も実装しなければ[[MUST:なりません]]。
924    
925     #en
926     The <code>Window</code> interface, and interfaces that are required to
927     be implemented by objects implementing that interface, including:
928     #ja
929     <code>Window</code> 界面と、この界面を実装するオブジェクトが実装することを[[REQUIRED:要求]]されている界面。
930     これには、次の界面が含まれます。
931    
932     #pattern
933     The * interface
934     #ja
935     $1 界面
936 apache 1.21
937     #pattern
938     The * interface.
939     #ja
940     $1 界面。

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24