W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2010

[whatwg] Question regarding event: in server-sent events

From: Nicholas Zakas <nzakas@yahoo-inc.com>
Date: Fri, 15 Oct 2010 11:34:14 -0700
Message-ID: <B66541E954ECF146AD8CA69D34A283FF256EFAF7B9@SP2-EX07VS02.ds.corp.yahoo.com>
In reading through the spec, it looks like this is legal in the event stream:

event: foo
data: bar

And then processed as:

>> If the event name buffer is not the empty string but is also not a valid event type name, as defined by the DOM Events specification, set the data  buffer and the event name buffer to the empty string and abort these steps.

If I'm reading this correctly, an event name of "foo" would fail this step in the process and not cause a message event to be fired. However, if the event name were for example "click", then this would be okay and the following step would be taken:

>>If the event name buffer has a value other than the empty string, change the type of the newly created event to equal the value of the event name  buffer.

A few questions about this:

1)       Does this mean that a click event would be fired on the EventSource object, such as that onclick would be called? Or does this still fire the message event but event.type is now "click"?
2)       Why the limitation of events only in the DOM Events spec? It seems that most of those events are irrelevant in the context of a non-UI part of the page.
3)       Assuming I've understood the current spec correctly, what is the use case for named events?

Thanks,
Nicholas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20101015/24190b96/attachment.htm>
Received on Friday, 15 October 2010 11:34:14 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:01 UTC