Closed Bug 1529646 Opened 7 years ago Closed 2 years ago

WPT webrtc/RTCIceCandidate-constructor.html is wrong about why {candidate: null} throws TypeError

Categories

(Core :: WebRTC: Signaling, defect, P2)

defect

Tracking

()

RESOLVED FIXED
126 Branch
Tracking Status
firefox126 --- fixed

People

(Reporter: bwc, Assigned: jib)

Details

Attachments

(1 file)

See this fiddle: https://jsfiddle.net/as6hex5y/1/

I think the relevant part of the spec is here: https://heycam.github.io/webidl/#es-dictionary

Note that using undefined instead of null elicits the expected TypeError

Maybe this is just a wrinkle caused by the fact that null can be converted to a DOMString?

I think the relevant part of the spec is here: https://heycam.github.io/webidl/#es-dictionary

I don't see it saying this should throw. This constructor takes an optional RTCIceCandidateInit dictionary, whose optional candidate member has a default value of "".

  • If Type(esDict) is NOT Undefined, Null or Object, then throw a TypeError.

Type of {candidate: null} (that is: the outer {}) is object, so proceed:

  • ...(skipping additional irrelevant checks on esDict)...
  • If esMemberValue is not undefined, then:
    • Let idlMemberValue be the result of converting esMemberValue to an IDL value whose type is the type member is declared to be of.

Where converting for DOMString takes us to toString which says: Return "null".

So it appears to me https://github.com/web-platform-tests/wpt/blob/master/webrtc/RTCIceCandidate-constructor.html#L59 is wrong.

Priority: -- → P3
Blocks: 1533019
Component: DOM: Bindings (WebIDL) → WebRTC: Signaling
Summary: When converting an Object value to a dictionary, using null to init required DOMString dictionary members does not throw → PeerConnection.jsm hides the fact that RTCIceCandidateInit.sdpMid is nullable from PeerConnectionImpl
Rank: 15
Priority: P3 → P2
Severity: normal → S3
Assignee: nobody → jib
Status: NEW → ASSIGNED
Summary: PeerConnection.jsm hides the fact that RTCIceCandidateInit.sdpMid is nullable from PeerConnectionImpl → WPT webrtc/RTCIceCandidate-constructor.html is wrong about why {candidate: null} throws TypeError
No longer blocks: 1533019
Pushed by jbruaroey@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a0375b7d9182 Fix mistaken claim in web-platform/tests/webrtc/RTCIceCandidate-constructor.html. r=bwc
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/45261 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 126 Branch
Upstream PR merged by moz-wptsync-bot
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: