Bug 62299 - IndexedDB test: key sort order across types
Summary: IndexedDB test: key sort order across types
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-08 11:17 PDT by Mark Pilgrim (Google)
Modified: 2011-06-10 17:24 PDT (History)
4 users (show)

See Also:


Attachments
Patch (5.98 KB, patch)
2011-06-08 11:18 PDT, Mark Pilgrim (Google)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Pilgrim (Google) 2011-06-08 11:17:07 PDT
http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#key-construct states "For purposes of comparison, all Arrays are greater than all DOMString, Date and float values; all DOMString values are greater than all Date and float values; and all Date values are greater than all float values." Further, http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#dfn-object-store states "Each record consists of a key and a value. The list is sorted according to key in ascending order."

This test adds a number of keys not in sorted order, then opens and iterates a cursor to check that the keys appear in sorted order according ot the sort rules laid out in the spec.

WebKit passes this test.
Comment 1 Mark Pilgrim (Google) 2011-06-08 11:18:18 PDT
Created attachment 96441 [details]
Patch
Comment 2 David Grogan 2011-06-08 12:49:22 PDT
LGTM

This reminded me that we don't handle Date yet.
Comment 3 David Grogan 2011-06-08 12:54:42 PDT
(In reply to comment #2)
> LGTM
> 
> This reminded me that we don't handle Date yet.

I guess bug 62300 proves this statement incorrect.

Why does this test not include comparing dates to these other types?  Just how the mozilla tests were?
Comment 4 Mark Pilgrim (Google) 2011-06-08 13:00:44 PDT
Actually we're done with the Mozilla tests; these are original tests I made up last week (and am just getting around to uploading now).

I could add some dates, but I'd have to change how we're comparing values since new Date(0) != new Date(0) in JavaScript.
Comment 5 David Grogan 2011-06-08 13:17:29 PDT
(In reply to comment #4)
> Actually we're done with the Mozilla tests; these are original tests I made up last week (and am just getting around to uploading now).

Hey, congratulations.  (Now I see that your usual link to the mozilla test isn't present here.)

> 
> I could add some dates, but I'd have to change how we're comparing values since new Date(0) != new Date(0) in JavaScript.

Following up in bug 62300.
Comment 6 WebKit Review Bot 2011-06-08 15:35:19 PDT
Comment on attachment 96441 [details]
Patch

Clearing flags on attachment: 96441

Committed r88397: <http://trac.webkit.org/changeset/88397>
Comment 7 WebKit Review Bot 2011-06-08 15:35:24 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Hans Wennborg 2011-06-09 02:22:32 PDT
(In reply to comment #2)
> This reminded me that we don't handle Date yet.

I thought we did support dates. Am I missing something?
Comment 9 David Grogan 2011-06-09 12:38:38 PDT
(In reply to comment #8)
> (In reply to comment #2)
> > This reminded me that we don't handle Date yet.
> 
> I thought we did support dates. Am I missing something?

We do, you're not missing anything.

I had a vague recollection of seeing a TODO somewhere that talked about *something* not supporting dates.  Now I'm trying to remember what that was about.
Comment 10 Mark Pilgrim (Google) 2011-06-10 07:26:38 PDT
LayoutTests/storage/indexedb/tutorial.html mentions that WebKit does not support dates or arrays.


    // Keys can be integers, strings, or null. (The spec also defines dates and there's talk of
    // handling arrays, but these are not implemented yet in Chromium/WebKit.) 

I'd be happy to open another bug about updating the tutorial with current information, if you like.
Comment 11 David Grogan 2011-06-10 17:24:23 PDT
(In reply to comment #10)
> LayoutTests/storage/indexedb/tutorial.html mentions that WebKit does not support dates or arrays.
> 
> 
>     // Keys can be integers, strings, or null. (The spec also defines dates and there's talk of
>     // handling arrays, but these are not implemented yet in Chromium/WebKit.) 
> 
> I'd be happy to open another bug about updating the tutorial with current information, if you like.

Sure!