[webrtc-pc] Is it illegal to modify sdp between createOffer and setLocalDescription? (#2907)

y-i has just created a new issue for https://github.com/w3c/webrtc-pc:

== Is it illegal to modify sdp between createOffer and setLocalDescription? ==
I read "4.4.2 Interface Definition" and have a question about [[LastCreatedOffer]].

```js
const offer = await pc.createOffer();
// modify sdp
await pc.setLocalDescription(offer);
```

Considering the behavior of the above code, according to step 5 of createOffer, the value will be set in [[LastCreatedOffer]] when createOffer is called.

If setLocalDescription is called after editing the SDP, it appears to be rejected with an InvalidModificationError because an sdp different from [[LastCreatedOffer]] is passed in step 4.2.
However, when I actually run it, all modern browsers (Chrome/Firefox/Safari) resolve it.

Am I misunderstanding something about this?
Or do all browsers violate the spec?

Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/2907 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 7 November 2023 08:49:58 UTC