<?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>17649</bug_id>
          
          <creation_ts>2012-06-29 13:27:33 +0000</creation_ts>
          <short_desc>Address WebIDL comments from Kyle Huey and Ms2ger</short_desc>
          <delta_ts>2013-03-01 22:27:11 +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>PC</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="Jonas Sicking (Not reading bugmail)">jonas</reporter>
          <assigned_to name="Joshua Bell">jsbell</assigned_to>
          <cc>eliotgra</cc>
    
    <cc>jsbell</cc>
    
    <cc>mike</cc>
    
    <cc>mounir</cc>
    
    <cc>Ms2ger</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>69534</commentid>
    <comment_count>0</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2012-06-29 13:27:33 +0000</bug_when>
    <thetext>http://lists.w3.org/Archives/Public/public-webapps/2012AprJun/1152.html

I&apos;m not sure that we can address all of them, such as the enum ones, due to limitations in ReSpec</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71337</commentid>
    <comment_count>1</comment_count>
    <who name="Eliot Graff">eliotgra</who>
    <bug_when>2012-07-23 23:45:00 +0000</bug_when>
    <thetext>Jonas,

I&apos;m assigning this to you. I&apos;ve taken care of some of Kyle&apos;s feedback, but I&apos;ll defer to you on things like the default values for the enums.


I&apos;ve FIXED the following:

3.1.9

The return type of the static functions on IDBKeyRange is not &apos;static
IDBKeyRange&apos;, it is just &apos;IDBKeyRange&apos;.

3.2.1

The correct type name is &quot;object&quot;, not &quot;Object&quot; (note the capitalization).

IDBRequest.readyState should be an enum type, not a DOMString.

3.2.2

IDBVersionChangeEvent should probably reference whatever spec defines how
constructors work for DOM events.

3.2.7

&quot;Object&quot; should be &quot;object&quot;.

3.2.8

IDBTransaction&apos;s mode attribute should be an enum type.



I DID NOT FIX the following items in the mail:

3.2.4

IDBDatabase.transaction&apos;s mode argument should be an enum type, with a
default value specified in IDL instead of in prose.

3.2.5

Is it intentional that IDBObjectStore.indexNames does not return the same
DOMStringList every time, unlike IDBDatabase.objectStoreNames (yes, I
realize that the circumstances under which the former can change are much
broader).

IDBObjectStore.openCursor&apos;s direction argument should be an enum type, with
a default value specified in IDL (right now it is unspecified).

3.2.6

IDBIndex.openCursor and IDBIndex.openKeyCursor&apos;s direction argument should
be an enum type, with a default value specified in IDL.



Also, it would be nice if we could tighten up keys from &apos;any&apos; to a union.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79852</commentid>
    <comment_count>2</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2012-12-10 18:50:22 +0000</bug_when>
    <thetext>One more I didn&apos;t see in Kyle&apos;s list:

3.1.12 Options Object - IDBObjectStoreParameters is defined as:

dictionary IDBObjectStoreParameters {
  DOMString? keyPath = null;
  boolean autoIncrement = false;
};

But the prose says: &quot;If the optionalParameters argument is specified and has a keyPath property which is not undefined or null, then set keyPath to the value of this property. If keyPath is an Array, then each item in the array is converted to a string. If keyPath is not an Array, it is converted to a string.&quot;

The IDL should either be:

  DOMString? keyPath = null;

or:

  (sequence&lt;DOMString&gt; or DOMString)? keyPath = null;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81943</commentid>
    <comment_count>3</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2013-01-22 17:07:28 +0000</bug_when>
    <thetext>Adding more IDL nits from Ms2ger - some overlap with items in this issue already, which is why I&apos;m not filing a separate bug.

Original messages dated January 21, 2013: http://lists.w3.org/Archives/Public/public-webapps/2013JanMar/

(1) IDBKeyRange should have static functions

From the examples in the IDB specification (in [1], for example) and from existing implementations, it appears that the functions on the IDBKeyRange interface (only, lowerBound, upperBound and bound) should be static. However, there is no actual normative requirement to that effect; instead, the IDL snippet requires those functions to only be callable on IDBKeyRange instances. [2]

[1] https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#key-generator-concept
[2] https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#idl-def-IDBKeyRange


(2) Event handlers

The IDB specification still uses IDL like

  [TreatNonCallableAsNull] attribute Function? onsuccess;

for its event handlers. Current practice is to use

  attribute EventHandler onsuccess;


(3) Type of IDBRequest.source

IDBRequest.source has type &quot;object&quot; in the IDL snippet, but the definition claims the attribute can return null. If this is the case, the type should be &quot;object?&quot;, as for all nullable types.


(4) Type of IDBRequest.readyState

interface IDBRequest : EventTarget {
    // …
    readonly attribute enum           readyState;
    // …
};

However, &quot;enum&quot; is not a type. The correct syntax would be something like

enum IDBReadyState { &quot;pending&quot;, &quot;done&quot; };

interface IDBRequest : EventTarget {
    // …
    readonly attribute IDBReadyState  readyState;
    // …
};

(5) Type of IDBCursor.source

IDBCursor.source is described as returning &quot;object&quot;. It would be better to return the union (IDBObjectStore or IDBIndex), to make it clear that that is what&apos;s intended.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81948</commentid>
    <comment_count>4</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2013-01-22 17:12:57 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; The IDL should either be:
&gt; 
&gt;   DOMString? keyPath = null;

I believe I meant:

    any? keyPath = null;

But the union is preferable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83850</commentid>
    <comment_count>5</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2013-02-28 23:40:30 +0000</bug_when>
    <thetext>From Ms2ger&apos;s list:


(1) IDBKeyRange should have static functions
- Resolved as https://dvcs.w3.org/hg/IndexedDB/rev/bf71413d740c

(2) Event handlers
- Resolved as https://dvcs.w3.org/hg/IndexedDB/rev/09a89b16b4b2

(3) Type of IDBRequest.source
- Resolved as https://dvcs.w3.org/hg/IndexedDB/rev/0f8193ddb6af

(4) Type of IDBRequest.readyState
- Resolved as https://dvcs.w3.org/hg/IndexedDB/rev/18b6e04cc02c

#5 is not yet fixed, and #3 could be improved to be:
 readonly attribute (IDBObjectStore or IDBIndex or IDBCursor)? source;
... but I&apos;m hitting a ReSpec.js bug (?) with unions</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83851</commentid>
    <comment_count>6</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2013-03-01 00:10:19 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; 3.2.6
&gt; 
&gt; IDBIndex.openCursor and IDBIndex.openKeyCursor&apos;s direction argument should
&gt; be an enum type, with a default value specified in IDL.

Resolved in: https://dvcs.w3.org/hg/IndexedDB/rev/47815a2eaed6</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83852</commentid>
    <comment_count>7</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2013-03-01 00:11:41 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt; (In reply to comment #1)
&gt; &gt; 3.2.6
&gt; &gt; 
&gt; &gt; IDBIndex.openCursor and IDBIndex.openKeyCursor&apos;s direction argument should
&gt; &gt; be an enum type, with a default value specified in IDL.
&gt; 
&gt; Resolved in: https://dvcs.w3.org/hg/IndexedDB/rev/47815a2eaed6

Whoops, that covers this as well:

&gt; IDBObjectStore.openCursor&apos;s direction argument should be an enum type, with
&gt; a default value specified in IDL (right now it is unspecified).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83854</commentid>
    <comment_count>8</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2013-03-01 00:28:19 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; 3.2.4
&gt; 
&gt; IDBDatabase.transaction&apos;s mode argument should be an enum type, with a
&gt; default value specified in IDL instead of in prose.

Resolved in https://dvcs.w3.org/hg/IndexedDB/rev/8e121d53f2f6 (although I left the prose in there as well).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83855</commentid>
    <comment_count>9</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2013-03-01 00:47:52 +0000</bug_when>
    <thetext>&gt; Also, it would be nice if we could tighten up keys from &apos;any&apos; to a union.

This is tracked w/ suggested fix as: https://www.w3.org/Bugs/Public/show_bug.cgi?id=20582

...


Here&apos;s what remains:
 
&gt; 3.2.5
&gt; 
&gt; Is it intentional that IDBObjectStore.indexNames does not return the same
&gt; DOMStringList every time, unlike IDBDatabase.objectStoreNames (yes, I
&gt; realize that the circumstances under which the former can change are much
&gt; broader).

That requires thinking. &quot;Next!&quot;

The rest are all union types, blocked on a ReSpec bug (?) to get the IDL perfect:

&gt; dictionary IDBObjectStoreParameters {
&gt;   DOMString? keyPath = null;
&gt;   boolean autoIncrement = false;
&gt; };

Should be:  (sequence&lt;DOMString&gt; or DOMString)? keyPath = null;
Or as a fallback:   any? keyPath = null;

&gt; Type of IDBRequest.source

Should be: (IDBObjectStore or IDBIndex or IDBCursor)?
 
&gt; Type of IDBCursor.source

Should be: (IDBObjectStore or IDBIndex)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83864</commentid>
    <comment_count>10</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2013-03-01 10:09:58 +0000</bug_when>
    <thetext>Robin?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83865</commentid>
    <comment_count>11</comment_count>
    <who name="Robin Berjon">robin</who>
    <bug_when>2013-03-01 11:55:01 +0000</bug_when>
    <thetext>(In reply to comment #10)
&gt; Robin?

This should all be fixed in 3.1.46 that just shipped.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83871</commentid>
    <comment_count>12</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2013-03-01 17:50:51 +0000</bug_when>
    <thetext>&gt; &gt; Type of IDBRequest.source
&gt; 
&gt; Should be: (IDBObjectStore or IDBIndex or IDBCursor)?

Fixed! https://dvcs.w3.org/hg/IndexedDB/rev/8a1cffca7f26
  
&gt; &gt; Type of IDBCursor.source
&gt; 
&gt; Should be: (IDBObjectStore or IDBIndex)

Fixed! https://dvcs.w3.org/hg/IndexedDB/rev/8a1cffca7f26

(In reply to comment #9)
&gt; 
&gt; &gt; dictionary IDBObjectStoreParameters {
&gt; &gt;   DOMString? keyPath = null;
&gt; &gt;   boolean autoIncrement = false;
&gt; &gt; };
&gt; 
&gt; Should be:  (sequence&lt;DOMString&gt; or DOMString)? keyPath = null;

ReSpec.js is truncating &quot;sequence&lt;DOMString&gt;&quot; into &quot;sequence&quot;. Mail to Robin written but not yet sent. :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83872</commentid>
    <comment_count>13</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2013-03-01 18:00:34 +0000</bug_when>
    <thetext>(In reply to comment #12)
&gt; 
&gt; ReSpec.js is truncating &quot;sequence&lt;DOMString&gt;&quot; into &quot;sequence&quot;. Mail to Robin
&gt; written but not yet sent. :)

My bad, I wasn&apos;t escaping in the HTML. Derp.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83873</commentid>
    <comment_count>14</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2013-03-01 18:08:08 +0000</bug_when>
    <thetext>&gt; &gt; dictionary IDBObjectStoreParameters {
&gt; &gt;   DOMString? keyPath = null;
&gt; &gt;   boolean autoIncrement = false;
&gt; &gt; };
&gt; 
&gt; Should be:  (sequence&lt;DOMString&gt; or DOMString)? keyPath = null;

Fixed! https://dvcs.w3.org/hg/IndexedDB/rev/dffdbbe300ab

This leaves the DOMStringList question re: 3.2.5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83890</commentid>
    <comment_count>15</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2013-03-01 22:26:20 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; 3.2.5
&gt; 
&gt; Is it intentional that IDBObjectStore.indexNames does not return the same
&gt; DOMStringList every time, unlike IDBDatabase.objectStoreNames (yes, I
&gt; realize that the circumstances under which the former can change are much
&gt; broader).

Is this question about the identity of the DOMStringList object returned by the property accesses, or about the values contained in the lists?

I&apos;m choosing to focus on the inconsistencies between the property definitions. I&apos;ve added the same text about snapshotting to indexNames as is present on objectStoreNames.

If that&apos;s not the intent of the question, can we file a new bug?

Resolved in https://dvcs.w3.org/hg/IndexedDB/rev/49660ca248b0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83891</commentid>
    <comment_count>16</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2013-03-01 22:27:11 +0000</bug_when>
    <thetext>I believe all issues mentioned in this bug have now been addressed. 

If not, we should probably file a new, much shorter bug. :)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>