/[suikacvs]/markup/html/html5/spec-ja/workers-non-normative.ja.html.u8
Suika

Contents of /markup/html/html5/spec-ja/workers-non-normative.ja.html.u8

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.28 - (hide annotations) (download)
Fri Aug 15 06:19:34 2008 UTC (17 years, 11 months ago) by wakaba
Branch: MAIN
Changes since 1.27: +227 -3 lines
make

1 wakaba 1.1
2     <html lang=en-US-x-hixie>
3     <head>
4     <title>Web Workers</title>
5     <link href="http://www.whatwg.org/style/specification" rel=stylesheet>
6     <!-- Japanese-translation-only style rules -->
7     <style>
8 wakaba 1.14 em, i {
9     font-style: normal;
10 wakaba 1.1 text-decoration: underline;
11     }
12 wakaba 1.14
13     .note, .warning {
14     font-style: normal;
15     }
16     p.note:before {
17     content: '注意: ';
18     }
19     p.warning:before {
20     content: '\26A0 警告! ';
21     }
22    
23 wakaba 1.1 ins.ja-note {
24     background-color: #EEFFFF;
25     color: black;
26     }
27 wakaba 1.16 span.ja-translation {
28     border-style: none !important;
29     }
30 wakaba 1.18
31     /* From Web Workers <style>, modified for Japanese texts */
32     p > span.ja-translation > span:not([title=""]):not([class="big-issue"]),
33     li > span.ja-translation > span:not([title=""]):not([class="big-issue"]) {
34     border-bottom: solid #99CC99;
35     }
36    
37 wakaba 1.1 </style>
38     <link href="http://www.whatwg.org/images/icon" rel=icon>
39    
40 wakaba 1.16 <style>
41     p > span:not([title=""]):not([class="big-issue"]), li > span:not([title=""]):not([class="big-issue"]) { border-bottom: solid #99CC99; }
42     </style>
43    
44 wakaba 1.1 <body class=draft>
45     <div class=head>
46     <p><span class=ja-translation lang=ja><a class=logo href="http://www.whatwg.org/" rel=home><img lang=en alt=WHATWG
47     src="http://www.whatwg.org/images/logo"></a></span></p>
48    
49     <h1 id=web-workers>Web Workers</h1>
50    
51     <h2 class="no-num no-toc" id=draft><span class=ja-translation lang=ja>勧告案<ins class=ja-note>の非公式和訳</ins> &mdash;
52 wakaba 1.28 <ins class=ja-note>(原文出版日)</ins> 2008年8月14日</span></h2>
53 wakaba 1.1
54     <p><span class=ja-translation lang=ja>みなさんにも作業にご参加いただけます。 <a
55     href="http://www.whatwg.org/mailing-list">作業部会の議論用メイリング・リストに参加してください。</a></span></p>
56    
57     <p><span class=ja-translation lang=ja><strong>Web デザイナー!</strong> みなさんのための <a
58     href="http://blog.whatwg.org/faq/" lang=en>FAQ</a>、<a
59     href="http://forums.whatwg.org/">掲示板</a>、<a
60     href="http://www.whatwg.org/mailing-list#help">ヘルプ用メイリング・リスト</a>があります!
61    
62     </span><p>
63    
64     <!-- Japanese-translation-only notes -->
65 wakaba 1.3 <ins class=ja-note style="display: block" lang=ja>
66 wakaba 1.1 <p>この文書は、 WHATWG HTML5 仕様書の日本語訳です。
67     HTML5 の正式な仕様書は英語版だけであり、
68     この日本語訳はあくまで参考としてご利用ください。
69    
70 wakaba 1.3 <p lang=en>This document is a Japanese translation of
71 wakaba 1.1 the WHATWG HTML5 specification. Note that the only normative specification
72     for the HTML5 is the original English version and this Japanese
73     translation is non‐normative.
74 wakaba 1.3
75     <p>日本語訳は <a href="edit/" rel=edit>Web 界面</a>を使って編集できます。
76     編集結果はおよそ3時間おきに反映されます。
77     また、原文の変更には毎日自動的に追随しています。
78    
79 wakaba 1.8 <p lang=en>The Japanese text can be edited using the <a href="edit/" rel=edit>Web
80 wakaba 1.3 interface</a>. Any modifications will be reflected to this translation
81     in about three hours. Note that any changes to the original specification
82     will automatically be incorporated to this translation every day.
83 wakaba 1.1 </ins>
84    
85     <p><span><!-- dummy --></span></p>
86    
87     <dl>
88     <dt><span class=ja-translation lang=ja><ins class=ja-note>原文の</ins>この版</span><dd><a
89 wakaba 1.13 href="http://www.whatwg.org/specs/web-workers/current-work/">http://whatwg.org/ww</a>
90 wakaba 1.1
91     <dt><span class=ja-translation lang=ja><ins class=ja-note>原文の</ins>改版履歴:</span><dd><span class=ja-translation lang=ja><span lang=en>Twitter</span> メッセージ (編集上の変更以外): <a
92 wakaba 1.20 href="http://twitter.com/WHATWG">http://twitter.com/WHATWG</a></span><dd><span class=ja-translation lang=ja>Commit-Watchers メイリング・リスト: <a
93     href="http://lists.whatwg.org/listinfo.cgi/commit-watchers-whatwg.org">http://lists.whatwg.org/listinfo.cgi/commit-watchers-whatwg.org</a></span><dd><span class=ja-translation lang=ja>対話的 <span lang=en>Web</span> 界面: <a href="http://html5.org/tools/web-workers-tracker">http://html5.org/tools/web-workers-tracker</a></span><dd><span class=ja-translation lang=ja><span lang=en>Subversion</span> 界面: <a href="http://svn.whatwg.org/webworkers/">http://svn.whatwg.org/webworkers/</a></span><dt><span class=ja-translation lang=ja>問題:</span><dd><span class=ja-translation lang=ja>フィードバックの送信先: <a
94 wakaba 1.1 href="http://www.whatwg.org/mailing-list">[email protected]</a></span><dd><span class=ja-translation lang=ja>フィードバックの閲覧・投票: <a
95     href="http://www.whatwg.org/issues/">http://www.whatwg.org/issues/</a></span><dt><span class=ja-translation lang=ja>編集者:</span><dd>Ian Hickson, Google, [email protected]
96     </dl>
97    
98     <p class=copyright>&copy; Copyright 2004-2008 Apple Computer, Inc.,
99     Mozilla Foundation, and Opera Software ASA.</p>
100    
101     <p class=copyright>You are granted a license to use, reproduce and create
102     derivative works of this document.</p>
103     </div>
104    
105     <hr>
106    
107     <h2 class="no-num no-toc" id=abstract><span class=ja-translation lang=ja>概要</span></h2>
108    
109 wakaba 1.14 <p><span class=ja-translation lang=ja>この仕様書は、 Web アプリケーションで、主たる頁とは並列に、
110     背景労働者スクリプトを走らせるための API を定義します。
111     これにより、メッセージ・パッシングによるスレッド的操作を協調機構として利用できるようになります。</span><h2 class="no-num no-toc" id=status><span class=ja-translation lang=ja>この文書の状態</span></h2>
112 wakaba 1.1
113     <p><span class=ja-translation lang=ja><strong>この文書は作業中です!</strong>
114     この文書は、コメントへの対応や通常の開発の過程として、
115     毎時毎分とは言い過ぎですが毎日のペースで変更されています。
116     コメントは非常に歓迎していますので、
117     <a href="mailto:[email protected]">[email protected]</a>
118     へお送りください。よろしくお願いします。</span><p><span class=ja-translation lang=ja>現在の焦点は、第1案の開発です。</span><p><span class=ja-translation lang=ja>実装者は、この仕様書が安定していないことに注意するべきです。
119     <strong>実装者は議論に参加しておかないと、
120     仕様がその実装とは非互換に変更されてしまうかもしれません。</strong>
121     この仕様書がいずれ実装呼び掛けの段階に達するのよりも前にこの仕様を実装したい販売者は、
122 wakaba 1.7 <a href="http://www.whatwg.org/mailing-list">WHATWG メイリング・リスト</a>に参加し、
123 wakaba 1.1 議論に加わるべきです。</span><p><span class=ja-translation lang=ja>この仕様書は <a
124     href="http://www.w3.org/html/wg">W3C HTML WG</a>
125     によっても出版されています。2つの仕様書の目次以降は同一です。</span><h2 class="no-num no-toc" id=contents><span class=ja-translation lang=ja>目次
126     </span></h2>
127     <!--begin-toc-->
128    
129     <ul class=toc>
130     <li><a href="#introduction"><span class=secno>1. </span>Introduction</a>
131     <ul class=toc>
132 wakaba 1.9 <li><a href="#tutorial"><span class=secno>1.1 </span>Tutorial</a>
133 wakaba 1.23 <ul class=toc>
134     <li><a href="#a-background"><span class=secno>1.1.1 </span>A
135     background number-crunching worker</a>
136    
137     <li><a href="#a-worker"><span class=secno>1.1.2 </span>A worker for
138     updating a client-side database</a>
139    
140     <li><a href="#worker"><span class=secno>1.1.3 </span>Worker used for
141     backgroud I/O</a>
142    
143     <li><a href="#shared"><span class=secno>1.1.4 </span>Shared
144     workers</a>
145    
146     <li><a href="#delegation"><span class=secno>1.1.5
147     </span>Delegation</a>
148    
149 wakaba 1.28 <li><a href="#providing"><span class=secno>1.1.6 </span>Providing
150     libraries</a>
151    
152     <li><a href="#granting"><span class=secno>1.1.7 </span>Granting
153 wakaba 1.23 capabilities</a>
154     </ul>
155 wakaba 1.1
156 wakaba 1.16 <li><a href="#conformance"><span class=secno>1.2 </span>Conformance
157 wakaba 1.1 requirements</a>
158     <ul class=toc>
159 wakaba 1.16 <li><a href="#dependencies"><span class=secno>1.2.1
160 wakaba 1.1 </span>Dependencies</a>
161     </ul>
162    
163 wakaba 1.16 <li><a href="#terminology"><span class=secno>1.3 </span>Terminology</a>
164 wakaba 1.9 </ul>
165    
166 wakaba 1.13 <li><a href="#infrastructure"><span class=secno>2.
167     </span>Infrastructure</a>
168 wakaba 1.9 <ul class=toc>
169 wakaba 1.22 <li><a href="#the-workerglobalscope"><span class=secno>2.1 </span>The
170     <code>WorkerGlobalScope</code> interface</a>
171 wakaba 1.9
172 wakaba 1.16 <li><a href="#base-urls"><span class=secno>2.2 </span>Base URLs and
173     origins of workers</a>
174    
175     <li><a href="#the-queue"><span class=secno>2.3 </span>The queue of
176 wakaba 1.9 events</a>
177    
178 wakaba 1.16 <li><a href="#the-workers"><span class=secno>2.4 </span>The worker's
179 wakaba 1.11 ports</a>
180    
181 wakaba 1.16 <li><a href="#processing"><span class=secno>2.5 </span>Processing
182 wakaba 1.9 model</a>
183 wakaba 1.13
184 wakaba 1.16 <li><a href="#creating"><span class=secno>2.6 </span>Creating
185 wakaba 1.13 workers</a>
186 wakaba 1.9 </ul>
187    
188 wakaba 1.13 <li><a href="#apis-available"><span class=secno>3. </span>APIs available
189     to workers</a>
190 wakaba 1.22 <ul class=toc>
191     <li><a href="#importing"><span class=secno>3.1 </span>Importing scripts
192     and libraries</a>
193    
194     <li><a href="#apis-defined"><span class=secno>3.2 </span>APIs defined in
195     other specifications</a>
196    
197     <li><a href="#interface"><span class=secno>3.3 </span>Interface objects
198     and constructors</a>
199 wakaba 1.23
200     <li><a href="#worker0"><span class=secno>3.4 </span>Worker locations</a>
201    
202 wakaba 1.22 </ul>
203 wakaba 1.1
204     <li class=no-num><a href="#references">References</a>
205    
206     <li class=no-num><a href="#acknowledgements">Acknowledgements</a>
207     </ul>
208     <!--end-toc-->
209    
210     <hr>
211    
212 wakaba 1.3 <h2 id=introduction><span class=ja-translation lang=ja><span class=secno>1. </span>はじめに</span></h2>
213 wakaba 1.1
214 wakaba 1.12 <h3 id=tutorial><span class=ja-translation lang=ja><span class=secno>1.1 </span>解説</span></h3>
215 wakaba 1.1
216 wakaba 1.27 <p><span class=ja-translation lang=ja><em>この節は規定の一部ではありません。</em></span><p><span class=ja-translation lang=ja>労働者は色々なことに使えます。次の各節では、色々な使い方の例を示します。</span><h4 id=a-background><span class=ja-translation lang=ja><span class=secno>1.1.1 </span>数値処理背景労働者</span></h4>
217 wakaba 1.23
218 wakaba 1.27 <p><span class=ja-translation lang=ja><em>この節は規定の一部ではありません。</em></span><p><span class=ja-translation lang=ja>労働者の一番単純な用法は、計算的に高価な仕事を利用者界面を中断させずに実行することです。</span><p><span class=ja-translation lang=ja>この例では、主たる文書が労働者を作って素数を (素朴な方法で) 計算させ、
219     新しく見つかった素数を順番に表示してゆきます。</span><p><span class=ja-translation lang=ja>主たる頁は次の通りです。</span><pre>&lt;!DOCTYPE HTML>
220 wakaba 1.23 &lt;html>
221     &lt;head>
222     &lt;title>Worker example: One-core computation&lt;/title>
223     &lt;/head>
224     &lt;body>
225     &lt;p>The highest prime number discovered so far is: &lt;output id="result">&lt;/output>&lt;/p>
226     &lt;script>
227     var worker = createWorker('worker.js');
228 wakaba 1.25 worker.port.onmessage = function (event) {
229 wakaba 1.23 document.getElementById('result').textContent = event.message;
230     };
231     &lt;/script>
232     &lt;/body>
233     &lt;/html></pre>
234    
235     <p>The <code title=dom-WorkerFactory-createWorker><a
236     href="#createworker">createWorker()</a></code> method call creates a
237 wakaba 1.25 worker and returns a <code><a href="#worker1">Worker</a></code> object
238     representing that worker and containing a <code>MessagePort</code> object,
239     which is used to communicate with the worker. That object's <code
240 wakaba 1.23 title=dom-MessagePort-onmessage>onmessage</code> event handler attribute
241     allows the code to receive messages from the worker.
242    
243 wakaba 1.27 <p><span class=ja-translation lang=ja>労働者自体は次の通りです。</span><pre>var n = 1;
244 wakaba 1.23 search: while (true) {
245     n += 1;
246     for (var i = 2; i &lt;= Math.sqrt(n); i += 1)
247     if (n % i == 0)
248     continue search;
249     // found a prime!
250     port.postMessage(n);
251     }</pre>
252    
253     <p>The bulk of this code is simply an unoptimised search for a prime
254     number. To send a message back to the page, the <code
255     title=dom-WorkerGlobalScope-port><a href="#port">port</a></code> variable
256     (defined automatically when the worker is created) is used to post a
257     message when a prime is found.
258    
259 wakaba 1.27 <p><span class=ja-translation lang=ja><a href="http://www.whatwg.org/demos/workers/primes/page.html">この例をオンラインで見る</a>。</span><h4 id=a-worker><span class=secno>1.1.2 </span>A worker for updating a
260 wakaba 1.23 client-side database</h4>
261    
262     <p><span class=ja-translation lang=ja><em>この節は規定の一部ではありません。</em></span><p>In this example, the main document spawns a worker whose only task is to
263     listen for notifications from the server, and, when appropriate, either
264     add or remove data from the client-side database.
265    
266     <p>Since no communication occurs between the worker and the main page, the
267     main page can start the worker by just doing:
268    
269     <pre>&lt;script>
270     createWorker('worker.js');
271     &lt;/script></pre>
272    
273 wakaba 1.27 <p><span class=ja-translation lang=ja>労働者自体は次の通りです。</span><pre>var server = new WebSocket('ws://whatwg.org/database');
274 wakaba 1.25 var database = openDatabase('demobase', '1.0', 'Demo Database', 10240);
275 wakaba 1.23 server.onmessage = function (event) {
276     // data is in the format "command key value"
277     var data = event.message.split(' ');
278     switch (data[0]) {
279     case '+':
280     database.transaction(function(tx) {
281     tx.executeSql('INSERT INTO pairs (key, value) VALUES (?, ?)', data[1], data[2]);
282     });
283     case '-':
284     database.transaction(function(tx) {
285     tx.executeSql('DELETE FROM pairs WHERE key=? AND value=?', data[1], data[2]);
286     });
287     }
288     };</pre>
289    
290     <p>This connects to the server using the <code>WebSocket</code> mechanism
291     and opens the local database (which, we presume, has been created
292     earlier). The worker then just listens for messages from the worker and
293     acts on them as appropriate, forever (or until the main page is closed).
294    
295     <p><a
296     href="http://www.whatwg.org/demos/workers/database-updater/page.html">View
297     this example online</a>. (This example will not actually function, since
298     the server does not actually exist and the database is not created by this
299     sample code.)
300    
301     <h4 id=worker><span class=secno>1.1.3 </span>Worker used for backgroud I/O</h4>
302    
303     <p><span class=ja-translation lang=ja><em>この節は規定の一部ではありません。</em></span><p>In this example, the main document uses two workers, one for fetching
304     stock updates for at regular intervals, and one for fetching performing
305     search queries that the user requests.
306    
307 wakaba 1.27 <p><span class=ja-translation lang=ja>主たる頁は次の通りです。</span><pre>&lt;!DOCTYPE HTML>
308 wakaba 1.23 &lt;html>
309     &lt;head>
310     &lt;title>Worker example: Stock ticker&lt;/title>
311     &lt;script>
312     // TICKER
313     var symbol = 'GOOG'; // default symbol to watch
314     var ticker = createWorker('ticker.js');
315 wakaba 1.25 ticker.port.postMessage(symbol);
316 wakaba 1.23
317     // SEARCHER
318     var searcher = createWorker('searcher.js');
319     function search(query) {
320 wakaba 1.25 searcher.port.postMessage(query);
321 wakaba 1.23 }
322    
323     // SYMBOL SELECTION UI
324     function select(newSymbol) {
325     symbol = newSymbol;
326 wakaba 1.25 ticker.port.postMessage(symbol);
327 wakaba 1.23 }
328     &lt;/script>
329     &lt;/head>
330     &lt;body>
331     &lt;p>&lt;output id="symbol">&lt;/output> &lt;output id="value">&lt;/output>&lt;/p>
332     &lt;script>
333 wakaba 1.25 ticker.port.onmessage = function (event) {
334 wakaba 1.23 var data = event.message.split(' ');
335     document.getElementById('symbol').textContent = data[0];
336     document.getElementById('value').textContent = data[1];
337     };
338     &lt;/script>
339     &lt;p>&lt;label>Search: &lt;input type="text" oninput="search(this.value)">&lt;/label>&lt;/p>
340     &lt;ul id="results">&lt;/ul>
341     &lt;script>
342 wakaba 1.25 searcher.port.onmessage = function (event) {
343 wakaba 1.23 var data = event.message.split(' ');
344     var results = document.getElementById('results');
345     while (results.hasChildNodes()) // clear previous results
346     results.removeChild(results.firstChild);
347     for (var i = 0; i &lt; data.length; i += 1) {
348     // add a list item with a button for each result
349     var li = document.createElement('li');
350     var button = document.createElement('button');
351     button.value = data[i];
352     button.type = 'button';
353     button.onclick = function () { select(this.value); };
354     button.textContent = data[i];
355     li.appendChild(button);
356     results.appendChild(li);
357     }
358     };
359     &lt;/script>
360     &lt;p>(The data in this example is not real. Try searching for "Google" or "Apple".)&lt;/p>
361     &lt;/body>
362     &lt;/html></pre>
363    
364     <p>Messages are queued until the <code
365     title=handler-MessagePort-onmessage>onmessage</code> handler is set, so
366     even if it takes a while for the message handler to be attached, no data
367     is lost.
368    
369     <p>The two workers use a common library for performing the actual network
370     calls. This library is as follows:
371    
372     <pre>function get(url) {
373     try {
374     var xhr = new XMLHttpRequest();
375     xhr.open('GET', url, false);
376     xhr.send();
377     return xhr.responseText;
378     } catch (e) {
379     return ''; // turn all errors into empty results
380     }
381     }</pre>
382    
383     <p>The stock updater worker is as follows:
384    
385 wakaba 1.25 <pre>importScripts('io.js');
386 wakaba 1.23 var timer;
387     var symbol;
388     function update() {
389     port.postMessage(symbol + ' ' + get('stock.cgi?' + symbol));
390     timer = setTimeout(update, 10000);
391     }
392     port.onmessage = function (event) {
393     if (timer)
394     clearTimeout(timer);
395     symbol = event.message;
396     update();
397     };</pre>
398    
399     <p>The search query worker is as follows:
400    
401 wakaba 1.25 <pre>importScripts('io.js');
402 wakaba 1.23 port.onmessage = function (event) {
403     port.postMessage(get('search.cgi?' + event.message));
404     };</pre>
405    
406 wakaba 1.27 <p><span class=ja-translation lang=ja><a href="http://www.whatwg.org/demos/workers/stocks/page.html">この例をオンラインで見る</a>。</span><h4 id=shared><span class=secno>1.1.4 </span>Shared workers</h4>
407 wakaba 1.23
408     <p><span class=ja-translation lang=ja><em>この節は規定の一部ではありません。</em></span><p>In this example, multiple windows (viewers) can be opened that are all
409     viewing the same map. All the windows share the same map information, with
410     a single worker coordinating all the viewers. Each viewer can move around
411     idependently, but if they set any data on the map, all the viewers are
412     updated.
413    
414     <p>The main page isn't interesting, it merely provides a way to open the
415     viewers:
416    
417     <pre>&lt;!DOCTYPE HTML>
418     &lt;html>
419     &lt;head>
420     &lt;title>Workers example: Multiviewer&lt;/title>
421     &lt;script>
422     function openViewer() {
423     window.open('viewer.html');
424     }
425     &lt;/script>
426     &lt;/head>
427     &lt;body>
428     &lt;p>&lt;button type=button onclick="openViewer()">Open a new
429     viewer&lt;/button>&lt;/p>
430     &lt;p>Each viewer opens in a new window. You can have as many viewers
431     as you like, they all view the same data.&lt;/p>
432     &lt;/body>
433     &lt;/html></pre>
434    
435     <p>The viewer is more involved:
436    
437     <pre>&lt;!DOCTYPE HTML>
438     &lt;html>
439     &lt;head>
440     &lt;title>Workers example: Multiviewer viewer&lt;/title>
441     &lt;script>
442     var worker = createNamedWorker('worker.js', 'core');
443    
444     // CONFIGURATION
445     function configure(event) {
446     if (event.message.substr(0, 4) != 'cfg ') return;
447     var name = event.message.substr(4).split(' ', 1);
448     // update display to mention our name is name
449     document.getElementsByTagName('h1')[0].textContent += ' ' + name;
450     // no longer need this listener
451 wakaba 1.25 worker.port.removeEventListener('message', configure, false);
452 wakaba 1.23 }
453 wakaba 1.25 worker.port.addEventListener('message', configure, false);
454 wakaba 1.23
455     // MAP
456     function paintMap(event) {
457     if (event.message.substr(0, 4) != 'map ') return;
458     var data = event.message.substr(4).split(',');
459     // display tiles data[0] .. data[8]
460     var canvas = document.getElementById('map');
461     var context = canvas.getContext('2d');
462     for (var y = 0; y &lt; 3; y += 1) {
463     for (var x = 0; x &lt; 3; x += 1) {
464     var tile = data[y * 3 + x];
465     if (tile == '0')
466     context.fillStyle = 'green';
467     else
468     context.fillStyle = 'maroon';
469     fillRect(x * 50, y * 50, 50, 50);
470     }
471     }
472     }
473 wakaba 1.25 worker.port.addEventListener('message', paintMap, false);
474 wakaba 1.23
475     // PUBLIC CHAT
476     function updatePublicChat(event) {
477     if (event.message.substr(0, 4) != 'txt ') return;
478     var name = event.message.substr(4).split(' ', 1);
479     var message = event.message.substr(4 + length(name) + 1);
480     // display "&lt;name> message" in public chat
481     var dialog = document.getElementById('public');
482     var dt = document.createElement('dt');
483     dt.textContent = name;
484     dialog.appendChild(dt);
485     var dd = document.createElement('dd');
486     dd.textContent = message;
487     dialog.appendChild(dd);
488     }
489 wakaba 1.25 worker.port.addEventListener('message', updatePublicChat, false);
490 wakaba 1.23
491     // PRIVATE CHAT
492     function startPrivateChat(event) {
493     if (event.message.substr(0, 4) != 'msg ') return;
494     var name = event.message.substr(4).split(' ', 1);
495     var port = event.port;
496     // display a private chat UI
497     var ul = document.getElementById('private');
498     var li = document.createElement('li');
499     var h3 = document.createElement('h3');
500     h3.textContent = 'Private chat with ' + name;
501     li.appendChild(h3);
502     var dialog = document.createElement('dialog');
503     var addMessage = function(name, message) {
504     var dt = document.createElement('dt');
505     dt.textContent = name;
506     dialog.appendChild(dt);
507     var dd = document.createElement('dd');
508     dd.textContent = message;
509     dialog.appendChild(dd);
510     };
511     port.onmessage = function (event) {
512     addMessage(name, event.message);
513     };
514     li.appendChild(dialog);
515     var form = document.createElement('form');
516     var p = document.createElement('p');
517     var input = document.createElement('input');
518     input.size = 50;
519     p.appendChild(input);
520     p.appendChild(document.createTextNode(' '));
521     var button = document.createElement('button');
522     button.textContent = 'Post';
523     p.appendChild(button);
524     form.onsubmit = function () {
525     port.postMessage(input.value);
526     addMessage('me', input.value);
527     input.value = '';
528     return false;
529     };
530     form.appendChild(p);
531     li.appendChild(form);
532     }
533 wakaba 1.25 worker.port.addEventListener('message', startPrivateChat, false);
534 wakaba 1.23
535     function init() {
536 wakaba 1.25 // begin receiving messages (messages are queued until you either
537     // set worker.port.onmessage or call worker.port.start())
538     worker.port.start();
539 wakaba 1.23 }
540     &lt;/script>
541     &lt;/head>
542     &lt;body onload="init()">
543     &lt;h1>Viewer&lt;/h1>
544     &lt;h2>Map&lt;/h2>
545     &lt;p>&lt;canvas id="map" height=150 width=150>&lt;/canvas>&lt;/p>
546     &lt;p>
547 wakaba 1.25 &lt;button type=button onclick="worker.port.postMessage('mov left')">Left&lt;/button>
548     &lt;button type=button onclick="worker.port.postMessage('mov up')">Up&lt;/button>
549     &lt;button type=button onclick="worker.port.postMessage('mov down')">Down&lt;/button>
550     &lt;button type=button onclick="worker.port.postMessage('mov right')">Right&lt;/button>
551     &lt;button type=button onclick="worker.port.postMessage('set 0')">Set 0&lt;/button>
552     &lt;button type=button onclick="worker.port.postMessage('set 1')">Set 1&lt;/button>
553 wakaba 1.23 &lt;/p>
554     &lt;h2>Public Chat&lt;/h2>
555     &lt;dialog id="public">&lt;/dialog>
556 wakaba 1.25 &lt;form onsubmit="worker.port.postMessage('txt ' + message.value); message.value = ''; return false;">
557 wakaba 1.23 &lt;p>
558     &lt;input type="text" name="message" size="50">
559     &lt;button>Post&lt;/button>
560     &lt;/p>
561     &lt;/form>
562     &lt;h2>Private Chat&lt;/h2>
563     &lt;ul id="private">&lt;/ul>
564     &lt;/body>
565 wakaba 1.25 &lt;/html>
566     </pre>
567 wakaba 1.23
568     <p>There are several key things worth noting about the way the viewer is
569     written.
570    
571     <p><strong>Multiple listeners</strong>. Instead of a single message
572     processing function, the code here attaches multiple event listeners, each
573     one performing a quick check to see if it is relevant for the message. In
574     this example it doesn't make much difference, but if multiple authors
575     wanted to collaborate using a single port to communicate with a worker, it
576     would allow for independent code instead of changes having to all be made
577     to a single event handling function.
578    
579     <p>Because event listeners are registered using <code
580     title="">addEventListener()</code> instead of <code
581     title=handler-MessagePort-onmessage>onmessge</code>, the events remain
582     queued until the <code title=dom-MessagePort-start>start()</code> method
583     is called on the message port, in the <code title="">init()</code>
584     function called from the <code title=handler-onload>onload</code> handler.
585    
586     <p>Registering event listeners in this way also allows you to unregister
587     specific listeners when you are done with them, as is done with the <code
588     title="">configure()</code> method in this example.
589    
590     <p>Finally, the worker:
591    
592     <pre>
593     var nextName = 0;
594     function getNextName() {
595     // this could use more friendly names
596     // but for now just return a number
597     return nextName++;
598     }
599    
600     var map = [
601     [0, 0, 0, 0, 0, 0, 0],
602     [1, 1, 0, 1, 0, 1, 1],
603     [0, 1, 0, 1, 0, 0, 0],
604     [0, 1, 0, 1, 0, 1, 1],
605     [0, 0, 0, 1, 0, 0, 0],
606     [1, 0, 0, 1, 1, 1, 1],
607     [1, 1, 0, 1, 1, 0, 1],
608     ];
609    
610     function wrapX(x) {
611     if (x &lt; 0) return wrapX(x + map[0].length);
612     if (x >= map[0].length) return wrapX(x - map[0].length);
613     return x;
614     }
615    
616     function wrapY(y) {
617     if (y &lt; 0) return wrapY(y + map.length);
618     if (y >= map[0].length) return wrapY(y - map.length);
619     return y;
620     }
621    
622     function sendMapData(viewer) {
623     var data = '';
624     for (var y = viewer.y-1; y &lt;= viewer.y+1; y += 1) {
625     for (var x = viewer.x-1; x &lt;= viewer.x+1; x += 1) {
626     if (data != '')
627     data += ',';
628     data += map[y][x];
629     }
630     }
631     viewer.port.postMessage('map ' + data);
632     }
633    
634     var viewers = {};
635     onconnect = function (event) {
636     event.port._name = getNextName();
637     event.port._data = { port: event.port, x: 0, y: 0, };
638     viewers[event.port._name] = event.port._data;
639     event.port.postMessage('cfg ' + name);
640     event.port.onmessage = getMessage;
641     sendMapData(event.port._data);
642     };
643    
644     function getMessage(event) {
645     switch (event.message.substr(0, 4)) {
646     case 'mov ':
647     var direction = event.message.substr(4);
648     var dx = 0;
649     var dy = 0;
650     switch (direction) {
651     case 'up': dy = -1; break;
652     case 'down': dy = 1; break;
653     case 'left': dx = -1; break;
654     case 'right': dx = 1; break;
655     }
656     event.target._data.x = wrapX(event.target._data.x + dx);
657     event.target._data.y = wrapY(event.target._data.y + dy);
658     sendMapData(event.target._data);
659     break;
660     case 'set ':
661     var value = event.message.substr(4);
662     map[event.target._data.y][event.target._data.x] = value;
663     for (var viewer in viewers)
664     sendMapData(viewers[viewer]);
665     break;
666     case 'txt ':
667     var name = event.target._name;
668     var message = event.message.substr(4);
669     for (var viewer in viewers)
670     viewers[viewer].port.postMessage('txt ' + name + ' ' + message);
671     break;
672     case 'msg ':
673     var party1 = event._data;
674     var party2 = viewers[event.message.substr(4).split(' ', 1)];
675     if (party2) {
676     var channel = new MessageChannel();
677     party1.port.postMessage('msg ' + party2.name, channel.port1);
678     party2.port.postMessage('msg ' + party1.name, channel.port2);
679     }
680     break;
681     }
682     }</pre>
683    
684     <p><strong>Connecting to multiple pages</strong>. Instead of using the
685     <code title=dom-WorkerGlobalScope-port><a href="#port">port</a></code>
686     global variable in the worker, the script uses the <code
687     title=handler-WorkerGlobalScope-onconnect><a
688     href="#onconnect">onconnect</a></code> event listener to listen for
689     multiple connections.
690    
691     <p><strong>Direct channels</strong>. When the worker receives a "msg"
692     message from one viewer naming another viewer, it sets up a direct
693     connection between the two, so that the two viewers can communicate
694     directly without the worker having to proxy all the messages.
695    
696 wakaba 1.27 <p><span class=ja-translation lang=ja><a href="http://www.whatwg.org/demos/workers/multiviewer/page.html">この例をオンラインで見る</a>。</span><h4 id=delegation><span class=secno>1.1.5 </span>Delegation</h4>
697 wakaba 1.23
698     <p><span class=ja-translation lang=ja><em>この節は規定の一部ではありません。</em></span><p>With multicore CPUs becoming prevalent, one way to obtain better
699     performance is to split computationally expensive tasks amongst multiple
700     workers. In this example, a computationally expensive task that is to be
701     performed for every number from 1 to 10,000,000 is farmed out to ten
702     subworkers.
703    
704     <p>The main page is as follows, it just reports the result:
705    
706     <pre>&lt;!DOCTYPE HTML>
707     &lt;html>
708     &lt;head>
709     &lt;title>Worker example: One-core computation&lt;/title>
710     &lt;/head>
711     &lt;body>
712     &lt;p>The highest prime number discovered so far is: &lt;output id="result">&lt;/output>&lt;/p>
713     &lt;script>
714     var worker = createWorker('worker.js');
715 wakaba 1.25 worker.port.onmessage = function (event) {
716 wakaba 1.23 document.getElementById('result').textContent = event.message;
717     };
718     &lt;/script>
719     &lt;/body>
720     &lt;/html></pre>
721    
722 wakaba 1.27 <p><span class=ja-translation lang=ja>労働者自体は次の通りです。</span><pre>// settings
723 wakaba 1.23 var num_workers = 10;
724     var items_per_worker = 1000000;
725    
726     // start the workers
727     var result = 0;
728     var pending_workers = num_workers;
729     for (var i = 0; i &lt; num_workers; i += 1) {
730     var worker = createWorker('core.js');
731 wakaba 1.25 worker.port.postMessage(i * items_per_worker);
732     worker.port.postMessage((i+1) * items_per_worker);
733     worker.port.onmessage = storeResult;
734 wakaba 1.23 }
735    
736     // handle the results
737     function storeResult(event) {
738     result += 1*event.message;
739     pending_workers -= 1;
740     if (pending_workers &lt;= 0)
741     port.postMessage(result); // finished!
742     }</pre>
743    
744     <p>It consists of a loop to start the subworkers, and then a handler that
745     waits for all the subworkers to respond.
746    
747     <p>The subworkers are implemented as follows:
748    
749     <pre>var start;
750     onmessage = getStart;
751     function getStart(event) {
752     start = 1*event.message;
753     onmessage = getEnd;
754     }
755    
756     var end;
757     function getEnd(event) {
758     end = 1*event.message;
759     onmessage = null;
760     do();
761     }
762    
763     function do() {
764     var result = 0;
765     for (var i = start; i &lt; end; i += 1) {
766     // perform some complex calculation here
767     result += 1;
768     }
769     port.postMessage(result);
770     }</pre>
771    
772     <p>They receive two numbers in two events, perform the computation for the
773     range of numbers thus specified, and then report the result back to the
774     parent.
775    
776 wakaba 1.28 <p><span class=ja-translation lang=ja><a href="http://www.whatwg.org/demos/workers/multicore/page.html">この例をオンラインで見る</a>。</span><h4 id=providing><span class=secno>1.1.6 </span>Providing libraries</h4>
777    
778     <p><span class=ja-translation lang=ja><em>この節は規定の一部ではありません。</em></span><p>Suppose that a cryptography library is made available that provides
779     three tasks:
780    
781     <dl>
782     <dt>Generate a public/private key pair
783    
784     <dd>Takes a port, on which it will send two messages, first the public key
785     and then the private key.
786    
787     <dt>Given a plaintext and a public key, return the corresponding
788     cyphertext
789    
790     <dd>Takes a port, to which any number of messages can be sent, the first
791     giving the public key, and the remainder giving the plaintext, each of
792     which is encrypted and then sent on that same channel as the cyphertext.
793     The user can close the port when it is done encrypting content.
794    
795     <dt>Given a cyphertext and a private key, return the corresponding
796     plaintext
797    
798     <dd>Takes a port, to which any number of messages can be sent, the first
799     giving the private key, and the remainder giving the cyphertext, each of
800     which is decrypted and then sent on that same channel as the plaintext.
801     The user can close the port when it is done decrypting content.
802     </dl>
803    
804     <p>The library itself is as follows:
805    
806     <pre>function handleMessage(e) {
807     if (e.message == "genkeys")
808     genkeys(e.port);
809     else if (e.message == "encrypt")
810     encrypt(e.port);
811     else if (e.message == "decrypt")
812     decrypt(e.port);
813     }
814    
815     function genkeys(p) {
816     var keys = _generateKeyPair();
817     p.postMessage(keys[0]);
818     p.postMessage(keys[1]);
819     }
820    
821     function encrypt(p) {
822     var key, state = 0;
823     p.onmessage = function (e) {
824     if (state == 0) {
825     key = e.message;
826     state = 1;
827     } else {
828     p.postMessage(_encrypt(key, e.message));
829     }
830     };
831     }
832    
833     function decrypt(p) {
834     var key, state = 0;
835     p.onmessage = function (e) {
836     if (state == 0) {
837     key = e.message;
838     state = 1;
839     } else {
840     p.postMessage(_decrypt(key, e.message));
841     }
842     };
843     }
844    
845     onconnect = function (e) { e.port.onmessage = handleMessage; }
846    
847    
848     // the "crypto" functions:
849    
850     function _generateKeyPair() {
851     return [Math.random(), Math.random()];
852     }
853    
854     function _encrypt(k, s) {
855     return 'encrypted-' + k + ' ' + s;
856     }
857    
858     function _decrypt(k, s) {
859     return s.substr(s.indexOf(' ')+1);
860     }</pre>
861    
862     <p>Note that the crypto functions here are just stubs and don't do real
863     cryptography.
864    
865     <p>This library could be used as follows:
866    
867     <pre>&lt;!DOCTYPE HTML>
868     &lt;html>
869     &lt;head>
870     &lt;title>Worker example: Crypto library&lt;/title>
871     &lt;script>
872     var crytoLib = createWorker('libcrypto-v1.js'); // or could use 'libcrypto-v2.js'
873     function getKeys() {
874     var state = 0;
875     cryptoLib.port.startConversation("genkeys").onmessage = function (e) {
876     if (state == 0)
877     document.getElementById('public').value = e.message;
878     else if (state == 1)
879     document.getElementById('private').value = e.message;
880     state += 1;
881     };
882     }
883     function enc() {
884     var channel = new MessageChannel();
885     cryptoLib.port.postMessage("encrypt", channel.port2);
886     channel.port1.postMessage(document.getElementById('public').value);
887     channel.port1.postMessage(document.getElementById('input').value);
888     port1.onmessage = function (e) {
889     document.getElementById('input').value = e.message;
890     port1.close();
891     };
892     }
893     function dec() {
894     var channel = new MessageChannel();
895     cryptoLib.port.postMessage("decrypt", channel.port2);
896     channel.port1.postMessage(document.getElementById('private').value);
897     channel.port1.postMessage(document.getElementById('input').value);
898     port1.onmessage = function (e) {
899     document.getElementById('input').value = e.message;
900     port1.close();
901     };
902     }
903     &lt;/script>
904     &lt;style>
905     textarea { display: block; }
906     &lt;/style>
907     &lt;/head>
908     &lt;body onload="getKeys()">
909     &lt;fieldset>
910     &lt;legend>Keys&lt;/legend>
911     &lt;p>&lt;label>Public Key: &lt;textarea id="public">&lt;/label>&lt;/p>
912     &lt;p>&lt;label>Private Key: &lt;textarea id="private">&lt;/label>&lt;/p>
913     &lt;/fieldset>
914     &lt;p>&lt;label>Input: &lt;textarea id="input">&lt;/label>&lt;/p>
915     &lt;p>&lt;button onclick="enc()">Encrypt&lt;/button> &lt;button onclick="dec()">Decrypt&lt;/button>&lt;/p>
916     &lt;/body>
917     &lt;/html></pre>
918    
919     <p>A later version of the API, though, might want to offload all the crypto
920     work onto subworkers. This could be done as follows:
921    
922     <pre>function handleMessage(e) {
923     if (e.message == "genkeys")
924     genkeys(e.port);
925     else if (e.message == "encrypt")
926     encrypt(e.port);
927     else if (e.message == "decrypt")
928     decrypt(e.port);
929     }
930    
931     function genkeys(p) {
932     var generator = createWorker('libcrypto-v2-generator.js');
933     generator.postMessage('', p);
934     }
935    
936     function encrypt(p) {
937     p.onmessage = function (e) {
938     var key = e.message;
939     var encryptor = createWorker('libcrypto-v2-encryptor.js');
940     encryptor.postMessage(key, p);
941     };
942     }
943    
944     function encrypt(p) {
945     p.onmessage = function (e) {
946     var key = e.message;
947     var decryptor = createWorker('libcrypto-v2-decryptor.js');
948     decryptor.postMessage(key, p);
949     };
950     }
951    
952     onconnect = function (e) { e.port.onmessage = handleMessage; }
953     </pre>
954    
955     <p>The little subworkers would then be as follows.
956    
957     <p>For generating key pairs:
958    
959     <pre>port.onmessage = function (e) {
960     e.port.postMessage(Math.random());
961     e.port.postMessage(Math.random());
962     close();
963     }
964     </pre>
965    
966     <p>For encrypting:
967    
968     <pre>port.onmessage = function (e) {
969     var key = e.message;
970     e.port.onmessage = function (e) {
971     var s = e.message;
972     port.postMessage('encrypted-' + key + ' ' + s);
973     }
974     e.port.onunload = function (e) {
975     close();
976     }
977     }</pre>
978    
979     <p>For decrypting:
980    
981     <pre>port.onmessage = function (e) {
982     var key = e.message;
983     e.port.onmessage = function (e) {
984     var s = e.message;
985     port.postMessage(s.substr(s.indexOf(' ')+1));
986     }
987     e.port.onunload = function (e) {
988     close();
989     }
990     }</pre>
991    
992     <p>Notice how the users of the API don't have to even know that this is
993     happening &mdash; the API hasn't changed; the library can delegate to
994     subworkers without changing its API, even though it is accepting data
995     using message channels.
996    
997     <p><span class=ja-translation lang=ja><a href="http://www.whatwg.org/demos/workers/crypto/page.html">この例をオンラインで見る</a>。</span><h4 id=granting><span class=secno>1.1.7 </span>Granting capabilities</h4>
998 wakaba 1.23
999     <p><span class=ja-translation lang=ja><em>この節は規定の一部ではありません。</em></span><p class=big-issue>...
1000 wakaba 1.9
1001 wakaba 1.16 <h3 id=conformance><span class=ja-translation lang=ja><span class=secno>1.2 </span>適合性要件</span></h3>
1002 wakaba 1.1
1003 wakaba 1.24 <p><span class=ja-translation lang=ja>この仕様書のすべての図、例示、注意書き、ならびに規定の一部ではないと明記したすべての節は、
1004 wakaba 1.1 規定の一部ではありません。
1005 wakaba 1.24 この仕様書のそれ以外の部分はすべて規定の一部です。</span><p><span class=ja-translation lang=ja>この文書の規定の部分にあるキーワード「<em class=rfc2119 title="MUST">しなければなりません</em>」、
1006 wakaba 1.1 「<em class=rfc2119 title="MUST NOT">してはなりません</em>」、
1007 wakaba 1.24 「<em class=rfc2119 title="REQUIRED">必須です</em>」、<!--"SHALL", "SHALL
1008     NOT",-->「<em class=rfc2119 title="SHOULD">するべきです</em>」、
1009 wakaba 1.1 「<em class=rfc2119 title="SHOULD NOT">するべきではありません</em>」、
1010     「<em class=rfc2119 title="RECOMMENDED">推奨します</em>」、「<em class=rfc2119 title="MAY">して構いません</em>」、
1011     「<em class=rfc2119 title="OPTIONAL">任意です</em>」は、 RFC 2119 で説明されているように解釈します。
1012 wakaba 1.24 この仕様書<ins class=ja-note>の原文</ins>では、
1013     可読性の観点から、
1014     これらの語<ins class=ja-note>の原語</ins>のすべて大文字による表記は行っていません。
1015 wakaba 1.1 <a href="#refsRFC2119">[RFC2119]</a></span></p>
1016     <!-- XXX but they should be
1017     marked up -->
1018    
1019     <p><span class=ja-translation lang=ja>算法の一部として<ins class=ja-note>動作の指示の形で (原文では</ins>命令形で<ins class=ja-note>) </ins>記述された要件
1020     (例えば「先頭の間隔文字をすべて除去します」や「偽を返し、これらの段階を停止します」)
1021 wakaba 1.24 は、算法を紹介するに当たって使われたキーワード (<em class=rfc2119 title="MUST">しなければなりません</em>、
1022 wakaba 1.1 <em class=rfc2119 title="SHOULD">するべきです</em>、<em class=rfc2119 title="MAY">して構いません</em>など) の意味により解釈します。</span><p><span class=ja-translation lang=ja>いくつかの適合性要件は属性やメソッドやオブジェクトの要件として説明されています。
1023     そのような要件は、利用者エージェントに関する要件として解釈します。</span><p><span class=ja-translation lang=ja>算法や特定の段階として説明されている適合性要件は、
1024     最終的な結果が等価である限り、任意の方法で実装して<em class=rfc2119 title="MAY">構いません</em>。
1025     (特に、この仕様書で定義されている算法は追うのを簡単にしており、
1026 wakaba 1.24 高性能であることを目指してはいません。)</span><p><span class=ja-translation lang=ja>この仕様書で定義する唯一の適合性の級は利用者エージェントです。</span><p><span class=ja-translation lang=ja>利用者エージェントは、サービス拒否攻撃を防ぐため、
1027 wakaba 1.1 記憶容量を使い尽くすことを防ぐため、
1028     あるいは環境特有の制限に対応するためなどの目的で、
1029 wakaba 1.16 別段の制約のない入力に対して実装特有の制限を設けて<em class=rfc2119 title="MAY">構いません</em>。</span><h4 id=dependencies><span class=ja-translation lang=ja><span class=secno>1.2.1 </span>依存性</span></h4>
1030 wakaba 1.1
1031 wakaba 1.24 <p><span class=ja-translation lang=ja>この仕様書は、他のいくつかの下位の仕様書に依存しています。</span><dl>
1032 wakaba 1.1 <dt>HTML5
1033    
1034     <dd>
1035 wakaba 1.24 <p><span class=ja-translation lang=ja>この仕様書では、 HTML5 の多くの基礎的な概念を使用します。
1036 wakaba 1.1 <a href="#refsHTML5">[HTML5]</a></span></p>
1037    
1038     <dt>ECMAScript
1039    
1040     <dd>
1041 wakaba 1.24 <p><span class=ja-translation lang=ja>この仕様書は、スクリプト言語として JavaScript
1042 wakaba 1.1 を使うことを想定しています。 <a href="#refsJS">[JS]</a></span></p>
1043    
1044     <dt>WebIDL
1045    
1046     <dd>
1047 wakaba 1.24 <p><span class=ja-translation lang=ja>この仕様書の IDL ブロックは、WebIDL 仕様書における意味を用います。 <a href="#refsWebIDL">[WebIDL]</a></span></p>
1048 wakaba 1.1 </dl>
1049    
1050 wakaba 1.16 <h3 id=terminology><span class=ja-translation lang=ja><span class=secno>1.3 </span>用語</span></h3>
1051 wakaba 1.1
1052 wakaba 1.24 <p><span class=ja-translation lang=ja>簡単のため、文書が利用者に対してレンダリングされる方法に言及する時に<em>示す</em>、
1053     <em>表示する</em>、<em>可視</em>などの用語を使うことがあります。
1054     このような用語は特に視覚媒体を暗示しているわけではありません。
1055     他の媒体であってもこれらの用語が等価な方法で適用されるものと考えなければ<em class=rfc2119 title="MUST">なりません</em>。</span><p><span class=ja-translation lang=ja>「<code title="">Foo</code> オブジェクト」という構文 (<code title="">Foo</code>
1056 wakaba 1.10 は実際には界面) を時々使いますが、より正確な「界面 <code title="">Foo</code>
1057     を実装しているオブジェクト」の代わりに用いています。</span><p><span class=ja-translation lang=ja>DOM という語は、 Web アプリケーションでスクリプトに利用可能とされている API
1058 wakaba 1.1 の集合を指して用い、必ずしも DOM 中核仕様書で定義されている実際の
1059     <code>Document</code> オブジェクトその他の <code>Node</code>
1060     オブジェクトの存在を暗示してはいません。<a
1061     href="#refsDOM3CORE">[DOM3CORE]</a></span><p><span class=ja-translation lang=ja>DOM 属性は、その値が (例えば著者のスクリプトにより) 取り出される時<em>取得される</em>といい、
1062     新しい値がその属性に割り当てられる時<em>設定される</em>といいます。</span><p><span class=ja-translation lang=ja>DOM オブジェクトが<dfn id=live>生きている</dfn>という場合、
1063     そのオブジェクトを返す属性は常に同じオブジェクトを返さなければ<em class=rfc2119 title="MUST">ならない</em>
1064     (毎回新しいオブジェクトを返すのではなく) 上に、
1065     そのオブジェクトの属性やメソッドがそのオブジェクトの裏にある実際のデータのスナップ写真ではなく、
1066 wakaba 1.27 データそのものに対して操作されなければ<em class=rfc2119 title="MUST">ならない</em>ことを意味します。</span><h2 id=infrastructure><span class=ja-translation lang=ja><span class=secno>2. </span>基盤</span></h2>
1067 wakaba 1.9
1068 wakaba 1.22 <h3 id=the-workerglobalscope><span class=ja-translation lang=ja><span class=secno>2.1 </span><code><a href="#workerglobalscope">WorkerGlobalScope</a></code> 界面</span></h3>
1069 wakaba 1.9
1070     <pre
1071 wakaba 1.22 class=idl>[NoInterfaceObject] interface <dfn id=workerglobalscope>WorkerGlobalScope</dfn> {
1072     // core worker features
1073     readonly attribute <a href="#workerglobalscope">WorkerGlobalScope</a> <a href="#self" title=dom-WorkerGlobalScope-self>self</a>;
1074 wakaba 1.23 readonly attribute <a href="#workerlocation">WorkerLocation</a> <a href="#location" title=dom-WorkerGlobalScope-location>location</a>;
1075 wakaba 1.22 readonly attribute DOMString <a href="#name" title=dom-WorkerGlobalScope-name>name</a>;
1076     readonly attribute boolean <a href="#closing" title=dom-WorkerGlobalScope-closing>closing</a>;
1077     void <a href="#close" title=dom-WorkerGlobalScope-close>close</a>();
1078    
1079 wakaba 1.11 // event handler attributes
1080 wakaba 1.22 attribute <span>EventListener</span> <a href="#onconnect" title=handler-WorkerGlobalScope-onconnect>onconnect</a>;
1081     attribute <span>EventListener</span> <a href="#onunload" title=handler-WorkerGlobalScope-onunload>onunload</a>;
1082 wakaba 1.9 };</pre>
1083    
1084 wakaba 1.23 <p>Objects implementing the <code><a
1085     href="#workerglobalscope">WorkerGlobalScope</a></code> interface must also
1086     implement the <code>EventTarget</code> interface.
1087    
1088 wakaba 1.22 <p>The <dfn id=self
1089     title=dom-WorkerGlobalScope-self><code>self</code></dfn> attribute must
1090     return the <code><a href="#workerglobalscope">WorkerGlobalScope</a></code>
1091     object itself.
1092    
1093 wakaba 1.23 <p>The <dfn id=location
1094     title=dom-WorkerGlobalScope-location><code>location</code></dfn> attribute
1095     must return the <code><a href="#workerlocation">WorkerLocation</a></code>
1096     object created for the <code><a
1097     href="#workerglobalscope">WorkerGlobalScope</a></code> object when the
1098     worker was created. It represents the <span>absolute URL</span> of the
1099     script that was used to initialize the worker.
1100 wakaba 1.22
1101     <p>The <dfn id=name
1102     title=dom-WorkerGlobalScope-name><code>name</code></dfn> attribute must
1103     return the value it was assigned when the <code><a
1104     href="#workerglobalscope">WorkerGlobalScope</a></code> object was created
1105     by the "<a href="#run-a">run a worker</a>" algorithm. If it has a value
1106     that isn't the empty string, its value represents the name that can be
1107     used to obtain a reference to the worker using the <code
1108 wakaba 1.25 title=dom-WorkerFactory-createSharedWorker><a
1109     href="#createsharedworker">createSharedWorker()</a></code> method.
1110 wakaba 1.22
1111     <p>The <dfn id=closing
1112     title=dom-WorkerGlobalScope-closing><code>closing</code></dfn> attribute
1113     must return false until it is set to true by one of the algorithms in the
1114 wakaba 1.16 processing model section below.
1115 wakaba 1.9
1116 wakaba 1.22 <p>The following are the <span>event handler DOM attributes</span> that
1117     must be supported by objects implementing the <code><a
1118     href="#workerglobalscope">WorkerGlobalScope</a></code> interface:
1119    
1120     <dl>
1121 wakaba 1.16 <dt><dfn id=onconnect
1122 wakaba 1.22 title=handler-WorkerGlobalScope-onconnect><code>onconnect</code></dfn>
1123 wakaba 1.11
1124     <dd>
1125 wakaba 1.22 <p><span class=ja-translation lang=ja><code title=event-WorkerGlobalScope-connect>connect</code> 事象が当該 <code><a href="#workerglobalscope">WorkerGlobalScope</a></code> オブジェクトを対象としているか、泡立って当該オブジェクトを通過する時に、
1126 wakaba 1.12 呼び出されなければなりません。</span><dt><dfn id=onunload
1127 wakaba 1.22 title=handler-WorkerGlobalScope-onunload><code>onunload</code></dfn>
1128 wakaba 1.11
1129     <dd>
1130 wakaba 1.22 <p><span class=ja-translation lang=ja><code title=event-unload>unload</code> 事象が当該 <code><a href="#workerglobalscope">WorkerGlobalScope</a></code> オブジェクトを対象としているか、泡立って当該オブジェクトを通過する時に、
1131 wakaba 1.12 呼び出されなければなりません。</span></dl>
1132 wakaba 1.11
1133 wakaba 1.23 <p>In addition to the above members, the <a href="#success" title="worker
1134     creation succeeded">worker creation success steps</a> add a <dfn id=port
1135     title=dom-WorkerGlobalScope-port><code>port</code></dfn> property to the
1136     object.
1137    
1138 wakaba 1.18 <h3 id=base-urls><span class=ja-translation lang=ja><span class=secno>2.2 </span>労働者の基底 URL と起源</span></h3>
1139 wakaba 1.16
1140 wakaba 1.22 <p>The <span>base URL</span> of a <span>URL</span> passed to an API in a
1141 wakaba 1.23 worker is the <span>absolute URL</span> given that the worker's <code
1142     title=dom-WorkerGlobalScope-location><a
1143     href="#location">location</a></code> attribute represents.
1144 wakaba 1.22
1145     <p>Both the <span>origin</span> and <span>effective script origin</span> of
1146     scripts running in workers are the <span>origin</span> of the
1147 wakaba 1.23 <span>absolute URL</span> given that the worker's <code
1148     title=dom-WorkerGlobalScope-location><a
1149     href="#location">location</a></code> attribute represents.
1150 wakaba 1.22
1151     <h3 id=the-queue><span class=ja-translation lang=ja><span class=secno>2.3 </span>事象の待ち行列</span></h3>
1152    
1153     <p>Each <code><a href="#workerglobalscope">WorkerGlobalScope</a></code>
1154     object is asssociated with a <dfn id=queue>queue of events</dfn>, which is
1155     initially empty.
1156 wakaba 1.9
1157 wakaba 1.22 <p><span class=ja-translation lang=ja>待ち行列中の事象は、 DOM 事象か小休止呼び戻しのいずれかです。</span><p><span class=ja-translation lang=ja>労働者中で呼び出しまたは発送されるすべての非同期の呼び戻しと事象は、
1158 wakaba 1.17 労働者の待ち行列に追加されなければなりません。
1159 wakaba 1.12 ただし、実際の呼び戻しの呼び出しや事象の発送は、後述の「<a
1160 wakaba 1.22 href="#run-a">労働者を走らせる</a>」処理モデルに従い処理されます。</span><p>Once the <code><a
1161     href="#workerglobalscope">WorkerGlobalScope</a></code>'s <code
1162     title=dom-WorkerGlobalScope-closing><a href="#closing">closing</a></code>
1163     attribute is set to true, the queue must discard anything else that would
1164     be added to it. Effectively, once the <code
1165     title=dom-WorkerGlobalScope-closing><a href="#closing">closing</a></code>
1166     attribute is true, timers stop firing, notifications for all pending
1167     asynchronous operations are dropped, etc.
1168    
1169     <h3 id=the-workers><span class=ja-translation lang=ja><span class=secno>2.4 </span>労働者のポート</span></h3>
1170 wakaba 1.11
1171 wakaba 1.14 <p><span class=ja-translation lang=ja>労働者は、メッセージ通信路とその <code>MessagePort</code>
1172 wakaba 1.22 オブジェクトを通じて、他の労働者や閲覧文脈と通信します。</span><p>Each <code><a href="#workerglobalscope">WorkerGlobalScope</a></code>
1173     <var title="">worker</var> has a list of <dfn id=the-workers0>the worker's
1174     ports</dfn>, which consists of all the <code>MessagePort</code> objects
1175     that are entangled with another port and that have one (but only one) port
1176     owned by <var title="">worker</var>. This list includes all the
1177     <code>MessagePort</code> objects that are in events pending in the <a
1178     href="#queue">queue of events</a>.
1179 wakaba 1.16
1180     <hr>
1181    
1182 wakaba 1.23 <p>A worker is said to be a <dfn id=permissible>permissible worker</dfn> if
1183     either:
1184    
1185     <ul>
1186     <li>at some point past or present a <code>MessagePort</code> owned by the
1187     worker was entangled with a <code>MessagePort</code> <var
1188     title="">p</var> whose owner is a <code>Window</code> object whose
1189     <span>active document</span> is the <code>Document</code> that was that
1190     <span>browsing context</span>'s <span>active document</span> when <var
1191     title="">p</var> was created, and that <code>Document</code> is
1192     <span>fully active</span>, or
1193    
1194     <li>at some point past or present a <code>MessagePort</code> owned by the
1195     worker was entangled with a <code>MessagePort</code> owned by another
1196     worker that is currently a <a href="#permissible">permissible worker</a>.
1197     </ul>
1198    
1199     <hr>
1200    
1201     <p>A worker is said to be a <dfn id=protected>protected worker</dfn> if
1202     either:
1203    
1204     <ul>
1205     <li>it has outstanding timers, database transactions, or network
1206     connections, and is a <a href="#permissible">permissible worker</a>, or:
1207    
1208     <li>there is a <a href="#protected">protected worker</a> that at some
1209     point past or present owned a <code>MessagePort</code> that was entangled
1210     with a <code>MessagePort</code> owned by this worker.
1211     </ul>
1212    
1213     <hr>
1214    
1215     <p>A worker is said to be an <dfn id=active>active needed worker</dfn> if
1216     either:
1217    
1218     <ul>
1219     <li>the worker is a <a href="#protected">protected worker</a>, or
1220    
1221     <li>at least one of the <a href="#the-workers0">the worker's ports</a> is
1222     entangled with a <code>MessagePort</code> <var title="">p</var> whose
1223     owner is a <code>Window</code> object whose <span>active document</span>
1224     is the <code>Document</code> that was that <span>browsing
1225     context</span>'s <span>active document</span> when that
1226     <code>MessagePort</code> <var title="">p</var> was created, and that
1227     <code>Document</code> is <span>fully active</span>, or
1228 wakaba 1.22
1229 wakaba 1.23 <li>at least one of the <a href="#the-workers0">the worker's ports</a> has
1230 wakaba 1.22 an entangled <code>MessagePort</code> owned by a <code><a
1231     href="#workerglobalscope">WorkerGlobalScope</a></code> object that is
1232 wakaba 1.23 itself an <a href="#active">active needed worker</a>.
1233 wakaba 1.22 </ul>
1234    
1235     <hr>
1236    
1237 wakaba 1.23 <p>A worker is said to be a <dfn id=suspendable>suspendable worker</dfn> if
1238     it is not an <a href="#active">active needed worker</a> but either:
1239 wakaba 1.22
1240 wakaba 1.23 <ul>
1241     <li>at least one of the <a href="#the-workers0">the worker's ports</a> has
1242     an entangled <code>MessagePort</code> owned by a <code>Window</code>
1243     object, or
1244    
1245     <li>at least one of the <a href="#the-workers0">the worker's ports</a> has
1246 wakaba 1.22 an entangled <code>MessagePort</code> owned by a <code><a
1247     href="#workerglobalscope">WorkerGlobalScope</a></code> object that is
1248 wakaba 1.23 itself a <span>needed worker</span>.
1249 wakaba 1.22 </ul>
1250 wakaba 1.16
1251     <h3 id=processing><span class=ja-translation lang=ja><span class=secno>2.5 </span>処理モデル</span></h3>
1252 wakaba 1.12
1253     <p><span class=ja-translation lang=ja>利用者エージェントが、<span>URL</span> <var
1254     title="">url</var>、閲覧文脈 <var title="">owner browsing
1255     context</var>、<code>Document</code> <var title="">owner
1256     document</var> のスクリプトに対する、 <var
1257 wakaba 1.14 title="">name</var> と名付けられた<dfn id=run-a>労働者を走らせる</dfn>、
1258 wakaba 1.12 という時には、利用者エージェントは、次の段階を、完全に分離された並列実行環境で実行しなければ<em class=rfc2119 title="MUST">なりません</em>。</span><ol>
1259     <li>
1260     <p><span class=ja-translation lang=ja><var title="">url</var> で識別される資源を取って来ようと試みます。</span></p>
1261    
1262 wakaba 1.23 <p>If the attempt fails, then abort these steps and invoke the <a
1263 wakaba 1.25 href="#worker2" title="worker creation failed">error handling steps</a>
1264 wakaba 1.23 defined by the algorithm that called this one.</p>
1265 wakaba 1.12
1266     <p><span class=ja-translation lang=ja>この試みが成功した場合、 <var title="">script</var>
1267     を得られた資源とします。</span></p>
1268    
1269     <p class=note><span class=ja-translation lang=ja><code>script</code> 要素と同様に、スクリプトの MIME 型は無視します。
1270     <code>script</code> 要素とは異なり、
1271     型を上書きする方法はありません。スクリプトは常に JavaScript
1272     と仮定します。</span></p>
1273 wakaba 1.11 <!-- XXX people will complain about
1274     this. I guess we might want to examine the MIME type... -->
1275    
1276    
1277     <li>
1278 wakaba 1.22 <p>Create a new <code><a
1279     href="#workerglobalscope">WorkerGlobalScope</a></code> object, <var
1280     title="">worker</var>.</p>
1281    
1282     <li>
1283     <p>Set the <code title=dom-WorkerGlobalScope-name><a
1284     href="#name">name</a></code> attribute of <var title="">worker</var> to
1285     the value of <var title="">name</var>.</p>
1286 wakaba 1.13
1287     <li>
1288 wakaba 1.23 <p>Create a new <code><a href="#workerlocation">WorkerLocation</a></code>
1289     object for the <code title=dom-WorkerGlobalScope-location><a
1290     href="#location">location</a></code> attribute of <var
1291     title="">worker</var>, representing <var title="">url</var>.</p>
1292    
1293     <li>
1294 wakaba 1.18 <p><span class=ja-translation lang=ja><var title="">script</var> のスクリプト実行文脈を (ひいては大域オブジェクトをも)
1295     <var
1296     title="">worker</var> とします。</span></p>
1297 wakaba 1.9
1298     <li>
1299 wakaba 1.12 <p><span class=ja-translation lang=ja><var title="">script</var> のスクリプト閲覧文脈を <var title="">owner browsing context</var>
1300     とします。</span></p>
1301 wakaba 1.9
1302     <li>
1303 wakaba 1.12 <p><span class=ja-translation lang=ja><var title="">script</var> のスクリプト文書文脈を <var title="">owner document</var>
1304     とします。</span></p>
1305 wakaba 1.9
1306     <li>
1307 wakaba 1.18 <p><span class=ja-translation lang=ja>この段階を呼び出す算法が定義する<a href="#success" title="worker creation
1308     succeeded">成功段階</a>を呼び出します。</span></p>
1309    
1310 wakaba 1.22 <p class=note>This will usually add an event to the <a
1311 wakaba 1.23 href="#queue">queue of events</a> and set the <code
1312     title=dom-WorkerGlobalScope-port><a href="#port">port</a></code>
1313     property on the <var title="">worker</var> object. If it does, that
1314     event will have a <code>MessagePort</code> and thus the list of <a
1315 wakaba 1.22 href="#the-workers0">the worker's ports</a> will not be empty. If it
1316     doesn't, then the next step will set the <var title="">worker</var>
1317     object's <code title=dom-WorkerGlobalScope-closing><a
1318     href="#closing">closing</a></code> attribute to true.</p>
1319    
1320     <li>
1321 wakaba 1.23 <p><strong>Closing orphan workers</strong>: Start monitoring <var
1322     title="">worker</var>, such that as soon as the worker stops being
1323     either an <a href="#active">active needed worker</a> or a <a
1324     href="#suspendable">suspendable worker</a>, the <var
1325 wakaba 1.22 title="">worker</var> object's <code
1326     title=dom-WorkerGlobalScope-closing><a
1327 wakaba 1.25 href="#closing">closing</a></code> attribute is set to true and an event
1328     named <code title=event-unload>unload</code>, which uses the
1329     <code>Event</code> object, which does not bubble, and which is not
1330     cancelable, is added it to the worker's <code><a
1331     href="#workerglobalscope">WorkerGlobalScope</a></code> object's <a
1332     href="#queue">queue of events</a>, targetted at the <code><a
1333     href="#workerglobalscope">WorkerGlobalScope</a></code> object.</p>
1334 wakaba 1.22
1335     <li>
1336 wakaba 1.23 <p><strong>Suspending workers</strong>: Start monitoring <var
1337     title="">worker</var>, such that whenever the <var title="">worker</var>
1338     object's <code title=dom-WorkerGlobalScope-closing><a
1339     href="#closing">closing</a></code> attribute is false and the worker is
1340     a <a href="#suspendable">suspendable worker</a>, the user agent suspends
1341     execution of script in that worker until such time as either the <code
1342 wakaba 1.22 title=dom-WorkerGlobalScope-closing><a
1343     href="#closing">closing</a></code> attribute switches to true or the
1344 wakaba 1.23 worker stops being a <a href="#suspendable">suspendable worker</a>.</p>
1345 wakaba 1.11
1346     <li>
1347 wakaba 1.14 <p><span class=ja-translation lang=ja><var title="">script</var> を、返るか、例外の捕獲に失敗するか、後述の「<a href="#kill-a">労働者を殺す</a>」算法により早々に停止させられるかのいずれかまで走らせます。</span></p>
1348 wakaba 1.11
1349 wakaba 1.23 <p class=note>If the script gets aborted by the "<a href="#kill-a">kill a
1350     worker</a>" algorithm, then that same algorithm will cause there to only
1351     be a single event in the <a href="#queue">queue of events</a> at the
1352     next step, namely the <code title=message-unload>unload</code> event.</p>
1353 wakaba 1.9
1354     <li>
1355 wakaba 1.22 <p><i>Event loop</i>: Wait until either there is an event in the <a
1356     href="#queue">queue of events</a> associated with <var
1357     title="">worker</var> or the <var title="">worker</var> object's <code
1358     title=dom-WorkerGlobalScope-closing><a
1359     href="#closing">closing</a></code> attribute is set to true.</p>
1360 wakaba 1.9
1361     <li>
1362 wakaba 1.14 <p><span class=ja-translation lang=ja><a href="#queue">事象の待ち行列</a>中で最古の事象か呼び戻しがあれば、
1363     これを発送します。この事象の取扱いや呼び戻しの実行は、後述の「<a href="#kill-a">労働者を殺す</a>」
1364     算法により、早々に停止させられるかもしれません。</span></p>
1365 wakaba 1.9
1366     <li>
1367 wakaba 1.22 <p>If there are any more events in the <a href="#queue">queue of
1368     events</a> or if the <var title="">worker</var> object's <code
1369     title=dom-WorkerGlobalScope-closing><a
1370     href="#closing">closing</a></code> attribute is set to false, then jump
1371     back to the step above labeled <i>event loop</i>.</p>
1372 wakaba 1.9
1373     <li>
1374 wakaba 1.23 <p class=big-issue>timers, intervals, XMLHttpRequests, database
1375     transactions, etc, must be killed; ports must be unentangled</p>
1376 wakaba 1.25
1377     <li>
1378     <p>At the next available opportunity, after any scripts have finished
1379     executing<!-- XXX queue -->, <span>fire a simple event</span> called
1380     <code title=event-unload>unload</code> at any <code><a
1381     href="#worker1">Worker</a></code> objects associated with this worker.</p>
1382 wakaba 1.9 </ol>
1383    
1384     <hr>
1385    
1386 wakaba 1.14 <p><span class=ja-translation lang=ja>利用者エージェントが<dfn id=kill-a>労働者を殺す</dfn>という時には、
1387     利用者エージェントは、次の段階を労働者の主たるループ (先に定義した「<a
1388     href="#run-a">労働者を走らせる</a>」処理モデル) と並列に走らせなければ<em class=rfc2119 title="MUST">なりません</em>。</span><ol>
1389     <li>
1390 wakaba 1.22 <p>Create an <code>Event</code> object with the event name <code
1391     title=event-unload>unload</code>, which does not bubble and is not
1392     cancelable, and add it to the worker's <code><a
1393     href="#workerglobalscope">WorkerGlobalScope</a></code> object's <a
1394     href="#queue">queue of events</a>, targetted at the <code><a
1395     href="#workerglobalscope">WorkerGlobalScope</a></code> object itself.
1396 wakaba 1.23 </li>
1397     <!-- XXX shouldn't add one if closing is
1398     already true, assuming unload has already been added to the queue
1399     (?) -->
1400 wakaba 1.22
1401     <li>
1402     <p>Set the worker's <code><a
1403     href="#workerglobalscope">WorkerGlobalScope</a></code> object's <code
1404     title=dom-WorkerGlobalScope-closing><a
1405     href="#closing">closing</a></code> attribute to true.
1406    
1407     <li>
1408 wakaba 1.23 <p>Wait a user-agent-defined amount of time. If the "<a href="#run-a">run
1409     a worker</a>" processing model defined above immediately starts running
1410     event listeners registered for the <code
1411     title=event-unload>unload</code> event, this time should not be zero
1412     &mdash; the idea is that the <code title=event-unload>unload</code>
1413     event can be used to clean up when shutting down unexpectedly.
1414    
1415     <li>
1416 wakaba 1.14 <p><span class=ja-translation lang=ja><a href="#queue">事象の待ち行列</a>中にこの算法が追加した
1417     <code title=event-unload>unload</code>
1418     事象以外の事象が存在する場合には、それらを発送せずに捨てます。</span><li>
1419     <p><span class=ja-translation lang=ja>この算法が追加した <code title=event-unload>unload</code>
1420     事象がまだ発送されていなければ、現在労働者中で走っているスクリプトを停止します。</span><li>
1421     <p><span class=ja-translation lang=ja>利用者エージェント定義の時間、待ちます。</span><li>
1422     <p><span class=ja-translation lang=ja>現在労働者中で走っているスクリプト (スクリプトが走っているとすると、
1423     これは <code
1424     title=event-unload>unload</code>
1425     事象の取扱器です。) を停止します。</span></ol>
1426 wakaba 1.9
1427 wakaba 1.22 <p>User agents may invoke the "<a href="#kill-a">kill a worker</a>"
1428     processing model on a worker at any time, e.g. in response to user
1429     requests, in response to CPU quota management, or when a worker stops
1430 wakaba 1.23 being an <a href="#active">active needed worker</a> if the worker
1431     continues executing even after its <code
1432     title=dom-WorkerGlobalScope-closing><a href="#closing">closing</a></code>
1433     attribute was set to true.
1434 wakaba 1.16
1435 wakaba 1.11 <hr>
1436    
1437 wakaba 1.22 <p>When a script invokes the <dfn id=close
1438     title=dom-WorkerGlobalScope-close><code>close()</code></dfn> method on a
1439     <code><a href="#workerglobalscope">WorkerGlobalScope</a></code> object,
1440     the user agent must run the following steps:
1441    
1442     <ol>
1443     <li>
1444     <p>Create an <code>Event</code> object with the event name <code
1445     title=event-unload>unload</code>, which does not bubble and is not
1446     cancelable, and add it to the <code><a
1447     href="#workerglobalscope">WorkerGlobalScope</a></code> object's <a
1448     href="#queue">queue of events</a>, targetted at the <code><a
1449     href="#workerglobalscope">WorkerGlobalScope</a></code> object itself.
1450    
1451     <li>
1452     <p>Set the worker's <code><a
1453     href="#workerglobalscope">WorkerGlobalScope</a></code> object's <code
1454     title=dom-WorkerGlobalScope-closing><a
1455     href="#closing">closing</a></code> attribute to true.
1456    
1457     <li>
1458     <p>For each <code>MessagePort</code> object that is entangled with
1459     another port and that has one (but only one) port whose owner is the
1460     <code><a href="#workerglobalscope">WorkerGlobalScope</a></code> object
1461     on which the method was invoked, run the following substeps:</p>
1462 wakaba 1.11
1463     <ol>
1464     <li>
1465 wakaba 1.15 <p><span class=ja-translation lang=ja>2つのポートをほどきます。</span><li>
1466 wakaba 1.22 <p>At the next available opportunity, after any scripts have finished
1467     executing<!-- XXX queue -->, <span>fire a simple event</span> called
1468     <code title=event-unload>unload</code> at the other port (the one
1469     whose owner is not the <code><a
1470     href="#workerglobalscope">WorkerGlobalScope</a></code> object on which
1471     the <code title=dom-WorkerGlobalScope-close><a
1472     href="#close">close()</a></code> method was called).
1473     </ol>
1474 wakaba 1.11 </ol>
1475    
1476 wakaba 1.16 <h3 id=creating><span class=ja-translation lang=ja><span class=secno>2.6 </span>労働者の作成</span></h3>
1477 wakaba 1.9
1478     <pre
1479 wakaba 1.22 class=idl>[NoInterfaceObject] interface <dfn id=workerfactory>WorkerFactory</dfn> {
1480 wakaba 1.25 <a href="#worker1">Worker</a> <a href="#createworker" title=dom-WorkerFactory-createWorker>createWorker</a>(in DOMString scriptURL);
1481     <a href="#worker1">Worker</a> <a href="#createsharedworker" title=dom-WorkerFactory-createSharedWorker>createSharedWorker</a>(in DOMString name, in DOMString scriptURL);
1482     };
1483    
1484     interface <dfn id=worker1>Worker</dfn> {
1485     <span>MessagePort</span> <a href="#port0" title=dom-Worker-port>port</a>();
1486    
1487     // event handler attributes
1488     attribute <span>EventListener</span> <a href="#onload" title=handler-Worker-onload>onload</a>;
1489     attribute <span>EventListener</span> <a href="#onerror" title=handler-Worker-onerror>onerror</a>;
1490     attribute <span>EventListener</span> <a href="#onunload0" title=handler-Worker-onunload>onunload</a>;
1491 wakaba 1.9 };</pre>
1492    
1493 wakaba 1.22 <p>Objects that implement the <code>Window</code> and <code><a
1494 wakaba 1.25 href="#workerglobalscope">WorkerGlobalScope</a></code> interfaces must
1495     also implement the <code><a href="#workerfactory">WorkerFactory</a></code>
1496     interface.
1497 wakaba 1.22
1498     <hr>
1499 wakaba 1.13
1500 wakaba 1.22 <p><span class=ja-translation lang=ja>利用者エージェントは、 <dfn id=createworker title=dom-WorkerFactory-createWorker><code>createWorker(<var title="">scriptURL</var>)</code></dfn> メソッドが呼び出された時、
1501 wakaba 1.15 次の段階を走らせなければ<em class=rfc2119 title="MUST">なりません</em>。</span><ol>
1502 wakaba 1.13 <li>
1503 wakaba 1.15 <p><span class=ja-translation lang=ja><var
1504     title="">scriptURL</var> 引数を<span title="resolve a url">解決</span>します。</span><li>
1505     <p><span class=ja-translation lang=ja>これが失敗した場合、 <code>SYNTAX_ERR</code>
1506     例外を投げます。</span><li>
1507     <p><span class=ja-translation lang=ja>得られた絶対 URL の起源がメソッドを呼び出したスクリプトの起源と<span title="same origin">同じ</span>でない場合、
1508     保安性例外を投げます。</span><li>
1509     <p><span class=ja-translation lang=ja>得られた絶対 URL から、名前が空文字列である<a href="#create">労働者を作成</a>します。</span><li>
1510 wakaba 1.25 <p>Return the <code><a href="#worker1">Worker</a></code> object returned
1511     from the <a href="#create">create a worker</a> algorithm.
1512     </ol>
1513 wakaba 1.11
1514     <hr>
1515    
1516 wakaba 1.25 <p><span class=ja-translation lang=ja>利用者エージェントは、 <dfn id=createsharedworker title=dom-WorkerFactory-createSharedWorker><code>createSharedWorker(<var title="">name</var>, <var title="">scriptURL</var>)</code></dfn> メソッドが呼び出された時、
1517 wakaba 1.15 次の段階を走らせなければ<em class=rfc2119 title="MUST">なりません</em>。</span><ol>
1518 wakaba 1.13 <li>
1519 wakaba 1.15 <p><span class=ja-translation lang=ja><var
1520     title="">scriptURL</var> 引数を<span title="resolve a url">解決</span>します。</span><li>
1521     <p><span class=ja-translation lang=ja>これが失敗した場合、 <code>SYNTAX_ERR</code>
1522     例外を投げます。</span><li>
1523     <p><span class=ja-translation lang=ja>得られた絶対 URL の起源がメソッドを呼び出したスクリプトの起源と<span title="same origin">同じ</span>でない場合、
1524     保安性例外を投げます。</span><li>
1525 wakaba 1.25 <p>If the <var title="">name</var> argument is the empty string, <a
1526     href="#create">create a worker</a> from the resulting <span>absolute
1527     URL</span>, whose name is the empty string, and return the <code><a
1528     href="#worker1">Worker</a></code> object returned from the <a
1529     href="#create">create a worker</a> algorithm. Then, abort these steps.
1530    
1531     <li>
1532 wakaba 1.22 <p>If there exists a worker whose <code
1533     title=dom-WorkerGlobalScope-closing><a
1534     href="#closing">closing</a></code> attribute is false, whose <code
1535     title=dom-WorkerGlobalScope-name><a href="#name">name</a></code>
1536     attribute is exactly equal to the <var title="">name</var> argument, and
1537 wakaba 1.23 whose <code title=dom-WorkerGlobalScope-location><a
1538     href="#location">location</a></code> attribute represents an
1539     <span>absolute URL</span> that has the <span>same origin</span> as the
1540     resulting <span>absolute URL</span>, then run these substeps:</p>
1541 wakaba 1.13
1542     <ol>
1543     <li>
1544 wakaba 1.23 <p>If that worker's <code title=dom-WorkerGlobalScope-location><a
1545     href="#location">location</a></code> attribute represents an
1546     <span>absolute URL</span> that is not exactly equal to the resulting
1547     <span>absolute URL</span>, then throw a <code>URL_MISMATCH_ERR</code>
1548 wakaba 1.26 exception and abort these steps. <span class=big-issue>code 21</span>
1549 wakaba 1.22
1550     <li>
1551 wakaba 1.15 <p><span class=ja-translation lang=ja>メソッドを呼び出したスクリプトのスクリプト実行文脈が所有する新しい <code>MessagePort</code>
1552     オブジェクトを作成します。</span><li>
1553 wakaba 1.25 <p><span>Create a new <code><a href="#worker1">Worker</a></code>
1554     object</span> associated with that worker, and assign the newly
1555     created port to its <code title=dom-Worker-port><a
1556     href="#port0">port</a></code> attribute.
1557    
1558     <li>
1559     <p>Return the newly created <code><a href="#worker1">Worker</a></code>
1560     object.
1561    
1562     <li>
1563     <p>Asynchronously, <a href="#connect" title="connect to a
1564     worker">connect</a> to this preexisting worker, with the newly created
1565     <code>MessagePort</code> and <code><a
1566     href="#worker1">Worker</a></code> objects.
1567     </ol>
1568    
1569     <p>Otherwise, <a href="#create">create a worker</a> from the resulting
1570     <span>absolute URL</span>, whose name is the value of the <var
1571     title="">name</var> argument, and return the <code><a
1572     href="#worker1">Worker</a></code> object returned from the <a
1573     href="#create">create a worker</a> algorithm.</p>
1574 wakaba 1.11 </ol>
1575    
1576     <hr>
1577    
1578 wakaba 1.15 <p><span class=ja-translation lang=ja>メソッド呼び出しの文脈において、 URL <var title="">url</var> から名前 <var
1579     title="">name</var> の<dfn id=create>労働者を作成</dfn>する段階は、次の通りです。</span><ol>
1580     <li>
1581     <p><span class=ja-translation lang=ja>メソッドを呼び出したスクリプトのスクリプト実行文脈が所有する新しい <code>MessagePort</code>
1582     オブジェクトを作成します。</span><li>
1583 wakaba 1.25 <p><span>Create a new <code><a href="#worker1">Worker</a></code>
1584     object</span>, associated with the worker that will be created below,
1585     and assign the newly created port to its <code title=dom-Worker-port><a
1586     href="#port0">port</a></code> attribute.
1587    
1588     <li>
1589     <p>Return that <code><a href="#worker1">Worker</a></code> object.
1590    
1591     <li>
1592 wakaba 1.15 <p><span class=ja-translation lang=ja>並列実行文脈において (つまり、別のスレッドやプロセスや同様の構造において)、 <var title="">owner browsing
1593     context</var> をメソッドを呼び出したスクリプトのスクリプト閲覧文脈、 <var title="">owner
1594     document</var> をメソッドを呼び出したスクリプトのスクリプト文書文脈として、
1595     URL
1596     <var
1597     title="">url</var> のスクリプトのための <var
1598     title="">name</var> という名前の<a href="#run-a">労働者を走らせます</a>。</span></p>
1599    
1600 wakaba 1.23 <p>If that algorithm invokes the steps for <dfn id=success title="worker
1601     creation succeeded">success steps</dfn>, then <a href="#connect"
1602     title="connect to a worker">connect</a> to this new worker, with the
1603     newly created port, and if that algorithm returns a second new port,
1604     then add a new property <code title=dom-WorkerGlobalScope-port><a
1605     href="#port">port</a></code> on the new worker's <code><a
1606     href="#workerglobalscope">WorkerGlobalScope</a></code> object, whose
1607 wakaba 1.25 value is the <code>MessagePort</code> object returned by the <a
1608 wakaba 1.23 href="#connect">connect to a worker</a> algorithm.</p>
1609    
1610 wakaba 1.25 <p>Otherwise, if the <dfn id=worker2>worker creation failed</dfn>, then
1611 wakaba 1.23 at the next available opportunity, after any scripts have finished
1612     executing<!-- XXX queue -->, <span>fire a simple event</span> called
1613 wakaba 1.25 <code title=event-error>error</code> at the newly created <code><a
1614     href="#worker1">Worker</a></code> object.</p>
1615 wakaba 1.11 </ol>
1616    
1617     <hr>
1618    
1619 wakaba 1.25 <p>The steps to <dfn id=connect>connect to a worker</dfn> given a
1620     <code>MessagePort</code> object <var title="">port</var> and a <code><a
1621     href="#worker1">Worker</a></code> object <var title="">worker</var> are as
1622     follows:
1623    
1624     <ol>
1625 wakaba 1.13 <li>
1626 wakaba 1.22 <p>If <var title="">port</var> would have been garbage collected, or if
1627     the <span>active document</span> of the owner of <var
1628     title="">port</var> is no longer the same <code>Document</code> object
1629     as when <var title="">port</var> was created, then do nothing. Abort
1630     these steps. If the worker was just created, it'll get killed
1631     immediately.</p>
1632    
1633     <li>
1634     <p><span>Create a new <code>MessagePort</code> object</span> owned by the
1635     <code><a href="#workerglobalscope">WorkerGlobalScope</a></code> of the
1636     worker.
1637 wakaba 1.13
1638     <li>
1639 wakaba 1.15 <p><span class=ja-translation lang=ja>この新しく作成されたポートとこれらの段階に渡されたポート <var
1640     title="">port</var> を絡めます。</span><li>
1641 wakaba 1.25 <p>At the next available opportunity, after any scripts have finished
1642     executing<!-- XXX queue -->, <span>fire a simple event</span> called
1643     <code title=event-load>load</code> at <var title="">worker</var>.
1644    
1645     <li>
1646 wakaba 1.22 <p>Create an event that uses the <code>MessageEvent</code> interface,
1647     with the name <code title=event-connect>connect</code>, which does not
1648     bubble, is cancelable, has no default action, has a <code
1649     title=dom-MessageEvent-data>data</code> attribute whose value is the
1650     empty string and has a <code
1651     title=dom-MessageEvent-messagePort>messagePort</code> attribute whose
1652     value is the newly created port, and add it to the worker's <code><a
1653     href="#workerglobalscope">WorkerGlobalScope</a></code> object's <a
1654     href="#queue">queue of events</a>, targetted at the <code><a
1655     href="#workerglobalscope">WorkerGlobalScope</a></code> object itself.
1656 wakaba 1.23
1657     <li>
1658     <p>Return the newly created port.
1659 wakaba 1.22 </ol>
1660 wakaba 1.15
1661 wakaba 1.25 <hr>
1662    
1663 wakaba 1.27 <p><span class=ja-translation lang=ja><dfn id=port0 title=dom-Worker-port><code>port</code></dfn> attribute on a <code><a href="#worker1">Worker</a></code> object must return the value it was assigned when the <code><a href="#worker1">Worker</a></code> object was created by the methods on the <code><a href="#workerfactory">WorkerFactory</a></code> 界面。</span><p>The following are the <span>event handler DOM attributes</span> that
1664 wakaba 1.25 must be supported by objects implementing the <code><a
1665     href="#worker1">Worker</a></code> interface:
1666    
1667     <dl>
1668     <dt><dfn id=onload title=handler-Worker-onload><code>onload</code></dfn>
1669    
1670     <dd>
1671     <p><span class=ja-translation lang=ja><code title=event-load>load</code> 事象が当該 <code><a href="#worker1">Worker</a></code> オブジェクトを対象としているか、泡立って当該オブジェクトを通過する時に、
1672     呼び出されなければなりません。</span><dt><dfn id=onerror
1673     title=handler-Worker-onerror><code>onerror</code></dfn>
1674    
1675     <dd>
1676     <p>Must be invoked whenever an <code title=event-error>error</code> event
1677     is targeted at or bubbles through the <code><a
1678     href="#worker1">Worker</a></code> object.
1679    
1680     <dt><dfn id=onunload0
1681     title=handler-Worker-onunload><code>onunload</code></dfn>
1682    
1683     <dd>
1684     <p>Must be invoked whenever an <code title=event-unload>unload</code>
1685     event is targeted at or bubbles through the <code><a
1686     href="#worker1">Worker</a></code> object.
1687     </dl>
1688    
1689 wakaba 1.15 <h2 id=apis-available><span class=ja-translation lang=ja><span class=secno>3. </span>労働者が利用可能な API</span></h2>
1690    
1691 wakaba 1.22 <pre
1692     class=idl>[NoInterfaceObject] interface <dfn id=workerutils>WorkerUtils</dfn> {
1693 wakaba 1.25 void <a href="#importscripts" title=dom-WorkerGlobalScope-importScripts>importScripts</a>([Variadic] in DOMString urls);
1694 wakaba 1.22 readonly attribute <span>Storage</span> <a href="#localstorage" title=dom-localStorage>localStorage</a>;
1695     <span>Database</span> <a href="#opendatabase" title=dom-opendatabase>openDatabase</a>(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize);
1696     void <a href="#shownotification" title=dom-showNotification>showNotification</a>(in DOMString title, in DOMString subtitle, in DOMString description);
1697     void <a href="#shownotification" title=dom-showNotification>showNotification</a>(in DOMString title, in DOMString subtitle, in DOMString description, in VoidCallback onclick);
1698     };</pre>
1699 wakaba 1.16
1700 wakaba 1.25 <p><span class=ja-translation lang=ja><code><a href="#workerglobalscope">WorkerGlobalScope</a></code> 界面を実装するオブジェクトは、 <code><a href="#workerutils">WorkerUtils</a></code> 界面も実装しなければ<em class=rfc2119 title="MUST">なりません</em>。</span><p class=big-issue>Need to define a sync database API.
1701 wakaba 1.16
1702     <p class=big-issue>May need to define a browser sniffing API (like
1703     window.navigator).</p>
1704     <!-- XXX ApplicationCache -->
1705     <!-- XXX a way to set cookies on the URL for the script -->
1706     <!-- XXX debugging: void log(in DOMString s); // log to console -->
1707     <!-- XXX debugging: onerror -->
1708    
1709     <hr>
1710    
1711 wakaba 1.19 <p><span class=ja-translation lang=ja>DOM API (<code>Node</code> オブジェクト、 <code>Document</code>
1712 wakaba 1.22 オブジェクト、その他) は、この版のこの仕様書では労働者に利用可能ではありません。</span><h3 id=importing><span class=secno>3.1 </span>Importing scripts and
1713     libraries</h3>
1714    
1715 wakaba 1.25 <p>When a script invokes the <dfn id=importscripts
1716     title=dom-WorkerGlobalScope-importScripts><code>importScripts(<var
1717     title="">urls</var>)</code></dfn> method on a <code><a
1718 wakaba 1.22 href="#workerglobalscope">WorkerGlobalScope</a></code> object, the user
1719     agent must run the following steps:
1720    
1721     <ol>
1722     <li>
1723 wakaba 1.25 <p>If there are no arguments, return without doing anything. Abort these
1724     steps.
1725    
1726     <li>
1727     <p><span title="resolve a url">Resolve</span> each argument.
1728 wakaba 1.22
1729 wakaba 1.25 <li>
1730     <p>If any fail, throw a <code>SYNTAX_ERR</code> exception.
1731 wakaba 1.22
1732 wakaba 1.25 <li>
1733     <p>If any of the resulting <span title="absolute URL">absolute
1734     URLs</span> have an <span>origin</span> that is not the <span
1735     title="same origin">same</span> as the origin of the script that invoked
1736     the method, then throw a <span>security exception</span>.
1737 wakaba 1.22
1738 wakaba 1.25 <li>
1739     <p>Attempt to <span>fetch</span> each resource identified by the
1740     resulting <span title="absolute URLs">absolute URL</span>.</p>
1741 wakaba 1.22
1742     <li>
1743 wakaba 1.25 <p>For each argument in turn, in the order given, starting with the first
1744     one, run these substeps:</p>
1745    
1746     <ol>
1747     <li>
1748     <p>Wait for the fetching attempt for the corresponding resource to
1749     complete.</p>
1750    
1751     <p>If the fetching attempt failed, throw a <code>NETWORK_ERR</code>
1752 wakaba 1.26 exception and abort all these steps. <a
1753     href="#refsXHR">[XHR]</a><!-- XXX get DOM Core updated instead
1754     --></p>
1755 wakaba 1.25
1756     <p>If the fetching attempt succeeded, then let <var
1757     title="">script</var> be the resource that was obtained.</p>
1758    
1759     <p class=note>As with the worker's script, the script here is always
1760     assumed to be JavaScript, regardless of the MIME type.</p>
1761     <!-- XXX -->
1762    
1763     <li>
1764     <p><span class=ja-translation lang=ja><var title="">script</var> の<span>スクリプト実行文脈</span>、
1765 wakaba 1.22 <span>スクリプト閲覧文脈</span>、<span>スクリプト文書文脈</span>を、
1766     この労働者についての<a href="#run-a">労働者を走らせる</a>処理モデルで実行されたスクリプトについてのものと同じとします。</span></p>
1767    
1768 wakaba 1.25 <li>
1769     <p>Run <var title="">script</var> until it either returns, fails to
1770     catch an exception, or gets prematurely aborted by the "<a
1771     href="#kill-a">kill a worker</a>" algorithm above.</p>
1772    
1773     <p>If an exception was raised or if the script was prematurely aborted,
1774     then abort all these steps, letting the exception or aborting continue
1775     to be processed by the script that called the <code
1776     title=dom-WorkerGlobalScope-importScripts><a
1777     href="#importscripts">importScripts()</a></code> method.</p>
1778 wakaba 1.22
1779 wakaba 1.25 <p>If the "<a href="#kill-a">kill a worker</a>" algorithm aborts the
1780     script then abort all these steps.</p>
1781     </ol>
1782 wakaba 1.22 </ol>
1783    
1784     <h3 id=apis-defined><span class=secno>3.2 </span>APIs defined in other
1785     specifications</h3>
1786    
1787     <p>The <dfn id=localstorage
1788     title=dom-localStorage><code>localStorage</code></dfn>, <dfn
1789     id=opendatabase title=dom-opendatabase><code>openDatabase()</code></dfn>
1790     must act as defined for the APIs with the same names on the
1791     <code>Window</code> object in the HTML5 specification, with the exception
1792     that where the API would use the <span>origin</span> of the <span>active
1793     document</span> of the <span>browsing context</span> of the
1794     <code>Window</code> object on which the method was supposedly invoked, it
1795     must instead use the <span>origin</span> of the script that invoked the
1796     method. <a href="#refsHTML5">[HTML5]</a>
1797    
1798     <p>The <dfn id=shownotification
1799     title=dom-showNotification><code>showNotification()</code></dfn> methods
1800     must act as defined for the APIs with the same names on the
1801     <code>Window</code> object in the HTML5 specification. <a
1802     href="#refsHTML5">[HTML5]</a>
1803    
1804     <h3 id=interface><span class=secno>3.3 </span>Interface objects and
1805     constructors</h3>
1806    
1807     <p>There must be no interface objects and constructors available in the
1808     global scope of scripts whose <span>script execution context</span> is a
1809     <code><a href="#workerglobalscope">WorkerGlobalScope</a></code> object
1810     except for the following:
1811    
1812     <ul>
1813     <li>
1814     <p><span class=ja-translation lang=ja>XMLHttpRequest 仕様書で定義されている
1815     <code>XMLHttpRequest</code> とすべての界面オブジェクトと構築器、
1816     ただし<span>文書応答実体本体</span>は常に null でなければ<em class=rfc2119 title="MUST">なりません</em>。 <a
1817     href="#refsXHR">[XHR]</a></span><li>
1818     <p><span class=ja-translation lang=ja><code>WebSocket</code> 界面オブジェクトと構築器</span><li>
1819     <p><span class=ja-translation lang=ja><code>MessageChannel</code> 界面オブジェクトと構築器</span></ul>
1820 wakaba 1.23
1821     <h3 id=worker0><span class=secno>3.4 </span>Worker locations</h3>
1822    
1823     <pre
1824     class=idl>[NoInterfaceObject] interface <dfn id=workerlocation>WorkerLocation</dfn> {
1825     readonly attribute DOMString <a href="#href" title=dom-WorkerLocation-href>href</a>;
1826     readonly attribute DOMString <a href="#protocol" title=dom-WorkerLocation-protocol>protocol</a>;
1827     readonly attribute DOMString <a href="#host" title=dom-WorkerLocation-host>host</a>;
1828     readonly attribute DOMString <a href="#hostname" title=dom-WorkerLocation-hostname>hostname</a>;
1829 wakaba 1.25 readonly attribute DOMString <a href="#port1" title=dom-WorkerLocation-port>port</a>;
1830 wakaba 1.23 readonly attribute DOMString <a href="#pathname" title=dom-WorkerLocation-pathname>pathname</a>;
1831     readonly attribute DOMString <a href="#search" title=dom-WorkerLocation-search>search</a>;
1832     readonly attribute DOMString <a href="#hash" title=dom-WorkerLocation-hash>hash</a>;
1833     };</pre>
1834    
1835     <p>A <code><a href="#workerlocation">WorkerLocation</a></code> object
1836     represents an <span>absolute URL</span> set at its creation.
1837    
1838     <p>The <dfn id=href title=dom-WorkerLocation-href><code>href</code></dfn>
1839     attribute must return the <span>absolute URL</span> that the object
1840     represents.
1841    
1842     <p>The <code><a href="#workerlocation">WorkerLocation</a></code> interface
1843     also has the complement of <span>URL decomposition attributes</span>, <dfn
1844     id=protocol title=dom-WorkerLocation-protocol><code>protocol</code></dfn>,
1845     <dfn id=host title=dom-WorkerLocation-host><code>host</code></dfn>, <dfn
1846 wakaba 1.25 id=port1 title=dom-WorkerLocation-port><code>port</code></dfn>, <dfn
1847 wakaba 1.23 id=hostname title=dom-WorkerLocation-hostname><code>hostname</code></dfn>,
1848     <dfn id=pathname
1849     title=dom-WorkerLocation-pathname><code>pathname</code></dfn>, <dfn
1850     id=search title=dom-WorkerLocation-search><code>search</code></dfn>, and
1851     <dfn id=hash title=dom-WorkerLocation-hash><code>hash</code></dfn>. These
1852     must follow the rules given for URL decomposition attributes, with the
1853     <span title=concept-uda-input>input</span> being the <span>absolute
1854     URL</span> that the object represents (same as the <code
1855     title=dom-WorkerLocation-href><a href="#href">href</a></code> attribute),
1856     and the <span title=concept-uda-setter>common setter action</span> being a
1857     no-op, since the attributes are defined to be readonly. <a
1858     href="#refsHTML5">[HTML5]</a>
1859 wakaba 1.22
1860     <h2 class=no-num id=references><span class=ja-translation lang=ja>参考文献</span></h2>
1861 wakaba 1.1
1862     <p class=big-issue><span class=ja-translation lang=ja>この章は将来の仕様案で執筆します。</span><h2 class=no-num id=acknowledgements><span class=ja-translation lang=ja>謝辞</span></h2>
1863     <!-- ACKS -->
1864    
1865 wakaba 1.22 <p><span class=ja-translation lang=ja>Aaron Boodman, Jonas Sicking, Maciej Stachowiak, Mike Smith, Philip Taylor の有用かつ重要なコメントに感謝します。</span><p><span class=ja-translation lang=ja>Gears チームの方々にも非常に感謝します。
1866 wakaba 1.14 Gears チームの方々はこの技術を開拓し、その経験はこの仕様書にも多大な影響を与えています。
1867     </span>

[email protected]
ViewVC Help
Powered by ViewVC 1.1.24