| 43 |
title=dom-$5><code>initMessageEventNS()</code></dfn> |
title=dom-$5><code>initMessageEventNS()</code></dfn> |
| 44 |
メソッドは、 DOM3 事象界面の似たような名前のメソッドと同じような方法で事象を初期化しなければ[[MUST:なりません]]。 |
メソッドは、 DOM3 事象界面の似たような名前のメソッドと同じような方法で事象を初期化しなければ[[MUST:なりません]]。 |
| 45 |
<a |
<a |
|
href="#refsDOM3EVENTS">[DOM3EVENTS]</a> |
|
| 46 |
|
href="#refsDOM3EVENTS">[DOM3EVENTS]</a> |
| 47 |
|
|
| 48 |
|
#en |
| 49 |
|
The <dfn id=data4 title=dom-MessageEvent-data><code>data</code></dfn> |
| 50 |
|
attribute represents the message being sent. |
| 51 |
|
#ja |
| 52 |
|
<dfn id=data4 title=dom-MessageEvent-data><code>data</code></dfn> |
| 53 |
|
属性は送信されたメッセージを表します。 |
| 54 |
|
|
| 55 |
|
#en |
| 56 |
|
The <dfn id=origin1 |
| 57 |
|
title=dom-MessageEvent-origin><code>origin</code></dfn> attribute |
| 58 |
|
represents, in <a href="#server-sent">server-sent events</a> and <a |
| 59 |
|
href="#cross-document">cross-document messaging</a>, the <a |
| 60 |
|
href="#origin0">origin</a> of the document that sent the message |
| 61 |
|
(typically the scheme, hostname, and port of the document, but not its |
| 62 |
|
path or fragment identifier). |
| 63 |
|
#ja |
| 64 |
|
<dfn id=origin1 |
| 65 |
|
title=dom-MessageEvent-origin><code>origin</code></dfn> |
| 66 |
|
属性は、 <a href="#server-sent">鯖送信事象</a>と<a |
| 67 |
|
href="#cross-document">文書間メッセージ交換</a>において、メッセージを送信した文書の<a |
| 68 |
|
href="#origin0">起源</a> |
| 69 |
|
(普通は当該文書の scheme と hostname と port で、 path や素片識別子は含みません。) |
| 70 |
|
を表します。 |
| 71 |
|
|
| 72 |
|
#en |
| 73 |
|
The <dfn id=lasteventid |
| 74 |
|
title=dom-MessageEvent-lastEventId><code>lastEventId</code></dfn> |
| 75 |
|
attribute represents, in <a href="#server-sent">server-sent events</a>, |
| 76 |
|
the <span>last event ID string</span> of the event source. |
| 77 |
|
#ja |
| 78 |
|
<dfn id=lasteventid |
| 79 |
|
title=dom-MessageEvent-lastEventId><code>lastEventId</code></dfn> |
| 80 |
|
属性は、<a href="#server-sent">鯖送信事象</a>において、 |
| 81 |
|
事象源の<span>最終事象識別子文字列</span>を表します。 |
| 82 |
|
|
| 83 |
|
#en |
| 84 |
|
The <dfn id=source3 |
| 85 |
|
title=dom-MessageEvent-source><code>source</code></dfn> attribute |
| 86 |
|
represents, in <a href="#cross-document">cross-document messaging</a>, the |
| 87 |
|
<code><a href="#window">Window</a></code> from which the message came. |
| 88 |
|
#ja |
| 89 |
|
<dfn id=source3 |
| 90 |
|
title=dom-MessageEvent-source><code>source</code></dfn> 属性は、 |
| 91 |
|
<a href="#cross-document">文書間メッセージ交換</a>において、 |
| 92 |
|
メッセージが送られて来た元の |
| 93 |
|
<code><a href="#window">Window</a></code> を表します。 |
| 94 |
|
|
| 95 |
|
#en |
| 96 |
|
The <dfn id=messageport |
| 97 |
|
title=dom-MessageEvent-messagePort><code>messagePort</code></dfn> |
| 98 |
|
attribute represents, in <a href="#cross-document">cross-document |
| 99 |
|
messaging</a> and <a href="#channel0">channel messaging</a> the <code><a |
| 100 |
|
href="#messageport0">MessagePort</a></code> being sent, if any. |
| 101 |
|
#ja |
| 102 |
|
<dfn id=messageport |
| 103 |
|
title=dom-MessageEvent-messagePort><code>messagePort</code></dfn> |
| 104 |
|
属性は、<a href="#cross-document">文書間メッセージ交換</a>と<a href="#channel0">通信路メッセージ交換</a>において、 |
| 105 |
|
送信された <code><a |
| 106 |
|
href="#messageport0">MessagePort</a></code> があれば、 |
| 107 |
|
それを表します。 |
| 108 |
|
|
| 109 |
|
|
| 110 |
|
#en |
| 111 |
|
Unless otherwise specified, when the user agent creates and dispatches a |
| 112 |
|
<code title=event-message><a href="#message2">message</a></code> event in |
| 113 |
|
the algorithms described in the following sections, the <code |
| 114 |
|
title=dom-MessageEvent-lastEventId><a |
| 115 |
|
href="#lasteventid">lastEventId</a></code> attribute must be the empty |
| 116 |
|
string, the <code title=dom-MessageEvent-origin><a |
| 117 |
|
href="#origin1">origin</a></code> attribute must be the empty string, the |
| 118 |
|
<code title=dom-MessageEvent-source><a href="#source3">source</a></code> |
| 119 |
|
attribute must be null, and the <code |
| 120 |
|
title=dom-MessageEvent-messagePort><a |
| 121 |
|
href="#messageport">messagePort</a></code> attribute must be null. |
| 122 |
|
#ja |
| 123 |
|
特に規定がない場合、利用者エージェントが以後の節で説明する算法の中で |
| 124 |
|
<code title=event-message><a href="#message2">message</a></code> |
| 125 |
|
事象を作成して発送する時に、 <code |
| 126 |
|
title=dom-MessageEvent-lastEventId><a |
| 127 |
|
href="#lasteventid">lastEventId</a></code> 属性は空文字列でなければ[[MUST:ならず]]、 |
| 128 |
|
<code title=dom-MessageEvent-origin><a |
| 129 |
|
href="#origin1">origin</a></code> 属性は空文字列でなければ[[MUST:ならず]]、 |
| 130 |
|
<code title=dom-MessageEvent-source><a href="#source3">source</a></code> |
| 131 |
|
属性は null でなければ[[MUST:ならず]]、 <code |
| 132 |
|
title=dom-MessageEvent-messagePort><a |
| 133 |
|
href="#messageport">messagePort</a></code> |
| 134 |
|
属性は null でなければ[[MUST:なりません]]。 |
| 135 |
|
|
| 136 |
|
|
| 137 |
|
#pattern |
| 138 |
|
<span class=secno>* </span><dfn |
| 139 |
|
id=server-sent>Server-sent events</dfn> |
| 140 |
|
#ja |
| 141 |
|
<span class=secno>$1 </span><dfn |
| 142 |
|
id=server-sent>鯖送信事象</dfn> |
| 143 |
|
|
| 144 |
|
#en |
| 145 |
|
This section describes a mechanism for allowing servers to dispatch DOM |
| 146 |
|
events into documents that expect it. The <code><a |
| 147 |
|
href="#eventsource">eventsource</a></code> element provides a simple |
| 148 |
|
interface to this mechanism. |
| 149 |
|
#ja |
| 150 |
|
この節は、鯖が事象を待ち受けている文書の中に DOM |
| 151 |
|
事象を発送できるようにする仕組みを説明します。 |
| 152 |
|
<code><a |
| 153 |
|
href="#eventsource">eventsource</a></code> |
| 154 |
|
要素はこの仕組みに対する単純な界面を提供しています。 |
| 155 |
|
|
| 156 |
|
#en |
| 157 |
|
Any object that implements the <code>EventTarget</code> interface must |
| 158 |
|
also implement the <code><a |
| 159 |
|
href="#remoteeventtarget">RemoteEventTarget</a></code> interface. |
| 160 |
|
#ja |
| 161 |
|
<code>EventTarget</code> 界面を実装するオブジェクトは、 <code><a |
| 162 |
|
href="#remoteeventtarget">RemoteEventTarget</a></code> |
| 163 |
|
界面も実装しなければ[[MUST:なりません]]。 |
| 164 |
|
|
| 165 |
|
#en |
| 166 |
|
When the <dfn id=addeventsource |
| 167 |
|
title=dom-RemoteEventTarget-addEventSource><code>addEventSource(<var |
| 168 |
|
title="">src</var>)</code></dfn> method is invoked, the user agent must <a |
| 169 |
|
href="#resolve" title="resolve a url">resolve</a> the <a |
| 170 |
|
href="#url">URL</a> specified in <var title="">src</var>, and if that |
| 171 |
|
succeeds, add the resulting <a href="#absolute">absolute URL</a> to the <a |
| 172 |
|
href="#list-of3" title=concept-eventsource-list>list of event sources</a> |
| 173 |
|
for that object. The same URL can be registered multiple times. If the URL |
| 174 |
|
fails to resolve, then the user agent must raise a <code>SYNTAX_ERR</code> |
| 175 |
|
exception. |
| 176 |
|
#ja |
| 177 |
|
<dfn id=addeventsource |
| 178 |
|
title=dom-RemoteEventTarget-addEventSource><code>addEventSource(<var |
| 179 |
|
title="">src</var>)</code></dfn> |
| 180 |
|
メソッドが呼び出された時、利用者エージェントは |
| 181 |
|
<var title="">src</var> |
| 182 |
|
に指定された <a |
| 183 |
|
href="#url">URL</a> |
| 184 |
|
を<a |
| 185 |
|
href="#resolve" title="resolve a url">解決</a>し、 |
| 186 |
|
それが成功した場合、得られた<a href="#absolute">絶対 URL</a> をそのオブジェクトの<a |
| 187 |
|
href="#list-of3" title=concept-eventsource-list>事象源のリスト</a>に追加しなければ[[MUST:なりません]]。 |
| 188 |
|
同じ URL を何度も登録することができます。 |
| 189 |
|
URL の解決に失敗した場合は、利用者エージェントは <code>SYNTAX_ERR</code> |
| 190 |
|
例外を発生させなければ[[MUST:なりません]]。 |