https://www.w3.org/Bugs/Public/show_bug.cgi?id=26181
Bug ID: 26181 Summary: Spec should specify the presentation of the array returned by navigator.getGamepads() w.r.t "holes" Product: WebAppsWG Version: unspecified Hardware: All OS: All Status: NEW Severity: normal Priority: P2 Component: Gamepad Assignee: t...@mielczarek.org Reporter: t...@mielczarek.org QA Contact: public-webapps-bugzi...@w3.org CC: m...@w3.org, public-webapps@w3.org Currently the spec is silent about how the gamepad array should look in the face of removing Gamepads. What Firefox implements (I need to check other browsers) is like: <no gamepads connected> navigator.getGamepads() == [] <connect gamepad 1> navigator.getGamepads() == [Gamepad] <connect gamepad 2> navigator.getGamepads() == [Gamepad, Gamepad] <disconnect gamepad 1> navigator.getGamepads() == [null, Gamepad] The intent is that the array is always at least max(Gamepad.index)+1 length, and entries where there's no longer a Gamepad present are "holes". Firefox uses null for their values, but Chrome and IE use undefined, so the spec should clarify that. (undefined seems sensible) -- You are receiving this mail because: You are on the CC list for the bug.