Contact emails fbeauf...@chromium.org
mattreyno...@chromium.org Specification https://www.w3.org/TR/gamepad/#extensions-to-the-navigator-interface Summary We intend to replace GamepadList with sequence<Gamepad?> for navigator.getGamepads() return value to follow the spec and match current Gecko and WebKit implementations. Blink component Blink>GamepadAPI <https://bugs.chromium.org/p/chromium/issues/list?q=component:Blink%3EGamepadAPI> Motivation The W3C Gamepad spec defines the value returned by navigator.getGamepads() as a sequence<Gamepad?>, but Chrome is the only browser to implement it as a GamepadList. It has a similar interface (as it provides an operator[] getter and length attribute) but is not identical as it also provides an .item() accessor. Because of that, web developers tend to use [...navigator.getGamepads()] when they could simply use the Array returned by navigator.getGamepads(). TAG review As Gecko and WebKit already implement this spec, a TAG review doesn't seem required. Risks I've scanned the httparchive.response_bodies.2021_11_01_desktop table and found 995 URLs that contain “.getGamepads()” and “.item(“. Roughly half of them are from the A-Frame, TDV Player, and ArcGIS libraries and don’t use the Gamepad API “.item()” accessor. I’ve looked at 20 randomly picked URLs and didn’t find a single one using the Gamepad API “.item()” accessor. They are used for other APIs like NodeList or TouchList, and not the return value of navigator.getGamepads(). Results are publicly available at https://docs.google.com/spreadsheets/d/e/2PACX-1vSFs3guk11lnMMIyvt6pFR586oRYxO0ap20uF1i7U7CZW8aRDS7kJYw05MQCZ3CcijT-Zxq2HFgQcOC/pubhtml Interoperability and Compatibility Gecko: Spec compliant already WebKit: Spec compliant already Web developers: Positive (https://www.youtube.com/watch?v=pIIHJ-NIyes&t=527s ) Debuggability No specific DevTools changes are required. This feature is treated like any other JS event/attribute. Is this feature fully tested by web-platform-tests <https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md> ? Yes. See https://wpt.fyi/results/gamepad Tracking bug https://crbug.com/708201 Estimated milestones M99 Link to entry on the Chrome Platform Status https://www.chromestatus.com/feature/5693119438782464 -- You received this message because you are subscribed to the Google Groups "blink-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscr...@chromium.org. To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAPpwU5K7%2BajfRH0LOxOnitYwG0Hkn5W3M5GevxaOL-CpacCpCA%40mail.gmail.com.