[Bug 21801] New: [IndexedDB] Cursor operations when source deleted are not defined

https://www.w3.org/Bugs/Public/show_bug.cgi?id=21801

            Bug ID: 21801
           Summary: [IndexedDB] Cursor operations when source deleted are
                    not defined
    Classification: Unclassified
           Product: WebAppsWG
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Indexed Database API
          Assignee: dave.null@w3.org
          Reporter: jsbell@chromium.org
        QA Contact: public-webapps-bugzilla@w3.org
                CC: mike@w3.org, public-webapps@w3.org

In a version change transaction:

store = db.createObjectStore("store");
db.deleteObjectStore("store");
store.put(0, 0); // throws InvalidStateError since object is deleted

But consider:

store = db.createObjectStore("store");
store.put(0, 0);
store.openCursor().onsuccess = function(e) {
  var cursor = e.target.result;
  if (cursor) {
    db.deleteObjectStore("store");
    cursor.continue();
  }
};

The behavior here does not appear to be specified. It seems to me it should
also throw InvalidStateError. This could be specified by adding to the
operation descriptions for IDBIndex continue, advance, update and delete:

"If the cursor's source or effective object store has been deleted, the
implementation MUST throw a DOMException of type InvalidStateError."

(The same would apply to operations on an index if its object store is deleted.
That also seems underspecified.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Tuesday, 23 April 2013 19:39:59 UTC