<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>26203</bug_id>
          
          <creation_ts>2014-06-25 18:55:54 +0000</creation_ts>
          <short_desc>Order in which index entries should be reused is unspecified</short_desc>
          <delta_ts>2015-04-24 10:59:21 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>HISTORICAL - Gamepad</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Brady Eidson">beidson</reporter>
          <assigned_to name="Ted Mielczarek [:ted]">ted</assigned_to>
          <cc>b.kelemen</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>108352</commentid>
    <comment_count>0</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2014-06-25 18:55:54 +0000</bug_when>
    <thetext>Order in which index entries should be reused is unspecified.

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

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:
&quot;if a gamepad is disconnected, and subsequently the same or a different gamepad is then connected, the lowest previously used index must be reused.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108353</commentid>
    <comment_count>1</comment_count>
    <who name="Ted Mielczarek [:ted]">ted</who>
    <bug_when>2014-06-25 19:02:28 +0000</bug_when>
    <thetext>Your suggestion is what Firefox implements (and I&apos;m fairly certain Chrome), and is certainly the intended behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119882</commentid>
    <comment_count>2</comment_count>
    <who name="Ted Mielczarek [:ted]">ted</who>
    <bug_when>2015-04-24 10:59:21 +0000</bug_when>
    <thetext>Moved to https://github.com/w3c/gamepad/issues/11</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>