Bug 135440 - IDB versionchange event not constructed with proper eventType
Summary: IDB versionchange event not constructed with proper eventType
Status: RESOLVED DUPLICATE of bug 136583
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Vicki Pfau
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-07-30 16:56 PDT by Vicki Pfau
Modified: 2014-09-05 15:16 PDT (History)
6 users (show)

See Also:


Attachments
Patch (4.48 KB, patch)
2014-07-30 17:41 PDT, Vicki Pfau
darin: review-
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-12 for mac-mountainlion-wk2 (483.25 KB, application/zip)
2014-07-30 19:43 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vicki Pfau 2014-07-30 16:56:07 PDT
When constructing a versionchange event in IDBDatabase::onVersionChange, the event is not constructed with a proper eventType, giving it a null event type.

<rdar://problem/17394855>
Comment 1 Vicki Pfau 2014-07-30 17:41:07 PDT
Created attachment 235785 [details]
Patch
Comment 2 Pratik Solanki 2014-07-30 17:56:50 PDT
Comment on attachment 235785 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=235785&action=review

> Source/WebCore/Modules/indexeddb/IDBDatabase.cpp:311
> +    enqueueEvent(IDBVersionChangeEvent::create(oldVersion, newVersion, newVersionNullness, eventNames().versionchangeEvent));

We should just make IDBVersionChangeEvent::create() pass the correct event name instead of having callers pass it. See for example EventFactory::create() which has

#if ENABLE(INDEXED_DATABASE)
    if (type == "IDBVersionChangeEvent")
        return IDBVersionChangeEvent::create();
#endif

That would also create an event with no name.
Comment 3 Build Bot 2014-07-30 19:43:50 PDT
Comment on attachment 235785 [details]
Patch

Attachment 235785 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/5219620243898368

New failing tests:
media/track/add-and-remove-track.html
Comment 4 Build Bot 2014-07-30 19:43:52 PDT
Created attachment 235802 [details]
Archive of layout-test-results from webkit-ews-12 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-12  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 5 Darin Adler 2014-08-19 09:36:13 PDT
Comment on attachment 235785 [details]
Patch

Setting review- so we can do what Pratik suggested.
Comment 6 Vicki Pfau 2014-08-19 14:07:35 PDT
The reason I hadn't done that yet it because some of the invocations of the constructor pass different event names. Which itself is weird and probably bad. I can have it have a sane default argument though, instead of just being null.
Comment 7 Pratik Solanki 2014-08-20 09:49:41 PDT
I think we should just remove the default arg and have it be one that callers are forced to pass. Make it the first argument of the create method and the constructor. Something like the following.

-    static PassRefPtr<IDBVersionChangeEvent> create(unsigned long long oldVersion = 0, unsigned long long newVersion = 0, IndexedDB::VersionNullness newVersionNullness = IndexedDB::VersionNullness::Null, const AtomicString& eventType = AtomicString())
+    static PassRefPtr<IDBVersionChangeEvent> create(const AtomicString& eventType, unsigned long long oldVersion = 0, unsigned long long newVersion = 0, IndexedDB::VersionNullness newVersionNullness = IndexedDB::VersionNullness::Null)
Comment 8 Vicki Pfau 2014-09-05 15:16:01 PDT
A patch identical to the r-'d patch here (minus tests) was landed with bug #136583.

*** This bug has been marked as a duplicate of bug 136583 ***