W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2011

Re: [indexeddb] Default direction of Cursors

From: Jonas Sicking <jonas@sicking.cc>
Date: Mon, 6 Jun 2011 10:02:35 -0700
Message-ID: <BANLkTimKLy65848XbjCfPgjSM=G20OY=Tg@mail.gmail.com>
To: Israel Hilerio <israelh@microsoft.com>
Cc: "public-webapps@w3.org" <public-webapps@w3.org>
On Mon, Jun 6, 2011 at 9:47 AM, Israel Hilerio <israelh@microsoft.com> wrote:
> On Mon, May 23, 2011 at 4:30 PM, Jonas Sicking wrote:
>> On Mon, May 23, 2011 at 12:54 PM, Israel Hilerio <israelh@microsoft.com>
>> wrote:
>> > I noticed that we don't define the default direction of a cursor when
>> accessing records.  Both, Firefox and Chrome go from smallest to
>> largest.  This seems reasonable to us.  Can we record this behavior on the
>> spec?
>>
>> Wow, good catch, that's a pretty glaring hole indeed. Yes, all cursors should
>> default to NEXT as direction IMHO.
>>
>> / Jonas
>
> How about adding the following to section "3.1.10 Cursor" to define the default behavior:
>
> "The default direction of a cursor is to move in a monolithically
> increasing order of the record keys.  The default range of a cursor is
> unbounded (that is, it has no upper and lower bounds defined). It is
> also closed, which implies it includes the endpoints."

Just specify the actual values that should be used as defaults
instead. I.e. IDBCursor.NEXT for the direction and null for the range.
That way the algorithms actually iterating the cursor will fully
define all edge cases. Your above text makes it unclear for example
what happens if the backing store is modified during iteration.

/ Jonas
Received on Monday, 6 June 2011 17:03:32 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:45 GMT