Diff
Modified: trunk/LayoutTests/ChangeLog (208404 => 208405)
--- trunk/LayoutTests/ChangeLog 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/LayoutTests/ChangeLog 2016-11-04 23:27:19 UTC (rev 208405)
@@ -1,3 +1,14 @@
+2016-11-04 Brady Eidson <[email protected]>
+
+ IndexedDB 2.0: Clean up more transaction abort and exception throwing behavior from IDBObjectStore.
+ https://bugs.webkit.org/show_bug.cgi?id=164424
+
+ Reviewed by Alex Christensen.
+
+ * storage/indexeddb/resources/transaction-basics.js:
+ * storage/indexeddb/transaction-basics-expected.txt:
+ * storage/indexeddb/transaction-basics-private-expected.txt:
+
2016-11-04 Ryosuke Niwa <[email protected]>
Load stylesheets in link elements inside a connected shadow tree
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (208404 => 208405)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2016-11-04 23:27:19 UTC (rev 208405)
@@ -1,5 +1,33 @@
2016-11-04 Brady Eidson <[email protected]>
+ IndexedDB 2.0: Clean up more transaction abort and exception throwing behavior from IDBObjectStore.
+ https://bugs.webkit.org/show_bug.cgi?id=164424
+
+ Reviewed by Alex Christensen.
+
+ This patch actually turns a handful of PASS to FAIL in the imported tests, but those are parts of the
+ spec in flux/under discussion.
+
+ We'll update either source or the tests as things are resolved.
+
+ * IndexedDB-private-browsing/idbcursor_advance_index7-expected.txt:
+ * IndexedDB-private-browsing/idbcursor_continue_index7-expected.txt:
+ * IndexedDB-private-browsing/idbindex_get7-expected.txt:
+ * IndexedDB-private-browsing/idbindex_getKey7-expected.txt:
+ * IndexedDB-private-browsing/idbindex_openCursor2-expected.txt:
+ * IndexedDB-private-browsing/idbindex_openKeyCursor3-expected.txt:
+ * web-platform-tests/IndexedDB/idbcursor_advance_index7-expected.txt:
+ * web-platform-tests/IndexedDB/idbcursor_continue_index7-expected.txt:
+ * web-platform-tests/IndexedDB/idbindex_get8-expected.txt:
+ * web-platform-tests/IndexedDB/idbindex_getKey8-expected.txt:
+ * web-platform-tests/IndexedDB/idbindex_openCursor3-expected.txt:
+ * web-platform-tests/IndexedDB/idbindex_openKeyCursor4-expected.txt:
+ * web-platform-tests/IndexedDB/transaction-abort-index-metadata-revert-expected.txt:
+ * web-platform-tests/IndexedDB/transaction-abort-multiple-metadata-revert-expected.txt:
+ * web-platform-tests/IndexedDB/transaction-abort-object-store-metadata-revert-expected.txt:
+
+2016-11-04 Brady Eidson <[email protected]>
+
IndexedDB 2.0: Handle IDBObjectStore rename behavior properly when version change transaction aborts.
https://bugs.webkit.org/show_bug.cgi?id=164416
Modified: trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbcursor_advance_index7-expected.txt (208404 => 208405)
--- trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbcursor_advance_index7-expected.txt 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbcursor_advance_index7-expected.txt 2016-11-04 23:27:19 UTC (rev 208405)
@@ -1,3 +1,5 @@
-PASS IDBCursor.advance() - index - throw TransactionInactiveError
+FAIL IDBCursor.advance() - index - throw TransactionInactiveError assert_throws: Calling advance() should throws an exception TransactionInactiveError when the transaction is not active. function "function () {
+ cursor.advance(1);
+ ..." threw object "InvalidStateError (DOM IDBDatabase Exception 11): Failed ..." that is not a DOMException TransactionInactiveError: property "code" is equal to 11, expected 0
Modified: trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbcursor_continue_index7-expected.txt (208404 => 208405)
--- trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbcursor_continue_index7-expected.txt 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbcursor_continue_index7-expected.txt 2016-11-04 23:27:19 UTC (rev 208405)
@@ -1,3 +1,5 @@
-PASS IDBCursor.continue() - index - throw TransactionInactiveError
+FAIL IDBCursor.continue() - index - throw TransactionInactiveError assert_throws: Calling continue() should throws an exception TransactionInactiveError when the transaction is not active. function "function () {
+ cursor.continue();
+ ..." threw object "InvalidStateError (DOM IDBDatabase Exception 11): Failed ..." that is not a DOMException TransactionInactiveError: property "code" is equal to 11, expected 0
Modified: trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbindex_get7-expected.txt (208404 => 208405)
--- trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbindex_get7-expected.txt 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbindex_get7-expected.txt 2016-11-04 23:27:19 UTC (rev 208405)
@@ -1,5 +1,3 @@
-FAIL IDBIndex.get() - throw TransactionInactiveError on aborted transaction assert_throws: function "function (){
- index.get("data");
- }" threw object "TransactionInactiveError (DOM IDBDatabase Exception): Fai..." that is not a DOMException InvalidStateError: property "code" is equal to 0, expected 11
+PASS IDBIndex.get() - throw TransactionInactiveError on aborted transaction
Modified: trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbindex_getKey7-expected.txt (208404 => 208405)
--- trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbindex_getKey7-expected.txt 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbindex_getKey7-expected.txt 2016-11-04 23:27:19 UTC (rev 208405)
@@ -1,5 +1,3 @@
-FAIL IDBIndex.getKey() - throw TransactionInactiveError on aborted transaction assert_throws: function "function (){
- index.getKey("data");
- }" threw object "TransactionInactiveError (DOM IDBDatabase Exception): Fai..." that is not a DOMException InvalidStateError: property "code" is equal to 0, expected 11
+PASS IDBIndex.getKey() - throw TransactionInactiveError on aborted transaction
Modified: trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbindex_openCursor2-expected.txt (208404 => 208405)
--- trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbindex_openCursor2-expected.txt 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbindex_openCursor2-expected.txt 2016-11-04 23:27:19 UTC (rev 208405)
@@ -1,5 +1,3 @@
-FAIL IDBIndex.openCursor() - throw TransactionInactiveError on aborted transaction assert_throws: function "function (){
- index.openCursor();
- }" threw object "TransactionInactiveError (DOM IDBDatabase Exception): Fai..." that is not a DOMException InvalidStateError: property "code" is equal to 0, expected 11
+PASS IDBIndex.openCursor() - throw TransactionInactiveError on aborted transaction
Modified: trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbindex_openKeyCursor3-expected.txt (208404 => 208405)
--- trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbindex_openKeyCursor3-expected.txt 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbindex_openKeyCursor3-expected.txt 2016-11-04 23:27:19 UTC (rev 208405)
@@ -1,5 +1,3 @@
-FAIL IDBIndex.openKeyCursor() - throw TransactionInactiveError on aborted transaction assert_throws: function "function (){
- index.openKeyCursor();
- }" threw object "TransactionInactiveError (DOM IDBDatabase Exception): Fai..." that is not a DOMException InvalidStateError: property "code" is equal to 0, expected 11
+PASS IDBIndex.openKeyCursor() - throw TransactionInactiveError on aborted transaction
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_advance_index7-expected.txt (208404 => 208405)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_advance_index7-expected.txt 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_advance_index7-expected.txt 2016-11-04 23:27:19 UTC (rev 208405)
@@ -1,3 +1,5 @@
-PASS IDBCursor.advance() - index - throw TransactionInactiveError
+FAIL IDBCursor.advance() - index - throw TransactionInactiveError assert_throws: Calling advance() should throws an exception TransactionInactiveError when the transaction is not active. function "function () {
+ cursor.advance(1);
+ ..." threw object "InvalidStateError (DOM IDBDatabase Exception 11): Failed ..." that is not a DOMException TransactionInactiveError: property "code" is equal to 11, expected 0
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_continue_index7-expected.txt (208404 => 208405)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_continue_index7-expected.txt 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_continue_index7-expected.txt 2016-11-04 23:27:19 UTC (rev 208405)
@@ -1,3 +1,5 @@
-PASS IDBCursor.continue() - index - throw TransactionInactiveError
+FAIL IDBCursor.continue() - index - throw TransactionInactiveError assert_throws: Calling continue() should throws an exception TransactionInactiveError when the transaction is not active. function "function () {
+ cursor.continue();
+ ..." threw object "InvalidStateError (DOM IDBDatabase Exception 11): Failed ..." that is not a DOMException TransactionInactiveError: property "code" is equal to 11, expected 0
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_get8-expected.txt (208404 => 208405)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_get8-expected.txt 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_get8-expected.txt 2016-11-04 23:27:19 UTC (rev 208405)
@@ -1,5 +1,3 @@
-FAIL IDBIndex.get() - throw InvalidStateError on index deleted by aborted upgrade assert_throws: function "function (){
- index.get("data");
- }" threw object "TransactionInactiveError (DOM IDBDatabase Exception): Fai..." that is not a DOMException InvalidStateError: property "code" is equal to 0, expected 11
+PASS IDBIndex.get() - throw InvalidStateError on index deleted by aborted upgrade
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_getKey8-expected.txt (208404 => 208405)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_getKey8-expected.txt 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_getKey8-expected.txt 2016-11-04 23:27:19 UTC (rev 208405)
@@ -1,5 +1,3 @@
-FAIL IDBIndex.getKey() - throw InvalidStateError on index deleted by aborted upgrade assert_throws: function "function (){
- index.getKey("data");
- }" threw object "TransactionInactiveError (DOM IDBDatabase Exception): Fai..." that is not a DOMException InvalidStateError: property "code" is equal to 0, expected 11
+PASS IDBIndex.getKey() - throw InvalidStateError on index deleted by aborted upgrade
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_openCursor3-expected.txt (208404 => 208405)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_openCursor3-expected.txt 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_openCursor3-expected.txt 2016-11-04 23:27:19 UTC (rev 208405)
@@ -1,5 +1,3 @@
-FAIL IDBIndex.openCursor() - throw InvalidStateError on index deleted by aborted upgrade assert_throws: function "function (){
- index.openCursor();
- }" threw object "TransactionInactiveError (DOM IDBDatabase Exception): Fai..." that is not a DOMException InvalidStateError: property "code" is equal to 0, expected 11
+PASS IDBIndex.openCursor() - throw InvalidStateError on index deleted by aborted upgrade
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_openKeyCursor4-expected.txt (208404 => 208405)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_openKeyCursor4-expected.txt 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_openKeyCursor4-expected.txt 2016-11-04 23:27:19 UTC (rev 208405)
@@ -1,5 +1,3 @@
-FAIL IDBIndex.openKeyCursor() - throw InvalidStateError on index deleted by aborted upgrade assert_throws: function "function (){
- index.openKeyCursor();
- }" threw object "TransactionInactiveError (DOM IDBDatabase Exception): Fai..." that is not a DOMException InvalidStateError: property "code" is equal to 0, expected 11
+PASS IDBIndex.openKeyCursor() - throw InvalidStateError on index deleted by aborted upgrade
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-abort-index-metadata-revert-expected.txt (208404 => 208405)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-abort-index-metadata-revert-expected.txt 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-abort-index-metadata-revert-expected.txt 2016-11-04 23:27:19 UTC (rev 208405)
@@ -1,8 +1,8 @@
-FAIL Created stores get their indexes marked as deleted after the transaction that created them aborts assert_throws: IDBIndex.get should throw InvalidStateError, indicating that the index is marked for deletion, immediately after IDBTransaction.abort() returns function "() => index.get('query')" threw object "TransactionInactiveError (DOM IDBDatabase Exception): Fai..." that is not a DOMException InvalidStateError: property "code" is equal to 0, expected 11
+PASS Created stores get their indexes marked as deleted after the transaction that created them aborts
FAIL Deleted stores get their indexes marked as not-deleted after the transaction that deleted them aborts assert_array_equals: IDBObjectStore.indexNames should be empty immediately after IDBDatabase.deleteObjectStore() returns lengths differ, expected 0 got 2
FAIL Created+deleted stores still have their indexes marked as deleted after the transaction aborts assert_array_equals: IDBObjectStore.indexNames should be empty immediately after IDBDatabase.deleteObjectStore() returns lengths differ, expected 0 got 2
-FAIL Created indexes get marked as deleted after their transaction aborts assert_throws: IDBIndex.get should throw InvalidStateError, indicating that the index is marked for deletion, immediately after IDBTransaction.abort() returns function "() => index.get('query')" threw object "TransactionInactiveError (DOM IDBDatabase Exception): Fai..." that is not a DOMException InvalidStateError: property "code" is equal to 0, expected 11
+PASS Created indexes get marked as deleted after their transaction aborts
FAIL Deleted indexes get marked as not-deleted after the transaction aborts assert_throws: IDBIndex.get should throw TransactionInactiveError, indicating that the index is no longer marked for deletion, immediately after IDBTransaction.abort() returns function "() => index.get('query')" threw object "InvalidStateError (DOM IDBDatabase Exception 11): Failed ..." that is not a DOMException TransactionInactiveError: property "code" is equal to 11, expected 0
PASS Created+deleted indexes are still marked as deleted after their transaction aborts
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-abort-multiple-metadata-revert-expected.txt (208404 => 208405)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-abort-multiple-metadata-revert-expected.txt 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-abort-multiple-metadata-revert-expected.txt 2016-11-04 23:27:19 UTC (rev 208405)
@@ -1,5 +1,5 @@
-FAIL Deleted indexes in newly created stores are still marked as deleted after the transaction aborts assert_throws: IDBObjectStore.get should throw InvalidStateError, indicating that the store is marked for deletion, immediately after IDBTransaction.abort() returns function "() => store.get('query')" threw object "TransactionInactiveError (DOM IDBDatabase Exception): Fai..." that is not a DOMException InvalidStateError: property "code" is equal to 0, expected 11
+PASS Deleted indexes in newly created stores are still marked as deleted after the transaction aborts
FAIL Deleted indexes in deleted stores are still marked as not-deleted after the transaction aborts assert_array_equals: IDBObjectStore.indexNames for the deleted store should be empty immediately after IDBDatabase.deleteObjectStore() returns lengths differ, expected 0 got 1
FAIL Deleted indexes in created+deleted stores are still marked as deleted after their transaction aborts assert_array_equals: IDBObjectStore.indexNames should be empty immediately after IDBDatabase.deleteObjectStore() returns lengths differ, expected 0 got 1
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-abort-object-store-metadata-revert-expected.txt (208404 => 208405)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-abort-object-store-metadata-revert-expected.txt 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-abort-object-store-metadata-revert-expected.txt 2016-11-04 23:27:19 UTC (rev 208405)
@@ -1,6 +1,6 @@
-FAIL Created stores get marked as deleted after their transaction aborts assert_throws: IDBObjectStore.get should throw InvalidStateError, indicating that the store is marked for deletion, immediately after IDBTransaction.abort() returns function "() => store.get('query')" threw object "TransactionInactiveError (DOM IDBDatabase Exception): Fai..." that is not a DOMException InvalidStateError: property "code" is equal to 0, expected 11
-PASS Deleted stores get marked as not-deleted after the transaction aborts
-FAIL Created+deleted stores are still marked as deleted after their transaction aborts assert_throws: IDBObjectStore.get should throw InvalidStateError, indicating that the store is still marked for deletion, immediately after IDBTransaction.abort() returns function "() => store.get('query')" threw object "TransactionInactiveError (DOM IDBDatabase Exception): Fai..." that is not a DOMException InvalidStateError: property "code" is equal to 0, expected 11
+PASS Created stores get marked as deleted after their transaction aborts
+FAIL Deleted stores get marked as not-deleted after the transaction aborts assert_throws: IDBObjectStore.get should throw TransactionInactiveError, indicating that the store is no longer marked for deletion, immediately after IDBTransaction.abort() returns function "() => store.get('query')" threw object "InvalidStateError (DOM IDBDatabase Exception 11): Failed ..." that is not a DOMException TransactionInactiveError: property "code" is equal to 11, expected 0
+PASS Created+deleted stores are still marked as deleted after their transaction aborts
PASS Un-instantiated deleted stores get marked as not-deleted after the transaction aborts
Modified: trunk/LayoutTests/storage/indexeddb/resources/transaction-basics.js (208404 => 208405)
--- trunk/LayoutTests/storage/indexeddb/resources/transaction-basics.js 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/LayoutTests/storage/indexeddb/resources/transaction-basics.js 2016-11-04 23:27:19 UTC (rev 208405)
@@ -100,18 +100,18 @@
{
debug("");
debug("testInactiveAbortedTransaction():");
- evalAndExpectException("index.openCursor()", "0", "'TransactionInactiveError'");
- evalAndExpectException("index.openKeyCursor()", "0", "'TransactionInactiveError'");
- evalAndExpectException("index.get(0)", "0", "'TransactionInactiveError'");
- evalAndExpectException("index.getKey(0)", "0", "'TransactionInactiveError'");
- evalAndExpectException("index.count()", "0", "'TransactionInactiveError'");
+ evalAndExpectException("index.openCursor()", "11", "'InvalidStateError'");
+ evalAndExpectException("index.openKeyCursor()", "11", "'InvalidStateError'");
+ evalAndExpectException("index.get(0)", "11", "'InvalidStateError'");
+ evalAndExpectException("index.getKey(0)", "11", "'InvalidStateError'");
+ evalAndExpectException("index.count()", "11", "'InvalidStateError'");
- evalAndExpectException("store.put(0, 0)", "0", "'TransactionInactiveError'");
- evalAndExpectException("store.add(0, 0)", "0", "'TransactionInactiveError'");
- evalAndExpectException("store.delete(0)", "0", "'TransactionInactiveError'");
- evalAndExpectException("store.clear()", "0", "'TransactionInactiveError'");
- evalAndExpectException("store.get(0)", "0", "'TransactionInactiveError'");
- evalAndExpectException("store.openCursor()", "0", "'TransactionInactiveError'");
+ evalAndExpectException("store.put(0, 0)", "11", "'InvalidStateError'");
+ evalAndExpectException("store.add(0, 0)", "11", "'InvalidStateError'");
+ evalAndExpectException("store.delete(0)", "11", "'InvalidStateError'");
+ evalAndExpectException("store.clear()", "11", "'InvalidStateError'");
+ evalAndExpectException("store.get(0)", "11", "'InvalidStateError'");
+ evalAndExpectException("store.openCursor()", "11", "'InvalidStateError'");
}
function testSetVersionAbort4()
Modified: trunk/LayoutTests/storage/indexeddb/transaction-basics-expected.txt (208404 => 208405)
--- trunk/LayoutTests/storage/indexeddb/transaction-basics-expected.txt 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/LayoutTests/storage/indexeddb/transaction-basics-expected.txt 2016-11-04 23:27:19 UTC (rev 208405)
@@ -61,59 +61,59 @@
testInactiveAbortedTransaction():
Expecting exception from index.openCursor()
PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'TransactionInactiveError'
-Exception message: Failed to execute 'openCursor' on 'IDBIndex': The transaction is inactive or finished.
+PASS code is 11
+PASS ename is 'InvalidStateError'
+Exception message: Failed to execute 'openCursor' on 'IDBIndex': The index or its object store has been deleted.
Expecting exception from index.openKeyCursor()
PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'TransactionInactiveError'
-Exception message: Failed to execute 'openKeyCursor' on 'IDBIndex': The transaction is inactive or finished.
+PASS code is 11
+PASS ename is 'InvalidStateError'
+Exception message: Failed to execute 'openKeyCursor' on 'IDBIndex': The index or its object store has been deleted.
Expecting exception from index.get(0)
PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'TransactionInactiveError'
-Exception message: Failed to execute 'get' on 'IDBIndex': The transaction is inactive or finished.
+PASS code is 11
+PASS ename is 'InvalidStateError'
+Exception message: Failed to execute 'get' on 'IDBIndex': The index or its object store has been deleted.
Expecting exception from index.getKey(0)
PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'TransactionInactiveError'
-Exception message: Failed to execute 'getKey' on 'IDBIndex': The transaction is inactive or finished.
+PASS code is 11
+PASS ename is 'InvalidStateError'
+Exception message: Failed to execute 'getKey' on 'IDBIndex': The index or its object store has been deleted.
Expecting exception from index.count()
PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'TransactionInactiveError'
-Exception message: Failed to execute 'count' on 'IDBIndex': The transaction is inactive or finished.
+PASS code is 11
+PASS ename is 'InvalidStateError'
+Exception message: Failed to execute 'count' on 'IDBIndex': The index or its object store has been deleted.
Expecting exception from store.put(0, 0)
PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'TransactionInactiveError'
-Exception message: Failed to store record in an IDBObjectStore: The transaction is inactive or finished.
+PASS code is 11
+PASS ename is 'InvalidStateError'
+Exception message: Failed to store record in an IDBObjectStore: The object store has been deleted.
Expecting exception from store.add(0, 0)
PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'TransactionInactiveError'
-Exception message: Failed to store record in an IDBObjectStore: The transaction is inactive or finished.
+PASS code is 11
+PASS ename is 'InvalidStateError'
+Exception message: Failed to store record in an IDBObjectStore: The object store has been deleted.
Expecting exception from store.delete(0)
PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'TransactionInactiveError'
-Exception message: Failed to execute 'delete' on 'IDBObjectStore': The transaction is inactive or finished.
+PASS code is 11
+PASS ename is 'InvalidStateError'
+Exception message: Failed to execute 'delete' on 'IDBObjectStore': The object store has been deleted.
Expecting exception from store.clear()
PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'TransactionInactiveError'
-Exception message: Failed to execute 'clear' on 'IDBObjectStore': The transaction is inactive or finished.
+PASS code is 11
+PASS ename is 'InvalidStateError'
+Exception message: Failed to execute 'clear' on 'IDBObjectStore': The object store has been deleted.
Expecting exception from store.get(0)
PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'TransactionInactiveError'
-Exception message: Failed to execute 'get' on 'IDBObjectStore': The transaction is inactive or finished.
+PASS code is 11
+PASS ename is 'InvalidStateError'
+Exception message: Failed to execute 'get' on 'IDBObjectStore': The object store has been deleted.
Expecting exception from store.openCursor()
PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'TransactionInactiveError'
-Exception message: Failed to execute 'openCursor' on 'IDBObjectStore': The transaction is inactive or finished.
+PASS code is 11
+PASS ename is 'InvalidStateError'
+Exception message: Failed to execute 'openCursor' on 'IDBObjectStore': The object store has been deleted.
testSetVersionAbort4():
PASS self.db.objectStoreNames is []
Modified: trunk/LayoutTests/storage/indexeddb/transaction-basics-private-expected.txt (208404 => 208405)
--- trunk/LayoutTests/storage/indexeddb/transaction-basics-private-expected.txt 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/LayoutTests/storage/indexeddb/transaction-basics-private-expected.txt 2016-11-04 23:27:19 UTC (rev 208405)
@@ -61,59 +61,59 @@
testInactiveAbortedTransaction():
Expecting exception from index.openCursor()
PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'TransactionInactiveError'
-Exception message: Failed to execute 'openCursor' on 'IDBIndex': The transaction is inactive or finished.
+PASS code is 11
+PASS ename is 'InvalidStateError'
+Exception message: Failed to execute 'openCursor' on 'IDBIndex': The index or its object store has been deleted.
Expecting exception from index.openKeyCursor()
PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'TransactionInactiveError'
-Exception message: Failed to execute 'openKeyCursor' on 'IDBIndex': The transaction is inactive or finished.
+PASS code is 11
+PASS ename is 'InvalidStateError'
+Exception message: Failed to execute 'openKeyCursor' on 'IDBIndex': The index or its object store has been deleted.
Expecting exception from index.get(0)
PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'TransactionInactiveError'
-Exception message: Failed to execute 'get' on 'IDBIndex': The transaction is inactive or finished.
+PASS code is 11
+PASS ename is 'InvalidStateError'
+Exception message: Failed to execute 'get' on 'IDBIndex': The index or its object store has been deleted.
Expecting exception from index.getKey(0)
PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'TransactionInactiveError'
-Exception message: Failed to execute 'getKey' on 'IDBIndex': The transaction is inactive or finished.
+PASS code is 11
+PASS ename is 'InvalidStateError'
+Exception message: Failed to execute 'getKey' on 'IDBIndex': The index or its object store has been deleted.
Expecting exception from index.count()
PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'TransactionInactiveError'
-Exception message: Failed to execute 'count' on 'IDBIndex': The transaction is inactive or finished.
+PASS code is 11
+PASS ename is 'InvalidStateError'
+Exception message: Failed to execute 'count' on 'IDBIndex': The index or its object store has been deleted.
Expecting exception from store.put(0, 0)
PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'TransactionInactiveError'
-Exception message: Failed to store record in an IDBObjectStore: The transaction is inactive or finished.
+PASS code is 11
+PASS ename is 'InvalidStateError'
+Exception message: Failed to store record in an IDBObjectStore: The object store has been deleted.
Expecting exception from store.add(0, 0)
PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'TransactionInactiveError'
-Exception message: Failed to store record in an IDBObjectStore: The transaction is inactive or finished.
+PASS code is 11
+PASS ename is 'InvalidStateError'
+Exception message: Failed to store record in an IDBObjectStore: The object store has been deleted.
Expecting exception from store.delete(0)
PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'TransactionInactiveError'
-Exception message: Failed to execute 'delete' on 'IDBObjectStore': The transaction is inactive or finished.
+PASS code is 11
+PASS ename is 'InvalidStateError'
+Exception message: Failed to execute 'delete' on 'IDBObjectStore': The object store has been deleted.
Expecting exception from store.clear()
PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'TransactionInactiveError'
-Exception message: Failed to execute 'clear' on 'IDBObjectStore': The transaction is inactive or finished.
+PASS code is 11
+PASS ename is 'InvalidStateError'
+Exception message: Failed to execute 'clear' on 'IDBObjectStore': The object store has been deleted.
Expecting exception from store.get(0)
PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'TransactionInactiveError'
-Exception message: Failed to execute 'get' on 'IDBObjectStore': The transaction is inactive or finished.
+PASS code is 11
+PASS ename is 'InvalidStateError'
+Exception message: Failed to execute 'get' on 'IDBObjectStore': The object store has been deleted.
Expecting exception from store.openCursor()
PASS Exception was thrown.
-PASS code is 0
-PASS ename is 'TransactionInactiveError'
-Exception message: Failed to execute 'openCursor' on 'IDBObjectStore': The transaction is inactive or finished.
+PASS code is 11
+PASS ename is 'InvalidStateError'
+Exception message: Failed to execute 'openCursor' on 'IDBObjectStore': The object store has been deleted.
testSetVersionAbort4():
PASS self.db.objectStoreNames is []
Modified: trunk/Source/WebCore/ChangeLog (208404 => 208405)
--- trunk/Source/WebCore/ChangeLog 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/Source/WebCore/ChangeLog 2016-11-04 23:27:19 UTC (rev 208405)
@@ -1,3 +1,25 @@
+2016-11-04 Brady Eidson <[email protected]>
+
+ IndexedDB 2.0: Clean up more transaction abort and exception throwing behavior from IDBObjectStore.
+ https://bugs.webkit.org/show_bug.cgi?id=164424
+
+ Reviewed by Alex Christensen.
+
+ No new tests (Covered by existing tests).
+
+ This patch actually turns a handful of PASS to FAIL in the imported tests, but those are parts of the
+ spec in flux/under discussion.
+
+ We'll update either source or the tests as things are resolved.
+
+ * Modules/indexeddb/IDBIndex.cpp:
+ (WebCore::IDBIndex::rollbackInfoForVersionChangeAbort):
+
+ * Modules/indexeddb/IDBObjectStore.cpp:
+ (WebCore::IDBObjectStore::get):
+ (WebCore::IDBObjectStore::putOrAdd):
+ (WebCore::IDBObjectStore::rollbackForVersionChangeAbort):
+
2016-11-04 Ryosuke Niwa <[email protected]>
Load stylesheets in link elements inside a connected shadow tree
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp (208404 => 208405)
--- trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp 2016-11-04 23:27:19 UTC (rev 208405)
@@ -140,8 +140,10 @@
if (!objectStoreInfo)
return;
- if (!objectStoreInfo->hasIndex(m_info.identifier()))
+ if (!objectStoreInfo->hasIndex(m_info.identifier())) {
+ m_deleted = true;
return;
+ }
m_info = m_originalInfo;
}
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp (208404 => 208405)
--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp 2016-11-04 23:02:19 UTC (rev 208404)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp 2016-11-04 23:27:19 UTC (rev 208405)
@@ -211,12 +211,12 @@
LOG(IndexedDB, "IDBObjectStore::get");
ASSERT(currentThread() == m_transaction->database().originThreadID());
+ if (m_deleted)
+ return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'get' on 'IDBObjectStore': The object store has been deleted.") };
+
if (!m_transaction->isActive())
return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral("Failed to execute 'get' on 'IDBObjectStore': The transaction is inactive or finished.") };
- if (m_deleted)
- return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'get' on 'IDBObjectStore': The object store has been deleted.") };
-
auto idbKey = scriptValueToIDBKey(execState, key);
if (!idbKey->isValid())
return Exception { IDBDatabaseException::DataError, ASCIILiteral("Failed to execute 'get' on 'IDBObjectStore': The parameter is not a valid key.") };
@@ -229,12 +229,12 @@
LOG(IndexedDB, "IDBObjectStore::get");
ASSERT(currentThread() == m_transaction->database().originThreadID());
+ if (m_deleted)
+ return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'get' on 'IDBObjectStore': The object store has been deleted.") };
+
if (!m_transaction->isActive())
return Exception { IDBDatabaseException::TransactionInactiveError };
- if (m_deleted)
- return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'get' on 'IDBObjectStore': The object store has been deleted.") };
-
IDBKeyRangeData keyRangeData(keyRange);
if (!keyRangeData.isValid())
return Exception { IDBDatabaseException::DataError };
@@ -275,11 +275,6 @@
if (!context)
return Exception { IDBDatabaseException::UnknownError, ASCIILiteral("Unable to store record in object store because it does not have a valid script execution context") };
- // The IDB spec for several IDBObjectStore methods states that transaction related exceptions should fire before
- // the exception for an object store being deleted.
- // However, a handful of W3C IDB tests expect the deleted exception even though the transaction inactive exception also applies.
- // Additionally, Chrome and Edge agree with the test, as does Legacy IDB in WebKit.
- // Until this is sorted out, we'll agree with the test and the majority share browsers.
if (m_deleted)
return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to store record in an IDBObjectStore: The object store has been deleted.") };
@@ -607,9 +602,22 @@
String currentName = m_info.name();
m_info = m_originalInfo;
- if (!transaction().database().info().infoForExistingObjectStore(m_info.identifier()))
+ auto& databaseInfo = transaction().database().info();
+ auto* objectStoreInfo = databaseInfo.infoForExistingObjectStore(m_info.identifier());
+ if (!objectStoreInfo) {
m_info.rename(currentName);
+ m_deleted = true;
+ } else {
+ HashSet<uint64_t> indexesToRemove;
+ for (auto indexIdentifier : objectStoreInfo->indexMap().keys()) {
+ if (!objectStoreInfo->hasIndex(indexIdentifier))
+ indexesToRemove.add(indexIdentifier);
+ }
+ for (auto indexIdentifier : indexesToRemove)
+ m_info.deleteIndex(indexIdentifier);
+ }
+
Locker<Lock> locker(m_referencedIndexLock);
for (auto& index : m_referencedIndexes.values())
index->rollbackInfoForVersionChangeAbort();