#pattern * Communication #ja $1 通信 #pattern * Event definitions #ja $1 事象定義 #en Messages in server-sent events, Web sockets, cross-document messaging, and channel messaging use the message event. #ja 鯖送信事象Web ソケット文書間メッセージ交換通信路メッセージ交換のメッセージはmessage 事象を使います。 #en The following interface is defined for this event: #ja 次の界面はこの事象のために定義されています。 #pattern The *() and *() methods must initialise the event in a manner analogous to the similarly-named methods in the DOM3 Events interfaces. [DOM3EVENTS] #ja $3() メソッドと initMessageEventNS() メソッドは、 DOM3 事象界面の似たような名前のメソッドと同じような方法で事象を初期化しなければ[[MUST:なりません]]。 [DOM3EVENTS] #en The data attribute represents the message being sent. #ja data 属性は送信されたメッセージを表します。 #en The origin attribute 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 identifier). #ja origin 属性は、 鯖送信事象文書間メッセージ交換において、メッセージを送信した文書の起源 (普通は当該文書の scheme と hostname と port で、 path や素片識別子は含みません。) を表します。 #en The lastEventId attribute represents, in server-sent events, the last event ID string of the event source. #ja lastEventId 属性は、鯖送信事象において、 事象源の最終事象識別子文字列を表します。 #en The source attribute represents, in cross-document messaging, the Window from which the message came. #ja source 属性は、 文書間メッセージ交換において、 メッセージが送られて来た元の Window を表します。 #en The messagePort attribute represents, in cross-document messaging and channel messaging the MessagePort being sent, if any. #ja messagePort 属性は、文書間メッセージ交換通信路メッセージ交換において、 送信された MessagePort があれば、 それを表します。 #en Unless otherwise specified, when the user agent creates and dispatches a message event in the algorithms described in the following sections, the lastEventId attribute must be the empty string, the origin attribute must be the empty string, the source attribute must be null, and the messagePort attribute must be null. #ja 特に規定がない場合、利用者エージェントが以後の節で説明する算法の中で message 事象を作成して発送する時に、 lastEventId 属性は空文字列でなければ[[MUST:ならず]]、 origin 属性は空文字列でなければ[[MUST:ならず]]、 source 属性は null でなければ[[MUST:ならず]]、 messagePort 属性は null でなければ[[MUST:なりません]]。 #pattern * Server-sent events #ja $1 鯖送信事象 #en This section describes a mechanism for allowing servers to dispatch DOM events into documents that expect it. The eventsource element provides a simple interface to this mechanism. #ja この節は、鯖が事象を待ち受けている文書の中に DOM 事象を発送できるようにする仕組みを説明します。 eventsource 要素はこの仕組みに対する単純な界面を提供しています。 #en Any object that implements the EventTarget interface must also implement the RemoteEventTarget interface. #ja EventTarget 界面を実装するオブジェクトは、 RemoteEventTarget 界面も実装しなければ[[MUST:なりません]]。 #en When the addEventSource(src) method is invoked, the user agent must resolve the URL specified in src, and if that succeeds, add the resulting absolute URL to the list of event sources for that object. The same URL can be registered multiple times. If the URL fails to resolve, then the user agent must raise a SYNTAX_ERR exception. #ja addEventSource(src) メソッドが呼び出された時、利用者エージェントは src に指定された URL解決し、 それが成功した場合、得られた絶対 URL をそのオブジェクトの事象源のリストに追加しなければ[[MUST:なりません]]。 同じ URL を何度も登録することができます。 URL の解決に失敗した場合は、利用者エージェントは SYNTAX_ERR 例外を発生させなければ[[MUST:なりません]]。 #en When the removeEventSource(src) method is invoked, the user agent must resolve the URL specified in src, and if that succeeds, remove the resulting absolute URL from the list of event sources for that object. If the same URI has been registered multiple times, removing it must remove only one instance of that URI for each invocation of the removeEventSource() method. If the URL fails to resolve, the user agent does nothing. #ja removeEventSource(src) メソッドが呼び出された時、利用者エージェントは src に指定された URL解決し、 それが成功した場合、得られた絶対 URL をそのオブジェクトの事象源のリストからさ駆除しなければ[[MUST:なりません]]。 同じ URI が複数回登録されている場合、 removeEventSource() メソッドを呼び出す時に削除するのはその URI の1つの実現値だけを削除しなければ[[MUST:なりません]]。 URL の解決に失敗した場合は、利用者エージェントは何もしません。