This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26203 - Order in which index entries should be reused is unspecified
Summary: Order in which index entries should be reused is unspecified
Status: RESOLVED MOVED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Gamepad (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Ted Mielczarek [:ted]
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-25 18:55 UTC by Brady Eidson
Modified: 2015-04-24 10:59 UTC (History)
3 users (show)

See Also:


Attachments

Description Brady Eidson 2014-06-25 18:55:54 UTC
Order in which index entries should be reused is unspecified.

The description of the index property on Gamepad states:
"if a gamepad is disconnected, and subsequently the same or a different gamepad is then connected, index entries must be reused."

So if I have 2 gamepads, then disconnect index 0, then connect a new gamepad, it should reuse index 0.

If I have 3 gamepads, then disconnect index 1, then connect a new gamepad, it should reuse index 1.

But what if I have 3 gamepads, disconnect index 1, then disconnect index 0.
Then connect a new gamepad.

Which index should it reuse?  0, which is the lowest unused index?  Or 1, because it was the first disconnected index?

I would say 0, and suggest the spec state something like:
"if a gamepad is disconnected, and subsequently the same or a different gamepad is then connected, the lowest previously used index must be reused."
Comment 1 Ted Mielczarek [:ted] 2014-06-25 19:02:28 UTC
Your suggestion is what Firefox implements (and I'm fairly certain Chrome), and is certainly the intended behavior.
Comment 2 Ted Mielczarek [:ted] 2015-04-24 10:59:21 UTC
Moved to https://github.com/w3c/gamepad/issues/11