New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 697121 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 674593


Show other hotlists

Hotlists containing this issue:
Non-Standard-IDL


Sign in to add a comment

Merge MIDIInputMap#size and MIDIOutputMap#size into the maplike<> definition

Project Member Reported by lunalu@chromium.org, Feb 28 2017

Issue description

Currently this API is not in the spec and it is not shipped behind any flags. Maybe we should standardize it? 
 
Components: -Blink>Input Blink>WebMIDI
I checked the latest maplike spec; https://heycam.github.io/webidl/#idl-maplike

It says "If the readonly keyword is used, this includes “entries”, “forEach”, “get”, “has”, “keys”, “values”, @@iterator methods and a “size” getter". So the spec seems to have the size already, IIUC?
Also, we already have the size getter.

Here is my trial in the DevTool console.

> navigator.requestMIDIAccess().then((a) => { _x = a; })
< Promise {[[PromiseStatus]]: "pending", [[PromiseValue]]: undefined}
> _x.inputs.size
< 1

Cc: bashi@chromium.org
Components: Blink>Bindings
Summary: Merge MIDIInputMap#size and MIDIOutputMap#size into the maplike<> definition (was: Standardize MIDI[Input | output]Map#size?)
Specs are here:
https://webaudio.github.io/web-midi-api/#MIDIInputMap
https://webaudio.github.io/web-midi-api/#MIDIOutputMap

Seems like the fix here should be to have the bindings generated do this for us? bashi@, can you confirm?
Oops, I notice that it does not work correctly.
modules/webmidi/MIDI{Input|Output}Map.idl have size entries, but I didn't implement it, and auto-generated code counts wrong thing and maybe returns always 1 even though the map contains more MIDI{Input|Output}.

So anyway as foolip says, we need to remove explicit size entry from MIDI{Input|Output}Map, and the bindings should generate size entry to for maplike<>.
Cc: foolip@chromium.org

Comment 7 by bashi@chromium.org, Mar 10 2017

Yes, the code generator should generate size getter IIUC.
Owner: jbroman@chromium.org
Status: Started (was: Untriaged)
This seems pretty simple; I'll just mail out a CL.
Cc: j...@opera.com
 Issue 690601  has been merged into this issue.
Project Member

Comment 10 by bugdroid1@chromium.org, Apr 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3ca2419cbb0dc16043535a1ec1e04b4977e725c1

commit 3ca2419cbb0dc16043535a1ec1e04b4977e725c1
Author: jbroman <jbroman@chromium.org>
Date: Thu Apr 13 19:26:34 2017

[Bindings] Make maplike<> and setlike<> imply a readonly size attribute.

This required implementing one for RTCStatsReport, which is presently missing
it.

This also replaces the size attribute on FontFaceSet, MIDIInputMap and
MIDIOutputMap with one generated according to the WebIDL rules for maplike<>
and setlike<>.

Because the spec specifies that this property is not enumerable, this has the
side effect of making it non-enumerable on the interfaces that already define
it explicitly.

BUG= 697121 
TBR=tommyw@chromium.org

Review-Url: https://codereview.chromium.org/2813023002
Cr-Commit-Position: refs/heads/master@{#464501}

[modify] https://crrev.com/3ca2419cbb0dc16043535a1ec1e04b4977e725c1/content/renderer/media/webrtc/rtc_stats.cc
[modify] https://crrev.com/3ca2419cbb0dc16043535a1ec1e04b4977e725c1/content/renderer/media/webrtc/rtc_stats.h
[modify] https://crrev.com/3ca2419cbb0dc16043535a1ec1e04b4977e725c1/content/shell/test_runner/mock_webrtc_peer_connection_handler.cc
[modify] https://crrev.com/3ca2419cbb0dc16043535a1ec1e04b4977e725c1/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/3ca2419cbb0dc16043535a1ec1e04b4977e725c1/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/3ca2419cbb0dc16043535a1ec1e04b4977e725c1/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/3ca2419cbb0dc16043535a1ec1e04b4977e725c1/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/3ca2419cbb0dc16043535a1ec1e04b4977e725c1/third_party/WebKit/Source/bindings/scripts/v8_interface.py
[modify] https://crrev.com/3ca2419cbb0dc16043535a1ec1e04b4977e725c1/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.cpp
[modify] https://crrev.com/3ca2419cbb0dc16043535a1ec1e04b4977e725c1/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface2.h
[modify] https://crrev.com/3ca2419cbb0dc16043535a1ec1e04b4977e725c1/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.cpp
[modify] https://crrev.com/3ca2419cbb0dc16043535a1ec1e04b4977e725c1/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceGarbageCollected.h
[modify] https://crrev.com/3ca2419cbb0dc16043535a1ec1e04b4977e725c1/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
[modify] https://crrev.com/3ca2419cbb0dc16043535a1ec1e04b4977e725c1/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.h
[modify] https://crrev.com/3ca2419cbb0dc16043535a1ec1e04b4977e725c1/third_party/WebKit/Source/core/css/FontFaceSet.idl
[modify] https://crrev.com/3ca2419cbb0dc16043535a1ec1e04b4977e725c1/third_party/WebKit/Source/modules/peerconnection/RTCStatsReport.h
[modify] https://crrev.com/3ca2419cbb0dc16043535a1ec1e04b4977e725c1/third_party/WebKit/Source/modules/webmidi/MIDIInputMap.idl
[modify] https://crrev.com/3ca2419cbb0dc16043535a1ec1e04b4977e725c1/third_party/WebKit/Source/modules/webmidi/MIDIOutputMap.idl
[modify] https://crrev.com/3ca2419cbb0dc16043535a1ec1e04b4977e725c1/third_party/WebKit/public/platform/WebRTCStats.h

Status: Fixed (was: Started)

Sign in to add a comment