<?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>16653</bug_id>
          
          <creation_ts>2012-04-06 18:41:31 +0000</creation_ts>
          <short_desc>IndexedDB: Define overloads for IDBDatabase.transaction()</short_desc>
          <delta_ts>2013-04-02 17:43:42 +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="Joshua Bell">jsbell</reporter>
          <assigned_to name="Joshua Bell">jsbell</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>jonas</cc>
    
    <cc>mcginnis900</cc>
    
    <cc>mike</cc>
    
    <cc>odinho</cc>
    
    <cc>public-webapps</cc>
    
    <cc>robin</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>66485</commentid>
    <comment_count>0</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2012-04-06 18:41:31 +0000</bug_when>
    <thetext>Currently the IDL is:

  IDBTransaction transaction (any storeNames, optional DOMString mode);

There was discussion on the list about removing &quot;any&quot; and using overloads to define the binding behavior here, e.g.:

  IDBTransaction transaction (DOMString storeName, optional DOMString mode);
  IDBTransaction transaction (sequence&lt;DOMString&gt; storeNames, optional DOMString mode);
  IDBTransaction transaction (DOMStringList storeNames, optional DOMString mode);

Not sure if we want sequence&lt;DOMString&gt; or DOMString[] (I think the former is the new hotness); also, not sure if DOMStringList can be defined to &quot;coerce&quot; to sequence&lt;DOMString&gt; to reduce the use of that type.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66490</commentid>
    <comment_count>1</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2012-04-06 22:55:06 +0000</bug_when>
    <thetext>I don&apos;t think we can do this until ReSpec is changed to support it. Please let me know if I&apos;m wrong though.

I *think* the proper WebIDL syntax would be

enum transactionMode { &quot;readonly, &quot;readwrite&quot; };
IDBTransaction transaction ((DOMString or sequence&lt;DOMString&gt;) storeName,
                            optional transactionMode mode);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67249</commentid>
    <comment_count>2</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2012-05-02 19:00:42 +0000</bug_when>
    <thetext>More broadly, methods that are currently spec&apos;d to take &quot;any&quot; arguments that could be distinguished by WebIDL overloads should be, as this eliminates the need for this spec to deal with conversions (e.g. is passing a JS number to a function that takes a DOMString allowed or a TypeError?)

This does NOT apply to arguments which are keys (which is covered clearly in the spec) or values (ditto, via HTML5 structured clone algorithm)

That leaves:

IDBDatabase.transaction(any storeNames, ...)
IDBObjectStore.createIndex(..., any keyPath, ...)

(plus IDB*Sync variants)

As an example where spec ambiguity could exist, the behavior of JS and undefined and null values for is well covered by the WebIDL spec in the case of db.createObjectStore(name, {keyPath: VALUE_IN_QUESTION}) but not in the case of store.createIndex(name, VALUE_IN_QUESTION). Ensuring that the interpretation the keyPath value in both methods is dictated by WebIDL seems highly desirable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67265</commentid>
    <comment_count>3</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2012-05-02 21:37:18 +0000</bug_when>
    <thetext>Robin, any plans to get ReSpec fixed to support these types of things?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83875</commentid>
    <comment_count>4</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2013-03-01 19:05:11 +0000</bug_when>
    <thetext>This should be resolved in: https://dvcs.w3.org/hg/IndexedDB/rev/b6d2f7b5a5a0

Since I filed this, I&apos;d appreciate it if someone else could verify that the changes make sense.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85429</commentid>
    <comment_count>5</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-04-02 17:43:42 +0000</bug_when>
    <thetext>For what it&apos;s worth, the changes make sense to me as a binding implementor.  I can&apos;t speak for whether they make sense for indexeddb per se...</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>