[webrtc-pc] Checks in https://w3c.github.io/webrtc-pc/#dom-RTCDTMFSender-insertDTMF could be simplified (#2254)

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

== Checks in https://w3c.github.io/webrtc-pc/#dom-RTCDTMFSender-insertDTMF could be simplified ==
Step 3 and 4 of insertDTMF are:
3. If transceiver's [[Stopped]] slot is true, throw an InvalidStateError.
4. If transceiver's [[CurrentDirection]] slot is recvonly or inactive, throw an InvalidStateError.
Step 6.6 (canInsertDTMF) will trigger an InvalidStateError if transceiver's [[CurrentDirection]] is neither "sendrecv" nor "sendonly".

Steps 4 is unneeded given step 6.6.
Since transceiver's [[CurrentDirection]] is supposed to be null in case transceiver's [[Stopped]] is true, we could also potentially remove step 3 as well.

It also seems checks 17.1 and 17.2 could be rewritten as a single check:
If transceiver's [[CurrentDirection]] slot is neither "sendrecv" nor "sendonly", abort these steps.

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

Received on Monday, 5 August 2019 01:18:15 UTC