Title: [194754] trunk
Revision
194754
Author
beid...@apple.com
Date
2016-01-07 20:08:36 -0800 (Thu, 07 Jan 2016)

Log Message

Modern IDB: Success-after-open event should only have the IDBOpenDBRequest as its target.
https://bugs.webkit.org/show_bug.cgi?id=152875

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (At least 2 failing tests now pass).

* Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
(WebCore::IDBClient::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):

* Modules/indexeddb/client/IDBRequestImpl.cpp:
(WebCore::IDBClient::IDBRequest::dispatchEvent): Only add the transaction and database as potential
  targets for this event if it is *not* the success-after-open event.
* Modules/indexeddb/client/IDBRequestImpl.h:

LayoutTests:

* platform/mac-wk1/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (194753 => 194754)


--- trunk/LayoutTests/ChangeLog	2016-01-08 03:58:33 UTC (rev 194753)
+++ trunk/LayoutTests/ChangeLog	2016-01-08 04:08:36 UTC (rev 194754)
@@ -1,3 +1,12 @@
+2016-01-07  Brady Eidson  <beid...@apple.com>
+
+        Modern IDB: Success-after-open event should only have the IDBOpenDBRequest as its target.
+        https://bugs.webkit.org/show_bug.cgi?id=152875
+
+        Reviewed by Alex Christensen.
+
+        * platform/mac-wk1/TestExpectations:
+
 2016-01-07  Alexey Proskuryakov  <a...@apple.com>
 
         Better test gardening. Only skip those tests that use touch events, not the whole

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (194753 => 194754)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2016-01-08 03:58:33 UTC (rev 194753)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2016-01-08 04:08:36 UTC (rev 194754)
@@ -73,10 +73,6 @@
 imported/w3c/indexeddb/interfaces.html [ Skip ]
 imported/w3c/indexeddb/keyorder.htm [ Skip ]
 
-# W3C IDB tests - Legacy IDB passes, Modern IDB fails
-imported/w3c/indexeddb/request_bubble-and-capture.htm [ Failure ]
-imported/w3c/indexeddb/transaction_bubble-and-capture.htm [ Failure ]
-
 # W3C IDB tests - Legacy IDB fails, Modern IDB fails differently
 imported/w3c/indexeddb/idbindex_get7.htm [ Failure ]
 imported/w3c/indexeddb/idbindex_getKey7.htm [ Failure ]

Modified: trunk/Source/WebCore/ChangeLog (194753 => 194754)


--- trunk/Source/WebCore/ChangeLog	2016-01-08 03:58:33 UTC (rev 194753)
+++ trunk/Source/WebCore/ChangeLog	2016-01-08 04:08:36 UTC (rev 194754)
@@ -1,3 +1,20 @@
+2016-01-07  Brady Eidson  <beid...@apple.com>
+
+        Modern IDB: Success-after-open event should only have the IDBOpenDBRequest as its target.
+        https://bugs.webkit.org/show_bug.cgi?id=152875
+
+        Reviewed by Alex Christensen.
+
+        No new tests (At least 2 failing tests now pass).
+
+        * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
+        (WebCore::IDBClient::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
+
+        * Modules/indexeddb/client/IDBRequestImpl.cpp:
+        (WebCore::IDBClient::IDBRequest::dispatchEvent): Only add the transaction and database as potential
+          targets for this event if it is *not* the success-after-open event.
+        * Modules/indexeddb/client/IDBRequestImpl.h:
+
 2016-01-07  Brent Fulgham  <bfulg...@apple.com>
 
         Correct missing EXT_sRGB Format Handling

Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp (194753 => 194754)


--- trunk/Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp	2016-01-08 03:58:33 UTC (rev 194753)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp	2016-01-08 04:08:36 UTC (rev 194754)
@@ -84,7 +84,10 @@
     ASSERT(m_result->type() == IDBAny::Type::IDBDatabase);
     m_transaction->addRequest(*this);
 
-    enqueueEvent(Event::create(eventNames().successEvent, false, false));
+    auto event = Event::create(eventNames().successEvent, false, false);
+    m_openDatabaseSuccessEvent = &event.get();
+
+    enqueueEvent(WTFMove(event));
 }
 
 void IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion()

Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp (194753 => 194754)


--- trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp	2016-01-08 03:58:33 UTC (rev 194753)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp	2016-01-08 04:08:36 UTC (rev 194754)
@@ -274,7 +274,9 @@
     Vector<RefPtr<EventTarget>> targets;
     targets.append(this);
 
-    if (m_transaction) {
+    if (&event == m_openDatabaseSuccessEvent)
+        m_openDatabaseSuccessEvent = nullptr;
+    else if (m_transaction) {
         if (!m_transaction->isFinished())
             targets.append(m_transaction);
         if (!m_transaction->database().isClosingOrClosed())

Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h (194753 => 194754)


--- trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h	2016-01-08 03:58:33 UTC (rev 194753)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h	2016-01-08 04:08:36 UTC (rev 194754)
@@ -131,6 +131,8 @@
     IndexedDB::RequestType m_requestType = { IndexedDB::RequestType::Other };
     bool m_contextStopped { false };
 
+    Event* m_openDatabaseSuccessEvent { nullptr };
+
 private:
     void onError();
     void onSuccess();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to