[whatwg] Thread to run Web Socket feedback from the protocol ?

I've question about thread to run Web Socket feedback from the protocol.

If server sends back handshake response and a data frame, and close
immediately, fast enough to run JavaScript on browser, how readyState should
be?
1) When client recognizes handshake response header, it changes readyState
to OPEN  and queue a task to fire a simple event named "open".
2) Then client reads a data frame, and queue a task to fire a MessageEvent.
3) Then client recognizes the socket is closed, it changes readyState to
CLOSED and queue a task to fire a simple event named "close".

I'm wondering this process should be done on the same thread of the
JavaScript, or may be on the different thread.
If it should run on the same thread,  1) would be processed after JavaScript
code is processed. Thus, readyState is OPEN when it receives "open" event.
However, if it may run on the different thread, 1)-3) might be processed
before JavaScript code is processed.  So, readyState might be CLOSED when it
receives "open" event.

Which is correct behavior?
It seems WebKit/Mac does former, and Chromium does latter, so
LayoutTests/websocket/tests/simple.html would fail with Chromium.

-- 
ukai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20091203/9caa9029/attachment.htm>

Received on Wednesday, 2 December 2009 23:49:23 UTC