Closed
Description
The spec currently states the following (emphasis mine):
Note that this call is NOT required in order to use the MIDIPort- calling send() on a MIDIOutput or attaching a MIDIMessageEvent handler on a MIDIInput will cause an implicit open().
This means that, if output
is a MIDIOutput
object, the following snippet (setting an event handler) opens the port:
output.onmidimessage = (m) => { console.log(m); }
but the following (adding an event listener) doesn't:
output.addEventListener("midimessage", () => { console.log(m); });
It seems like we need to state that both ways open the port, for Web Compat reasons.
https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers
https://dom.spec.whatwg.org/#concept-event-listener