[html5] r1479 - /

whatwg at whatwg.org whatwg at whatwg.org
Tue Apr 22 20:20:32 PDT 2008


Author: ianh
Date: 2008-04-22 20:20:31 -0700 (Tue, 22 Apr 2008)
New Revision: 1479

Modified:
   index
   source
Log:
[o] (2) Include a lastEventId field on the event for <event-source>.

Modified: index
===================================================================
--- index	2008-04-23 01:42:37 UTC (rev 1478)
+++ index	2008-04-23 03:20:31 UTC (rev 1479)
@@ -36785,18 +36785,19 @@
 
   <h3 id=event1><span class=secno>6.1 </span>Event definitions</h3>
 
-  <p>Messages in <a href="#cross-document">cross-document messaging</a> and,
-   by default, in <a href="#server-sent">server-sent DOM events</a>, use the
-   <dfn id=message0 title=event-message><code>message</code></dfn> event.
+  <p>Messages in <a href="#cross-document">cross-document messaging</a> and
+   in <a href="#server-sent">server-sent DOM events</a>, use the <dfn
+   id=message0 title=event-message><code>message</code></dfn> event.
 
   <p>The following interface is defined for this event:
 
   <pre class=idl>interface <dfn id=messageevent>MessageEvent</dfn> : Event {
   readonly attribute DOMString <a href="#data4" title=dom-MessageEvent-data>data</a>;
-  readonly attribute DOMString <span title=dom-MessageEvent-origin>origin</span>;
+  readonly attribute DOMString <a href="#origin1" title=dom-MessageEvent-origin>origin</a>;
+  readonly attribute DOMString <a href="#lasteventid" title=dom-MessageEvent-lastEventId>lastEventId</a>;
   readonly attribute <a href="#window">Window</a> <a href="#source2" title=dom-MessageEvent-source>source</a>;
-  void <a href="#initmessageevent" title=dom-MessageEvent-initMessageEvent>initMessageEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString dataArg, in DOMString originArg, in Window sourceArg);
-  void <a href="#initmessageeventns" title=dom-MessageEvent-initMessageEventNS>initMessageEventNS</a>(in DOMString namespaceURI, in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString dataArg, in DOMString originArg, in Window sourceArg);
+  void <a href="#initmessageevent" title=dom-MessageEvent-initMessageEvent>initMessageEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString dataArg, in DOMString originArg, in DOMString lastEventIdArg, in Window sourceArg);
+  void <a href="#initmessageeventns" title=dom-MessageEvent-initMessageEventNS>initMessageEventNS</a>(in DOMString namespaceURI, in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString dataArg, in DOMString originArg, in DOMString lastEventIdArg, in Window sourceArg);
 };</pre>
 
   <p>The <dfn id=initmessageevent
@@ -36811,12 +36812,17 @@
    attribute represents the message being sent.
 
   <p>The <dfn id=origin1
-   title=dom-MessageEvent-domain><code>origin</code></dfn> attribute
+   title=dom-MessageEvent-origin><code>origin</code></dfn> attribute
    represents, in <a href="#cross-document">cross-document messaging</a>, the
    <a href="#origin0">origin</a> of the document that sent the message
    (typically the scheme, hostname, and port of the document, but not its
    path or fragment identifier).
 
+  <p>The <dfn id=lasteventid
+   title=dom-MessageEvent-lastEventId><code>lastEventId</code></dfn>
+   attribute represents, in <a href="#server-sent">server-sent dom
+   events</a>, the <span>last event ID string</span> of the event source.
+
   <p>The <dfn id=source2
    title=dom-MessageEvent-source><code>source</code></dfn> attribute
    represents, in <a href="#cross-document">cross-document messaging</a>, the
@@ -37107,8 +37113,7 @@
    <dt>If the field name is "event"
 
    <dd>
-    <p>Set the <var title="">event name</var> buffer the field value. <a
-     href="#refsXMLNS">[XMLNS]</a>
+    <p>Set the <var title="">event name</var> buffer the to field value.
 
    <dt>If the field name is "data"
 
@@ -37141,7 +37146,7 @@
     <p>The field is ignored.
   </dl>
 
-  <p id=dispatchEvent>When the user agent is required to <dfn id=dispatch
+  <p id=dispatchMessage>When the user agent is required to <dfn id=dispatch
    title="">dispatch the event</dfn>, then the user agent must act as
    follows:
 
@@ -37165,10 +37170,14 @@
      which does not bubble, is cancelable, and has no default action. The
      <code title=dom-MessageEvent-data><a href="#data4">data</a></code>
      attribute must be set to the value of the <var title="">data</var>
-     buffer, the <code title=dom-MessageEvent-origin>origin</code> attribute
-     must be set to the <a href="#origin0">origin</a> of the event stream,
-     and the <code title=dom-MessageEvent-source><a
-     href="#source2">source</a></code> attribute must be set to null.
+     buffer, the <code title=dom-MessageEvent-origin><a
+     href="#origin1">origin</a></code> attribute must be set to the <a
+     href="#origin0">origin</a> of the event stream, the <code
+     title=dom-MessageEvent-lastEventId><a
+     href="#lasteventid">lastEventId</a></code> attribute must be set to the
+     <span>last event ID string</span> of the event source, and the <code
+     title=dom-MessageEvent-source><a href="#source2">source</a></code>
+     attribute must be set to null.
 
    <li>
     <p>If the <var title="">event name</var> buffer has a value other than
@@ -37185,6 +37194,12 @@
      the event stream is registered.
   </ol>
 
+  <p class=note>If an event doesn't have an "id" field, but an earlier event
+   did set the event source's <span>last event ID string</span>, then the
+   event's <code title=dom-MessageEvent-lastEventId><a
+   href="#lasteventid">lastEventId</a></code> field will be set to the value
+   of whatever the last seen "id" field was.
+
   <div class=example>
    <p>The following event stream, once followed by a blank line:</p>
 
@@ -38227,13 +38242,15 @@
      title="">message</var> argument to the <code
      title=dom-window-postMessage><a
      href="#postmessage">postMessage()</a></code> method, the <code
-     title=dom-MessageEvent-origin>origin</code> attribute must be set to the
-     <a href="#origin0">origin</a> of the document that the script that
-     invoked the methods is associated with, and the <code
-     title=dom-MessageEvent-source><a href="#source2">source</a></code>
-     attribute must be set to the <code><a href="#window">Window</a></code>
-     object of the default view of the browsing context with which that
-     document is associated.</p>
+     title=dom-MessageEvent-origin><a href="#origin1">origin</a></code>
+     attribute must be set to the <a href="#origin0">origin</a> of the
+     document that the script that invoked the methods is associated with,
+     the <code title=dom-MessageEvent-lastEventId><a
+     href="#lasteventid">lastEventId</a></code> attribute must be set to the
+     empty string, and the <code title=dom-MessageEvent-source><a
+     href="#source2">source</a></code> attribute must be set to the <code><a
+     href="#window">Window</a></code> object of the default view of the
+     browsing context with which that document is associated.</p>
 
     <p class=issue>Define 'origin' more exactly -- IDN vs no IDN, effect of
      window.document.domain on its value, etc</p>
@@ -38250,10 +38267,10 @@
    and event listeners have been executed as appropriate).
 
   <p class=warning>Authors should check the <code
-   title=dom-MessageEvent-origin>origin</code> attribute to ensure that
-   messages are only accepted from domains that they expect to receive
-   messages from. Otherwise, bugs in the author's message handling code could
-   be exploited by hostile sites.
+   title=dom-MessageEvent-origin><a href="#origin1">origin</a></code>
+   attribute to ensure that messages are only accepted from domains that they
+   expect to receive messages from. Otherwise, bugs in the author's message
+   handling code could be exploited by hostile sites.
 
   <p class=warning>Authors should include the <var title="">origin</var>
    argument in messages that contain any confidential information, to make

Modified: source
===================================================================
--- source	2008-04-23 01:42:37 UTC (rev 1478)
+++ source	2008-04-23 03:20:31 UTC (rev 1479)
@@ -34224,8 +34224,8 @@
 
   <h3>Event definitions</h3>
 
-  <p>Messages in <span>cross-document messaging</span> and, by
-  default, in <span>server-sent DOM events</span>, use the <dfn
+  <p>Messages in <span>cross-document messaging</span> and in
+  <span>server-sent DOM events</span>, use the <dfn
   title="event-message"><code>message</code></dfn> event.</p>
 
   <p>The following interface is defined for this event:</p>
@@ -34233,9 +34233,10 @@
   <pre class="idl">interface <dfn>MessageEvent</dfn> : Event {
   readonly attribute DOMString <span title="dom-MessageEvent-data">data</span>;
   readonly attribute DOMString <span title="dom-MessageEvent-origin">origin</span>;
+  readonly attribute DOMString <span title="dom-MessageEvent-lastEventId">lastEventId</span>;
   readonly attribute <span>Window</span> <span title="dom-MessageEvent-source">source</span>;
-  void <span title="dom-MessageEvent-initMessageEvent">initMessageEvent</span>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString dataArg, in DOMString originArg, in Window sourceArg);
-  void <span title="dom-MessageEvent-initMessageEventNS">initMessageEventNS</span>(in DOMString namespaceURI, in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString dataArg, in DOMString originArg, in Window sourceArg);
+  void <span title="dom-MessageEvent-initMessageEvent">initMessageEvent</span>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString dataArg, in DOMString originArg, in DOMString lastEventIdArg, in Window sourceArg);
+  void <span title="dom-MessageEvent-initMessageEventNS">initMessageEventNS</span>(in DOMString namespaceURI, in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in DOMString dataArg, in DOMString originArg, in DOMString lastEventIdArg, in Window sourceArg);
 };</pre>
 
   <p>The <dfn
@@ -34251,13 +34252,18 @@
   attribute represents the message being sent.</p>
 
   <p>The <dfn
-  title="dom-MessageEvent-domain"><code>origin</code></dfn> attribute
+  title="dom-MessageEvent-origin"><code>origin</code></dfn> attribute
   represents, in <span>cross-document messaging</span>, the
   <span>origin</span> of the document that sent the message (typically
   the scheme, hostname, and port of the document, but not its path or
   fragment identifier).</p>
 
   <p>The <dfn
+  title="dom-MessageEvent-lastEventId"><code>lastEventId</code></dfn>
+  attribute represents, in <span>server-sent dom events</span>, the
+  <span>last event ID string</span> of the event source.</p>
+
+  <p>The <dfn
   title="dom-MessageEvent-source"><code>source</code></dfn> attribute
   represents, in <span>cross-document messaging</span>, the
   <code>Window</code> from which the message came.</p>
@@ -34570,8 +34576,8 @@
 
    <dt>If the field name is "event"</dt>
 
-   <dd><p>Set the <var title="">event name</var> buffer the field
-   value. <a href="#refsXMLNS">[XMLNS]</a></p></dd>
+   <dd><p>Set the <var title="">event name</var> buffer the to field
+   value.</p></dd>
 
 
    <dt>If the field name is "data"</dt>
@@ -34605,8 +34611,9 @@
   </dl>
 
 
-  <p id="dispatchEvent">When the user agent is required to <dfn
-  title="">dispatch the event</dfn>, then the user agent must act as follows:
+  <p id="dispatchMessage">When the user agent is required to <dfn
+  title="">dispatch the event</dfn>, then the user agent must act as
+  follows:
 
   <ol>
 
@@ -34629,7 +34636,10 @@
    title="dom-MessageEvent-data">data</code> attribute must be set to
    the value of the <var title="">data</var> buffer, the <code
    title="dom-MessageEvent-origin">origin</code> attribute must be set
-   to the <span>origin</span> of the event stream, and the <code
+   to the <span>origin</span> of the event stream, the <code
+   title="dom-MessageEvent-lastEventId">lastEventId</code>
+   attribute must be set to the <span>last event ID string</span> of
+   the event source, and the <code
    title="dom-MessageEvent-source">source</code> attribute must be set
    to null.</p></li>
    
@@ -34647,7 +34657,13 @@
 
   </ol>
 
+  <p class="note">If an event doesn't have an "id" field, but an
+  earlier event did set the event source's <span>last event ID
+  string</span>, then the event's <code
+  title="dom-MessageEvent-lastEventId">lastEventId</code> field will
+  be set to the value of whatever the last seen "id" field was.</p>
 
+
   <div class="example">
 
    <p>The following event stream, once followed by a blank line:</p>
@@ -35716,11 +35732,12 @@
     the <code title="dom-window-postMessage">postMessage()</code>
     method, the <code title="dom-MessageEvent-origin">origin</code>
     attribute must be set to the <span>origin</span> of the document
-    that the script that invoked the methods is associated with, and
-    the <code title="dom-MessageEvent-source">source</code> attribute
-    must be set to the <code>Window</code> object of the default view
-    of the browsing context with which that document is
-    associated.</p>
+    that the script that invoked the methods is associated with, the
+    <code title="dom-MessageEvent-lastEventId">lastEventId</code>
+    attribute must be set to the empty string, and the <code
+    title="dom-MessageEvent-source">source</code> attribute must be
+    set to the <code>Window</code> object of the default view of the
+    browsing context with which that document is associated.</p>
 
     <p class="issue">Define 'origin' more exactly -- IDN vs no IDN,
     effect of window.document.domain on its value, etc</p>




More information about the Commit-Watchers mailing list