<?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>16013</bug_id>
          
          <creation_ts>2012-02-17 13:05:33 +0000</creation_ts>
          <short_desc>objectStoreNames order should be specified (alphabetic?)</short_desc>
          <delta_ts>2012-03-02 16:19:48 +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>Indexed Database API</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Odin Hørthe Omdal">odinho</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>israelh</cc>
    
    <cc>jonas</cc>
    
    <cc>jsbell</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>64225</commentid>
    <comment_count>0</comment_count>
    <who name="Odin Hørthe Omdal">odinho</who>
    <bug_when>2012-02-17 13:05:33 +0000</bug_when>
    <thetext>We should probably specify objectStoreNames order.

http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#widl-IDBDatabase-objectStoreNames
http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#widl-IDBDatabaseSync-objectStoreNames

I suggest changing:

&gt; On getting, this attribute must return a list of names of the object stores
&gt; currently in the connected database. 

To:

&gt; On getting, this attribute must return a list of names of the object stores
&gt; currently in the connected database sorted in ascending order.


Should also specify what we mean by sorted in ascending order here. Probably the same as is already said for comparing DOMStrings in keys.

E.g. step 5 of http://es5.github.com/#x11.8.5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64228</commentid>
    <comment_count>1</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2012-02-17 14:28:23 +0000</bug_when>
    <thetext>I think alphabetic or creation order would be the two simplest solutions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64247</commentid>
    <comment_count>2</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2012-02-17 18:06:03 +0000</bug_when>
    <thetext>Agreed that it should be specified.

I lean slightly towards lexical order rather than creation order since creation order might require some implementations to store additional data just for that purpose.

This should apply to the IDBObjectStore.indexNames attribute as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64297</commentid>
    <comment_count>3</comment_count>
    <who name="Odin Hørthe Omdal">odinho</who>
    <bug_when>2012-02-20 09:38:58 +0000</bug_when>
    <thetext>I concur with Joshua Bell.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64509</commentid>
    <comment_count>4</comment_count>
    <who name="Israel Hilerio [MSFT]">israelh</who>
    <bug_when>2012-02-23 22:15:06 +0000</bug_when>
    <thetext>I would prefer if we were to return them using creation order.  Returning them in alphabetic order works well (for US) until you start having to deal with collations, then things get complex very quickly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64510</commentid>
    <comment_count>5</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2012-02-23 22:23:03 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; I would prefer if we were to return them using creation order.  Returning them
&gt; in alphabetic order works well (for US) until you start having to deal with
&gt; collations, then things get complex very quickly.

FWIW, I would assume that if we&apos;re sorting them follow the same order that JavaScript strings sort, by comparing 16-bit units, not actually alphabetical-in-a-real-language or according to any Unicode collation. e.g. [ &quot;&quot;, &quot;\x00&quot;, &quot;0&quot;, &quot;1&quot;, &quot;A&quot;, &quot;B&quot;, &quot;a&quot;, &quot;b&quot;, &quot;\xC0, &quot;\xFF&quot;, &quot;\uD7FF&quot;, &quot;\uD800\uDC00&quot;, &quot;\uE000&quot;, &quot;\uFFFF&quot; ]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64516</commentid>
    <comment_count>6</comment_count>
    <who name="Israel Hilerio [MSFT]">israelh</who>
    <bug_when>2012-02-24 01:02:41 +0000</bug_when>
    <thetext>I&apos;m not sure that using JavaScript strings sorting provides a meaningful solution.  Developers will still have to sort their objectStore names if they want to guarantee that they are correctly sorted (&quot;A&quot;, &quot;a&quot;, &quot;B&quot;, &quot;b&quot;, etc.).

Israel</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64517</commentid>
    <comment_count>7</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2012-02-24 01:06:10 +0000</bug_when>
    <thetext>IMHO, the intent of this issue is to ensure the stores are reported in deterministic order, not necessarily an order that&apos;s useful.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64536</commentid>
    <comment_count>8</comment_count>
    <who name="Odin Hørthe Omdal">odinho</who>
    <bug_when>2012-02-24 12:57:44 +0000</bug_when>
    <thetext>Reading objectStoreNames and indexNames may not be what you do as your bread and butter, but it&apos;s nice having them interoperable between implementations. We never know what crazy code someone will write ;-)

I really prefer the stupid lexical sort over creation order, because of the implementation issue Joshua highlighted.

Lexical is just an easy sort right before returning the names. Creation order on the other hand means we&apos;ve got to store extra information about every object store and index.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64577</commentid>
    <comment_count>9</comment_count>
    <who name="Israel Hilerio [MSFT]">israelh</who>
    <bug_when>2012-02-24 23:28:27 +0000</bug_when>
    <thetext>Sounds reasonable, we agree!

While we already return our object store and index names using creation date ordering, we&apos;re okay with changing this internal behavior to return them (object store names and index names) in lexical sort order.  The good news is that we don&apos;t see this change impacting any of our internal and external partner implementations.

We&apos;re definetely looking forward to having IDB be one of the new interoperable storage solutions on HTML5.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64648</commentid>
    <comment_count>10</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2012-02-27 16:42:07 +0000</bug_when>
    <thetext>Sounds good to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64918</commentid>
    <comment_count>11</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2012-03-02 16:12:02 +0000</bug_when>
    <thetext>Fixed for both objectStoreNames and indexNames. I used the same reference for sorting order as we use for strings when sorting keys.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64921</commentid>
    <comment_count>12</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2012-03-02 16:19:48 +0000</bug_when>
    <thetext>Fixed</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>