Open
Bug 1441723
Opened 7 years ago
Updated 2 years ago
readyState after createDataChannel() should always be "connecting".
Categories
(Core :: WebRTC, defect, P2)
Core
WebRTC
Tracking
()
NEW
Tracking | Status | |
---|---|---|
firefox60 | --- | affected |
People
(Reporter: jib, Unassigned)
References
Details
The spec [1] says the initial state of a data channel is always "connecting". Specifically:
const dc = pc.createDataChannel("dc");
console.log(dc.readyState); // "connecting"
Firefox (and Chrome btw) get it wrong for subsequent data channels of an established peer connection:
const dc = pc.createDataChannel("dc");
console.log(dc.readyState); // "open"
dc.onopen = () => console.log(dc.readyState); // "open"
Strangely, you can register an onopen callback in open state and it still fires!
The spec [2] says readyState is only set to "open" in the queued task that fires the `onopen` event.
STR:
1. Open https://jsfiddle.net/jib1/uewthp80/
Expected result:
dc3 connecting
dc3 onopen open
Actual result:
dc3 open
dc3 onopen open
AFAIK this is not a regression.
[1] http://w3c.github.io/webrtc-pc/#dom-peerconnection-createdatachannel
[2] http://w3c.github.io/webrtc-pc/#announce-datachannel-open
Comment 1•7 years ago
|
||
Will write a WPT test for this.
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•