RE: [indexeddb] Default direction of Cursors

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 UTC