forked from speced/respec
-
Notifications
You must be signed in to change notification settings - Fork 3
/
webidl.html
621 lines (599 loc) · 19.2 KB
/
webidl.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
<!DOCTYPE html>
<html>
<head>
<title>W3C ReSpec WebIDL tests</title>
<meta http-equiv='Content-Type' content='text/html;charset=utf-8'/>
<script src='../js/respec.js' class='remove'></script>
<script class='remove'>
var respecConfig = {
// document info
specStatus: "ED",
shortName: "wicked-cool",
previousPublishDate: "2009-03-15",
previousMaturity: "REC",
edDraftURI: "http://dev.w3.org/2009/dap/respec/test-spec/",
// lcEnd: ...
// extraCSS: ["http://dev.w3.org/2009/dap/ReSpec.js/css/respec.css"],
extraCSS: ["../css/respec.css"],
tocIntroductory: true,
// editors
editors: [
{ name: "Robin Berjon", url: "http://berjon.com/",
company: "Robineko", companyURL: "http://robineko.com/" },
{ name: "Batman", company: "Outsiders" },
],
noIDLIn: true,
// WG
wg: "Device APIs and Policy Working Group",
wgURI: "http://www.w3.org/2009/dap/",
wgPublicList: "public-device-apis",
wgPatentURI: "http://www.w3.org/2004/01/pp-impl/43696/status",
};
</script>
</head>
<body>
<section id='abstract'>
This is just a bunch of tests for the WebIDL processing in ReSpec.
</section>
<section>
<h2>Interfaces</h2>
<p></p>
<section>
<h2>Simplest</h2>
<dl title='interface Dahut1' class='idl'></dl>
</section>
<section>
<h2>Inheritance</h2>
<dl title='interface Dahut2 : Cryptoid' class='idl'></dl>
</section>
<section>
<h2>Multiple Inheritance</h2>
<dl title='interface Dahut3 : Cryptoid, Mammal' class='idl'></dl>
</section>
<section>
<h2>Extended Attribute</h2>
<dl title='[Constructor] interface Dahut4' class='idl'></dl>
</section>
<section>
<h2>Everything</h2>
<dl title='[Constructor] interface Dahut5 : Cryptoid, Mammal' class='idl'></dl>
</section>
<section>
<h2>Partial</h2>
<dl title='partial interface Dahut17' class='idl'></dl>
</section>
</section>
<section>
<h2>Constants</h2>
<p></p>
<dl title='interface Dahut6' class='idl'>
<dt>const unsigned short LEVROGYROUS = 0</dt>
<dd>
Turning left.
</dd>
<dt>const float DEXTROGYROUS = 1.6</dt>
<dd>
Turning right.
</dd>
<dt>const boolean SHOUT = true</dt>
<dd>
The shout.
</dd>
</dl>
</section>
<section>
<h2>Attributes</h2>
<p></p>
<dl title='interface Dahut7' class='idl'>
<dt>attribute DOMString foo</dt>
<dd>
The foo attribute.
</dd>
<dt>readonly attribute DOMString bar</dt>
<dd>
The bar attribute.
</dd>
<dt>attribute unsigned short xxx</dt>
<dd>
The xxx attribute.
</dd>
<dt>readonly attribute unsigned short yyy</dt>
<dd>
The yyy attribute.
</dd>
<dt>[Ook, Oook] readonly attribute unsigned short ook</dt>
<dd>
The ook attribute.
</dd>
</dl>
</section>
<section>
<h2>Dictionaries</h2>
<p></p>
<section>
<h2>Simplest</h2>
<dl title='dictionary Dico1' class='idl'></dl>
</section>
<section>
<h2>Inheritance</h2>
<dl title='dictionary Dico1 : Dico0' class='idl'></dl>
</section>
<section>
<h2>Partial</h2>
<dl title='partial dictionary Dico1' class='idl'></dl>
</section>
<section>
<h2>With members</h2>
<dl title='dictionary Dico2' class='idl'>
<dt>DOMString foo</dt>
<dd>
The foo member.
</dd>
<dt>unsigned short xxx</dt>
<dd>
The xxx member.
</dd>
<dt>DOMString? fillPattern = "black"</dt>
<dd>
The nullable and defaulted fillPattern member.
</dd>
<dt>DOMString? strokePattern = null</dt>
<dd>
The nullable and defaulted strokePattern member.
</dd>
</dl>
</section>
</section>
<section>
<h2>Methods</h2>
<p></p>
<dl title='interface Dahut8' class='idl'>
<dt>void doIt1 ()</dt>
<dd>
The doIt1 method.
</dd>
<dt>DOMString doIt2 ()</dt>
<dd>
The doIt2 method.
</dd>
<dt>unsigned short doIt3 ()</dt>
<dd>
The doIt3 method.
</dd>
<dt>void doIt4 (in Dahut7 foo)</dt>
<dd>
The doIt4 method.
</dd>
<dt>void noIn (DahutSansIn foo)</dt>
<dd>
No in.
</dd>
<dt>void doIt5 (in DOMString foo, in unsigned short bar)</dt>
<dd>
The doIt5 method.
</dd>
<dt>[NameSetter] Dahut7 doIt6 ([Optional] in Dahut5 foo, [Optional, TreastAsNull] in unsigned short bar)</dt>
<dd>
The doIt6 method.
</dd>
<!-- this is for extended method descriptions -->
<dt>void extended ()</dt>
<dd>
This is an example of a method the parameters of which are described in greater detail.
<dl class='parameters'>
<dt>DOMString foo</dt>
<dd>
Specifies foo, a basic parameter.
</dd>
<dt>[Optional, TreastAsNull] unsigned short another</dt>
<dd>
This is another parameter, more complex. And we add a lot of text to see it all wrap.
And we add a lot of text to see it all wrap. And we add a lot of text to see it all wrap.
And we add a lot of text to see it all wrap. And we add a lot of text to see it all wrap.
And we add a lot of text to see it all wrap. And we add a lot of text to see it all wrap.
And we add a lot of text to see it all wrap. And we add a lot of text to see it all wrap.
</dd>
</dl>
</dd>
</dl>
</section>
<section>
<h2>Serializer</h2>
<p></p>
<dl title='interface Dahut85' class='idl'>
<dt>attribute DOMString foo</dt>
<dt>attribute DOMString bar</dt>
<dt>serializer = { foo, bar}</dt>
</dl>
<section>
<h2>Exception Definitions</h2>
<p></p>
<dl title='[NoInterfaceObject] exception BoomBoomBoomBoom' class='idl'>
<dt>const unsigned short SUIT_UP_ERR = 0</dt>
<dd>
You didn't put on your suit.
</dd>
<dt>const unsigned short LEGENDARY_ERR = 1</dt>
<dd>
Bo-ring.
</dd>
<dt>const DOMString DENIED_ERR = "DE-waitforit-NIED!!!!"</dt>
<dd>
Or not.
</dd>
<dt>unsigned short xxx</dt>
<dd>
The xxx field.
</dd>
<dt>unsigned short yyy</dt>
<dd>
The yyy field.
</dd>
<dt>[Ook, Oook] unsigned short ook</dt>
<dd>
The ook field.
</dd>
</dl>
</section>
<section>
<h2>Exception Raising</h2>
<p></p>
<dl title='interface Dahut9' class='idl'>
<dt>void raising ()</dt>
<dd>
This is an example of a method that raises an exception.
<div class='exception' title='BoomBoomBoomBoom'>
This is an exception that is raised as a whole, for a reason but without specific codes
being mentioned.
</div>
</dd>
<dt>void raising2 ()</dt>
<dd>
This is an example of a method that raises another exception.
<dl class='exception' title='ImSoExceptional'>
<dt>TOO_SEXY_ERR</dt>
<dd>
Raised whenever I walk out the door.
</dd>
<dt>COOL_FROOD_ERR</dt>
<dd>
Not a club you can buy your way into.
</dd>
</dl>
</dd>
<dt>void complexRaising2 ()</dt>
<dd>
This is an example of a method that does a bunch of things.
<dl class='exception' title='ImSoExceptional'>
<dt>TOO_SEXY_ERR</dt>
<dd>
Raised whenever I walk out the door.
</dd>
<dt>COOL_FROOD_ERR</dt>
<dd>
Not a club you can buy your way into.
And we add a lot of text to see it all wrap. And we add a lot of text to see it all wrap.
And we add a lot of text to see it all wrap. And we add a lot of text to see it all wrap.
</dd>
</dl>
<dl class='parameters'>
<dt>[Optional, TreastAsNull] unsigned short another</dt>
<dd>
This is another parameter, more complex. And we add a lot of text to see it all wrap.
And we add a lot of text to see it all wrap. And we add a lot of text to see it all wrap.
And we add a lot of text to see it all wrap. And we add a lot of text to see it all wrap.
</dd>
</dl>
<div class='exception' title='JustForYouException'>
This is an exception that is raised as a whole, for a reason but without specific codes
being mentioned.
And we add a lot of text to see it all wrap. And we add a lot of text to see it all wrap.
And we add a lot of text to see it all wrap. And we add a lot of text to see it all wrap.
</div>
</dd>
</dl>
</section>
<section>
<h2>Exception On Attributes</h2>
<p></p>
<dl title='interface Dahut10' class='idl'>
<dt>attribute DOMString gr</dt>
<dd>
This is an example of an attribute that raises an exception.
<div class='getraises' title='BoomBoomBoomBoom'>
This is an exception that is raised on getting, simply.
</div>
</dd>
<dt>attribute DOMString sr</dt>
<dd>
This is an example of an attribute that raises an exception.
<div class='setraises' title='BoomBoomBoomBoom'>
This is an exception that is raised on setting, simply.
</div>
</dd>
<dt>attribute DOMString bothAtOnce</dt>
<dd>
This is an example of an attribute that raises an exception.
<div class='getraises setraises' title='BoomBoomBoomBoom'>
This is an exception that is raised on getting and setting, simply, at once.
</div>
</dd>
<dt>attribute DOMString multi</dt>
<dd>
This is an example of an attribute that raises an exception.
<div class='setraises' title='BoomBoomBoomBoom'>
This is an exception that is raised on setting, simply, 01.
</div>
<div class='getraises' title='JustForYouException'>
This is an exception that is raised on setting, simply, 02.
</div>
<div class='setraises' title='ImSoExceptional'>
This is an exception that is raised on getting, simply, 01.
</div>
<div class='setraises getraises' title='BatError'>
This is an exception that is raised on getting, simply, 02.
</div>
</dd>
<dt>attribute DOMString grc</dt>
<dd>
This is an example of an attribute that raises an exception.
<dl class='getraises' title='BoomBoomBoomBoom'>
<dt>TEST_ERR</dt>
<dd>
This is an exception that is raised on getting, complex.
</dd>
<dt>FOO_ERR</dt>
<dd>
Foooo foo fooooooo fooof ooooooooooo...
</dd>
</dl>
</dd>
<dt>attribute DOMString src</dt>
<dd>
This is an example of an attribute that raises an exception.
<dl class='setraises' title='BoomBoomBoomBoom'>
<dt>TEST_ERR</dt>
<dd>
This is an exception that is raised on setting, complex.
</dd>
<dt>FOO_ERR</dt>
<dd>
Foooo foo fooooooo fooof ooooooooooo...
</dd>
</dl>
</dd>
<dt>attribute DOMString bothAtOnceC</dt>
<dd>
This is an example of an attribute that raises an exception.
<dl class='getraises setraises' title='BoomBoomBoomBoom'>
<dt>TEST_ERR</dt>
<dd>
This is an exception that is raised on getting and setting, complex, at once.
</dd>
<dt>FOO_ERR</dt>
<dd>
Foooo foo fooooooo fooof ooooooooooo...
</dd>
</dl>
</dd>
<dt>attribute DOMString multic</dt>
<dd>
This is an example of an attribute that raises an exception.
<dl class='setraises' title='BoomBoomBoomBoom'>
<dt>TEST_ERR</dt>
<dd>
This is an exception that is raised on setting, complex, 01.
</dd>
<dt>FOO_ERR</dt>
<dd>
Foooo foo fooooooo fooof ooooooooooo...
</dd>
</dl>
<dl class='getraises' title='JustForYouException'>
<dt>TEST_ERR</dt>
<dd>
This is an exception that is raised on setting, complex, 02.
</dd>
<dt>FOO_ERR</dt>
<dd>
Foooo foo fooooooo fooof ooooooooooo...
</dd>
</dl>
<dl class='setraises' title='ImSoExceptional'>
<dt>TEST_ERR</dt>
<dd>
This is an exception that is raised on getting, complex, 01.
</dd>
<dt>FOO_ERR</dt>
<dd>
Foooo foo fooooooo fooof ooooooooooo...
</dd>
</dl>
<dl class='getraises setraises' title='BatError'>
<dt>TEST_ERR</dt>
<dd>
This is an exception that is raised on getting, complex, 02.
</dd>
<dt>FOO_ERR</dt>
<dd>
Foooo foo fooooooo fooof ooooooooooo...
</dd>
</dl>
</dd>
</dl>
</section>
<section>
<h2>Sequences</h2>
<p></p>
<dl title='interface Dahut14' class='idl'>
<dt>attribute sequence<DOMString> foos</dt>
<dd>
The foo attribute.
</dd>
<dt>attribute sequence<Dahut9> moreDahuts</dt>
<dd>
The moreDahuts attribute.
</dd>
<dt>sequence<Dahut5> doSomething (in sequence<Dahut10> dahuts)</dt>
<dd>
The doSomething method.
</dd>
<!-- this is for extended method descriptions -->
<dt>void doSomethingElse ()</dt>
<dd>
Sequencing
<dl class='parameters'>
<dt>sequence<DOMString> bars</dt>
<dd>
Specifies foo, a basic parameter.
</dd>
</dl>
</dd>
</dl>
</section>
<section>
<h2>Typedefs</h2>
<p>
An automatic typedef:
</p>
<div class='idl' title='typedef sequence<Dahut10> DaaahuuutList'></div>
<p>
A typedef with content:
</p>
<div class='idl' title='typedef geometry::basic::Point Point'>
For simplicity's sake, we'll refer to that geometry object directly as
<a>Point</a>.
</div>
</section>
<section>
<h2>Implements</h2>
<p>
An automatic implements:
</p>
<div class='idl' title='Foo implements Dahut5'></div>
<p>
An implements with content:
</p>
<div class='idl' title='Dahut5 implements Foo'>
All instances of <a>Dahut5</a> MUST support <a>Foo</a>.
</div>
</section>
<section>
<h2>Bug based tests</h2>
<p>
Wrapping.
</p>
<dl title='interface Bug01' class='idl'>
<dt>long watchPowerSource(in PowerSourceCallback successCallback, [Optional] in PowerErrorCallback errorCallback)</dt>
<dd>unwrapped</dd>
<dt>long watchPowerSource(in PowerSourceCallback
successCallback, [Optional] in PowerErrorCallback
errorCallback)</dt>
<dd>wrapped</dd>
</dl>
</section>
<section>
<h2>Nullable</h2>
<p>
On all members that support it.
</p>
<dl title='interface NullableStuff' class='idl'>
<dt>const boolean? ARE_WE_THERE_YET = false</dt>
<dd>on const</dd>
<dt>attribute unsigned long? viciousness</dt>
<dd>on attribute</dd>
<dt>void nullMe (in MaybeNull? foo)</dt>
<dd>on simple method</dd>
<dt>unsigned long? nullRet ()</dt>
<dd>on simple method return</dd>
<dt>void extendedNull ()</dt>
<dd>
With the extended syntax
<dl class='parameters'>
<dt>unsigned long? foo</dt>
<dd>
Specifies foo, nullable.
</dd>
</dl>
</dd>
</dl>
<p>
A nullable typedef:
</p>
<div class='idl' title='typedef foo::MightBeNull? SimplerName'></div>
</section>
<section>
<h2>Optional parameters</h2>
<dl title='interface OptionalStuff' class='idl'>
<dt>void oneOpt (in optional MaybeNot foo)</dt>
<dd>on simple method</dd>
<dt>void twoOpt (in Yes yes, in optional MaybeNot foo, in optional MaybeNot bar)</dt>
<dd>multi params</dd>
<dt>void restOpt (in Yes yes, in optional MaybeNot foo, in SilentlyOpt bar)</dt>
<dd>optional to the rest</dd>
<dt>void extendedOptional ()</dt>
<dd>
With the extended syntax
<dl class='parameters'>
<dt>optional unsigned long? foo</dt>
<dd>
Specifies foo, nullable and optional.
</dd>
</dl>
</dd>
</dl>
</section>
<section>
<h2>Arrays</h2>
<p>
On all members that support it.
</p>
<dl title='interface ArrayStuff' class='idl'>
<dt>attribute unsigned long[] viciousness</dt>
<dd>on attribute</dd>
<dt>void arrayMe (in ArrayThing[] foo)</dt>
<dd>on simple method</dd>
<dt>unsigned long[] arrayRet ()</dt>
<dd>on simple method return</dd>
<dt>void extendedArray ()</dt>
<dd>
With the extended syntax
<dl class='parameters'>
<dt>unsigned long[] foo</dt>
<dd>
An array of foo.
</dd>
</dl>
</dd>
</dl>
<p>
An array typedef:
</p>
<div class='idl' title='typedef foo::Stuff[] ArrayOfStuff'></div>
</section>
<section>
<h2>This actually tests example, but *shrug*</h2>
<pre class='example'>
This is over indented
So is this
</pre>
<p>
The following has stray WS at start
</p>
<pre class='example'>
This is indented
So is this
</pre>
<p>
More complex
</p>
<pre class='example'>
foo {
bar {
baz xxx xxx xxx
}
}
</pre>
</section>
</body>
</html>