This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 14057 - In section "The WebSocket interface" when describing the operation of the WebSocket constructor, the following statement is made: "Return a new WebSocket object, and continue these steps in the background (without blocking scripts). ... Establish a WebSoc
Summary: In section "The WebSocket interface" when describing the operation of the Web...
Status: RESOLVED INVALID
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: WebSocket API (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: public-webapps-bugzilla
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-07 06:29 UTC by contributor
Modified: 2011-09-10 05:23 UTC (History)
4 users (show)

See Also:


Attachments

Description contributor 2011-09-07 06:29:34 UTC
Specification: http://dev.w3.org/html5/websockets/
Multipage: http://www.whatwg.org/C#top
Complete: http://www.whatwg.org/c#top

Comment:
In section "The WebSocket interface" when describing the operation of the
WebSocket constructor, the following statement is made:

"Return a new WebSocket object, and continue these steps in the background
(without blocking scripts). ... Establish a WebSocket connection given the set
(host, port, resource name, secure), ..."

This is problematic because it means that the WebSocket connection can be
successfuly established before the script has a chance to set the onopen
property. This can result in missed onopen events.

Instead the operation of the WebSocket constructor should be suspended until
the currently executing script block is finished.

Dan Shappir
Ericom Software

Posted from: 81.218.35.98
User agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Comment 1 Charles Pritchard 2011-09-07 16:22:47 UTC
(In reply to comment #0)
> Specification: http://dev.w3.org/html5/websockets/
> This is problematic because it means that the WebSocket connection can be
> successfuly established before the script has a chance to set the onopen
> property. This can result in missed onopen events.

As I understand things, even if the websocket establishes before the end of the event loop, the onopen event will not be processed until the next loop.
Comment 2 Ian 'Hixie' Hickson 2011-09-10 05:23:04 UTC
comment 1 is correct.