-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
12988 lines (12300 loc) · 839 KB
/
index.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
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Web IDL</title>
<meta name="revision" content="$Id: Overview.html,v 1.1 2012/04/17 17:46:57 denis Exp $" />
<link rel="stylesheet" href="WebIDL.css" type="text/css" />
<script src="section-links.js" type="application/ecmascript"></script>
<script src="dfn.js" type="application/ecmascript"></script>
<link rel="stylesheet" href="http://www.w3.org/StyleSheets/TR/W3C-CR" type="text/css" /></head>
<body>
<div class="head"><div><a href="http://www.w3.org/"><img src="http://www.w3.org/Icons/w3c_home" width="72" height="48" alt="W3C" /></a></div><h1>Web IDL</h1><h2>W3C Candidate Recommendation <em>19 April 2012</em></h2><dl><dt>본 버전:</dt><dd><a href="http://www.w3.org/TR/2012/CR-WebIDL-20120419/">http://www.w3.org/TR/2012/CR-WebIDL-20120419/</a></dd><dt>현재의 Editor’s Draft:</dt><dd><a href="http://dev.w3.org/2006/webapi/WebIDL/">http://dev.w3.org/2006/webapi/WebIDL/</a></dd><dt>최신 버전:</dt><dd><a href="http://www.w3.org/TR/WebIDL/">http://www.w3.org/TR/WebIDL/</a></dd><dt>이전 버전들:</dt><dd><a href="http://www.w3.org/TR/2012/WD-WebIDL-20120207/">http://www.w3.org/TR/2012/WD-WebIDL-20120207/</a></dd><dd><a href="http://www.w3.org/TR/2011/WD-WebIDL-20110927/">http://www.w3.org/TR/2011/WD-WebIDL-20110927/</a></dd><dd><a href="http://www.w3.org/TR/2011/WD-WebIDL-20110712/">http://www.w3.org/TR/2011/WD-WebIDL-20110712/</a></dd><dd><a href="http://www.w3.org/TR/2010/WD-WebIDL-20101021/">http://www.w3.org/TR/2010/WD-WebIDL-20101021/</a></dd><dd><a href="http://www.w3.org/TR/2008/WD-WebIDL-20081219/">http://www.w3.org/TR/2008/WD-WebIDL-20081219/</a></dd><dd><a href="http://www.w3.org/TR/2008/WD-WebIDL-20080829/">http://www.w3.org/TR/2008/WD-WebIDL-20080829/</a></dd><dd><a href="http://www.w3.org/TR/2008/WD-DOM-Bindings-20080410/">http://www.w3.org/TR/2008/WD-DOM-Bindings-20080410/</a></dd><dd><a href="http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/">http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/</a></dd><dt>편집자:</dt><dd><a href="http://mcc.id.au/">Cameron McCormack</a>, Mozilla Corporation <[email protected]></dd></dl><p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2012 <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p></div><hr />
<!--
<div id='publication-warning'>
<strong>This document is in the process of being prepared to be published as a Candidate Recommendation.
Please note that it as yet has not been published as a CR and that this document
at dev.w3.org is still to be considered an unofficial draft.</strong> <br/> <button onclick="document.body.removeChild(this.parentNode)">Dismiss</button>
</div>
-->
<div class="section">
<h2>요약</h2>
<p>
이 문서는 웹브라우저들에서 정의하고자 하는 인터페이스들을 정의하는데에 사용될 수 있는 인터페이스 정의 언어인 Web IDL을 정의한다.
Web IDL은 웹 플랫폼에서의 일반적인 스크립트 객체들의 동작이 더 쉽게 명시될 수 있도록 하는 여러 특징들을 가진 IDL의 변형이다.
어떻게 Web IDL로 설명된 인터페이스들이 ECMAScript 실행 환경에서의 구성에 일치될 수 있는지 또한 이 문서에서 구체화 되어 있다.
이 문서가 이미 발간된 사양들을 구현하는 사람들에게 가이드로서 사용되고, 새로이 발간되는 사양들이 인터페이스의 구현이 상호 운용 가능하도록 따르는지를 보장하기 위해 이 문서를 참고할것으로 기대한다.
<!-- This document defines an interface definition language, Web IDL,
that can be used to describe interfaces that are intended to be
implemented in web browsers. Web IDL is an IDL variant with a
number of features that allow the behavior of common script objects in
the web platform to be specified more readily. How interfaces
described with Web IDL correspond to constructs within ECMAScript
execution environments is also detailed in this document.
It is expected that this document acts
as a guide to implementors of already-published specifications,
and that newly published specifications reference this
document to ensure conforming implementations of interfaces
are interoperable. -->
</p>
<!-- XXX
Things to consider that aren't in ednotes:
* Consistent linking to term definitions.
* Consistent capitalisation and naming of algorithm variables.
Potential V2 features:
* Parameterized interface types, for BlahLists
http://www.w3.org/mid/[email protected]
-->
<!--
<?revision-note http://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=&product=WebAppsWG&component=WebIDL&longdesc_type=allwordssubstr&longdesc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=&keywords_type=allwords&keywords=&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailtype1=substring&email1=&emailtype2=substring&email2=&bug_id_type=anyexact&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Importance&field0-0-0=noop&type0-0-0=noop&value0-0-0=?>
-->
</div>
<div class="section">
<h2 id="sotd">본 문서의 상태</h2>
<p><em>
이 섹션은 발간 당시의 이 문서의 상태에 대해 설명한다.
다른 문서가 이 문서를 대체할 수도 있다. 현재의 W3C 발간 목록과 이 기술 리포트의 최신 리비전을 <a href="http://www.w3.org/TR/">W3C technical
reports index</a> http://www.w3.org/TR/ 에서 찾을 수 있다.
</em></p><p>
이 문서는 <cite>Web IDL</cite> 사양의 2012년 4월 19일 <b>Candidate Recommendation</b>이다.
이 문서에 대한 의견은 <a href="mailto:[email protected]">[email protected]</a>로 보내주기 바란다.
(<a href="http://lists.w3.org/Archives/Public/public-script-coord/">archived</a>).
<!-- This section describes the status of this document at the time of
its publication. Other documents may supersede this document. A list
of current W3C publications and the latest revision of this technical
report can be found in the <a href="http://www.w3.org/TR/">W3C technical
reports index</a> at http://www.w3.org/TR/.
</em></p><p>
This document is the 19 April 2012 <b>Candidate Recommendation</b> of the
<cite>Web IDL</cite> specification.
Please send comments about this document to
<a href="mailto:[email protected]">[email protected]</a>
(<a href="http://lists.w3.org/Archives/Public/public-script-coord/">archived</a>). -->
</p>
<p>
이 문서는 적어도 2012년 6월 19일까지는 Candidate Recommendation으로 남아있을 것이다.
이 문서가 Proposed Recommendation 단계로 진행되기 전에 갖추어야 할 자세한 규정과, 위험한 단계에 있다고 여겨지고 Last Call Working Draft로의 문서 반환 없이 사양에서 빠질 수 있는 기능들과 에 대해서는 <a href="#cr-exit">Candidate Recommendation exit criteria</a> 섹션을 확인하라.
아직까지는 가능한 구현 리포트는 없다.
<!--
This document will remain a Candidate Recommendation until at least 19 July 2012. See the
<a href="#cr-exit">Candidate Recommendation exit criteria</a> section
for details on the criteria that must be met before this document can
progress to the Proposed Recommendation stage, and for the features that
are considered <em>at risk</em> and which may be dropped from the
specification without the document returning to a Last Call Working Draft.
As yet there is no implementation report available.
-->
</p>
<!--
<p>
The following features are considered <em>at risk</em>, and may be removed in
a future publication of this document if they remain unsued by Web specification
authors:
</p>
<ul>
<li>The <span class='idltype'>unrestricted float</span> and <span class='idltype'>unrestricted double</span> types.</li>
<li><a class='dfnref' href='#dfn-optional-argument-default-value'>Default values</a> for optional arguments.</li>
<li>The <a class='xattr' href='#ArrayClass'>[ArrayClass]</a>, <a class='xattr' href='#Clamp'>[Clamp]</a>, <a class='xattr' href='#EnforceRange'>[EnforceRange]</a> and <a class='xattr' href='#ImplicitThis'>[ImplicitThis]</a> extended attributes.</li>
</ul>
-->
<p>
이 문서는,
<a href="http://www.w3.org/2008/webapps/">Web Applications Working Group</a>,
W3C <a href="http://www.w3.org/Interaction/">Interaction Domain</a>내에 <a href="http://www.w3.org/2006/rwc/Activity">Rich Web Clients Activity</a>
의 일부에 의해 생성되었다.
이 문서에 발생하는 변경들은 <a href="http://dev.w3.org/cvsweb/2006/webapi/WebIDL/Overview.xml">W3C public CVS server</a>에서 찾을 수 있다.
<!--
This document is produced by the
<a href="http://www.w3.org/2008/webapps/">Web Applications Working Group</a>, part of the
<a href="http://www.w3.org/2006/rwc/Activity">Rich Web Clients Activity</a>
in the W3C <a href="http://www.w3.org/Interaction/">Interaction Domain</a>.
Changes made to this document can be found in the
<a href="http://dev.w3.org/cvsweb/2006/webapi/WebIDL/Overview.xml">W3C
public CVS server</a>.
-->
</p>
<p>
<!--In addition to the issues marked by editorial notes in this document,-->
사양을 위한 <a href="https://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=&product=WebAppsWG&component=WebIDL&longdesc_type=allwordssubstr&longdesc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=&keywords_type=allwords&keywords=&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailtype1=substring&email1=&emailtype2=substring&email2=&bug_id_type=anyexact&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse%20same%20sort%20as%20last%20time&field0-0-0=noop&type0-0-0=noop&value0-0-0=">버그 트랙커</a>가 있다. 세 Last Call 코멘트 기간동안에 제기된 이슈들은 다음의 문서들에서 추적된다:
<!--
There is a <a href="https://www.w3.org/Bugs/Public/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=&product=WebAppsWG&component=WebIDL&longdesc_type=allwordssubstr&longdesc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=&keywords_type=allwords&keywords=&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailtype1=substring&email1=&emailtype2=substring&email2=&bug_id_type=anyexact&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse%20same%20sort%20as%20last%20time&field0-0-0=noop&type0-0-0=noop&value0-0-0=">bug tracker</a>
for the specification. Issues raised during the three Last Call comment periods
are tracked in the following documents:
-->
</p>
<dl>
<dt><a href="http://www.w3.org/TR/2011/WD-WebIDL-20110712/">12 July 2011 Last Call Working Draft</a></dt>
<dd><a href="http://dev.w3.org/2006/webapi/WebIDL/lc1.txt">Web IDL LC#1 comment document</a></dd>
<dt><a href="http://www.w3.org/TR/2011/WD-WebIDL-20110927/">27 September 2011 Last call Working Draft</a></dt>
<dd><a href="http://dev.w3.org/2006/webapi/WebIDL/lc2.txt">Web IDL LC#2 comment document</a></dd>
<dt><a href="http://www.w3.org/TR/2012/WD-WebIDL-20120207/">7 February 2012 Last Call Working Draft</a></dt>
<dd><a href="http://dev.w3.org/2006/webapi/WebIDL/lc3.txt">Web IDL LC#3 comment document</a></dd>
</dl>
<p>
Candidate Recommendation으로서의 발간은 W3C 멤버십으로부터 지지받음을 나타내지는 않는다.
이것은 초안 문서이고 언제든 다른 문서에 의해 갱신, 대체되거나 쓸모없게 될 수도 있다.
이 문서를 진행중인 작업 이외로서 인용하는것은 부적절하다.
<!--
Publication as a Candidate Recommendation does not imply endorsement by the
W3C Membership. This is a draft document and may be updated, replaced
or obsoleted by other documents at any time. It is inappropriate to cite
this document as other than work in progress.
-->
</p><p>
이 문서는 <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February2004 W3C Patent Policy</a>하에서의 그룹 운영에 의해 생성되었다.
W3C는 그룹의 산출물들과의 연결에서 만들어진 <a href="http://www.w3.org/2004/01/pp-impl/42538/status">public list of any patent disclosures</a>를 관리하고, 그 페이지에는 특허 공개에 대한 지침이 포함되어 있다.
An individual who has actual knowledge of a patent which the individual
believes contains
<a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
Claim(s)</a> must disclose the information in accordance with
<a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
6 of the W3C Patent Policy</a>.
<!--
This document was produced by a group operating under the
<a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
2004 W3C Patent Policy</a>. W3C maintains a
<a href="http://www.w3.org/2004/01/pp-impl/42538/status">public list of
any patent disclosures</a> made in connection with the deliverables of
the group; that page also includes instructions for disclosing a patent.
An individual who has actual knowledge of a patent which the individual
believes contains
<a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
Claim(s)</a> must disclose the information in accordance with
<a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
6 of the W3C Patent Policy</a>.
-->
</p>
</div>
<div id="toc">
<h2>목차</h2>
<div class="toc"><ul><li><a href="#introduction">1. Introduction</a><ul><li><a href="#conventions">1.1. Typographic conventions</a></li></ul></li><li><a href="#conformance">2. Conformance</a></li><li><a href="#idl">3. Interface definition language</a><ul><li><a href="#idl-names">3.1. Names</a></li><li><a href="#idl-interfaces">3.2. Interfaces</a><ul><li><a href="#idl-constants">3.2.1. Constants</a></li><li><a href="#idl-attributes">3.2.2. Attributes</a></li><li><a href="#idl-operations">3.2.3. Operations</a></li><li><a href="#idl-special-operations">3.2.4. Special operations</a><ul><li><a href="#idl-legacy-callers">3.2.4.1. Legacy callers</a></li><li><a href="#idl-stringifiers">3.2.4.2. Stringifiers</a></li><li><a href="#idl-indexed-properties">3.2.4.3. Indexed properties</a></li><li><a href="#idl-named-properties">3.2.4.4. Named properties</a></li></ul></li><li><a href="#idl-static-operations">3.2.5. Static operations</a></li><li><a href="#idl-overloading">3.2.6. Overloading</a></li></ul></li><li><a href="#idl-dictionaries">3.3. Dictionaries</a></li><li><a href="#idl-exceptions">3.4. Exceptions</a></li><li><a href="#idl-enums">3.5. Enumerations</a></li><li><a href="#idl-callback-functions">3.6. Callback functions</a></li><li><a href="#idl-typedefs">3.7. Typedefs</a></li><li><a href="#idl-implements-statements">3.8. Implements statements</a></li><li><a href="#idl-objects">3.9. Objects implementing interfaces</a></li><li><a href="#idl-types">3.10. Types</a><ul><li><a href="#idl-any">3.10.1. any</a></li><li><a href="#idl-boolean">3.10.2. boolean</a></li><li><a href="#idl-byte">3.10.3. byte</a></li><li><a href="#idl-octet">3.10.4. octet</a></li><li><a href="#idl-short">3.10.5. short</a></li><li><a href="#idl-unsigned-short">3.10.6. unsigned short</a></li><li><a href="#idl-long">3.10.7. long</a></li><li><a href="#idl-unsigned-long">3.10.8. unsigned long</a></li><li><a href="#idl-long-long">3.10.9. long long</a></li><li><a href="#idl-unsigned-long-long">3.10.10. unsigned long long</a></li><li><a href="#idl-float">3.10.11. float</a></li><li><a href="#idl-unrestricted-float">3.10.12. unrestricted float</a></li><li><a href="#idl-double">3.10.13. double</a></li><li><a href="#idl-unrestricted-double">3.10.14. unrestricted double</a></li><li><a href="#idl-DOMString">3.10.15. DOMString</a></li><li><a href="#idl-object">3.10.16. object</a></li><li><a href="#idl-interface">3.10.17. Interface types</a></li><li><a href="#idl-dictionary">3.10.18. Dictionary types</a></li><li><a href="#idl-enumeration">3.10.19. Enumeration types</a></li><li><a href="#idl-callback-function">3.10.20. Callback function types</a></li><li><a href="#idl-nullable-type">3.10.21. Nullable types — <var>T</var>?</a></li><li><a href="#idl-sequence">3.10.22. Sequences — sequence<<var>T</var>></a></li><li><a href="#idl-array">3.10.23. Arrays — <var>T</var>[]</a></li><li><a href="#idl-union">3.10.24. Union types</a></li><li><a href="#idl-Date">3.10.25. Date</a></li></ul></li><li><a href="#idl-extended-attributes">3.11. Extended attributes</a></li></ul></li><li><a href="#ecmascript-binding">4. ECMAScript binding</a><ul><li><a href="#es-environment">4.1. ECMAScript environment</a></li><li><a href="#es-type-mapping">4.2. ECMAScript type mapping</a><ul><li><a href="#es-any">4.2.1. any</a></li><li><a href="#es-void">4.2.2. void</a></li><li><a href="#es-boolean">4.2.3. boolean</a></li><li><a href="#es-byte">4.2.4. byte</a></li><li><a href="#es-octet">4.2.5. octet</a></li><li><a href="#es-short">4.2.6. short</a></li><li><a href="#es-unsigned-short">4.2.7. unsigned short</a></li><li><a href="#es-long">4.2.8. long</a></li><li><a href="#es-unsigned-long">4.2.9. unsigned long</a></li><li><a href="#es-long-long">4.2.10. long long</a></li><li><a href="#es-unsigned-long-long">4.2.11. unsigned long long</a></li><li><a href="#es-float">4.2.12. float</a></li><li><a href="#es-unrestricted-float">4.2.13. unrestricted float</a></li><li><a href="#es-double">4.2.14. double</a></li><li><a href="#es-unrestricted-double">4.2.15. unrestricted double</a></li><li><a href="#es-DOMString">4.2.16. DOMString</a></li><li><a href="#es-object">4.2.17. object</a></li><li><a href="#es-interface">4.2.18. Interface types</a></li><li><a href="#es-dictionary">4.2.19. Dictionary types</a></li><li><a href="#es-enumeration">4.2.20. Enumeration types</a></li><li><a href="#es-callback-function">4.2.21. Callback function types</a></li><li><a href="#es-nullable-type">4.2.22. Nullable types — <var>T</var>?</a></li><li><a href="#es-sequence">4.2.23. Sequences — sequence<<var>T</var>></a></li><li><a href="#es-array">4.2.24. Arrays — <var>T</var>[]</a><ul><li><a href="#platform-array-object-getownproperty">4.2.24.1. Platform array object [[GetOwnProperty]] method</a></li><li><a href="#platform-array-object-defineownproperty">4.2.24.2. Platform array object [[DefineOwnProperty]] method</a></li><li><a href="#platform-array-object-delete">4.2.24.3. Platform array object [[Delete]] method</a></li></ul></li><li><a href="#es-union">4.2.25. Union types</a></li><li><a href="#es-Date">4.2.26. Date</a></li></ul></li><li><a href="#es-extended-attributes">4.3. ECMAScript-specific extended attributes</a><ul><li><a href="#ArrayClass">4.3.1. [ArrayClass]</a></li><li><a href="#Clamp">4.3.2. [Clamp]</a></li><li><a href="#Constructor">4.3.3. [Constructor]</a></li><li><a href="#EnforceRange">4.3.4. [EnforceRange]</a></li><li><a href="#ImplicitThis">4.3.5. [ImplicitThis]</a></li><li><a href="#LenientThis">4.3.6. [LenientThis]</a></li><li><a href="#NamedConstructor">4.3.7. [NamedConstructor]</a></li><li><a href="#NoInterfaceObject">4.3.8. [NoInterfaceObject]</a></li><li><a href="#OverrideBuiltins">4.3.9. [OverrideBuiltins]</a></li><li><a href="#PutForwards">4.3.10. [PutForwards]</a></li><li><a href="#Replaceable">4.3.11. [Replaceable]</a></li><li><a href="#NamedPropertiesObject">4.3.12. [NamedPropertiesObject]</a></li><li><a href="#TreatNonCallableAsNull">4.3.13. [TreatNonCallableAsNull]</a></li><li><a href="#TreatNullAs">4.3.14. [TreatNullAs]</a></li><li><a href="#TreatUndefinedAs">4.3.15. [TreatUndefinedAs]</a></li><li><a href="#Unforgeable">4.3.16. [Unforgeable]</a></li></ul></li><li><a href="#es-interfaces">4.4. Interfaces</a><ul><li><a href="#interface-object">4.4.1. Interface object</a><ul><li><a href="#es-interface-call">4.4.1.1. Interface object [[Call]] method</a></li></ul></li><li><a href="#named-constructors">4.4.2. Named constructors</a></li><li><a href="#interface-prototype-object">4.4.3. Interface prototype object</a></li><li><a href="#named-properties-object">4.4.4. Named properties object</a><ul><li><a href="#named-properties-object-getownproperty">4.4.4.1. Named properties object [[GetOwnProperty]] method</a></li></ul></li><li><a href="#es-constants">4.4.5. Constants</a></li><li><a href="#es-attributes">4.4.6. Attributes</a></li><li><a href="#es-operations">4.4.7. Operations</a></li></ul></li><li><a href="#es-implements-statements">4.5. Implements statements</a></li><li><a href="#es-platform-objects">4.6. Platform objects implementing interfaces</a><ul><li><a href="#indexed-and-named-properties">4.6.1. Indexed and named properties</a></li><li><a href="#getownproperty">4.6.2. Platform object [[GetOwnProperty]] method</a></li><li><a href="#defineownproperty">4.6.3. Platform object [[DefineOwnProperty]] method</a></li><li><a href="#delete">4.6.4. Platform object [[Delete]] method</a></li><li><a href="#call">4.6.5. Platform object [[Call]] method</a></li><li><a href="#property-enumeration">4.6.6. Property enumeration</a></li></ul></li><li><a href="#es-user-objects">4.7. User objects implementing callback interfaces</a></li><li><a href="#es-invoking-callback-functions">4.8. Invoking callback functions</a></li><li><a href="#es-exceptions">4.9. Exceptions</a><ul><li><a href="#es-exception-interface-object">4.9.1. Exception interface object</a><ul><li><a href="#es-exception-call">4.9.1.1. Exception interface object [[Call]] method</a></li></ul></li><li><a href="#es-exception-interface-prototype-object">4.9.2. Exception interface prototype object</a></li><li><a href="#es-exception-constants">4.9.3. Constants</a></li><li><a href="#es-exception-fields">4.9.4. Exception fields</a></li></ul></li><li><a href="#es-exception-objects">4.10. Exception objects</a></li><li><a href="#es-throwing-exceptions">4.11. Throwing exceptions</a></li><li><a href="#es-handling-exceptions">4.12. Handling exceptions</a></li></ul></li><li><a href="#common">5. Common definitions</a><ul><li><a href="#common-DOMTimeStamp">5.1. DOMTimeStamp</a></li><li><a href="#common-Function">5.2. Function</a></li><li><a href="#common-VoidFunction">5.3. VoidFunction</a></li></ul></li><li><a href="#extensibility">6. Extensibility</a></li><li><a href="#referencing">7. Referencing this specification</a></li><li><a href="#acknowledgements">8. Acknowledgements</a></li></ul><ul><li><a href="#idl-grammar">A. IDL grammar</a></li><li><a href="#references">B. References</a><ul><li><a href="#normative-references">B.1. Normative references</a></li><li><a href="#informative-references">B.2. Informative references</a></li></ul></li><li><a href="#cr-exit">C. Candidate Recommendation exit criteria</a></li><li><a href="#changes">D. Changes</a></li></ul></div>
</div>
<div id="sections">
<div id="introduction" class="section">
<h2>1. 소개</h2>
<p class="norm">이 부분은 정보성 부분입니다.</p>
<p>
W3C에 의해 발간되는 프로그래밍 언어 인터페이스들을 포함하는 기술 리포트들은, 일반적으로 Object Management Group’s Interface Definition Language (IDL), 즉 <a href="#ref-OMGIDL">[OMGIDL]</a> 을 사용하여 설명되어 왔습니다.
IDL은 이러한 인터페이스들을 언어 독립적인 방법으로 설명하기 위한 방법을 제공합니다. 보통 그러한 문서들에는, IDL로 설명된 그 인터페이스들을 주어진 언어로 구성하는데에 어떻게 부합하는지에 대한 추가적인 언어 연결 부록들이 포함됩니다.
<!-- Technical reports published by the W3C that include programming
language interfaces have typically been described using the
Object Management Group’s Interface Definition Language (IDL)
<a href="#ref-OMGIDL">[OMGIDL]</a>. The IDL provides a means to
describe these interfaces in a language independent manner. Usually,
additional language binding appendices are included in such
documents which detail how the interfaces described with the IDL
correspond to constructs in the given language. -->
</p>
<p>
하지만, 이러한 사양들에서 웹에서 가장 일반적으로 사용되는 언어인 ECMAScript를 위한 연결들은
계속해서 충분치 못한 정확성을 갖고 정의되어왔고, 그 결과 상호 운용성 문제들을 일으키게 되었습니다.
게다가, 각 사양들은 같은 기본 정보들을 설명해야만 하는데, 예들들어 IDL로 설명되는 DOM 인터페이스들은 ECMAScript 전역 객체의 속성들에 해당한다거나, 또는 <a class="idltype" href="#idl-unsigned-long">unsigned long</a> IDL 타입은 ECMAScript의 <span class="estype">Number</span> 타입으로 옮겨져야 한다는 것입니다.
<!-- However, the bindings in these specifications for the language most
commonly used on the web, ECMAScript, are consistently specified with
low enough precision as to result in interoperability issues. In
addition, each specification must describe the same basic information,
such as DOM interfaces described in IDL corresponding to properties
on the ECMAScript global object, or the <a class="idltype" href="#idl-unsigned-long">unsigned
long</a> IDL type mapping to the <span class="estype">Number</span>
type in ECMAScript. -->
</p>
<p>
이 사양은, Web API들을 위한 인터페이스들을 정의하는 사양들에서 사용하기 위한 OMG IDL과 비슷한 IDL 언어를 정의합니다.
예전의 문장들내에서 작성되어져 왔어야 했던 일반적인 기능을 지원하기 위해 많은 확장들이 IDL에서 주어집니다.
또한, ECMAScript 5.1판을 위한 정확한 언어 연결들이 주어집니다.
<!-- This specification defines an IDL language similar to OMG IDL
for use by specifications that define interfaces for Web APIs. A number of extensions are
given to the IDL to support common functionality that previously must
have been written in prose. In addition, precise language bindings
for ECMAScript Edition 5.1 are given. -->
</p>
<div id="conventions" class="section">
<h3>1.1. 표기 규칙</h3>
<p>
이 문서에는 다음의 표기 규칙이 사용되었습니다:
</p>
<ul>
<li>용어들의 사례들을 정의: <dfn id="dfn-example-term">example term</dfn></li>
<li>이 문서내에 정의된 용어로의 링크: <a class="dfnref" href="#dfn-example-term">example term</a></li>
<li>다른 문서내에 정의된 용어로의 링크: <a class="dfnref external" href="#dfn-example-term">example term</a></li>
<li>문법 기호들: <span class="sym">ExampleGrammarSymbol</span></li>
<li>IDL과 ECMAScript 타입들: <span class="idltype">ExampleType</span></li>
<li>코드 fragment: <code>a = b + obj.f()</code></li>
<li>유니코드 문자들: <span class="char">U+0030 DIGIT ZERO ("0")</span></li>
<li>확장 속성: <span class="xattr">[ExampleExtendedAttribute]</span></li>
<li>문장과 알고리즘들 내의 변수 이름들: <var>exampleVariableName</var>.</li>
<li>IDL 약식 구문 예제들:
<pre class="syntax">interface <i>identifier</i> {
<em>interface-members…</em>
};</pre>
(빨간 문자는 그 주위의 문장에서 논의되는 구문의 특정 부분을 강조하기 위해 사용되었습니다.)</li>
<li>IDL 문법 fragment들:
<table class="grammar">
<tr><td><span class="prod-number">[5]</span></td><td><span class="sym">ExampleGrammarSymbol</span></td><td class="prod-mid">→</td><td><span class="prod-lines">OtherSymbol "sometoken"<br /> | AnotherSymbol<br /> | ε <span class="comment">// nothing</span></span></td></tr>
</table>
(각각의 문법 규칙은 참조를 위해 숫자가 매겨지고, 그 왼쪽에 보여집니다.)</li>
<li>비 규범적인 노트들: <div class="note"><div class="noteHeader">노트</div><p>이것은 노트입니다.</p></div></li>
<li>비 규범적인 예제들: <div class="example"><div class="exampleHeader">예제</div><p>이것은 예제입니다.</p></div></li>
<li>규범적인 경고들: <div class="warning"><div class="warningHeader">경고</div><p>이것은 경고입니다.</p></div></li>
<li>코드 블록들: <div class="block"><div class="blockTitleDiv"><span class="blockTitle">IDL</span></div><div class="blockContent"><pre class="code"><code class="idl-code"><span class="comment">// 이것은 IDL 코드 블록입니다.</span>
interface 예제 {
attribute long something;
};</code></pre></div></div>
<div class="block"><div class="blockTitleDiv"><span class="blockTitle">ECMAScript</span></div><div class="blockContent"><pre class="code"><code class="es-code"><span class="comment">// 이것은 ECMAScript 코드 블록입니다.</span>
window.onload = function() { window.alert("loaded"); };</code></pre></div></div></li>
</ul>
</div>
</div>
<div id="conformance" class="section">
<h2>2. Conformance</h2>
<p>
이 사양내에서 도표들, 예제들, 노트들 그리고 정보성이라고 표시된 섹션들을 제외한 모든것들은 규범적입니다.
<!-- Everything in this specification is normative except for diagrams, examples, notes and sections marked as being informative. -->
</p>
<p>
이 문서 내에 “<span class="rfc2119">MUST</span>”,
“<span class="rfc2119">MUST NOT</span>”,
“<span class="rfc2119">REQUIRED</span>”,
“<span class="rfc2119">SHALL</span>”,
“<span class="rfc2119">SHALL NOT</span>”,
“<span class="rfc2119">SHOULD</span>”,
“<span class="rfc2119">SHOULD NOT</span>”,
“<span class="rfc2119">RECOMMENDED</span>”,
“<span class="rfc2119">MAY</span>” 그리고
“<span class="rfc2119">OPTIONAL</span>” 와 같은 주요 단어들은,
<cite><a href="http://tools.ietf.org/html/rfc2119">Key words for use in RFCs to
Indicate Requirement Levels</a></cite>
<a href="#ref-RFC2119">[RFC2119]</a>에서 설명된것과 같이 해석될 수 있습니다.
The keywords “<span class="rfc2119">MUST</span>”,
“<span class="rfc2119">MUST NOT</span>”,
“<span class="rfc2119">REQUIRED</span>”,
“<span class="rfc2119">SHALL</span>”,
“<span class="rfc2119">SHALL NOT</span>”,
“<span class="rfc2119">SHOULD</span>”,
“<span class="rfc2119">SHOULD NOT</span>”,
“<span class="rfc2119">RECOMMENDED</span>”,
“<span class="rfc2119">MAY</span>” and
“<span class="rfc2119">OPTIONAL</span>” in this document are to be
interpreted as described in
<cite><a href="http://tools.ietf.org/html/rfc2119">Key words for use in RFCs to
Indicate Requirement Levels</a></cite>
<a href="#ref-RFC2119">[RFC2119]</a>.
</p>
<p>
다음의 적합성 class들이 이 사양에서 정의됩니다:
<!--The following conformance classes are defined by this specification:-->
</p>
<dl>
<dt><dfn id="dfn-conforming-idl-fragment">conforming IDL fragment</dfn></dt>
<dd>
<p>
한 <a class="dfnref" href="#dfn-idl-fragment">IDL fragment</a>가 <span class="rfc2119">MUST</span>-,
<span class="rfc2119">REQUIRED</span>- and <span class="rfc2119">SHALL</span>-레벨의 모든 기준을 만족할 경우 <a class="dfnref" href="#dfn-conforming-idl-fragment">conforming
IDL fragment</a>이라고 여겨진다.
<!--
An <a class="dfnref" href="#dfn-idl-fragment">IDL fragment</a> is considered
to be a <a class="dfnref" href="#dfn-conforming-idl-fragment">conforming
IDL fragment</a> if it satisfies all of the
<span class="rfc2119">MUST</span>-,
<span class="rfc2119">REQUIRED</span>- and <span class="rfc2119">SHALL</span>-level
criteria in this specification that apply to IDL fragments.
-->
</p>
</dd>
<dt><dfn id="dfn-conforming-implementation">conforming implementation</dfn></dt>
<dd>
<p>
A user agent is considered to be a
<a class="dfnref" href="#dfn-conforming-implementation">conforming implementation</a>
relative to a <a class="dfnref" href="#dfn-conforming-idl-fragment">conforming
IDL fragment</a> if it satisfies all of the <span class="rfc2119">MUST</span>-,
<span class="rfc2119">REQUIRED</span>- and <span class="rfc2119">SHALL</span>-level
criteria in this specification that apply to implementations for all language
bindings that the user agent supports.
</p>
</dd>
<dt><dfn id="dfn-conforming-ecmascript-implementation">conforming ECMAScript implementation</dfn></dt>
<dd>
<p>
A user agent is considered to be a
<a class="dfnref" href="#dfn-conforming-ecmascript-implementation">conforming ECMAScript implementation</a>
relative to a <a class="dfnref" href="#dfn-conforming-idl-fragment">conforming
IDL fragment</a> if it satisfies all of the <span class="rfc2119">MUST</span>-,
<span class="rfc2119">REQUIRED</span>- and <span class="rfc2119">SHALL</span>-level
criteria in this specification that apply to implementations for the ECMAScript
language binding.
</p>
</dd>
</dl>
</div>
<div id="idl" class="section">
<h2>3. 인터페이스 정의 언어 (Interface definition language)</h2>
<p>
이 부분은 웹 플랫폼 내의 API들을 위한 인터페이스들을 정의하기 위해 사용될 수 있는 Web IDL 언어를 정의한다.
Web API들을 정의하는 사양은, 그 사양에 의해 정의되는 API를 위한 인터페이스들(객체들이 보여줄 수 있는 상태와 행위)을 정의하는 하나 이상의 <dfn id="dfn-idl-fragment">IDL fragment들</dfn>을 포함할 수 있다.
한 <a class="dfnref" href="#dfn-idl-fragment">IDL fragment</a>은 <a class="sym" href="#prod-Definitions">Definitions</a> 문법 기호에 필적하는 정의들의 한 연속이다.
한 구현이 지원하는 <a class="dfnref" href="#dfn-idl-fragment">IDL fragment들</a>의 집합은 순서없이 나열된다.
전체적이 문법과 사용된 표기법의 설명은, <a href="#idl-grammar">부록 A</a>를 확인하라.
<!-- This section describes a language, <em>Web IDL</em>, which can be used to define
interfaces for APIs in the Web platform. A specification that defines Web APIs
can include one or more <dfn id="dfn-idl-fragment">IDL fragments</dfn> that
describe the interfaces (the state and behavior that objects can exhibit)
for the APIs defined by that specification.
An <a class="dfnref" href="#dfn-idl-fragment">IDL fragment</a> is
a sequence of definitions that matches the <a class="sym" href="#prod-Definitions">Definitions</a> grammar symbol.
The set of <a class="dfnref" href="#dfn-idl-fragment">IDL fragments</a> that
an implementation supports is not ordered.
See <a href="#idl-grammar">Appendix A</a> for the complete grammar and an explanation of the notation used. -->
</p>
<p>
<a class="dfnref" href="#dfn-idl-fragment">IDL fragment</a>에서 나타날 수 있는 다른 종류의 <dfn id="dfn-definition">정의들</dfn>은:
<a class="dfnref" href="#dfn-interface">interface들</a>,
<a class="dfnref" href="#dfn-partial-interface">부분 interface 정의들</a>,
<a class="dfnref" href="#dfn-dictionary">dictionary 들</a>,
<a class="dfnref" href="#dfn-partial-dictionary">부분 dictionary 정의들</a>,
<a class="dfnref" href="#dfn-exception">exception들</a>,
<a class="dfnref" href="#dfn-typedef">typedef들</a> 그리고
<a class="dfnref" href="#dfn-implements-statement">implements 문(statements)</a> 이다.
이들은 모두 다음의 섹션에서 정의된다.
<!-- The different kinds of <dfn id="dfn-definition">definitions</dfn> that can appear in an
<a class="dfnref" href="#dfn-idl-fragment">IDL fragment</a> are:
<a class="dfnref" href="#dfn-interface">interfaces</a>,
<a class="dfnref" href="#dfn-partial-interface">partial interface definitions</a>,
<a class="dfnref" href="#dfn-dictionary">dictionaries</a>,
<a class="dfnref" href="#dfn-partial-dictionary">partial dictionary definitions</a>,
<a class="dfnref" href="#dfn-exception">exceptions</a>,
<a class="dfnref" href="#dfn-typedef">typedefs</a> and
<a class="dfnref" href="#dfn-implements-statement">implements statements</a>.
These are all defined in the following sections. -->
</p>
<p>
각각의 <a class="dfnref" href="#dfn-definition">정의</a> (<a class="sym" href="#prod-Definition">Definition</a>에 부합하는)는,
언어 연결들에서 그 정의가 어떻게 다뤄질지를 제어할 수 있는 <a class="dfnref" href="#dfn-extended-attribute">확장 속성들</a> (<a class="sym" href="#prod-ExtendedAttributeList">ExtendedAttributeList</a>에 부합하는)의 목록들을 앞에 둘 수 있다.
이 사양에 의해 정의되는 언어 연결시 상호 운용 가능한(역주: "the language binding agnostic"의 의역, 여러 언어들에서 상호 운용할 수 있도록 일반화 가능함을 의미) 확장 속성들은 <a href="#idl-extended-attributes">섹션 3.11</a>에서 논의되며,
그러한 사양들의 ECMAScript 언어 연결은 <a href="#es-extended-attributes">섹션 4.3</a>에서 논의된다.
<!-- Each <a class="dfnref" href="#dfn-definition">definition</a>
(matching <a class="sym" href="#prod-Definition">Definition</a>)
can be preceded by a list of <a class="dfnref" href="#dfn-extended-attribute">extended attributes</a> ,
which can control how the definition will be handled in language bindings.
The extended attributes defined by this specification that are language binding
agnostic are discussed in <a href="#idl-extended-attributes">section 3.11</a>,
while those specific to the ECMAScript language binding are discussed
in <a href="#es-extended-attributes">section 4.3</a>. -->
</p>
<pre class="syntax">[<em>extended-attributes</em>]
interface <i>identifier</i> {
<i>interface-members…</i>
};</pre>
<table class="grammar"><tr id="proddef-Definitions"><td><span class="prod-number">[1]</span></td><td><a class="sym" href="#prod-Definitions">Definitions</a></td><td class="prod-mid">→</td><td class="prod-rhs"><span class="prod-lines"><a class="sym" href="#prod-ExtendedAttributeList">ExtendedAttributeList</a> <a class="sym" href="#prod-Definition">Definition</a> <a class="sym" href="#prod-Definitions">Definitions</a> <br /> |
ε</span></td></tr><tr id="proddef-Definition"><td><span class="prod-number">[2]</span></td><td><a class="sym" href="#prod-Definition">Definition</a></td><td class="prod-mid">→</td><td class="prod-rhs"><span class="prod-lines"><a class="sym" href="#prod-CallbackOrInterface">CallbackOrInterface</a> <br /> |
<a class="sym" href="#prod-Partial">Partial</a> <br /> |
<a class="sym" href="#prod-Dictionary">Dictionary</a> <br /> |
<a class="sym" href="#prod-Exception">Exception</a> <br /> |
<a class="sym" href="#prod-Enum">Enum</a> <br /> |
<a class="sym" href="#prod-Typedef">Typedef</a> <br /> |
<a class="sym" href="#prod-ImplementsStatement">ImplementsStatement</a></span></td></tr><tr id="proddef-CallbackOrInterface"><td><span class="prod-number">[3]</span></td><td><a class="sym" href="#prod-CallbackOrInterface">CallbackOrInterface</a></td><td class="prod-mid">→</td><td class="prod-rhs"><span class="prod-lines">"callback" <a class="sym" href="#prod-CallbackRestOrInterface">CallbackRestOrInterface</a> <br /> |
<a class="sym" href="#prod-Interface">Interface</a></span></td></tr></table>
<div class="example"><div class="exampleHeader">예제</div>
<p>
다음은 <a class="dfnref" href="#dfn-idl-fragment">IDL fragment</a>의 예제이다.
<!-- The following is an example of an <a class="dfnref" href="#dfn-idl-fragment">IDL fragment</a>. -->
</p>
<div class="block"><div class="blockTitleDiv"><span class="blockTitle">IDL</span></div><div class="blockContent"><pre class="code"><code class="idl-code">exception GraphicsException {
DOMString reason;
};
interface Paint { };
interface SolidColor : Paint {
attribute float red;
attribute float green;
attribute float blue;
};
interface Pattern : Paint {
attribute DOMString imageURL;
};
[Constructor]
interface GraphicalWindow {
readonly attribute unsigned long width;
readonly attribute unsigned long height;
attribute Paint currentPaint;
void drawRectangle(float x, float y, float width, float height)<!--
raises(GraphicsException)-->;
void drawText(float x, float y, DOMString text)<!--
raises(GraphicsException)-->;
};</code></pre></div></div>
<p>
여기서는, 네 개의 <a class="dfnref" href="#dfn-interface">interface</a>들과
하나의 <a class="dfnref" href="#dfn-exception">exception</a>이 정의되고 있다.
<span class="idltype">GraphicalWindow</span> interface는 두 개의
<a class="dfnref" href="#dfn-read-only">read only</a> <a class="dfnref" href="#dfn-attribute">속성</a>들,
하나의 쓰기 가능한 속성, 그리고 그 인터페이스 상에 정의된 두 개의 <a class="dfnref" href="#dfn-operation">operation</a>을 가진다.
<span class="idltype">GraphicalWindow</span> interface를 구현(implement)하는 객체는, 사용되는 특정 언어에 적합한 방식으로 이러한 속성들과 operation을 노출하게 될 것이다.
<!-- Here, four <a class="dfnref" href="#dfn-interface">interfaces</a> and one
<a class="dfnref" href="#dfn-exception">exception</a> are being defined.
The <span class="idltype">GraphicalWindow</span> interface has two
<a class="dfnref" href="#dfn-read-only">read only</a> <a class="dfnref" href="#dfn-attribute">attributes</a>,
one writable attribute, and two <a class="dfnref" href="#dfn-operation">operations</a>
defined on it. Objects that implement the <span class="idltype">GraphicalWindow</span> interface
will expose these attributes and operations in a manner appropriate to the
particular language being used. -->
</p>
<p>
ECMAScript에서는 IDL interface상의 attribute들은 접근자 속성들로, operation들은 모든 <span class="idltype">GraphicalWindow</span> 객체의 prototype 객체에 <span class="estype">Function</span>값화(化)된 데이터 속성들로서 존재하여 <span class="idltype">GraphicalWindow</span>를 implements하는 각 ECMAScript 객체들이 자신의 prototype 체인에 그 prototype 객체를 가지게 되도록 노출될 것이다.
<!--역주
attribute는 IDL에서 실제 쓰이는 키워드이므로 번역하지 않고 그냥 두었고,
property는 "속성"으로 번역함.
http://en.wikipedia.org/wiki/Attribute_(computing)
http://en.wikipedia.org/wiki/Property_(programming)
-->
<!-- In ECMAScript, the attributes on the IDL interfaces will be exposed as accessor
properties and the operations as <span class="estype">Function</span>-valued
data properties on a prototype object for all <span class="idltype">GraphicalWindow</span>
objects; each ECMAScript object that implements <span class="idltype">GraphicalWindow</span>
will have that prototype object in its prototype chain. -->
</p>
<!--JAVA
<p>
In Java, there will exist a Java interface that corresponds to the IDL
<span class='idltype'>GraphicalWindow</span> interface. This Java interface
will have methods that correspond to the operations, and getter and setter
methods that correspond to the attributes. Java objects that are considered
to implement the IDL <span class='idltype'>GraphicalWindow</span> interface
will implement the corresponding Java interface.
</p>
-->
<p>
<span class="idltype">GraphicalWindow</span>에 나타나는 <a class="xattr" href="#Constructor">[Constructor]</a>는 <a class="dfnref" href="#dfn-extended-attribute">확장 속성</a>이다.
이 확장 속성은, <code>new GraphicalWindow()</code>를 호출하면 그 인터페이스가 구현된 새로운 객체가 반환될 수 있도록 ECMAScript 구현에 존재하는 생성자를 만들게 된다.
<!-- The <a class="xattr" href="#Constructor">[Constructor]</a> that appears on <span class="idltype">GraphicalWindow</span>
is an <a class="dfnref" href="#dfn-extended-attribute">extended attribute</a>.
This extended attribute causes a constructor to exist in ECMAScript implementations,
so that calling <code>new GraphicalWindow()</code> would return a new object
that implemented the interface. \<!--JAVA The <a class='xattr' href='#Constructor'>[Constructor]</a>
extended attribute has no effect in the Java language binding, however.--\> -->
</p>
</div>
<div id="idl-names" class="section">
<h3>3.1. 이름 <!-- Names --></h3>
<p>
모든 <a class="dfnref" href="#dfn-interface">interface</a>,
<a class="dfnref" href="#dfn-partial-interface">부분 interface 정의</a>,
<a class="dfnref" href="#dfn-dictionary">dictionary</a>,
<a class="dfnref" href="#dfn-partial-dictionary">부분 dictionary 정의</a>,
<a class="dfnref" href="#dfn-exception">exception</a>,
<a class="dfnref" href="#dfn-enumeration">enumeration</a>,
<a class="dfnref" href="#dfn-callback-function">callback function</a> 그리고
<a class="dfnref" href="#dfn-typedef">typedef</a> (모두 <dfn id="dfn-named-definition">named definitions</dfn> 라고 불리는)
그리고 모든 <a class="dfnref" href="#dfn-constant">constant</a>,
<a class="dfnref" href="#dfn-attribute">attribute</a>,
<a class="dfnref" href="#dfn-exception-field">exception 필드</a>
and <a class="dfnref" href="#dfn-dictionary-member">dictionary 멤버</a>는 <a class="dfnref" href="#dfn-operation">operations</a>들과 같이 하나의 <dfn id="dfn-identifier">식별자</dfn>를 가진다.
식별자는 선언내 어딘가에 있는 <a class="sym" href="#prod-identifier">identifier</a> 토큰에 의해 결정된다:
<!--Every <a class="dfnref" href="#dfn-interface">interface</a>,
<a class="dfnref" href="#dfn-partial-interface">partial interface definition</a>,
<a class="dfnref" href="#dfn-dictionary">dictionary</a>,
<a class="dfnref" href="#dfn-partial-dictionary">partial dictionary definition</a>,
<a class="dfnref" href="#dfn-exception">exception</a>,
<a class="dfnref" href="#dfn-enumeration">enumeration</a>,
<a class="dfnref" href="#dfn-callback-function">callback function</a> and
<a class="dfnref" href="#dfn-typedef">typedef</a> (together called <dfn id="dfn-named-definition">named definitions</dfn>)
and every <a class="dfnref" href="#dfn-constant">constant</a>,
<a class="dfnref" href="#dfn-attribute">attribute</a>,
<a class="dfnref" href="#dfn-exception-field">exception field</a>
and <a class="dfnref" href="#dfn-dictionary-member">dictionary member</a> has an
<dfn id="dfn-identifier">identifier</dfn>, as do some
<a class="dfnref" href="#dfn-operation">operations</a>.
The identifier is determined by an
<a class="sym" href="#prod-identifier">identifier</a> token somewhere
in the declaration: -->
</p>
<ul>
<li>
<a class="dfnref" href="#dfn-named-definition">named definitions</a>에서는,
<code>interface</code>,
<code>dictionary</code>, <code>exception</code>, <code>enum</code>
또는 <code>callback</code> 키워드 바로 뒤에 나타나는 <a class="sym" href="#prod-identifier">identifier</a> 토큰이 그 정의의 식별자를 결정한다.
<pre class="syntax">interface <em>interface-identifier</em> { <i>interface-members…</i> };
partial interface <em>interface-identifier</em> { <i>interface-members…</i> };
exception <em>exception-identifier</em> { <i>exception-members…</i> };
dictionary <em>dictionary-identifier</em> { <i>dictionary-members…</i> };
partial dictionary <em>dictionary-identifier</em> { <i>dictionary-members…</i> };
enum <em>enumeration-identifier</em> { <i>enumeration-values…</i> };
callback <em>callback-identifier</em> = <i>callback-signature</i>;</pre>
</li>
<li>
<a class="dfnref" href="#dfn-attribute">attributes</a>,
<a class="dfnref" href="#dfn-typedef">typedefs</a>, <a class="dfnref" href="#dfn-exception-field">exception fields</a>
그리고 <a class="dfnref" href="#dfn-dictionary-member">dictionary members</a>에서는,
정의의 끝에있는 세미콜론 앞의 최종 <a class="sym" href="#prod-identifier">identifier</a> 토큰이 식별자를 결정한다.
<!-- For <a class="dfnref" href="#dfn-attribute">attributes</a>,
<a class="dfnref" href="#dfn-typedef">typedefs</a>, <a class="dfnref" href="#dfn-exception-field">exception fields</a>
and <a class="dfnref" href="#dfn-dictionary-member">dictionary members</a>,
the final <a class="sym" href="#prod-identifier">identifier</a> token before the
semicolon at the end of the declaration determines the identifier. -->
<pre class="syntax">interface <i>identifier</i> {
attribute <i>type</i> <em>attribute-identifier</em>;
};
typedef <i>type</i> <em>typedef-identifier</em>;
exception <i>identifier</i> {
<i>type</i> <em>exception-member-identifier</em>;
};
dictionary <i>identifier</i> {
<i>type</i> <em>dictionary-member-identifier</em>;
};</pre>
</li>
<li>
<a class="dfnref" href="#dfn-constant">constants</a>에서는,
이퀄(=) 표시 앞의 <a class="sym" href="#prod-identifier">identifier</a> 토큰이 식별자를 정의한다.
<!-- For <a class="dfnref" href="#dfn-constant">constants</a>,
the <a class="sym" href="#prod-identifier">identifier</a> token before the
equals sign determines the identifier. -->
<pre class="syntax">const <i>type</i> <em>constant-identifier</em> = <i>value</i>;</pre>
</li>
<li>
<a class="dfnref" href="#dfn-operation">operations</a>에서는,
반환 타입의 뒤, 열림 괄호 앞에오는 (<a class="sym" href="#prod-Operation">Operation</a> 내에 <a class="sym" href="#prod-OptionalIdentifier">OptionalIdentifier</a> 문법 표시 부분에 해당한다)
<a class="sym" href="#prod-identifier">identifier</a> 토큰이 operation의 식별자를 결정한다.
만약 그러한 <a class="sym" href="#prod-identifier">identifier</a> 토큰이 없을 경우,
그 operation은 식별자를 갖지 않는다.
<!--For <a class="dfnref" href="#dfn-operation">operations</a>, the
<a class="sym" href="#prod-identifier">identifier</a> token that appears
after the return type but before the opening parenthesis (that is,
one that is matched as part of the <a class="sym" href="#prod-OptionalIdentifier">OptionalIdentifier</a>
grammar symbol in an <a class="sym" href="#prod-Operation">Operation</a>) determines the identifier of the operation. If
there is no such <a class="sym" href="#prod-identifier">identifier</a> token,
then the operation does not have an identifier. -->
<pre class="syntax"><i>return-type</i> <em>operation-identifier</em>(<i>arguments…</i>);</pre>
</li>
</ul>
<div class="note"><div class="noteHeader">노트</div>
<p>
Operation은 getter나 setter와 같이 <a href="#idl-special-operations">특별한 종류의 operation</a>들을 선언하기 위해 사용되고 있을때, 식별자를 가지지 않을 수 있다.
<!-- Operations can have no identifier when they are being used to declare a
<a href="#idl-special-operations">special kind of operation</a>, such as a getter or setter. -->
</p>
</div>
<p>
이러한 모든 constructs에서, <a class="dfnref" href="#dfn-identifier">식별자</a>는 <a class="sym" href="#prod-identifier">identifier</a>토큰의 값이고, 어떤 하나의 선두의 <span class="char">U+005F LOW LINE ("_")</span> 문자(밑줄)이든 제거된 상태이다.
<!-- For all of these constructs, the <a class="dfnref" href="#dfn-identifier">identifier</a>
is the value of the <a class="sym" href="#prod-identifier">identifier</a> token with any single leading
<span class="char">U+005F LOW LINE ("_")</span> character (underscore) removed. -->
</p>
<div class="note"><div class="noteHeader">노트</div>
<p>
선두의 <span class="char">"_"</span>는, 식별자를 예약어 처럼 보이지 않도록 escape하기 위해 사용된다.
예들 들어, “interface” 라고 명명된 인터페이스가 정의될 수 있다. 선두의 <span class="char">"_"</span>는 그 식별자를 unescape 하기 위해 떨어져나가게 된다.
<!-- A leading <span class="char">"_"</span> is used to escape an identifier from looking
like a reserved word so that, for example, an interface named “interface” can be
defined. The leading <span class="char">"_"</span> is dropped to unescape the
identifier. -->
</p>
</div>
<p>
Operation 인자들은 조금 더 넓은 집합의 식별자들을 가질 수 있다.
한 operation 선언에서, 인자들의 식별자는 그 타입 바로 뒤에 즉시 명시되고, <a class="sym" href="#prod-identifier">identifier</a> 토큰 또는 <a class="sym" href="#prod-ArgumentNameKeyword">ArgumentNameKeyword</a> 표시에 부합하는 키워드들중에 하나에 의해 주어진다.
만약 이러한 키워드들중에 하나가 사용된다면, 밑줄로 시작하여 escape될 필요가 없다.
<!-- Operation arguments can take a slightly wider set of identifiers. In an operation
declaration, the identifier of an argument is specified immediately after its
type and is given by either an <a class="sym" href="#prod-identifier">identifier</a>
token or by one of the keywords that match the <a class="sym" href="#prod-ArgumentNameKeyword">ArgumentNameKeyword</a>
symbol. If one of these keywords is used, it need not be escaped with a leading
underscore. -->
</p>
<pre class="syntax"><i>return-type</i> <i>operation-identifier</i>(<i>argument-type</i> <em>argument-identifier</em>, …);</pre>
<table class="grammar"><tr id="proddef-ArgumentNameKeyword"><td><span class="prod-number">[55]</span></td><td><a class="sym" href="#prod-ArgumentNameKeyword">ArgumentNameKeyword</a></td><td class="prod-mid">→</td><td class="prod-rhs"><span class="prod-lines">
"attribute" <br /> |
"callback" <br /> |
"const" <br /> |
"creator" <br /> |
"deleter" <br /> |
"dictionary"
<br /> |
"enum" <br /> |
"exception" <br /> |
"getter" <br /> |
"implements" <br /> |
"inherit" <br /> |
"interface"
<br /> |
"legacycaller" <br /> |
"partial" <br /> |
"setter" <br /> |
"static" <br /> |
"stringifier" <br /> |
"typedef"
<br /> |
"unrestricted"
</span></td></tr></table>
<p>
만약 한 <a class="sym" href="#prod-identifier">identifier</a> 토큰이 사용된다면, 그 operation 인자의 <a class="dfnref" href="#dfn-identifier">식별자</a>는 그 토큰의 값이고, 그 값은 어떠한 단일 선두 <span class="char">U+005F LOW LINE ("_")</span> 문자(밑줄)이든 제거된채로 사용된다.
만약 대신에 <a class="sym" href="#prod-ArgumentNameKeyword">ArgumentNameKeyword</a> 키워드 토큰중 하나가 사용된다면,
operation 인자의 <a class="dfnref" href="#dfn-identifier">식별자</a>가 저 토큰이다.
<!-- If an <a class="sym" href="#prod-identifier">identifier</a> token is used, then the
<a class="dfnref" href="#dfn-identifier">identifier</a> of the operation argument
is the value of that token with any single leading
<span class="char">U+005F LOW LINE ("_")</span> character (underscore) removed.
If instead one of the <a class="sym" href="#prod-ArgumentNameKeyword">ArgumentNameKeyword</a>
keyword token is used, then the <a class="dfnref" href="#dfn-identifier">identifier</a> of the operation argument
is simply that token. -->
</p>
<p>
상기의 IDL 구조 중 어떤 <a class="dfnref" href="#dfn-identifier">식별자</a>도 “prototype”, “constructor”, “toString”
이거나 또는 <span class="char">U+005F LOW LINE ("_")</span>문자로 시작<a class="rfc2119">해서는 안된다</a>.
이들은 <dfn id="dfn-reserved-identifier">예약된 식별자</dfn>로 알려져있다.
<!-- The <a class="dfnref" href="#dfn-identifier">identifier</a> of any of the abovementioned
IDL constructs <a class="rfc2119">MUST NOT</a> be “prototype”, “constructor”, “toString”
or begin with a <span class="char">U+005F LOW LINE ("_")</span> character. These
are known as <dfn id="dfn-reserved-identifier">reserved identifiers</dfn>. -->
</p>
<p>
주어진 구현이 지원하는 <a class="dfnref" href="#dfn-idl-fragment">IDL fragment들</a>의 집합 내에서,
모든 <a class="dfnref" href="#dfn-interface">interface</a>,
<a class="dfnref" href="#dfn-dictionary">dictionary</a>,
<a class="dfnref" href="#dfn-exception">exception</a>,
<a class="dfnref" href="#dfn-enumeration">enumeration</a>,
<a class="dfnref" href="#dfn-callback-function">callback function</a> 그리고
<a class="dfnref" href="#dfn-typedef">typedef</a>의 <a class="dfnref" href="#dfn-identifier">식별자</a>는
다른 어떤 <a class="dfnref" href="#dfn-interface">interface</a>,
<a class="dfnref" href="#dfn-dictionary">dictionary</a>,
<a class="dfnref" href="#dfn-exception">exception</a>,
<a class="dfnref" href="#dfn-enumeration">enumeration</a>,
<a class="dfnref" href="#dfn-callback-function">callback function</a> 또는
<a class="dfnref" href="#dfn-typedef">typedef</a>의 식별자와도 같지 <span class="rfc2119">않아야만 한다.</span>
<!-- Within the set of <a class="dfnref" href="#dfn-idl-fragment">IDL fragment들</a>
that a given implementation supports,
the <a class="dfnref" href="#dfn-identifier">identifier</a> of every
<a class="dfnref" href="#dfn-interface">interface</a>,
<a class="dfnref" href="#dfn-dictionary">dictionary</a>,
<a class="dfnref" href="#dfn-exception">exception</a>,
<a class="dfnref" href="#dfn-enumeration">enumeration</a>,
<a class="dfnref" href="#dfn-callback-function">callback function</a> and
<a class="dfnref" href="#dfn-typedef">typedef</a>
<span class="rfc2119">MUST NOT</span>
be the same as the identifier of any other
<a class="dfnref" href="#dfn-interface">interface</a>,
<a class="dfnref" href="#dfn-dictionary">dictionary</a>,
<a class="dfnref" href="#dfn-exception">exception</a>,
<a class="dfnref" href="#dfn-enumeration">enumeration</a>,
<a class="dfnref" href="#dfn-callback-function">callback function</a> or
<a class="dfnref" href="#dfn-typedef">typedef</a> -->
</p>
<p>
한 <a class="dfnref" href="#dfn-idl-fragment">IDL fragment</a>내에서,
한 <a class="dfnref" href="#dfn-definition">definition</a>으로의 참조는, 그 참조되는 definition의 선언 뒤에 나타날 필요는 없다.
참조는 또한 <a class="dfnref" href="#dfn-idl-fragment">IDL fragment들</a>간에 가로질러 만들어질 수도 있다.
<!-- Within an <a class="dfnref" href="#dfn-idl-fragment">IDL fragment</a>, a reference
to a <a class="dfnref" href="#dfn-definition">definition</a> need not appear after
the declaration of the referenced definition. References can also be made
across <a class="dfnref" href="#dfn-idl-fragment">IDL fragment들</a>. -->
</p>
<div class="example"><div class="exampleHeader">예제</div>
<p>그러므로, 다음의 <a class="dfnref" href="#dfn-idl-fragment">IDL fragment</a> 은 유효하다:</p>
<!--<p>Therefore, the following <a class="dfnref" href="#dfn-idl-fragment">IDL fragment</a> is valid:</p>-->
<div class="block"><div class="blockTitleDiv"><span class="blockTitle">IDL</span></div><div class="blockContent"><pre class="code"><code class="idl-code">interface B : A {
void f(ArrayOfLongs x);
};
interface A {
};
typedef long[] ArrayOfLongs;</code></pre></div></div>
</div>
<div class="example"><div class="exampleHeader">예제</div>
<p>
<p>
다음의 <a class="dfnref" href="#dfn-idl-fragment">IDL fragment</a>은 어떻게 <a class="dfnref" href="#dfn-identifier">식별자들</a>이 definition들, <a class="dfnref" href="#dfn-interface-member">interface 멤버들</a>
and <a class="dfnref" href="#dfn-exception-member">exception 멤버들</a>에 주어지는지를 보여준다.
<!-- The following <a class="dfnref" href="#dfn-idl-fragment">IDL fragment</a>
demonstrates how <a class="dfnref" href="#dfn-identifier">identifiers</a>
are given to definitions, <a class="dfnref" href="#dfn-interface-member">interface members</a>
and <a class="dfnref" href="#dfn-exception-member">exception members</a>.-->
</p>
<div class="block"><div class="blockTitleDiv"><span class="blockTitle">IDL</span></div><div class="blockContent"><pre class="code"><code class="idl-code"><span class="comment">// Typedef 식별자: "number"</span>
typedef float number;
<span class="comment">// Exception 식별자: "FrameworkException"</span>
exception FrameworkException {
<span class="comment">// Constant 식별자: "ERR_NOT_FOUND"</span>
const long ERR_NOT_FOUND = 1;
<span class="comment">// Exception field 식별자: "code"</span>
long code;
};
<span class="comment">// Interface 식별자: "System"</span>
interface System {
<span class="comment">// Operation 식별자: "createObject"</span>
<span class="comment">// Operation argument 식별자: "interface"</span>
object createObject(DOMString _interface);
<span class="comment">// Operation argument 식별자: "interface"</span>
object[] createObjectArray(DOMString interface);
<span class="comment">// Operation has no 식별자; it declares a getter.</span>
getter DOMString (DOMString keyName);
};
<span class="comment">// Interface 식별자: "TextField"</span>
interface TextField {
<span class="comment">// Attribute 식별자: "const"</span>
attribute boolean _const;
<span class="comment">// Attribute 식별자: "value"</span>
attribute DOMString? _value;
};</code></pre></div></div>
<p>
<span class="idltype">TextField</span> <a class="dfnref" href="#dfn-interface">interface</a>의 두번째 <a class="dfnref" href="#dfn-attribute">attribute</a>는 밑줄로 escape될 필요가 없지만(“value”는 IDL 문법에서 키워드가 아니기 때문),
여전히 그 attribute의 <a class="dfnref" href="#dfn-identifier">식별자</a>를 얻기 위해 unescape되었음에 주목하라.
<!--Note that while the second <a class="dfnref" href="#dfn-attribute">attribute</a>
on the <span class="idltype">TextField</span> <a class="dfnref" href="#dfn-interface">interface</a>
need not have been escaped with an underscore (because “value” is
not a keyword in the IDL grammar), it is still unescaped
to obtain the attribute’s <a class="dfnref" href="#dfn-identifier">identifier</a>.-->
</p>
</div>
</div>
<div id="idl-interfaces" class="section">
<h3>3.2. Interfaces</h3>
<p>
<a class="dfnref" href="#dfn-idl-fragment">IDL fragment들</a>은 객체지향 시스템을 설명하는데에 사용된다.
그러한 시스템들에서, 객체는 식별 가능하고 상태와 동작이 캡슐화된 개체이다.
한 <dfn id="dfn-interface">interface</dfn>는 그 interface를 구현하는 객체가 노출하는 몇몇 상태와 동작을 선언하는 definition(<a class="sym" href="#prod-Interface">Interface</a> 또는
<span class="sym">"callback"</span> <a class="sym" href="#prod-Interface">Interface</a>에 대응하는)이다.
<!-- <a class="dfnref" href="#dfn-idl-fragment">IDL fragment들</a> are used to
describe object oriented systems. In such systems, objects are entities
that have identity and which are encapsulations of state and behavior.
An <dfn id="dfn-interface">interface</dfn> is a definition (matching
<a class="sym" href="#prod-Interface">Interface</a> or
<span class="sym">"callback"</span> <a class="sym" href="#prod-Interface">Interface</a>) that declares some
state and behavior that an object implementing that interface will expose. -->
</p>
<pre class="syntax">interface <i>identifier</i> {
<i>interface-members…</i>
};</pre>
<p>
한 interface는 <dfn id="dfn-interface-member">interface 멤버들</dfn>
(<a class="sym" href="#prod-InterfaceMembers">InterfaceMembers</a>에 대응하는)의 집합의 사양이고,
interface 멤버들은 interface선언내 중괄호들 사이에 나타나는 <a class="dfnref" href="#dfn-constant">constants</a>,
<a class="dfnref" href="#dfn-attribute">attribute들</a> 그리고
<a class="dfnref" href="#dfn-operation">operation들</a>이다.
Attribute들은 그 interface를 구현하는 객체가 노출하는 상태를 설명하고,
operation들은 그 객체에서 호출될 수 있는 행동들을 설명한다.
Constant들은 시스템 내 객체들의 사용자들의 편의로서 노출되는, 이름을 가진 상수값들을 선언한다.
<!-- An interface is a specification of a set of
<dfn id="dfn-interface-member">interface members</dfn>
(matching <a class="sym" href="#prod-InterfaceMembers">InterfaceMembers</a>),
which are the <a class="dfnref" href="#dfn-constant">constants</a>,
<a class="dfnref" href="#dfn-attribute">attributes</a> and
<a class="dfnref" href="#dfn-operation">operations</a>
that appear between the braces in the interface declaration.
Attributes describe the state that an object
implementing the interface will expose, and operations describe the
behaviors that can be invoked on the object. Constants declare
named constant values that are exposed as a convenience to users
of objects in the system. -->
</p>
<p>
Web IDL의 Interface들은 그 인터페이스를 구현하는 객체들이 어떻게 행동하는지를 설명한다.
객체 지향 언어를 위한 바인딩에서, 특정 IDL interface를 구현하는 한 객체는 그 객체의 상태를 점검 및 수정하고, 그 인터페이스에 의해 설명되는 행동들을 호출할 방법을 제공할 것으로 예상된다.
<!-- Interfaces in Web IDL describe how objects that implement the
interface behave. In bindings for object oriented languages, it is
expected that an object that implements a particular IDL interface
provides ways to inspect and modify the object's state and to
invoke the behavior described by the interface. -->
</p>
<!--JAVA
<div class='note'>
<p>
In the Java language binding, for example, this is achieved by having the
object implement a Java interface that has methods for reading and
writing attribute values and to invoke an operation.
</p>
</div>
-->
<p>
한 interface는 다른 interafce로 부터 <dfn id="dfn-inherit">상속</dfn>받도록 정의될 수 있다.
만약 그 interface의 식별자의 뒤에 <span class="char">U+003A COLON (":")</span> 문자와 한 <a class="dfnref" href="#dfn-identifier">identifier</a>가 온다면, 그 식별자는 상속한 interface를 식별한다.
다른 interface로부터 상속받은 한 interface를 구현한 객체는 그 상속받은 interface 또한 구현하게 된다.
그 객체는 그러므로 상속받은 interface로부터 온 interface 멤버들에 해당하는 멤버들 또한 가지게 된다.
<!-- An interface can be defined to <dfn id="dfn-inherit">inherit</dfn> from another interface.
If the identifier of the interface is followed by a
<span class="char">U+003A COLON (":")</span> character
and an <a class="dfnref" href="#dfn-identifier">identifier</a>,
then that identifier identifies the inherited interface.
An object that implements an interface that inherits from another
also implements that inherited interface. The object therefore will also
have members that correspond to the interface members from the inherited interface. -->
</p>
<pre class="syntax">interface <i>identifier</i> : <em>identifier-of-inherited-interface</em> {
<i>interface-members…</i>
};</pre>
<p>
<a href="#idl-overloading">overloading</a>의 경우를 제외하고, 멤버들이 나타나는 순서에는 중요한 의미는 없다.
<!-- The order that members appear in has no significance except in the
case of <a href="#idl-overloading">overloading</a>. -->
</p>
<p>
인터페이스들은 상속받은 인터페이스로부터 온 멤버와 같은 이름을 가진 인터페이스 멤버를 지정할 수도 있다.
상속한 인터페이스를 구현한 객체는 그 상속한 인터페이스의 멤버를 노출할 것이다.
override된 멤버가 그 객체에서 접근될지 여부는 언어 연결에 따라 다르다.
<!--
Interfaces may specify an interface member that has the same name as
one from an inherited interface. Objects that implement the derived
interface will expose the member on the derived interface. It is
language binding specific whether the overridden member can be
accessed on the object.
-->
</p>
<div class="example"><div class="exampleHeader">예제</div>
<p>
다음의 두 인터페이스를 보자.
<!-- Consider the following two interfaces. -->
</p>
<div class="block"><div class="blockTitleDiv"><span class="blockTitle">IDL</span></div><div class="blockContent"><pre class="code"><code class="idl-code">interface A {
void f();
void g();
};
interface B : A {
void f();
void g(DOMString x);
};</code></pre></div></div>
<p>
ECMAScript 언어 연결에서, <span class="idltype">B</span>의 인스턴스는 다음과 같은 프로토타입 체인을 가지게 될 것이다:
<!--
In the ECMAScript language binding, an instance of <span class="idltype">B</span>
will have a prototype chain that looks like the following:
-->
</p>
<pre> [Object.prototype: the Object prototype object]
↑
[A.prototype: interface prototype object for A]
↑
[B.prototype: interface prototype object for B]
↑
[instanceOfB]</pre>
<p>
ECMAScript에서 <code>instanceOfB.f()</code>를 호출하면 <span class="idltype">B</span>에 정의된 f가 작동될것이다.
그러나, 여전히 <span class="idltype">A</span>의 f또한 B를 구현한 한 객체에서 <code>A.prototype.f.call(instanceOfB)</code>를 호출함으로서 작동될 수 있다.
<!--
Calling <code>instanceOfB.f()</code> in ECMAScript will invoke the f defined
on <span class="idltype">B</span>. However, the f from <span class="idltype">A</span>
can still be invoked on an object that implements <span class="idltype">B</span> by
calling <code>A.prototype.f.call(instanceOfB)</code>.
-->
</p>
<!--JAVA
<p>
In the Java language binding, the two IDL interfaces will correspond to
the following Java interfaces:
</p>
<x:codeblock language='java'>public interface A {
void f();
void g();
}
public interface B extends A {
void f();
void g(String x);
}</x:codeblock>
<p>
Calling <code>instanceOfB.f()</code> in Java will invoke
the f defined on <span class='idltype'>B</span>. Due to
the way method overriding is defined in Java, there is no
way to call the f defined on <span class='idltype'>A</span>
on an object that implements <span class='idltype'>B</span>.
Since the signature of g is different in <span class='idltype'>A</span>
and <span class='idltype'>B</span>, however, both can be called
with, for example, <code>instanceOfB.g()</code> and
<code>instanceOfB.g("")</code>.
</p>
<p>
In both languages, the f and g from the derived interface
<span class='idltype'>B</span> are always accessible.
</p>
-->
</div>
<p>
주어진 인터페이스 <var>A</var>의 <dfn id="dfn-inherited-interfaces">상속받은 인터페이스</dfn>는 <var>A</var>가 직접적으로 또는 간접적으로 상속받은 모든 인터페이스의 집합이다. 만약 <var>A</var>가 다른 인터페이스로부터 상속받지 않는다면, 그 집합은 비어있다.
그렇지 않다면, 그 집합은 <var>A</var>가 <a class="dfnref" href="#dfn-inherit-dictionary">상속</a>받은 인터페이스 <var>B</var>와 <var>B</var>의 모든 <a class="dfnref" href="#dfn-inherited-interfaces">상속받은 인터페이스</a>이다.
<!--
The <dfn id="dfn-inherited-interfaces">inherited interfaces</dfn> of
a given interface <var>A</var> is the set of all interfaces that <var>A</var>
inherits from, directly or indirectly. If <var>A</var> does not <a class="dfnref" href="#dfn-inherit">inherit</a>
from another interface, then the set is empty. Otherwise, the set
includes the interface <var>B</var> that <var>A</var> <a class="dfnref" href="#dfn-inherit-dictionary">inherits</a>