You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"The length of the array returned must be at least one more than the maximum index value of the Gamepad objects returned in the array."
This offers more flexibility than seems useful, allowing e.g. an array of length 100 to always be returned. Always returning an array of the minimum length possible seems better.
[reply] [−] Comment 1 Ted Mielczarek [:ted] 2015-02-09 12:03:42 UTC
I'm not really sure why this is spec'ed this way, I think Scott wrote that text. I know Chrome (and possibly IE) always return an Array of length 4 even when no gamepads are connected.
Firefox always returns an array of the minimum possible length.
[reply] [−] Comment 2 Philip Jägenstedt 2015-02-10 08:52:23 UTC
Yes, Chrome does that, but it makes no sense to me :)
[reply] [−] Comment 3 Philip Jägenstedt 2015-02-10 08:53:31 UTC
I guess it made more sense when the object returned (GamepadList) is the same every time, less so when you return a new array every time.
The text was updated successfully, but these errors were encountered:
Originally filed as https://www.w3.org/Bugs/Public/show_bug.cgi?id=27986:
Philip Jägenstedt 2015-02-09 11:13:40 UTC
https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#widl-Navigator-getGamepads-sequence-Gamepad
"The length of the array returned must be at least one more than the maximum index value of the Gamepad objects returned in the array."
This offers more flexibility than seems useful, allowing e.g. an array of length 100 to always be returned. Always returning an array of the minimum length possible seems better.
[reply] [−] Comment 1 Ted Mielczarek [:ted] 2015-02-09 12:03:42 UTC
I'm not really sure why this is spec'ed this way, I think Scott wrote that text. I know Chrome (and possibly IE) always return an Array of length 4 even when no gamepads are connected.
Firefox always returns an array of the minimum possible length.
[reply] [−] Comment 2 Philip Jägenstedt 2015-02-10 08:52:23 UTC
Yes, Chrome does that, but it makes no sense to me :)
[reply] [−] Comment 3 Philip Jägenstedt 2015-02-10 08:53:31 UTC
I guess it made more sense when the object returned (GamepadList) is the same every time, less so when you return a new array every time.
The text was updated successfully, but these errors were encountered: