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

RE: [indexeddb] Default direction of Cursors

From: Israel Hilerio <israelh@microsoft.com>
Date: Mon, 6 Jun 2011 17:20:46 +0000
To: Jonas Sicking <jonas@sicking.cc>
CC: "public-webapps@w3.org" <public-webapps@w3.org>
Message-ID: <F695AF7AA77CC745A271AD0F61BBC61E3D143CDD@TK5EX14MBXC115.redmond.corp.microsoft.com>
What about this:

The default value for the range will be null which implies:
IDBKeyRange.lower = undefined
IDBKeyRange.upper = undefined
IDBKeyRange.lowerOpen = false
IDBKeyRange.upperOpen = false

The default value for the direction will be IDBCursor.NEXT.

Israel

On Mon, Jun 6, 2011 at 10:03 AM, Jonas Sicking wrote:
> 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:21:14 GMT

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