- From: Lars Knudsen <larsgk@gmail.com>
- Date: Wed, 25 Jan 2017 14:40:43 +0100
- To: Boris Zbarsky <bzbarsky@mit.edu>
- Cc: public-webapps <public-webapps@w3.org>
- Message-ID: <CA+jkkcjUXe=Ovqi3GCsNjTkC2UQ-qNuWSoOLA-1qFtGmLhfk9g@mail.gmail.com>
On Thu, Dec 22, 2016 at 6:43 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote: > On 12/22/16 6:17 AM, Florian Bösch wrote: > >> Afaik this stems from a limitation of Windows not shared by other OS'es. >> Does Firefox behave similarly? >> > > The Firefox behavior is as follows: > > 1) There is no limit. > 2) Only entries for gamepads that are or were present are returned. > 3) If a gamepad is removed, its spot in the array becomes null. > > So calling getGamepad() if there are no gamepads will return an empty > array. At least on Mac; I haven't tested on Windows. > > Note that the length of the array _has_ to be able to be more than 4, > because of the connection/disconnection behavior. If I connect and then > disconnect 5 gamepads and then connect a 6th one, the spec requires that an > array of length 6 be returned. > > That said, the spec allows the array to be arbitrarily longer than the > actual set of gamepads, padded with null; this is indistinguishable from > the state where gamepads used to exist at those indices and then were > disconnected. So the Chrome/IE behavior described of returning a length-4 > array filled with null (not undefined) is spec-compliant. It's kinda interesting though - and a very good example of what can be misinterpreted/misused if specs are not precise ;) > > > -Boris > >
Received on Wednesday, 25 January 2017 13:41:16 UTC