Bug 58660 - IndexedDB setVersion() does not trigger versionchange event
Summary: IndexedDB setVersion() does not trigger versionchange event
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-15 06:59 PDT by Mark Pilgrim (Google)
Modified: 2011-04-15 12:07 PDT (History)
4 users (show)

See Also:


Attachments
test case (1.71 KB, text/html)
2011-04-15 07:00 PDT, Mark Pilgrim (Google)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Pilgrim (Google) 2011-04-15 06:59:50 PDT
According to http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html (search for "VERSION_CHANGE transaction steps"), calling setVersion() on an open database should trigger a versionchange event on the database object. Mozilla does this ( test: http://mxr.mozilla.org/mozilla2.0/source/dom/indexedDB/test/test_setVersion_events.html?force=1 ) but in WebKit the versionchange event is never fired.
Comment 1 Mark Pilgrim (Google) 2011-04-15 07:00:37 PDT
Created attachment 89782 [details]
test case
Comment 2 David Grogan 2011-04-15 11:55:35 PDT
Assuming that the test fails without those lines commented out (versionChangeEventCount++ etc), I think moz got this one wrong.  A versionchange event should be fired at _other_ open connections, but not the one that calls setVersion.

This is the relevant part of the spec, the crucial bit being "except connection":

Let openDatabases be the set of all IDBDatabase and IDBDatabaseSync objects, except connection, connected to the same database as connection.

Fire a versionchange event at each object in openDatabases that is open.
Comment 3 Mark Pilgrim (Google) 2011-04-15 12:07:41 PDT
Aha, that makes more sense. I don't think they got it wrong; I think it was my misunderstanding in porting the test. Closing as invalid.