This is the catch-all bug for the exception work that we need to do in IndexedDB - mostly this involves aligning our exceptions to DOM4 exceptions, but there are a few places where the spec says we should throw a JavaScript TypeError.
Most of these are straight forward, but I spent some time trying to figure out how easy it would be to support the "Javascript TypeError" requirements in the indexeddb spec - it's kind of a nightmare in WebKit, since it's a JSEngine-specific call. The only way to support these are via additional features in WebIDL. there are only 3 in the spec, I suspect we should pushback and/or spin off into a separate bug. The three places are: 1) in open(), the version has to be > 0 2) in advance() the count must be > 0 3) in openCursor() the direction must be one of a small set of valid strings (and for legacy support, also possibly a number between 0 and 3 inclusive
Adding the metadata-snapshot stuff because that has the side benefit of letting the render-side (frontend) objects know that they've been deleted - i.e. by adding a deleted flag to IDBObjectStore and the like, and throwing an InvalidStateError when that occurs.
What's left to do here - just the TypeError work in http://webkit.org/b/87987 ?
I think there are one or two one-off fixes left - last I did a sweep through, about a week ago, I found one and made a unit test - I'll go dig up that branch.
Anything else remaining?
Created attachment 155094 [details] Patch
Created attachment 155889 [details] Patch
This is ready to land. Just rearranged some of the tests slightly for readability and to match the spec order (except in a few places to avoid horrible async contortions). dgrogan@, alecflett@ - please take a look.
Comment on attachment 155889 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=155889&action=review LGTM > LayoutTests/storage/indexeddb/resources/exceptions.js:213 > + // "Occurs if a request is made on a source object that has been deleted or removed." - covered in deleted-objects.html Are these comments intentional?
(In reply to comment #9) > > LayoutTests/storage/indexeddb/resources/exceptions.js:213 > > + // "Occurs if a request is made on a source object that has been deleted or removed." - covered in deleted-objects.html > > Are these comments intentional? Yeah - those are the only exceptions listed in the spec that this patch didn't test, and I wanted to make sure that the coverage in that other test was referenced.
tony@ - r? cq?
Comment on attachment 155889 [details] Patch rs=me
Comment on attachment 155889 [details] Patch Clearing flags on attachment: 155889 Committed r124837: <http://trac.webkit.org/changeset/124837>
All reviewed patches have been landed. Closing bug.