-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathHTML-comms-ja.html
3262 lines (2949 loc) · 99.2 KB
/
HTML-comms-ja.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><html lang="ja"><head><meta charset="utf-8">
<title>HTML Standard — Communication(日本語訳)</title>
<link rel="stylesheet" href="common.css" type="text/css">
<link rel="stylesheet" href="common-whatwg.css" type="text/css">
<script src="common0.js"></script>
<script src="common1.js" async></script>
<script>
Util.ready = function(){
const source_data = {
toc_main: 'comms',
generate: expand
};
Util.switchWordsInit(source_data);
}
function expand(){
const class_map = this.class_map;
const tag_map = this.tag_map;
const link_map = this.link_map;
let context = '';
return this.html.replace(
/%[\w\-~一-鿆あ-ん]+|``?(.+?)([$@\^])(\w*)/g,
create_html
);
function create_html(match, key, indicator, klass){
if(!key) {//%
return `<var>${match.slice(1)}</var>`;
}
let href = '';
let href1 = '';
{
const n = key.indexOf('@');
if(n > 0) {
href1 = key.slice(n + 1);
key = key.slice(0, n);
}
}
let text = key;
switch(klass){
case 'r':
text = `[${key}]`;
href = `HTML-references.html#refs${key}`;
break;
case 'l':
text = `"<code class="literal">${text}</code>"`;
break;
case 'sl':
text = `[[${key}]]`;
break;
case 'P': // production
href = `#_p.${key}`;
break;
case 'CTX': // set link context for "``"
context = key;
return '';
break;
case 'mc':
text = 'constructor';
href = `#dom-${key.toLowerCase()}`;
break;
case 'm':
const n = text.indexOf('(');
if(n > 0){
key = text.slice(0, n);
text = key + text.slice(n).replace(/\w+/g, '<var>$&</var>');
}
break;
case '0x': // escape '%'
return `%x${key}`;
break;
case 'U':
text = `U+${key}`;
break;
case 'en':
return `<span lang="en">${key}</span>`;
break;
}
let tag = tag_map[klass];
if(tag) {
let classname = class_map[klass];
classname = classname ? ` class="${classname}"` : '';
text = `<${tag}${classname}>${text}</${tag}>`;
}
if(match[1] === '`') {
klass = `${klass}!${context}`;
}
if(indicator !== '^'){
href = href1 || link_map[ klass ? `${klass}.${key}` : key ] || href;
if(!href){
console.log(match); // check error
return match;
}
switch(indicator){
case '$':
text = `<a href="${href}">${text}</a>`;
break;
case '@':
text = `<dfn id="${href.slice(1)}">${text}</dfn>`;
break;
}
}
return text;
}
}
</script>
<script type="text/plain" id="_source_data">
●●options
spec_date:2024-11-21
trans_update:2024-11-22
source_checked:240112
page_state_key:HTML
spec_status:LS
original_url:https://html.spec.whatwg.org/multipage/comms.html
abbr_url:HTMLcomms
site_nav:comms,network,html
nav_prev:HTMLnavigator
nav_next:HTMLsse
trans_1st_pub:2016-12-06
●●original_urls
the-messageevent-interface:https://html.spec.whatwg.org/multipage/comms.html
server-sent-events:https://html.spec.whatwg.org/multipage/server-sent-events.html
network:https://html.spec.whatwg.org/multipage/web-sockets.html
web-messaging:https://html.spec.whatwg.org/multipage/web-messaging.html
channel-messaging:https://html.spec.whatwg.org/multipage/web-messaging.html
broadcasting-to-other-browsing-contexts:https://html.spec.whatwg.org/multipage/web-messaging.html
●●class_map
e:element
a:attr
E:error
P:production
et:event-type
st:attr-state
sl:js-slot
jt:js-type
jA:abstract
v:value
U:code-point
●●tag_map
I:code
m:code
mb:code
E:code
c:code
e:code
a:code
et:code
st:i
sl:span
jA:span
jt:code
P:code
v:code
t:var
i:i
U:span
sub:sub
cite:cite
●●words_table1
postMessageO:postMessage
●●words_table
●network / messaging
address-book:address book::address 帳:アドレス帳
email::::メール
連絡先:contact::~
social::::ソーシャル
server-sent::::サーバ送信
hostname::::ホスト名
rate::::レート
rate-limiting
投函-:post::~::ポスト
投函~法:posting
投函-済み:posted
broadcast::::ブロードキャスト
文書間:cross-document::~
close:
~close済み:closed
~close中:closing
pipe::::パイプ
source設定群:sourceSettings
受信器:receiver::~
返信-:send back::~
切断-:disconnect::~
連絡-:entangle::~
連絡:entangle::~
連絡を断つ:disentangle
添付-:attach:~
実体:entity:~
宛先:target::~
~message法:messaging
●保安
DoS:denial-of-service:DoS
XSS:cross-site scripting:XSS
log-in:log in:::ログイン
log-out:log out:::ログアウト
~obj能力:object-capability
悪用-:exploit::~
機密的:confidential:~
濫用-:abuse:~
特権:privilege::~
信用-済み:trusted
欠陥:flaw::~
動作者:actor::~
提供-:provide::~
提供者:provider::~
消費者:consumer::~
増殖-:multiply:~
●IDL/型/構造
出自に:originate:~
property::::プロパティ
options:options
●環境
agent:
現任:incumbent:~
●処理
locking::::ロック処理
clone~record:cloneRecord
収集し直-:recollect
cross-process::::プロセス間
搬送-:ship::~
搬送-済み:shipped
未搬送:unshipped::~
公告-:announce::~
保持体:holder::~::ホルダ
静止-:pause::~
回送-:forward::~
弱い:weakな:~
同時に:simultaneous
保たれ:keepされ:~
例外投出あり:rethrow any exceptions::~
即座:prompt::~
破棄予定:doomed:~
代理-:proxy::~
処理待ち:pending:~
時間:time
短い:short
二重化された:two-ways
生きた:liveな
生き続け:continue to live
毎分:per minute
一時に跳ね上がり得る:lead to high transient
●構文/stream
LF:
CR:
COLON
space
BOM
直列形:serialized::~::シリアル形
逆直列化-:deserialize::~::逆シリアル化
●仕様
対称:symmetric:~
注意-:care:~
格別に注意する:extra care
高価:expensive:~
難点:difficulties:~
解決策:solution:~
基礎:basis:~
簡易的:naïve:~
black-box::::ブラックボックス
仮想の:virtual:~
協調:coordination:~
切替えれ:switchでき:切り替えれ
発展:evolution:~
計算:computation:~
勧める:adviseする:~
利用量:usage:~
適格:eligible:~
実用的でなくなる:impractical
大げさになる:unreasonable overhead
見込みが高い:likely
任意選択:may/optional
不要:no longer needed
-:criteria
~~主な違い:key difference
-:further
渡-:pass
似た命名の:similarly-named
できないこと:inability
逆も同様:vice-versa
当の:in question
手の込んだ:elaborate
目に見える:apparent
optionally
無論:of course
ばかりの:just been
こっち:over here
そっち:your
委ねる:opening up
確かめる:make sure
引き継いで:continuing
することもあり得る:possibility of 〜 trying to
まったく:in the slightest
単に:merely
何か:anything
これら二者:together
特に:most particularly
自らに利する:on its behalf
要は:key
消し去:go away
判別-不能:indistinguishable
利用-不能:no 〜 usable
影響しな:unaffected
抽象-化:abstracting out
放置-:forgot
至り/-:lead
〜とする:suppose
伝え:tell
●未分類
開かれ:openされ:~
clear:
game::::ゲーム
:time
捉える:viewed as a
wildcard::::ワイルドカード
個人名:person:~
側:side:~
~~大容量:hight volume
~~利己:own
方法
注記
始-:begin
対応:corresponding
-:back
入って来る:incoming
どこかで:on the floor
片:piece
後で:later
相手~側~port:twin
note
-:causing
respective
instantaneous
leaving
starting
first-class
渡すこと:passing
amount
long
sometime
altogether
part
came
同順の:maintaining their relative order
-:outer
同等:equal
%新~port~list:newPorts
%宛先~生成元:targetOrigin
%宛先~port:targetPort
%起動元~port:initiatorPort
%相手~port:otherPort
%宛先~window:targetWindow
%宛先~realm:targetRealm
%直列形:serialized
%最終-宛先~port:finalTargetPort
%逆直列化-~record:deserializeRecord
%構文解析した~URL:parsedURL
%~message~clone:messageClone
%~message~event~target:messageEventTarget
%破棄予定か:doomed
%~source~port:sourcePort
%transfer:transfer
%~source~storage~key:~sourceStorageKey
●指示語
最終-:final:~
旧いものから順:oldest first
もはや/それ以降:no longer
-:whereby
-:identical
two
同じ:single
:earlier
次:next
nothing
now
前回:the previous
一方
他方
片方
一連
両端:each end
今度:now
以下
以外
以降
個
初回
前節
各種
唯一
対応
次第
段階
時点
部位
別:alternate
●●original_id_map
for WebSocket
network:network-intro
network:the-websocket-interface
network:feedback-from-the-protocol
network:ping-and-pong-frames
network:the-closeevent-interface
network:garbage-collection-2
network:websocket
network:binarytype
network:closeevent
network:closeeventinit
●●mdn_urls
broadcastchannel:API/BroadcastChannel
messagechannel:API/MessageChannel
messageevent:API/MessageEvent
messageeventinit:API/MessageEventInit
messageeventsource:API/MessageEventSource
messageport:API/MessagePort
postmessageoptions:API/StructuredSerializeOptions
●●link_map
●IDL
Transferable:~HTMLcloning#transferable
E.DataCloneError:~WEBIDL#datacloneerror
E.InvalidStateError:~WEBIDL#invalidstateerror
E.SyntaxError:~WEBIDL#syntaxerror
object:~WEBIDL#idl-object
I.BroadcastChannel:#broadcastchannel
I.DOMException:~WEBIDL#idl-DOMException
I.ArrayBuffer:~WEBIDL#idl-ArrayBuffer
I.Blob:~FILEAPI#blob
I.Document:~HTMLdom#document
文書:~HTMLdom#the-document-object
I.Event:~DOM4#interface-event
I.EventHandler:~WAPI#eventhandler
I.EventInit:~DOM4#dictdef-eventinit
I.EventSource:~HTMLsse#eventsource
I.EventTarget:~DOM4#interface-eventtarget
I.File:~FILEAPI#file
I.FileList:~FILEAPI#filelist-section
I.MessageChannel:#messagechannel
I.MessageEvent:#messageevent
I.MessageEventInit:#messageeventinit
I.MessageEventSource:#messageeventsource
I.MessageEventTarget:#messageeventtarget
I.MessagePort:#messageport
I.StructuredSerializeOptions:#structuredserializeoptions
I.ServiceWorker:~SW1#serviceworker
I.SharedWorkerGlobalScope:~WORKERS#sharedworkerglobalscope
I.WebSocket:~WEBSOCKET#websocket
I.Window:~WINDOW#window
~window:~WINDOW#the-window-object
I.WindowProxy:~HTMLWPROXY#windowproxy
I.WorkerGlobalScope:~WORKERS#workerglobalscope
I.XMLHttpRequest:~XHR#xmlhttprequest
jt.Date:~TC39#sec-date-objects
constructor:~DOM4#concept-event-constructor
9.1
m.initMessageEvent:#dom-messageevent-initmessageevent
m.lastEventId:#dom-messageevent-lasteventid
m.origin:#dom-messageevent-origin
m.ports:#dom-messageevent-ports
m.source:#dom-messageevent-source
m.data:#dom-messageevent-data
mb.data:#dom-messageeventinit-data
mb.origin:#dom-messageeventinit-origin
mb.lastEventId:#dom-messageeventinit-lasteventid
mb.source:#dom-messageeventinit-source
mb.ports:#dom-messageeventinit-ports
9.4.3
m.onmessage:#handler-messageeventtarget-onmessage
m.onmessageerror:#handler-messageeventtarget-onmessageerror
9.5
m!MessagePort.close:#dom-messageport-close
m!MessagePort.postMessage:#dom-messageport-postmessage
m!MessagePort.~postMessageO:#dom-messageport-postmessage-options
m!MessagePort.start:#dom-messageport-start
m!MessagePort.onclose:#handler-messageport-onclose
9.6
m.new BroadcastChannel:#dom-broadcastchannel
m!BroadcastChannel.constructor:#dom-broadcastchannel
m!BroadcastChannel.postMessage:#dom-broadcastchannel-postmessage
m!BroadcastChannel.name:#dom-broadcastchannel-name
m!BroadcastChannel.close:#dom-broadcastchannel-close
m!BroadcastChannel.onmessage:#handler-broadcastchannel-onmessage
m!BroadcastChannel.onmessageerror:#handler-broadcastchannel-onmessageerror
9.5.2
m.constructor:#dom-messagechannel
m.new MessageChannel:#dom-messagechannel
m.port1:#dom-messagechannel-port1
m.port2:#dom-messagechannel-port2
m.postMessage:#dom-window-postmessage
m.~postMessageO:#dom-window-postmessage-options
m.window.postMessage:#dom-window-postmessage
m.transfer:#dom-structuredserializeoptions-transfer
m.targetOrigin:~WINDOW#dom-windowpostmessageoptions-targetorigin
m.addEventListener:~DOM4#dom-eventtarget-addeventlistener
m.initEvent:~DOM4#dom-event-initevent
e.iframe:~HEembed#the-iframe-element
et.close:~HTMLindex#event-close
et.connect:~HTMLindex#event-workerglobalscope-connect
et.hashchange:~HTMLindex#event-hashchange
et.message:~HTMLindex#event-message
et.messageerror:~HTMLindex#event-messageerror
et.resize:~CSSOMVIEW#eventdef-window-resize
sl.Detached:~HTMLcloning#detached
●用語
~channel名:#channel-name
~closeされたか:#concept-broadcastchannel-closed
eS.最後の~event~ID文字列:~HTMLsse#concept-event-stream-last-event-id
~message~event~target:#message-event-target
~port~message~queue:#port-message-queue
未搬送な~port~message~queue:#unshipped-port-message-queue
投函-済み~message~task~source:#posted-message-task-source
搬送-済みか:#has-been-shipped
~port 1:#port-1
~port 2:#port-2
~portを連絡する:#entangle
~portの連絡を断つ:#disentangle
~windowに~messageを投函する手続き:#window-post-message-steps
~message~portに~messageを投函する手続き:#message-port-post-message-steps
~message法に適格:#eligible-for-messaging
§
:#event-stream-interpretation
~server-sent~event:~HTMLsse#server-sent-events
~broadcast~channel:#broadcasting-to-other-browsing-contexts
~channel~message法:#channel-messaging
文書間~message法:#web-messaging
●用語(HTML
jA.StructuredSerialize:~HTMLcloning#structuredserialize
jA.StructuredDeserialize:~HTMLcloning#structureddeserialize
jA.StructuredSerializeWithTransfer:~HTMLcloning#structuredserializewithtransfer
jA.StructuredDeserializeWithTransfer:~HTMLcloning#structureddeserializewithtransfer
転送-可能:~HTMLcloning#transferable-objects
転送-手続き:~HTMLcloning#transfer-steps
転送-受信-時の手続き:~HTMLcloning#transfer-receiving-steps
設定群~obj:~WAPI#settings-object
関連な~realm:~WAPI#concept-relevant-realm
関連な~agent:~WAPI#relevant-agent
関連な設定群~obj:~WAPI#relevant-settings-object
関連な大域~obj:~WAPI#concept-relevant-global
gL.~realm:~WAPI#concept-global-object-realm
現任な設定群~obj:~WAPI#incumbent-settings-object
enV.大域~obj:~WAPI#concept-settings-object-global
enV.生成元:~WAPI#concept-settings-object-origin
~event~loop:~WAPI#event-loop
aG.~event~loop:#concept-agent-event-loop
~event~handler:~WAPI#event-handlers
~event~handler~IDL属性:~WAPI#event-handler-idl-attributes
~event~handler~event型:~WAPI#event-handler-event-type
~task:~WAPI#concept-task
大域~taskを~queueする:~WAPI#queue-a-global-task
~task~queue:~WAPI#task-queue
~task~source:~WAPI#task-source
tK.文書:~WAPI#concept-task-document
~DOM操作~task~source:~WAPI#dom-manipulation-task-source
全部的に作動中:~HTMLds#fully-active
閲覧~文脈:~HTMLds#browsing-context
結付けられた文書:~WINDOW#concept-document-window
対応する閲覧~文脈:~WINDOW#window-bc
同一-生成元:~ORIGIN#same-origin
sub.生成元:~ORIGIN#same-origin
生成元:~ORIGIN#concept-origin
生成元を直列化する:~ORIGIN#ascii-serialisation-of-an-origin
~navigate:~HTMLnav#navigate
wG.~close中か:~WORKERS#dom-workerglobalscope-closing
休止-可能:~WORKERS#suspendable-worker
~worker:~WORKERS#worker
共用~worker:~WORKERS#sharedworker
共用~worker内:~WORKERS#sharedworkerglobalscope
●用語(外部
実装定義:~INFRA#implementation-defined
追跡~行路:~INFRA#tracking-vector
doc.生成元:~DOM4#concept-document-origin
凍結d配列:~WEBIDL#dfn-frozen-array-type
新たな:~WEBIDLjs#new
~eventを発火する:~DOM4#concept-event-fire
url.生成元:~URL1#concept-url-origin
url.素片:~URL1#concept-url-fragment
~URL:~URL1#concept-url
~URL~record:~URL1#concept-url
~URL構文解析する:~URL1#concept-url-parser
非~storage目的~用に~storage~keyを得する:~STORAGE#obtain-a-storage-key-for-non-storage-purposes
同等な~storage~key:~STORAGE#storage-key-equal
●●trans_metadata
<p>
~THIS_PAGEは、~WHATWGによる HTML 仕様の § Communication 内の
<a href="~HTMLLS/comms.html#the-messageevent-interface">§ The MessageEvent interfaces</a>,
<a href="~HTMLLS/web-messaging.html#web-messaging">§ Cross-document messaging</a>,
<a href="~HTMLLS/web-messaging.html#channel-messaging">§ Channel messaging</a>,
<a href="~HTMLLS/web-messaging.html#broadcasting-to-other-browsing-contexts">§ Broadcasting to other browsing contexts</a>
を日本語に翻訳したものです
~PUB
</p>
</script>
</head>
<body>
<header>
<hgroup>
<h1>HTML — 通信</h1>
</hgroup>
</header>
<main id="MAIN" hidden>
<section id="comms">
<h2 title="Communication">9. 通信</h2>
<p id="network" class="note">注記:
この節に定義されていた `WebSocket$I ~interfaceは、
今や, `WebSockets^cite `WEBSOCKETS$r にて定義される。
◎
The WebSocket interface used to be defined here. It is now defined in WebSockets. [WEBSOCKETS]
</p>
<section id="_conventions">
<h3>【この訳に特有な表記規約】</h3>
◎表記記号
</section>
<section id="the-messageevent-interface">
<h3 title="The MessageEvent interfaces">9.1. `MessageEvent^I ~interface</h3>
<p>
次に挙げるものにおいては、
各 `message$et ~eventは, `MessageEvent$I ~interfaceを利用する
⇒#
`~server-sent~event$における~message/
`文書間~message法$/
`~channel~message法$/
`~broadcast~channel$/
`WebSockets^cite `WEBSOCKETS$r
◎
Messages in server-sent events, cross-document messaging, channel messaging, broadcast channels, and WebSockets use the MessageEvent interface for their message events: [WEBSOCKETS]
</p>
<pre class="idl">
[Exposed=(Window,Worker,AudioWorklet)]
interface `MessageEvent@I : `Event$I {
`constructor$(DOMString %type, optional `MessageEventInit$I %eventInitDict = {});
readonly attribute any `data$m;
readonly attribute USVString `origin$m;
readonly attribute DOMString `lastEventId$m;
readonly attribute `MessageEventSource$I? `source$m;
readonly attribute FrozenArray<`MessagePort$I> `ports$m;
undefined `initMessageEvent$m(DOMString %type, optional boolean %bubbles = false, optional boolean %cancelable = false, optional any %data = null, optional USVString %origin = "", optional DOMString %lastEventId = "", optional `MessageEventSource$I? %source = null, optional sequence<`MessagePort$I> %ports = []);
};
dictionary `MessageEventInit@I : `EventInit$I {
any `data@mb = null;
USVString `origin@mb = "";
DOMString `lastEventId@mb = "";
`MessageEventSource$I? `source@mb = null;
sequence<`MessagePort$I> `ports@mb = [];
};
typedef (`WindowProxy$I or `MessagePort$I or `ServiceWorker$I) `MessageEventSource@I;
</pre>
<dl class="domintro">
<dt>%event.`data$m</dt>
<dd>
~messageの~dataを返す。
◎
Returns the data of the message.
</dd>
<dt>%event.`origin$m</dt>
<dd>
[
`~server-sent~event$/`文書間~message法$
]の下では、
~messageの生成元を返す。
◎
Returns the origin of the message, for server-sent events and cross-document messaging.
</dd>
<dt>%event.`lastEventId$m</dt>
<dd>
`~server-sent~event$の下では、
`最後の~event~ID文字列$eSを返す。
◎
Returns the last event ID string, for server-sent events.
</dd>
<dt>%event.`source$m</dt>
<dd>
`文書間~message法$の下では、
~source~window
【送信-元~window】
の `WindowProxy$I を返す。
`SharedWorkerGlobalScope$I ~objに向けて発火された `connect$et ~eventにおいては、
添付されている `MessagePort$Iを返す。
◎
Returns the WindowProxy of the source window, for cross-document messaging, and the MessagePort being attached, in the connect event fired at SharedWorkerGlobalScope objects.
</dd>
<dt>%event.`ports$m</dt>
<dd>
[
`文書間~message法$/`~channel~message法$
]の下では、
~messageに伴われて送信された `MessagePort$I 配列を返す。
◎
Returns the MessagePort array sent with the message, for cross-document messaging and channel messaging.
</dd>
</dl>
<div class="algo">
<p>
`data@m
取得子~手続きは、
初期化-時の値を返す。
◎
The data attribute must return the value it was initialized to.\
</p>
<p>
結果は、
送信されてきた~messageを表現する。
◎
It represents the message being sent.
</p>
</div>
<div class="algo">
<p>
`origin@m
取得子~手続きは、
初期化-時の値を返す。
◎
The origin attribute must return the value it was initialized to.\
</p>
<p>
これは,[
`~server-sent~event$/`文書間~message法$
]の下では、[
~messageを送信した文書の`生成元$doc
]を表現する
(概して,当の文書の[
~scheme, ~hostname, ~port
]からなるが、
その[
~pathや`素片$url
]は含まない)。
◎
It represents, in server-sent events and cross-document messaging, the origin of the document that sent the message (typically the scheme, hostname, and port of the document, but not its path or fragment).
</p>
</div>
<div class="algo">
<p>
`lastEventId@m
取得子~手続きは、
初期化-時の値を返す。
◎
The lastEventId attribute must return the value it was initialized to.\
</p>
<p>
これは,`~server-sent~event$の下では、[
`EventSource$I ~objの`最後の~event~ID文字列$eS
]を表現する。
◎
It represents, in server-sent events, the last event ID string of the event source.
</p>
</div>
<div class="algo">
<p>
`source@m
取得子~手続きは、
初期化-時の値を返す。
◎
The source attribute must return the value it was initialized to.\
</p>
<p>
これは,
`文書間~message法$の下では、[
~messageを送ってきた`~window$に`対応する閲覧~文脈$の `WindowProxy$I
]を表現する。
`共用~worker内$で利用される `connect$et ~eventにおいては、
新たに接続している `MessagePort$I になる。
◎
It represents, in cross-document messaging, the WindowProxy of the browsing context of the Window object from which the message came; and in the connect events used by shared workers, the newly connecting MessagePort.
</p>
</div>
<div class="algo">
<p>
`ports@m
取得子~手続きは、
初期化-時の値を返す。
◎
The ports attribute must return the value it was initialized to.\
</p>
<p>
これは,[
`文書間~message法$/`~channel~message法$
]の下では、[
~messageに伴って送信される `MessagePort$I 配列
]を表現する。
◎
It represents, in cross-document messaging and channel messaging, the MessagePort array being sent.
</p>
</div>
<div class="algo">
<p>
`initMessageEvent(type, bubbles, cancelable, data, origin, lastEventId, source, ports)@m
~method~手続きは、[
似た命名の `initEvent()$m ~methodに相似的な方式
]で~eventを初期化する。
`DOM$r
【構築子と機能が重複する旧来の~method】
◎
The initMessageEvent(type, bubbles, cancelable, data, origin, lastEventId, source, ports) method must initialize the event in a manner analogous to the similarly-named initEvent() method. [DOM]
</p>
<p class="note">注記:
様々な~API(例: `WebSocket$I や `EventSource$I )が、
`MessagePort$I ~APIを利用せずに,
`MessageEvent$I ~interfaceを `message$et ~eventに利用する。
◎
Various APIs (e.g., WebSocket, EventSource) use the MessageEvent interface for their message event without using the MessagePort API.
</p>
</div>
</section>
<section id="server-sent-events">
<h3 title="Server-sent events">9.2. ~server-sent~event</h3>
<p class="trans-note">【
この節の内容の和訳は、
`別~page@~HTMLsse$にて。
】</p>
</section>
<section id="web-messaging">
<h3 title="Cross-document messaging">9.3. 文書間~message法</h3>
<a id="crossDocumentMessages"></a>
<p>
~securityや~privacyの理由から、
~web~browserは[
異なる~domainに属する文書どうしが互いに影響しあう
]のを防止する
— すなわち、
~XSSは許容されないようにする。
◎
Web browsers, for security and privacy reasons, prevent documents in different domains from affecting each other; that is, cross-site scripting is disallowed.
</p>
<p>
これは重要な~security用の特能であるが、
異なる~domainに属する~pageとの通信は,
その~pageが敵対的でなくとも防止される。
この節では、[
~source~domainに関わらず,
文書どうしが互いに~messageを通信しあえる
]ようにする~systemを[
~XSS攻撃を可能化しないように設計される仕方
]で導入する。
◎
While this is an important security feature, it prevents pages from different domains from communicating even when those pages are not hostile. This section introduces a messaging system that allows documents to communicate with each other regardless of their source domain, in a way designed to not enable cross-site scripting attacks.
</p>
<p class="note" id="fingerprint-postMessage">
注記:
`postMessage()$m ~APIは、
`追跡~行路$として利用され得る。
◎
The postMessage() API can be used as a tracking vector.
</p>
<section id="introduction-12">
<h4 title="Introduction">9.3.1. 序論</h4>
◎非規範的
<div class="example">
<p>
例えば,ある文書 %A が
`iframe$e 要素を包含していて,
その要素は 別の文書 %B を包含している下で,
%A 内の~scriptが %B の`~window$の
`window.postMessage()$m を~callした場合、
~message~eventは,その~objに向けて発火される
— %A の`~window$を出自にしているよう~markされた上で。
%A 内の~scriptは、
次の様になろう:
◎
For example, if document A contains an iframe element that contains document B, and script in document A calls postMessage() on the Window object of document B, then a message event will be fired on that object, marked as originating from the Window of document A. The script in document A might look like:
</p>
<pre class="lang-js">
var %o = document.getElementsByTagName('iframe')[0];