Open Bug 1316320 Opened 9 years ago Updated 3 years ago

RTCDataChannelEvent constructor allows a null secondary argument

Categories

(Core :: WebRTC, defect, P3)

defect

Tracking

()

People

(Reporter: lunalu, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36 Steps to reproduce: var pc = new RTCPeerConnection(); var c = pc.createDataChannel(''); var e = new RTCDataChannelEvent('type'); Actual results: No exception was thrown, and the resulting instance had null for the channel attribute even though it's not nullable in the IDL. Expected results: Should make the channel a required argument.
Component: Untriaged → General
Component: General → WebRTC
Product: Firefox → Core
Confirm the bug because according to the spec param eventInitDict of type RTCDataChannelEventInit is not optional. https://w3c.github.io/webrtc-pc/#rtcdatachannelevent
Status: UNCONFIRMED → NEW
Ever confirmed: true
Rank: 25
Priority: -- → P2
Luna wrote tests for this that would fail: https://codereview.chromium.org/2463953002/ We're trying to get our web-platform-tests upstreaming process in order, and hopefully this will be upstreamed soon.
> Should make the channel a required argument. That's a spec issue, as it's not required in the spec [1]. Please raise it with the spec first. Until that's resolved, it's not clear what console.log(new RTCDataChannelEvent("", {}).channel) should emit. As I recall when this was written, our webidl compiler demanded that dictionaries without at least one required member had to be optional arguments, but it compiles without 'optional' when I try it now, so that may have changed, but it's odd, as it leaves it unclear what e.channel should return in the above case. [1] https://w3c.github.io/webrtc-pc/#idl-def-rtcdatachanneleventinit
Flags: needinfo?(lunalu)
It is required in the spec: https://github.com/w3c/webrtc-pc/pull/864 Filed https://github.com/w3c/webrtc-pc/issues/942 for the repeated confusion caused by https://w3c.github.io/webrtc-pc/ being out of sync with master.
Flags: needinfo?(lunalu)
Mass change P2->P3 to align with new Mozilla triage process.
Priority: P2 → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.