这是indexloc提供的服务,不要输入任何密码
Skip to content

Commit 04bcdb5

Browse files
author
Marcos Cáceres
committed
Editorial: use new constructor syntax
1 parent f5e7352 commit 04bcdb5

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

index.html

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
<head>
44
<title>Web MIDI API</title>
55
<meta charset="utf-8" />
6-
<script src='https://www.w3.org/Tools/respec/respec-w3c-common' class='remove'></script>
6+
<script src='https://www.w3.org/Tools/respec/respec-w3c' class='remove'></script>
77
<script class='remove'>
88
var respecConfig = {
99
shortName: "webmidi",
1010
specStatus: "ED",
1111
copyrightStart: "2015",
12-
edDraftURI: "https://webaudio.github.io/web-midi-api/",
1312
editors: [
1413
{ name: "Chris Wilson",
1514
url: "mailto:cwilso@google.com",
@@ -22,7 +21,7 @@
2221
w3cid: "45545"
2322
},
2423
],
25-
github: "https://github.com/WebAudio/web-midi-api/",
24+
github: "WebAudio/web-midi-api",
2625
wg: "Audio Working Group",
2726
wgURI: "https://www.w3.org/2011/audio/",
2827
wgPublicList: "public-audio",
@@ -122,7 +121,8 @@ <h2>Extensions to the <dfn>Navigator</dfn> interface</h2>
122121

123122
<pre class="idl">
124123
partial interface Navigator {
125-
[SecureContext] Promise &lt;MIDIAccess> requestMIDIAccess(optional MIDIOptions options = {});
124+
[SecureContext]
125+
Promise &lt;MIDIAccess> requestMIDIAccess(optional MIDIOptions options = {});
126126
};
127127
</pre>
128128
<dl>
@@ -795,8 +795,9 @@ <h2><dfn>MIDIPortConnectionState</dfn> Enum</h2>
795795
<h2 id="MIDIMessageEvent"><dfn>MIDIMessageEvent</dfn> Interface</h2>
796796
<p>An event object implementing this interface is passed to a MIDIInput's onmidimessage handler when MIDI messages are received. Note that the DOM {{Event}} <code>timeStamp</code> attribute is defined as a {{DOMHighResTimeStamp}}, and represents the high-resolution time of when the event was received or is to be sent.</p>
797797
<pre class="idl">
798-
[SecureContext, Exposed=Window, Constructor(DOMString type, optional MIDIMessageEventInit eventInitDict = {})]
798+
[SecureContext, Exposed=Window]
799799
interface MIDIMessageEvent : Event {
800+
constructor(DOMString type, optional MIDIMessageEventInit eventInitDict = {});
800801
readonly attribute Uint8Array data;
801802
};
802803
</pre>
@@ -849,8 +850,9 @@ <h2 id="MIDIConnectionEvent"><dfn>MIDIConnectionEvent</dfn> Interface</h2>
849850
for new devices infrequently. As such, it is suggested that heavy
850851
reliance on connection events not be used.</p>
851852
<pre class="idl">
852-
[SecureContext, Exposed=Window, Constructor(DOMString type, optional MIDIConnectionEventInit eventInitDict = {})]
853+
[SecureContext, Exposed=Window]
853854
interface MIDIConnectionEvent : Event {
855+
constructor(DOMString type, optional MIDIConnectionEventInit eventInitDict = {});
854856
readonly attribute MIDIPort port;
855857
};
856858
</pre>
@@ -1117,7 +1119,7 @@ <h2>Security and Privacy Considerations of MIDI</h2>
11171119
<p>In short: the additional fingerprinting exposure of enumerating MIDI devices is directly analogous to the Gamepad API’s additional fingerprinting exposure through gamepad enumeration; typical users will only have at most a few devices connected, their configuration may change, and the information exposed is about the interface itself (i.e., no user-configured data).
11181120
<p>The additional security concern for receiving short messages is also small - it’s analogous to listening to keyboard, mouse, mobile/laptop accelerometer, touch input or gamepad events; there is no additional information exposed, and all messages other than clock signals must be initiated by the user.
11191121
<p>The additional concerns about sending short messages are analogous to any audio output - you cannot overwrite user information or expose use information, but you can make sounds happen, change patches, or (in rare configurations) toggle lights - but non-destructively, and not persistently.
1120-
<p>System Exclusive, on the other hand, has a much less bounded potential, and it seems that distinguishing requests for SysEx separately in the API is a good idea, in order to more carefully provide user security hooks. The <a data-lt="navigator.requestMIDIAccess">suggested security model</a> explicitly allows user agents to require the user's approval before giving access to MIDI devices, although it is not currently required to prompt the user for this approval - but it also detailed that system exclusive support must be requested as part of that request.
1122+
<p>System Exclusive, on the other hand, has a much less bounded potential, and it seems that distinguishing requests for SysEx separately in the API is a good idea, in order to more carefully provide user security hooks. The <a data-lt="Navigator.requestMIDIAccess">suggested security model</a> explicitly allows user agents to require the user's approval before giving access to MIDI devices, although it is not currently required to prompt the user for this approval - but it also detailed that system exclusive support must be requested as part of that request.
11211123
</p>
11221124
</section>
11231125

0 commit comments

Comments
 (0)