Annotation of html5/workers/Overview.html, revision 1.17
1.1 ihickson 1: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
2: <!-- when publishing, change bits marked ZZZ -->
3:
4: <html lang=en-US-x-Hixie>
5: <head>
6: <title>Web Workers</title>
7: <link href="http://www.w3.org/StyleSheets/TR/%57%33%43-ED" rel=stylesheet
8: type="text/css">
9: <!-- ZZZ ED vs WD -->
10:
11: <body>
12: <div class=head>
13: <p><a href="http://www.w3.org/"><img alt=W3C height=48
14: src="http://www.w3.org/Icons/w3c_home" width=72></a></p>
15:
16: <h1 id=web-workers>Web Workers</h1>
17:
18: <h2 class="no-num no-toc" id=an-accompaniment>An accompaniment
19: specification for HTML5</h2>
20:
21: <h2 class="no-num no-toc" id=editors><!-- "W3C Working Draft" --> Editor's
1.9 ihickson 22: Draft <!--ZZZ-->18 July 2008</h2>
1.1 ihickson 23:
24: <dl><!-- ZZZ: update the month/day
25: <dt>This Version:</dt>
26: <dd><a href="http://www.w3.org/TR/2008/WD-workers-20080101/">http://www.w3.org/TR/2008/WD-workers-20080101/</a></dd>
1.2 ihickson 27: <dt>Latest Published Version:</dt>
28: <dd><a href="http://www.w3.org/TR/workers/">http://www.w3.org/TR/workers/</a></dd>
1.1 ihickson 29: :ZZZ -->
30:
31: <dt>Latest Editor's Draft:
32:
33: <dd><a
34: href="http://dev.w3.org/html5/workers/">http://dev.w3.org/html5/workers/</a></dd>
1.2 ihickson 35: <!-- ZZZ: add the new version after it has shipped
36: <dt>Previous Versions:</dt>
37: <dd><a href="http://www.w3.org/TR/2008/WD-workers-20080101/">http://www.w3.org/TR/2008/WD-workers-20080101/</a>
38: :ZZZ -->
1.1 ihickson 39:
40: <dt>Editors:
41:
42: <dd><a href="mailto:ian@hixie.ch">Ian Hickson</a>, Google, Inc.
43: </dl>
44:
45: <p class=copyright><a
46: href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>
47: © 2008 <a href="http://www.w3.org/"><abbr title="World Wide Web
48: Consortium">W3C</abbr></a><sup>®</sup> (<a
49: href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of
50: Technology">MIT</abbr></a>, <a href="http://www.ercim.org/"><abbr
51: title="European Research Consortium for Informatics and
52: Mathematics">ERCIM</abbr></a>, <a
53: href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a
54: href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
55: <a
56: href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
57: and <a
58: href="http://www.w3.org/Consortium/Legal/copyright-documents">document
59: use</a> rules apply.</p>
60: <!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST -->
61:
62: <p class="alt copyright">The <a
63: href="http://www.whatwg.org/specs/web-workers/current-work/">WHATWG
64: version</a> of this specification is available under a more permissive
65: license.</p>
66: <!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST -->
67: </div>
68:
69: <hr>
70:
71: <h2 class="no-num no-toc" id=abstract>Abstract</h2>
72:
73: <p>This specification defines an API that allows Web application authors to
74: spawn background workers running scripts in parallel to their main page.
75: This allows for thread-like operation with message-passing as the
76: coordination mechanism.
77:
78: <h2 class="no-num no-toc" id=status>Status of this document</h2>
79: <!-- intro boilerplate (required) -->
80:
81: <p><em>This section describes the status of this document at the time of
82: its publication. Other documents may supersede this document. A list of
83: current W3C publications and the most recently formally published revision
84: of this technical report can be found in the <a
85: href="http://www.w3.org/TR/">W3C technical reports index</a> at
86: http://www.w3.org/TR/.</em></p>
87: <!-- where to send feedback (required) -->
88:
89: <p>If you wish to make comments regarding this document, please send them
90: to <a
91: href="mailto:public-html-comments@w3.org">public-html-comments@w3.org</a>
92: (<a
93: href="mailto:public-html-comments-request@w3.org?subject=subscribe">subscribe</a>,
94: <a
95: href="http://lists.w3.org/Archives/Public/public-html-comments/">archives</a>)
96: <!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING SENTENCE TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST -->
97: or <a href="mailto:whatwg@whatwg.org">whatwg@whatwg.org</a> (<a
98: href="http://lists.whatwg.org/listinfo.cgi/whatwg-whatwg.org">subscribe</a>,
99: <a
100: href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/">archives</a>).
101: <!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING SENTENCE TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST -->
102: All feedback is welcome.</p>
103: <!-- stability (required) -->
104:
105: <p>Implementors should be aware that this specification is not stable.
106: <strong>Implementors who are not taking part in the discussions are likely
107: to find the specification changing out from under them in incompatible
108: ways.</strong> Vendors interested in implementing this specification
109: before it eventually reaches the Candidate Recommendation stage should
110: join the aforementioned mailing lists and take part in the discussions.</p>
111: <!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST -->
112: <!-- version history or list of changes (required) -->
113:
114: <p>The latest stable version of the editor's draft of this specification is
115: always available on <a
116: href="http://dev.w3.org/html5/workers/Overview.html">the W3C CVS
117: server</a> and in the <a href="http://svn.whatwg.org/webworkers/">WHATWG
118: Subversion repository</a>. The latest editor's working copy (which may
119: contain unfinished text in the process of being prepared) is available <a
120: href="http://www.whatwg.org/specs/web-workers/current-work/">on the WHATWG
121: site</a>. Detailed change history can be obtained from the following
122: locations:</p>
123: <!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST -->
124: <!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING LIST TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST -->
125:
126: <ul>
127: <li>Twitter messages (non-editorial changes only): <a
128: href="http://twitter.com/WHATWG">http://twitter.com/WHATWG</a>
129:
130: <li>Interactive Web interface: <a
131: href="http://html5.org/tools/web-workers-tracker">http://html5.org/tools/web-workers-tracker</a>
132:
133: <li>Commit-Watchers mailing list: <a
134: href="http://lists.whatwg.org/listinfo.cgi/commit-watchers-whatwg.org">http://lists.whatwg.org/listinfo.cgi/commit-watchers-whatwg.org</a>
135:
136: <li>Subversion interface: <a
137: href="http://svn.whatwg.org/webworkers/">http://svn.whatwg.org/webworkers/</a>
138:
139: <li>CVS log: <a
140: href="http://dev.w3.org/cvsweb/html5/workers/Overview.html">http://dev.w3.org/cvsweb/html5/workers/Overview.html</a>
141: </ul>
142: <!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING LIST TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST -->
143: <!-- status of document, group responsible (required) -->
144:
145: <p>The W3C <a href="http://www.w3.org/html/wg/">HTML Working Group</a> is
146: the W3C working group responsible for this specification's progress along
1.9 ihickson 147: the W3C Recommendation track. <!--ZZZ:--> This specification is the 18
1.3 ihickson 148: July 2008 <!--ZZZ "Working Draft"-->Editor's Draft. <!--:ZZZ--></p>
1.1 ihickson 149: <!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST -->
150: <!-- relationship to other work (required) -->
151:
152: <p>This specification is also being produced by the <a
153: href="http://www.whatwg.org/">WHATWG</a>. The two specifications are
154: identical from the table of contents onwards.</p>
155: <!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST -->
156: <!-- UNDER NO CIRCUMSTANCES IS THE PRECEDING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST -->
157: <!-- context and rationale (required) -->
158:
159: <p>This specification is intended to specify a part of the Web platform
160: closely related to HTML5. It is defined in a separate document primarily
161: to ease the cognitive load on reviewers.</p>
162: <!-- UNDER NO CIRCUMSTANCES IS THE FOLLOWING PARAGRAPH TO BE REMOVED OR EDITED WITHOUT TALKING TO IAN FIRST -->
163: <!-- required patent boilerplate -->
164:
165: <p>This document was produced by a group operating under the <a
166: href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
167: 2004 W3C Patent Policy</a>. W3C maintains a <a
168: href="http://www.w3.org/2004/01/pp-impl/40318/status"
169: rel=disclosure>public list of any patent disclosures</a> made in
170: connection with the deliverables of the group; that page also includes
171: instructions for disclosing a patent. An individual who has actual
172: knowledge of a patent which the individual believes contains <a
173: href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
174: Claim(s)</a> must disclose the information in accordance with <a
175: href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
176: 6 of the W3C Patent Policy</a>.
177:
178: <h2 class="no-num no-toc" id=contents>Table of contents</h2>
179: <!--begin-toc-->
180:
181: <ul class=toc>
182: <li><a href="#introduction"><span class=secno>1. </span>Introduction</a>
183: <ul class=toc>
1.4 ihickson 184: <li><a href="#tutorial"><span class=secno>1.1 </span>Tutorial</a>
1.1 ihickson 185:
1.3 ihickson 186: <li><a href="#requirements"><span class=secno>1.2
187: </span>Requirements</a>
1.1 ihickson 188:
1.4 ihickson 189: <li><a href="#conformance"><span class=secno>1.3 </span>Conformance
1.1 ihickson 190: requirements</a>
191: <ul class=toc>
1.4 ihickson 192: <li><a href="#dependencies"><span class=secno>1.3.1
1.1 ihickson 193: </span>Dependencies</a>
194: </ul>
195:
1.4 ihickson 196: <li><a href="#terminology"><span class=secno>1.4 </span>Terminology</a>
197: </ul>
198:
1.12 ihickson 199: <li><a href="#infrastructure"><span class=secno>2.
200: </span>Infrastructure</a>
1.4 ihickson 201: <ul class=toc>
202: <li><a href="#the-windowworker"><span class=secno>2.1 </span>The
203: <code>WindowWorker</code> interface</a>
204:
1.15 ihickson 205: <li><a href="#base-urls"><span class=secno>2.2 </span>Base URLs and
206: origins of workers</a>
207:
208: <li><a href="#the-queue"><span class=secno>2.3 </span>The queue of
1.4 ihickson 209: events</a>
210:
1.15 ihickson 211: <li><a href="#the-workers"><span class=secno>2.4 </span>The worker's
1.9 ihickson 212: ports</a>
213:
1.15 ihickson 214: <li><a href="#processing"><span class=secno>2.5 </span>Processing
1.4 ihickson 215: model</a>
1.12 ihickson 216:
1.15 ihickson 217: <li><a href="#creating"><span class=secno>2.6 </span>Creating
1.12 ihickson 218: workers</a>
1.1 ihickson 219: </ul>
220:
1.12 ihickson 221: <li><a href="#apis-available"><span class=secno>3. </span>APIs available
222: to workers</a>
1.4 ihickson 223:
1.1 ihickson 224: <li class=no-num><a href="#references">References</a>
225:
226: <li class=no-num><a href="#acknowledgements">Acknowledgements</a>
227: </ul>
228: <!--end-toc-->
229:
230: <hr>
231:
232: <h2 id=introduction><span class=secno>1. </span>Introduction</h2>
233:
1.4 ihickson 234: <h3 id=tutorial><span class=secno>1.1 </span>Tutorial</h3>
1.1 ihickson 235:
236: <p><em>This section is non-normative.</em>
237:
1.4 ihickson 238: <p class=big-issue>This section is missing.
239:
1.3 ihickson 240: <h3 id=requirements><span class=secno>1.2 </span>Requirements</h3>
1.1 ihickson 241:
242: <p><em>This section is non-normative.</em>
243:
1.3 ihickson 244: <p>This specification aims to address the following use cases and
245: requirements:
246:
247: <ul>
248: <li>Background workers: A Web application needs to keep its data
249: synchronised with the server, both sending updates to the server and
250: receiving updates from the server, including handling buffering of
251: updates for when the application goes offline. The code to do this would
252: ideally be independent of the UI code.
253:
254: <li>URLs: Workers should be spawned from URLs, not from strings, since
255: script rarely has access to its own source.
256:
257: <li>Message queuing: Messages sent to a worker before the worker has
258: initialised should not be lost.
259:
260: <li>Workers should have access to timers.
261:
262: <li>Workers should have access to the network.
263:
264: <li>Workers should be able to use libraries.
265:
266: <li>Implementations should not have to expose <code>Node</code> or
267: <code>Document</code> objects to workers.
268:
269: <li>Workers should not share anything with the outside world. The objects
270: representing the worker in the worker itself and in the context that
271: created the worker should be different, for instance.
272:
273: <li>Shared workers: Multiple instances of the same Web application would
274: want to keep just one connection back to the server.
275:
276: <li>Capabilities granting: It should be possible for code running in one
277: iframe to negotiate a connection to another iframe, with that connection
278: granting certain rights (e.g. adding to an address book but not reading
279: from it).
280:
281: <li>Delegation: It should be possible for one worker to spawn another
282: worker and efficiently delagate a request to that worker, without the
283: caller being aware of the delagate and without the original worker having
284: to proxy all the messages.
285:
286: <li>Workers whose parents are not longer useful should be killed. Workers
287: should be able to detect this is about to happen and exit gracefully.
288: </ul>
289:
1.4 ihickson 290: <h3 id=conformance><span class=secno>1.3 </span>Conformance requirements</h3>
1.1 ihickson 291:
292: <p>All diagrams, examples, and notes in this specification are
293: non-normative, as are all sections explicitly marked non-normative.
294: Everything else in this specification is normative.
295:
296: <p>The key words "MUST", "MUST NOT", "REQUIRED", <!--"SHALL", "SHALL
297: NOT",-->
298: "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in the
299: normative parts of this document are to be interpreted as described in
300: RFC2119. For readability, these words do not appear in all uppercase
301: letters in this specification. <a href="#refsRFC2119">[RFC2119]</a></p>
302: <!-- XXX but they should be
303: marked up -->
304:
305: <p>Requirements phrased in the imperative as part of algorithms (such as
306: "strip any leading space characters" or "return false and abort these
307: steps") are to be interpreted with the meaning of the key word ("must",
308: "should", "may", etc) used in introducing the algorithm.
309:
310: <p>Some conformance requirements are phrased as requirements on attributes,
311: methods or objects. Such requirements are to be interpreted as
312: requirements on user agents.
313:
314: <p>Conformance requirements phrased as algorithms or specific steps may be
315: implemented in any manner, so long as the end result is equivalent. (In
316: particular, the algorithms defined in this specification are intended to
317: be easy to follow, and not intended to be performant.)
318:
319: <p>The only conformance class defined by this specification is user agents.
320:
321: <p>User agents may impose implementation-specific limits on otherwise
322: unconstrained inputs, e.g. to prevent denial of service attacks, to guard
323: against running out of memory, or to work around platform-specific
324: limitations.
325:
1.4 ihickson 326: <h4 id=dependencies><span class=secno>1.3.1 </span>Dependencies</h4>
1.1 ihickson 327:
328: <p>This specification relies on several other underlying specifications.
329:
330: <dl>
331: <dt>HTML5
332:
333: <dd>
334: <p>Many fundamental concepts from HTML5 are used by this specification.
335: <a href="#refsHTML5">[HTML5]</a></p>
336:
337: <dt>ECMAScript
338:
339: <dd>
340: <p>This specification is intended to be used with JavaScript as the
341: scripting language. <a href="#refsJS">[JS]</a></p>
342:
343: <dt>WebIDL
344:
345: <dd>
346: <p>The IDL blocks in this specification use the semantics of the WebIDL
347: specification. <a href="#refsWebIDL">[WebIDL]</a></p>
348: </dl>
349:
1.4 ihickson 350: <h3 id=terminology><span class=secno>1.4 </span>Terminology</h3>
1.1 ihickson 351:
352: <p>For simplicity, terms such as <em>shown</em>, <em>displayed</em>, and
353: <em>visible</em> might sometimes be used when referring to the way a
354: document is rendered to the user. These terms are not meant to imply a
355: visual medium; they must be considered to apply to other media in
356: equivalent ways.
357:
1.4 ihickson 358: <p>The construction "a <code title="">Foo</code> object", where <code
359: title="">Foo</code> is actually an interface, is sometimes used instead of
360: the more accurate "an object implementing the interface <code
361: title="">Foo</code>".
1.1 ihickson 362:
363: <p>The term DOM is used to refer to the API set made available to scripts
364: in Web applications, and does not necessarily imply the existence of an
365: actual <code>Document</code> object or of any other <code>Node</code>
366: objects as defined in the DOM Core specifications. <a
367: href="#refsDOM3CORE">[DOM3CORE]</a>
368:
369: <p>A DOM attribute is said to be <em>getting</em> when its value is being
370: retrieved (e.g. by author script), and is said to be <em>setting</em> when
371: a new value is assigned to it.
372:
373: <p>If a DOM object is said to be <dfn id=live>live</dfn>, then that means
374: that any attributes returning that object must always return the same
375: object (not a new object each time), and the attributes and methods on
376: that object must operate on the actual underlying data, not a snapshot of
377: the data.
378:
1.12 ihickson 379: <h2 id=infrastructure><span class=secno>2. </span>Infrastructure</h2>
1.4 ihickson 380:
381: <h3 id=the-windowworker><span class=secno>2.1 </span>The <code><a
382: href="#windowworker">WindowWorker</a></code> interface</h3>
383:
384: <pre
385: class=idl>[NoInterfaceObject] interface <dfn id=windowworker>WindowWorker</dfn> {
1.10 ihickson 386: readonly attribute DOMString <a href="#url" title=dom-WindowWorker-URL>URL</a>;
387: readonly attribute DOMString <a href="#name" title=dom-WindowWorker-name>name</a>;
388: readonly attribute boolean <a href="#closing" title=dom-WindowWorker-closing>closing</a>;
1.14 ihickson 389: boolean <a href="#import" title=dom-WindowWorker-import>import</a>(in DOMString url);
1.10 ihickson 390: void <a href="#close" title=dom-WindowWorker-close>close</a>();
1.9 ihickson 391:
392: // event handler attributes
1.10 ihickson 393: attribute <span>EventListener</span> <a href="#onattach" title=handler-WindowWorker-onattach>onattach</a>;
394: attribute <span>EventListener</span> <a href="#onunload" title=handler-WindowWorker-onunload>onunload</a>;
1.4 ihickson 395: };</pre>
396:
1.10 ihickson 397: <p>The <dfn id=url title=dom-WindowWorker-URL><code>URL</code></dfn>
1.9 ihickson 398: attribute must return the value it was assigned when the <code><a
399: href="#windowworker">WindowWorker</a></code> object was created by the "<a
400: href="#run-a">run a worker</a>" algorithm. It gives the <span>absolute
401: URL</span> of the script that was used to initialize the worker.
402:
1.10 ihickson 403: <p>The <dfn id=name title=dom-WindowWorker-name><code>name</code></dfn>
1.6 ihickson 404: attribute must return the value it was assigned when the <code><a
405: href="#windowworker">WindowWorker</a></code> object was created by the "<a
1.9 ihickson 406: href="#run-a">run a worker</a>" algorithm. If it has a value that isn't
407: the empty string, its value represents the name that can be used to obtain
408: a reference to the worker using the <code
1.11 ihickson 409: title=dom-WindowWorkerCreators-createNamedWorker><a
410: href="#createnamedworker">createNamedWorker()</a></code> method.
1.6 ihickson 411:
1.4 ihickson 412: <p>The <dfn id=closing
1.10 ihickson 413: title=dom-WindowWorker-closing><code>closing</code></dfn> attribute must
1.4 ihickson 414: return false until the "<a href="#kill-a">kill a worker</a>" processing
415: model defined below sets it to false.
416:
1.9 ihickson 417: <p>The following are the <span>event handler DOM attributes</span> that
418: must be supported by objects implementing the <code><a
419: href="#windowworker">WindowWorker</a></code> interface:
420:
421: <dl>
422: <dt><dfn id=onattach
1.10 ihickson 423: title=handler-WindowWorker-onattach><code>onattach</code></dfn>
1.9 ihickson 424:
425: <dd>
426: <p>Must be invoked whenever a <code
1.10 ihickson 427: title=event-WindowWorker-attach>attach</code> event is targeted at or
1.9 ihickson 428: bubbles through the <code><a
429: href="#windowworker">WindowWorker</a></code> object.
430:
431: <dt><dfn id=onunload
1.10 ihickson 432: title=handler-WindowWorker-onunload><code>onunload</code></dfn>
1.9 ihickson 433:
434: <dd>
435: <p>Must be invoked whenever a <code title=event-unload>unload</code>
436: event is targeted at or bubbles through the <code><a
437: href="#windowworker">WindowWorker</a></code> object.
438: </dl>
439:
1.15 ihickson 440: <h3 id=base-urls><span class=secno>2.2 </span>Base URLs and origins of
441: workers</h3>
442:
443: <p>The <span>base URL</span> of a <span>URL</span> passed to an API in a
1.16 ihickson 444: worker is the <span>absolute URL</span> given by the value of the <code
445: title=dom-WindowWorker-URL><a href="#url">URL</a></code> attribute of the
446: worker's <code><a href="#windowworker">WindowWorker</a></code> object.
1.15 ihickson 447:
448: <p>The <span>origin</span> and <span>effective script origin</span> of
449: scripts running in workers are both the <span>origin</span> of the
1.16 ihickson 450: <span>absolute URL</span> given by the value of the <code
451: title=dom-WindowWorker-URL><a href="#url">URL</a></code> attribute of the
452: worker's <code><a href="#windowworker">WindowWorker</a></code> object.
1.15 ihickson 453:
454: <h3 id=the-queue><span class=secno>2.3 </span>The queue of events</h3>
1.4 ihickson 455:
456: <p>Each <code><a href="#windowworker">WindowWorker</a></code> object is
457: asssociated with a <dfn id=queue>queue of events</dfn>, which is initially
458: empty.
459:
460: <p>An event in the queue can be a DOM event or a timeout callback.
461:
1.8 ihickson 462: <p>All asynchronous callbacks and events that would be called or dispatched
463: in the worker must be added to the worker's queue, with the "<a
464: href="#run-a">run a worker</a>" processing model below taking care of
465: actually calling the callbacks or dispatching the events.
466:
467: <p>Once the <code><a href="#windowworker">WindowWorker</a></code>'s <code
1.10 ihickson 468: title=dom-WindowWorker-closing><a href="#closing">closing</a></code>
1.8 ihickson 469: attribute is set to true, the queue must discard anything else that would
470: be added to it. Effectively, once the <code
1.10 ihickson 471: title=dom-WindowWorker-closing><a href="#closing">closing</a></code>
1.8 ihickson 472: attribute is true, timers stop firing, notifications for all pending
473: asynchronous operations are dropped, etc.
474:
1.15 ihickson 475: <h3 id=the-workers><span class=secno>2.4 </span>The worker's ports</h3>
1.9 ihickson 476:
477: <p>Workers communicate with other workers and with <span title="browsing
478: context">browsing contexts</span> through <span title="channel
479: messaging">message channels</span> and their <code>MessagePort</code>
480: objects.
481:
482: <p>Each <code><a href="#windowworker">WindowWorker</a></code> <var
483: title="">worker</var> has a list of <dfn id=the-workers0>the worker's
484: ports</dfn>, which consists of all the <code>MessagePort</code> objects
485: that are entangled with another port and that have one (but only one) port
486: whose <code title=dom-MessagePort-ownerWindow>ownerWindow</code> is <var
487: title="">worker</var>. This list includes all the <code>MessagePort</code>
488: objects that are in events pending in the <a href="#queue">queue of
489: events</a>.
490:
1.17 ! ihickson 491: <hr>
! 492:
! 493: <p>A worker is said to be a <dfn id=front-line>front-line worker</dfn> if
! 494: at least one of the <a href="#the-workers0">the worker's ports</a> has an
! 495: entangled <code>MessagePort</code> whose <code
! 496: title=dom-MessagePort-ownerWindow>ownerWindow</code> is a
! 497: <code>WindowBrowsingContext</code> object.
! 498:
! 499: <p>A worker is said to be a <dfn id=needed>needed worker</dfn> if either:
! 500:
! 501: <ul>
! 502: <li>it is a <a href="#front-line">front-line worker</a>, or
! 503:
! 504: <li>at least one of the <a href="#the-workers0">the worker's ports</a> has
! 505: an entangled <code>MessagePort</code> whose <code
! 506: title=dom-MessagePort-ownerWindow>ownerWindow</code> is a <code><a
! 507: href="#windowworker">WindowWorker</a></code> object that is itself a <a
! 508: href="#needed">needed worker</a>.
! 509: </ul>
! 510:
! 511: <hr>
! 512:
! 513: <p>A worker is said to be an <dfn id=active>active front-line worker</dfn>
! 514: if at least one of the <a href="#the-workers0">the worker's ports</a> has
! 515: both an <code title=dom-MessagePort-active>active</code> attribute whose
! 516: value is true and an entangled <code>MessagePort</code> whose <code
! 517: title=dom-MessagePort-ownerWindow>ownerWindow</code> is a
! 518: <code>WindowBrowsingContext</code> object.
! 519:
! 520: <p>A worker is said to be an <dfn id=active0>active needed worker</dfn> if
! 521: either:
! 522:
! 523: <ul>
! 524: <li>it is an <a href="#active">active front-line worker</a>, or
! 525:
! 526: <li>at least one of the <a href="#the-workers0">the worker's ports</a> has
! 527: an entangled <code>MessagePort</code> whose <code
! 528: title=dom-MessagePort-ownerWindow>ownerWindow</code> is a <code><a
! 529: href="#windowworker">WindowWorker</a></code> object that is itself an <a
! 530: href="#active0">active needed worker</a>.
! 531: </ul>
! 532:
1.15 ihickson 533: <h3 id=processing><span class=secno>2.5 </span>Processing model</h3>
1.4 ihickson 534:
1.6 ihickson 535: <p>When a user agent is to <dfn id=run-a>run a worker</dfn> named <var
1.7 ihickson 536: title="">name</var> for a script with <span>URL</span> <var
537: title="">url</var>, a browsing context <var title="">owner browsing
538: context</var> and a <code>Document</code> <var title="">owner
539: document</var>, it must run the following steps in a completely separate
540: and parallel execution environment:
1.4 ihickson 541:
542: <ol>
543: <li>
1.7 ihickson 544: <p>Attempt to <span>fetch</span><!-- XXX --> the resource identified by
545: <var title="">url</var>.</p>
546:
547: <p>If the attempt fails, then abort these steps and invoke the <a
1.9 ihickson 548: href="#worker" title="worker creation failed">error handling steps</a>
1.7 ihickson 549: defined by the algorithm that called this one.</p>
550:
551: <p>If the attempt succeeds, then let <var title="">script</var> be the
552: resource that was obtained.</p>
553:
554: <p class=note>As with <code>script</code> elements, the MIME type of the
555: script is ignored. Unlike with <code>script</code> elements, there is no
556: way to override the type. It's always assumed to be JavaScript.</p>
557: <!-- XXX people will complain about
558: this. I guess we might want to examine the MIME type... -->
559:
560:
561: <li>
1.4 ihickson 562: <p>Create a new <code><a href="#windowworker">WindowWorker</a></code>
563: object, <var title="">window</var>.</p>
564:
565: <li>
1.10 ihickson 566: <p>Set the <code title=dom-WindowWorker-URL><a href="#url">URL</a></code>
1.9 ihickson 567: attribute of <var title="">window</var> to the value of <var
568: title="">url</var>.</p>
569:
570: <li>
1.10 ihickson 571: <p>Set the <code title=dom-WindowWorker-name><a
1.6 ihickson 572: href="#name">name</a></code> attribute of <var title="">window</var> to
573: the value of <var title="">name</var>.</p>
574:
575: <li>
1.4 ihickson 576: <p>Let <var title="">script</var>'s <span>script execution context</span>
577: (and thus also <span>global object</span>) be <var
578: title="">window</var>.</p>
579:
580: <li>
581: <p>Let <var title="">script</var>'s <span>script browsing context</span>
582: be <var title="">owner browsing context</var>.</p>
583:
584: <li>
585: <p>Let <var title="">script</var>'s <span>script document context</span>
586: be <var title="">owner document</var>.</p>
587:
588: <li>
1.9 ihickson 589: <p>Invoke the <a href="#success" title="worker creation
590: succeeded">success steps</a> defined by the algorithm that called this
1.17 ! ihickson 591: one.</p>
! 592:
! 593: <p class=note>This will usually add an event to the <a
! 594: href="#queue">queue of events</a>. If it does, that event will have a
! 595: <code>MessagePort</code> and thus the list of <a
! 596: href="#the-workers0">the worker's ports</a> will not be empty. If it
! 597: doesn't, then the next step will set the <var title="">window</var>
! 598: object's <code title=dom-WindowWorker-closing><a
! 599: href="#closing">closing</a></code> attribute to true.</p>
! 600:
! 601: <li>
! 602: <p>Start monitoring <var title="">worker</var>, such that as soon as the
! 603: worker stops being a <a href="#needed">needed worker</a>, the <var
! 604: title="">window</var> object's <code title=dom-WindowWorker-closing><a
! 605: href="#closing">closing</a></code> attribute is set to true.</p>
1.9 ihickson 606:
607: <li>
608: <p>Start monitoring <var title="">worker</var>, such that whenever the
609: <var title="">window</var> object's <code
1.10 ihickson 610: title=dom-WindowWorker-closing><a href="#closing">closing</a></code>
1.17 ! ihickson 611: attribute is false and the worker is not an <a href="#active0">active
! 612: needed worker</a>, the user agent suspends execution of script in that
! 613: worker until such time as either the <code
1.10 ihickson 614: title=dom-WindowWorker-closing><a href="#closing">closing</a></code>
1.17 ! ihickson 615: attribute switches to true or the worker becomes an <a
! 616: href="#active0">active needed worker</a>.</p>
1.7 ihickson 617:
618: <li>
619: <p>Run <var title="">script</var> until it either returns, fails to catch
620: an exception, or gets prematurely aborted by the "<a href="#kill-a">kill
621: a worker</a>" algorithm below.</p>
622:
623: <p class=note>If the script gets aborted by the "<a href="#kill-a">kill a
624: worker</a>" algorithm, then that same algorithm will cause there to only
625: be a single event in the <a href="#queue">queue of events</a> at the
1.9 ihickson 626: next step, namely the <code title=message-unload>unload</code> event.
627: However, if the event is ignored then it will become true as soon as
628: that port is garbage collected.</p>
1.4 ihickson 629:
630: <li>
1.9 ihickson 631: <p><i>Event loop</i>: Wait until either there is an event in the <a
1.4 ihickson 632: href="#queue">queue of events</a> associated with <var
1.9 ihickson 633: title="">window</var> or the <var title="">window</var> object's <code
1.10 ihickson 634: title=dom-WindowWorker-closing><a href="#closing">closing</a></code>
1.9 ihickson 635: attribute is set to true.</p>
1.4 ihickson 636:
637: <li>
638: <p>Dispatch the oldest event or callback in the <a href="#queue">queue of
1.9 ihickson 639: events</a>, if any. The handling of this event or the execution of this
640: callback might get prematurely aborted by the "<a href="#kill-a">kill a
1.8 ihickson 641: worker</a>" algorithm below.</p>
1.4 ihickson 642:
643: <li>
644: <p>If there are any more events in the <a href="#queue">queue of
645: events</a> or if the <var title="">window</var> object's <code
1.10 ihickson 646: title=dom-WindowWorker-closing><a href="#closing">closing</a></code>
1.4 ihickson 647: attribute is set to false, then jump back to the step above labeled
648: <i>event loop</i>.</p>
649:
650: <li>
651: <p class=big-issue>timers, intervals, XMLHttpRequests, database
652: transactions, etc, must be killed; ports must be deactivated and
1.8 ihickson 653: unentangled (do not send unload)</p>
1.4 ihickson 654: </ol>
655:
656: <hr>
657:
658: <p>When a user agent is to <dfn id=kill-a>kill a worker</dfn>, it must run
659: the following steps in parallel with the worker's main loop (the "<a
660: href="#run-a">run a worker</a>" processing model defined above):
661:
662: <ol>
663: <li>
664: <p>Create an <code>Event</code> object with the event name <code
665: title=event-unload>unload</code>, which does not bubble and is not
666: cancelable, and add it to the worker's <code><a
667: href="#windowworker">WindowWorker</a></code> object's <a
1.8 ihickson 668: href="#queue">queue of events</a>, targetted at the <code><a
669: href="#windowworker">WindowWorker</a></code> object itself.
1.4 ihickson 670:
671: <li>
1.8 ihickson 672: <p>Set the worker's <code><a href="#windowworker">WindowWorker</a></code>
1.10 ihickson 673: object's <code title=dom-WindowWorker-closing><a
1.8 ihickson 674: href="#closing">closing</a></code> attribute to true.
675:
676: <li>
677: <p>Wait a user-agent-defined amount of time. If the "<a href="#run-a">run
678: a worker</a>" processing model defined above immediately starts running
679: event listeners registered for <code title=event-unload>unload</code>
680: event, this time should not be zero — the idea is that the <code
681: title=event-unload>unload</code> event can be used to clean up when
682: shutting down unexpectedly.
1.4 ihickson 683:
684: <li>
685: <p>If there are any events in the <a href="#queue">queue of events</a>
686: other than the <code title=event-unload>unload</code> event that this
687: algorithm just added, discard them without dispatching them.
688:
689: <li>
690: <p>If the <code title=event-unload>unload</code> event that this
691: algorithm just added hasn't yet been dispatched, then abort the script
692: currently running in the worker.
693:
694: <li>
695: <p>Wait a user-agent-defined amount of time.
696:
697: <li>
698: <p>Abort the script currently running in the worker (if any script is
699: running, then it will be a handler for the <code
700: title=event-unload>unload</code> event).
701: </ol>
702:
1.8 ihickson 703: <hr>
704:
1.14 ihickson 705: <p>When a script invokes the <dfn id=import
706: title=dom-WindowWorker-import><code>import(<var
707: title="">url</var>)</code></dfn> method on a <code><a
708: href="#windowworker">WindowWorker</a></code> object, the user agent must
709: run the following steps:
710:
711: <ol>
712: <li>
713: <p><span title="resolve a url">Resolve</span> the <var title="">url</var>
714: argument.
715:
716: <li>
717: <p>If this fails, throw a <code>SYNTAX_ERR</code> exception.
718:
719: <li>
720: <p>If the <span>origin</span> of the resulting <span>absolute URL</span>
721: is not the <span title="same origin">same</span> as the origin of the
722: script that invoked the method, then throw a <span>security
723: exception</span>.
724:
725: <li>
726: <p>Attempt to <span>fetch</span><!-- XXX --> the resource identified by
727: the resulting <span>absolute URL</span>.</p>
728:
729: <p>If the attempt fails, return false and abort these steps.</p>
730:
731: <p>If the attempt succeeds, then let <var title="">script</var> be the
732: resource that was obtained.</p>
733:
734: <p class=note>As with the initial script, the script here is always
735: assumed to be JavaScript, regardless of the MIME type.</p>
736: <!-- XXX -->
737:
738: <li>
739: <p>Let <var title="">script</var>'s <span>script execution
740: context</span>, <span>script browsing context</span>, and <span>script
741: document context</span> be the same as for the script that was executed
742: by the <a href="#run-a">run a worker</a> processing model for this
743: worker.</p>
744:
745: <li>
746: <p>Run <var title="">script</var> until it either returns, fails to catch
747: an exception, or gets prematurely aborted by the "<a href="#kill-a">kill
748: a worker</a>" algorithm below.</p>
749:
750: <p>If an exception was raised or if the script was prematurely aborted,
751: then abort these steps, letting the exception or aborting continue to be
752: processed by the script that called the <code
753: title=dom-WindowWorker-import><a href="#import">import()</a></code>
754: method.</p>
755:
756: <p>Otherwise, return true.</p>
757: </ol>
758:
759: <hr>
760:
1.8 ihickson 761: <p>When a script invokes the <dfn id=close
1.10 ihickson 762: title=dom-WindowWorker-close><code>close()</code></dfn> method on a
1.8 ihickson 763: <code><a href="#windowworker">WindowWorker</a></code> object, the user
764: agent must run the following steps:
765:
766: <ol>
767: <li>
768: <p>Create an <code>Event</code> object with the event name <code
769: title=event-unload>unload</code>, which does not bubble and is not
770: cancelable, and add it to the <code><a
771: href="#windowworker">WindowWorker</a></code> object's <a
772: href="#queue">queue of events</a>, targetted at the <code><a
773: href="#windowworker">WindowWorker</a></code> object itself.
774:
775: <li>
776: <p>Set the worker's <code><a href="#windowworker">WindowWorker</a></code>
1.10 ihickson 777: object's <code title=dom-WindowWorker-closing><a
1.8 ihickson 778: href="#closing">closing</a></code> attribute to true.
779:
780: <li>
781: <p>For each <code>MessagePort</code> object that is entangled with
782: another port and that has one (but only one) port whose <code
1.9 ihickson 783: title=dom-MessagePort-ownerWindow>ownerWindow</code> is the <code><a
1.8 ihickson 784: href="#windowworker">WindowWorker</a></code> object on which the method
785: was invoked, run the following substeps:</p>
786:
787: <ol>
788: <li>
789: <p>Unentangle the two ports.
790:
791: <li>
1.9 ihickson 792: <p>Set both ports' <code title=dom-MessagePort-active>active</code>
1.8 ihickson 793: attribute to false.
794:
795: <li>
796: <p>At the next available opportunity, after any scripts have finished
797: executing<!-- XXX queue -->, <span>fire a simple event</span> called
798: <code title=event-unload>unload</code> at the other port (the one
1.9 ihickson 799: whose <code title=dom-MessagePort-ownerWindow>ownerWindow</code> is
1.8 ihickson 800: not the <code><a href="#windowworker">WindowWorker</a></code> object
1.10 ihickson 801: on which the <code title=dom-WindowWorker-close><a
1.8 ihickson 802: href="#close">close()</a></code> method was called).
803: </ol>
804: </ol>
805:
1.15 ihickson 806: <h3 id=creating><span class=secno>2.6 </span>Creating workers</h3>
1.5 ihickson 807:
808: <pre
809: class=idl>[NoInterfaceObject] interface <dfn id=windowworkercreators>WindowWorkerCreators</dfn> {
1.11 ihickson 810: <span>MessagePort</span> <a href="#createworker" title=dom-WindowWorkerCreators-createWorker>createWorker</a>(in DOMString scriptURL);
811: <span>MessagePort</span> <a href="#createnamedworker" title=dom-WindowWorkerCreators-createNamedWorker>createNamedWorker</a>(in DOMString name, in DOMString scriptURL);
1.5 ihickson 812: };</pre>
813:
814: <p>Objects that implement the <code>Window</code> interface must also
815: implement the <code><a
816: href="#windowworkercreators">WindowWorkerCreators</a></code> interface.
817:
1.9 ihickson 818: <hr>
819:
1.11 ihickson 820: <p>When the <dfn id=createworker
821: title=dom-WindowWorkerCreators-createWorker><code>createWorker(<var
822: title="">scriptURL</var>)</code></dfn> method is invoked, the user agent
823: must run the following steps:
1.9 ihickson 824:
825: <ol>
826: <li>
827: <p><span title="resolve a url">Resolve</span> the <var
828: title="">scriptURL</var> argument.
829:
830: <li>
831: <p>If this fails, throw a <code>SYNTAX_ERR</code> exception.
832:
833: <li>
834: <p>If the <span>origin</span> of the resulting <span>absolute URL</span>
835: is not the <span title="same origin">same</span> as the origin of the
836: script that invoked the method, then throw a <span>security
837: exception</span>.
838:
839: <li>
840: <p><a href="#create">Create a worker</a> from the resulting
841: <span>absolute URL</span> whose name is the empty string.
842:
843: <li>
844: <p>Return the <code>MessagePort</code> object returned from the <a
845: href="#create">create a worker</a> algorithm.
846: </ol>
847:
848: <hr>
849:
1.11 ihickson 850: <p>When the <dfn id=createnamedworker
851: title=dom-WindowWorkerCreators-createNamedWorker><code>createNamedWorker(<var
852: title="">name</var>, <var title="">scriptURL</var>)</code></dfn> method is
1.9 ihickson 853: invoked, the user agent must run the following steps:
854:
855: <ol>
856: <li>
857: <p><span title="resolve a url">Resolve</span> the <var
858: title="">scriptURL</var> argument.
1.4 ihickson 859:
1.9 ihickson 860: <li>
861: <p>If this fails, throw a <code>SYNTAX_ERR</code> exception.
862:
863: <li>
864: <p>If the <span>origin</span> of the resulting <span>absolute URL</span>
865: is not the <span title="same origin">same</span> as the origin of the
866: script that invoked the method, then throw a <span>security
867: exception</span>.
868:
869: <li>
870: <p>If the <var title="">name</var> argument is the empty string, <a
871: href="#create">create a worker</a> from the resulting <span>absolute
872: URL</span>, whose name is the empty string, and return the
873: <code>MessagePort</code> object returned from the <a
874: href="#create">create a worker</a> algorithm. Then, abort these steps.
875:
876: <li>
1.10 ihickson 877: <p>If there exists a worker whose <code title=dom-WindowWorker-closing><a
1.9 ihickson 878: href="#closing">closing</a></code> attribute is false, whose <code
1.10 ihickson 879: title=dom-WindowWorker-name><a href="#name">name</a></code> attribute is
1.9 ihickson 880: exactly equal to the <var title="">name</var> argument, and whose <code
1.10 ihickson 881: title=dom-WindowWorker-URL><a href="#url">URL</a></code> attribute has
1.9 ihickson 882: the <span>same origin</span> as the resulting <span>absolute URL</span>,
883: then run these substeps:</p>
884:
885: <ol>
886: <li>
1.10 ihickson 887: <p>If that worker's <code title=dom-WindowWorker-URL><a
1.9 ihickson 888: href="#url">URL</a></code> attribute is not exactly equal to the
889: resulting <span>absolute URL</span>, then throw a
890: <code>URL_MISMATCH_ERR</code> exception and abort these steps. <span
891: class=big-issue>code 19</span>
892:
893: <li>
894: <p><span>Create a new <code>MessagePort</code> object</span> owned by
895: the <span>script execution context</span> of the script that invoked
896: the method.
897:
898: <li>
899: <p>Return that port.
900:
901: <li>
902: <p>Asynchronously, <a href="#attach" title="attach to a
903: worker">attach</a> to this preexisting worker, with the newly created
904: port.
905: </ol>
906:
907: <p>Otherwise, <a href="#create">create a worker</a> from the resulting
908: <span>absolute URL</span>, whose name is the value of the <var
909: title="">name</var> argument, and return the <code>MessagePort</code>
910: object returned from the <a href="#create">create a worker</a>
911: algorithm.</p>
912: </ol>
913:
914: <hr>
915:
916: <p>The steps to <dfn id=create>create a worker</dfn> from a
917: <span>URL</span> <var title="">url</var> and whose name is <var
918: title="">name</var>, in the context of a method call, are as follows:
919:
920: <ol>
921: <li>
922: <p><span>Create a new <code>MessagePort</code> object</span> owned by the
923: <span>script execution context</span> of the script that invoked the
924: method.
925:
926: <li>
927: <p>Return that port.
928:
929: <li>
930: <p>In a parallel execution context (i.e. a separate thread or process or
931: equivalent construct), <a href="#run-a">run a worker</a> named <var
932: title="">name</var> for the script with <span>URL</span> <var
933: title="">url</var>, with the <span>script browsing context</span> of the
934: script that invoked the method as the <var title="">owner browsing
935: context</var> and with the <span>script document context</span> of the
936: script that invoked the method as the <var title="">owner
937: document</var>.</p>
938:
939: <p>If that algorithm invokes the steps for <dfn id=success title="worker
940: creation succeeded">success steps</dfn>, then <a href="#attach"
941: title="attach to a worker">attach</a> to this new worker, with the newly
942: created port.</p>
943:
944: <p>Otherwise, if the <dfn id=worker>worker creation failed</dfn>, then at
945: the next available opportunity, after any scripts have finished
946: executing<!-- XXX queue -->, <span>fire a simple event</span> called
947: <code title=event-error>error</code> at the newly created port.</p>
948: </ol>
949:
950: <hr>
951:
952: <p>The steps to <dfn id=attach>attach to a worker</dfn> given a
953: <code>MessagePort</code> object <var title="">port</var> are as follows:
954:
955: <ol>
956: <li>
957: <p>If <var title="">port</var> would have been garbage collected, or if
958: the <span>active document</span> of the <code
959: title=dom-MessagePort-ownerWindow>ownerWindow</code> of <var
960: title="">port</var> is no longer the same <code>Document</code> object
961: as when <var title="">port</var> was created, then do nothing. Abort
962: these steps. If the worker was just created, it'll get killed
963: immediately.</p>
964:
965: <li>
966: <p><span>Create a new <code>MessagePort</code> object</span> owned by the
967: <code><a href="#windowworker">WindowWorker</a></code> of the worker.
968:
969: <li>
970: <p><span>Entangle</span> this newly created port and the port <var
971: title="">port</var> that was passed to these steps.
972:
973: <li>
974: <p>Set the <code title=dom-MessagePort-active>active</code> attribute of
975: both ports to true.
976:
977: <li>
978: <p>At the next available opportunity, after any scripts have finished
979: executing<!-- XXX queue -->, <span>fire a simple event</span> called
980: <code title=event-load>load</code> at <var title="">port</var>.
981:
982: <li>
983: <p>Create an event that uses the <code>MessageEvent</code> interface,
984: with the name <code title=event-attach>attach</code>, which does not
985: bubble, is cancelable, has no default action, has a <code
986: title=dom-MessageEvent-data>data</code> attribute whose value is the
987: empty string and has a <code
988: title=dom-MessageEvent-messagePort>messagePort</code> attribute whose
989: value is the newly created port, and add it to the worker's <code><a
990: href="#windowworker">WindowWorker</a></code> object's <a
991: href="#queue">queue of events</a>, targetted at the <code><a
992: href="#windowworker">WindowWorker</a></code> object itself.
993: </ol>
1.7 ihickson 994:
1.12 ihickson 995: <h2 id=apis-available><span class=secno>3. </span>APIs available to workers</h2>
996:
997: <p>Objects that implement the <code><a
998: href="#windowworker">WindowWorker</a></code> interface must also implement
999: the following interfaces:
1000:
1001: <ul>
1002: <li>
1003: <p>The <code>Window</code> interface, and interfaces that are required to
1004: be implemented by objects implementing that interface, including:</p>
1005:
1006: <ul>
1007: <li>The <code>WindowTimers</code> interface
1008:
1009: <li>The <code><a
1010: href="#windowworkercreators">WindowWorkerCreators</a></code> interface
1011: </ul>
1012:
1013: <li>The <code>EventTarget</code> interface.
1014: </ul>
1015:
1.13 ihickson 1016: <p>There must be no interface objects and constructors available in the
1017: global scope of scripts whose <span>script execution context</span> is a
1018: <code><a href="#windowworker">WindowWorker</a></code> object except for
1019: the following:
1020:
1021: <ul>
1022: <li>
1023: <p><code>XMLHttpRequest</code> and all interface objects and constructors
1024: defined by the XMLHttpRequest specifications, except that the
1025: <span>document response entity body</span> must always be null. <a
1026: href="#refsXHR">[XHR]</a>
1027:
1028: <li>
1029: <p>The <code>WebSocket</code> interface object and constructor.
1030:
1031: <li>
1032: <p>The <code>MessageChannel</code> interface object and constructor.
1033: </li>
1034: <!-- XXX showNotification() -->
1035: <!-- XXX ApplicationCache -->
1036: <!-- XXX globalStorage -->
1037: <!-- XXX openDatabase() -->
1038: <!-- XXX a way to set cookies on the URL for the script -->
1039: <!-- XXX the navigator object, for UA sniffing (?) -->
1040: <!-- XXX
1041: void log(in DOMString s); // log to console
1042: -->
1043: </ul>
1044:
1.1 ihickson 1045: <h2 class=no-num id=references>References</h2>
1046:
1047: <p class=big-issue>This section will be written in a future
1048: draft.<!--XXX-->
1049:
1050: <h2 class=no-num id=acknowledgements>Acknowledgements</h2>
1051: <!-- ACKS -->
1052:
1053: <p>Thanks to Maciej Stachowiak and Mike Smith for their useful and
1054: substantial comments.
1.4 ihickson 1055:
1056: <p>Huge thanks to the whole Gears team, who pioneered this technology and
1057: whose experience has been a huge influence on this specification.
Webmaster