Gamepad: Change |axes| and |buttons| IDL types |
||
Issue description
The |axes| and |buttons| attributes in Gamepad.idl are declared as
// https://github.com/w3c/gamepad/issues/28
[MeasureAs=GamepadAxes] readonly attribute double[] axes;
[MeasureAs=GamepadButtons] readonly attribute GamepadButton[] buttons;
I'd like to remove support for WebIDL arrays (such as "double[]") from Blink, as they were dropped from the spec in 2015, and before that we need to remove existing uses of arrays in the IDL files.
This case looks a bit more complicated than other usages we have in Blink because the spec still seems to be using arrays in the IDL interface (https://github.com/w3c/gamepad/issues/28).
It'd be good if the people working on the spec could look at that issue and update the spec accordingly before we can update our IDL files.
,
Aug 2 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/69b90aa1bcb5a046044a445beb9e08d67e3e401d commit 69b90aa1bcb5a046044a445beb9e08d67e3e401d Author: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> Date: Wed Aug 02 18:15:55 2017 gamepad: Use FrozenArrays for Gamepad#axes and Gamepad#buttons. Sync our IDL file with https://github.com/w3c/gamepad/pull/62 ("Switch from WebIDL arrays to FrozenArray<>s in the IDLs"). WebIDL has not had array types since 2015, so finally make our IDL files compliant with modern WebIDL following the spec fix. It is important to note that this change modifies the existing behavior slightly. - |axes| and |buttons| are now frozen objects with all the related consequences for its properties and prototype. - Those two attributes now return the same _object_ until their values change instead of always returning a new object on access. Doing so aligns our code with both the spec as well as Gecko, which has done the above ever since it implemented the Gamepad spec. Bug: 740875 Change-Id: Ifb618c9d4f8860eb55efc882e701dae7390808a5 Reviewed-on: https://chromium-review.googlesource.com/595979 Reviewed-by: Matt Reynolds <mattreynolds@chromium.org> Commit-Queue: Raphael Kubo da Costa (rakuco) <raphael.kubo.da.costa@intel.com> Cr-Commit-Position: refs/heads/master@{#491440} [modify] https://crrev.com/69b90aa1bcb5a046044a445beb9e08d67e3e401d/third_party/WebKit/LayoutTests/gamepad/gamepad-api-expected.txt [modify] https://crrev.com/69b90aa1bcb5a046044a445beb9e08d67e3e401d/third_party/WebKit/LayoutTests/gamepad/gamepad-api.html [modify] https://crrev.com/69b90aa1bcb5a046044a445beb9e08d67e3e401d/third_party/WebKit/LayoutTests/gamepad/gamepad-events-basic-expected.txt [modify] https://crrev.com/69b90aa1bcb5a046044a445beb9e08d67e3e401d/third_party/WebKit/LayoutTests/gamepad/gamepad-events-basic.html [modify] https://crrev.com/69b90aa1bcb5a046044a445beb9e08d67e3e401d/third_party/WebKit/LayoutTests/gamepad/gamepad-polling-access-expected.txt [modify] https://crrev.com/69b90aa1bcb5a046044a445beb9e08d67e3e401d/third_party/WebKit/LayoutTests/gamepad/gamepad-polling-access.html [modify] https://crrev.com/69b90aa1bcb5a046044a445beb9e08d67e3e401d/third_party/WebKit/Source/modules/gamepad/Gamepad.cpp [modify] https://crrev.com/69b90aa1bcb5a046044a445beb9e08d67e3e401d/third_party/WebKit/Source/modules/gamepad/Gamepad.h [modify] https://crrev.com/69b90aa1bcb5a046044a445beb9e08d67e3e401d/third_party/WebKit/Source/modules/gamepad/Gamepad.idl [modify] https://crrev.com/69b90aa1bcb5a046044a445beb9e08d67e3e401d/third_party/WebKit/Source/modules/gamepad/GamepadButton.cpp [modify] https://crrev.com/69b90aa1bcb5a046044a445beb9e08d67e3e401d/third_party/WebKit/Source/modules/gamepad/GamepadButton.h
,
Aug 2 2017
Thanks for the patch! Marking this as Fixed. |
||
►
Sign in to add a comment |
||
Comment 1 by raphael....@intel.com
, Jul 17 2017Status: Started (was: Available)