New issue
Advanced search Search tips

Issue 865642 link

Starred by 4 users

Issue metadata

Status: Started
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 3
Type: Task

Blocking:
issue 708201



Sign in to add a comment

Deprecate non-standard GamepadList item method

Project Member Reported by mattreynolds@chromium.org, Jul 19

Issue description

The W3C Gamepad spec defines the value returned by navigator.getGamepads() as a sequence<Gamepad?>, but Chrome implements it as a GamepadList. GamepadList has a similar interface (it provides an operator[] getter and length attribute) but is not identical as it also provides an .item() accessor.

The item accessor should be deprecated to match the spec and to allow Chrome's implementation to expose this value as sequence<Gamepad?> more easily.
 
Blocking: 708201
I took a look in httparchive for resources containing both 'getGamepads' and '.item(' to see if I could find something that would break:
https://bigquery.cloud.google.com/savedquery/762219082167:e859a577d6ac4e7c866020caff35f248

Looking at the 34 results, which is very few to begin with, looking through all of the '.item(' matches all of them seemed to be for other APIs like NodeList, and not the return value of getGamepads.

Based on analysis like that, I'd be happy to LGTM this removal on blink-dev without any deprecation period even.

Alternatively, a more conservative approach would be to add use counters for the use of the item method, but  you have to split the anonymous getter from the item() method to only measure the latter.
I updated the chromestatus entry (removed milestone) that referred to this bug, because it didn't seem to be correct.

Sign in to add a comment