Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIDIMessageEventInit and MIDIConnectionEventInit members should be required #168

Closed
foolip opened this issue Sep 15, 2016 · 3 comments · Fixed by #252
Closed

MIDIMessageEventInit and MIDIConnectionEventInit members should be required #168

foolip opened this issue Sep 15, 2016 · 3 comments · Fixed by #252
Assignees
Labels
class: substantive https://www.w3.org/2023/Process-20230612/#correction-classes status: ready for editing Enough information should be available to implement this change in the spec
Milestone

Comments

@foolip
Copy link
Contributor

foolip commented Sep 15, 2016

http://webaudio.github.io/web-midi-api/#MIDIMessageEvent
http://webaudio.github.io/web-midi-api/#MIDIConnectionEvent

Currently, the init dicts for the event constructors are optional, so new MIDIConnectionEvent('type') should work per spec. But the port attribute then couldn't be anything other than null, and yet it's not nullable.

The way to fix this is to make the init dicts non-optional and to make the members required, e.g.:

[Constructor(DOMString type, MIDIConnectionEventInit eventInitDict)]
interface MIDIConnectionEvent : Event {
    readonly        attribute MIDIPort port;
};

dictionary MIDIConnectionEventInit : EventInit {
             required MIDIPort port;
};

The only other option is to make the port attribute nullable, which would be silly.

@cwilso cwilso added the status: ready for editing Enough information should be available to implement this change in the spec label Sep 23, 2016
@cwilso cwilso added this to the V1 milestone Sep 23, 2016
@cwilso cwilso self-assigned this Sep 23, 2016
@foolip
Copy link
Contributor Author

foolip commented Dec 12, 2016

Friendly ping :) Blink's IDL is out of sync with the spec here and we'd like to fix it, but ideally not before the spec is fixed.

@cwilso
Copy link
Contributor

cwilso commented Oct 12, 2020

I think that #207 has obviated this, but I'm going to keep them both open until I've fixed.

@foolip
Copy link
Contributor Author

foolip commented Oct 13, 2020

Constructor operations should be unrelated to this, unless one makes drive-by fixes when fixing that of course.

This issue could be summarized as the difference between the IDL in spec and Blink:
https://webaudio.github.io/web-midi-api/#MIDIConnectionEventInit
https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/modules/webmidi/midi_connection_event_init.idl;l=8;drc=0aee4434a4dba42a42abaea9bfbc0cd196a63bc1

It looks like the nullability is the only remaining difference, and just making the member nullable in the spec would probably be the most pragmatic here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
class: substantive https://www.w3.org/2023/Process-20230612/#correction-classes status: ready for editing Enough information should be available to implement this change in the spec
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants