Skip to content

Commit

Permalink
Meta: add definition markup for MessageEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
domenic committed Jan 28, 2021
1 parent ecd23cf commit 48f6b28
Showing 1 changed file with 30 additions and 26 deletions.
56 changes: 30 additions & 26 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -95478,7 +95478,7 @@ self.onmessage = function(ev) {
events:</p>

<pre><code class="idl">[Exposed=(Window,Worker,AudioWorklet)]
interface <dfn>MessageEvent</dfn> : <span>Event</span> {
interface <dfn interface>MessageEvent</dfn> : <span>Event</span> {
<span data-x="dom-Event-constructor">constructor</span>(DOMString type, optional <span>MessageEventInit</span> eventInitDict = {});

readonly attribute any <span data-x="dom-MessageEvent-data">data</span>;
Expand All @@ -95490,15 +95490,15 @@ interface <dfn>MessageEvent</dfn> : <span>Event</span> {
undefined <span data-x="dom-MessageEvent-initMessageEvent">initMessageEvent</span>(DOMString type, optional boolean bubbles = false, optional boolean cancelable = false, optional any data = null, optional USVString origin = "", optional DOMString lastEventId = "", optional <span>MessageEventSource</span>? source = null, optional sequence&lt;<span>MessagePort</span>&gt; ports = []);
};

dictionary <dfn>MessageEventInit</dfn> : <span>EventInit</span> {
any data = null;
USVString origin = "";
DOMString lastEventId = "";
<span>MessageEventSource</span>? source = null;
sequence&lt;<span>MessagePort</span>&gt; ports = [];
dictionary <dfn dictionary>MessageEventInit</dfn> : <span>EventInit</span> {
any <dfn dict-member for="MessageEventInit" data-x="dom-MessageEventInit-data">data</dfn> = null;
USVString <dfn dict-member for="MessageEventInit" data-x="dom-MessageEventInit-origin">origin</dfn> = "";
DOMString <dfn dict-member for="MessageEventInit" data-x="dom-MessageEventInit-lastEventId">lastEventId</dfn> = "";
<span>MessageEventSource</span>? <dfn dict-member for="MessageEventInit" data-x="dom-MessageEventInit-source">source</dfn> = null;
sequence&lt;<span>MessagePort</span>&gt; <dfn dict-member for="MessageEventInit" data-x="dom-MessageEventInit-ports">ports</dfn> = [];
};

typedef (<span>WindowProxy</span> or <span>MessagePort</span> or <span>ServiceWorker</span>) <dfn>MessageEventSource</dfn>;</code></pre>
typedef (<span>WindowProxy</span> or <span>MessagePort</span> or <span>ServiceWorker</span>) <dfn typedef>MessageEventSource</dfn>;</code></pre>

<dl class="domintro">

Expand Down Expand Up @@ -95543,35 +95543,39 @@ typedef (<span>WindowProxy</span> or <span>MessagePort</span> or <span>ServiceWo

<div w-nodev>

<p>The <dfn><code data-x="dom-MessageEvent-data">data</code></dfn> attribute must return the value
it was initialized to. It represents the message being sent.</p>
<p>The <dfn attribute for="MessageEvent"><code data-x="dom-MessageEvent-data">data</code></dfn>
attribute must return the value it was initialized to. It represents the message being sent.</p>

<p>The <dfn><code data-x="dom-MessageEvent-origin">origin</code></dfn> attribute must return the
value it was initialized to. It represents, in <span>server-sent events</span> and
<span>cross-document messaging</span>, the <span data-x="concept-document-origin">origin</span> of
the document that sent the message (typically the scheme, hostname, and port of the document, but
not its path or <span data-x="concept-url-fragment">fragment</span>).</p>
<p>The <dfn attribute for="MessageEvent"><code
data-x="dom-MessageEvent-origin">origin</code></dfn> attribute must return the value it was
initialized to. It represents, in <span>server-sent events</span> and <span>cross-document
messaging</span>, the <span data-x="concept-document-origin">origin</span> of the document that
sent the message (typically the scheme, hostname, and port of the document, but not its path or
<span data-x="concept-url-fragment">fragment</span>).</p>

<p>The <dfn><code data-x="dom-MessageEvent-lastEventId">lastEventId</code></dfn> attribute must
return the value it was initialized to. It represents, in <span>server-sent events</span>, the
<span data-x="concept-event-stream-last-event-id">last event ID string</span> of the event
source.</p>
<p>The <dfn attribute for="MessageEvent"><code
data-x="dom-MessageEvent-lastEventId">lastEventId</code></dfn> attribute must return the value it
was initialized to. It represents, in <span>server-sent events</span>, the <span
data-x="concept-event-stream-last-event-id">last event ID string</span> of the event source.</p>

<p>The <dfn><code data-x="dom-MessageEvent-source">source</code></dfn> attribute must return the
value it was initialized to. It represents, in <span>cross-document messaging</span>, the
<p>The <dfn attribute for="MessageEvent"><code
data-x="dom-MessageEvent-source">source</code></dfn> attribute must return the value it was
initialized to. It represents, in <span>cross-document messaging</span>, the
<code>WindowProxy</code> of the <span>browsing context</span> of the <code>Window</code> object
from which the message came; and in the <code
data-x="event-WorkerGlobalScope-connect">connect</code> events used by <span
data-x="SharedWorkerGlobalScope">shared workers</span>, the newly connecting
<code>MessagePort</code>.</p>

<p>The <dfn><code data-x="dom-MessageEvent-ports">ports</code></dfn> attribute must return the
value it was initialized to. It represents, in <span>cross-document messaging</span> and
<span>channel messaging</span>, the <code>MessagePort</code> array being sent.</p>
<p>The <dfn attribute for="MessageEvent"><code data-x="dom-MessageEvent-ports">ports</code></dfn>
attribute must return the value it was initialized to. It represents, in <span>cross-document
messaging</span> and <span>channel messaging</span>, the <code>MessagePort</code> array being
sent.</p>

<!-- handwavy, file bugs if there are interop issues -->
<p>The <dfn><code data-x="dom-MessageEvent-initMessageEvent">initMessageEvent()</code></dfn>
method must initialize the event in a manner analogous to the similarly-named <code
<p>The <dfn method for="MessageEvent"><code
data-x="dom-MessageEvent-initMessageEvent">initMessageEvent()</code></dfn> method must initialize
the event in a manner analogous to the similarly-named <code
data-x="dom-Event-initEvent">initEvent()</code> method. <ref spec=DOM></p>

</div>
Expand Down

0 comments on commit 48f6b28

Please sign in to comment.