Title: [208518] trunk
Revision
208518
Author
[email protected]
Date
2016-11-09 17:42:24 -0800 (Wed, 09 Nov 2016)

Log Message

IndexedDB 2.0: Clean up some exception ordering.
https://bugs.webkit.org/show_bug.cgi?id=164566

LayoutTests/imported/w3c:

Reviewed by NOBODY (OOPS!).

* IndexedDB-private-browsing/idbcursor_advance_index7-expected.txt:
* IndexedDB-private-browsing/idbcursor_continue_index7-expected.txt:
* web-platform-tests/IndexedDB/idbcursor_advance_index7-expected.txt:
* web-platform-tests/IndexedDB/idbcursor_continue_index7-expected.txt:
* web-platform-tests/IndexedDB/idbobjectstore_createIndex14-exception_order-expected.txt:

Source/WebCore:

Reviewed by Alex Christensen.

No new tests (Covered by existing tests).

* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::advance):
(WebCore::IDBCursor::continueFunction):

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::createIndex):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (208517 => 208518)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2016-11-10 01:36:34 UTC (rev 208517)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2016-11-10 01:42:24 UTC (rev 208518)
@@ -1,3 +1,16 @@
+2016-11-09  Brady Eidson  <[email protected]>
+
+        IndexedDB 2.0: Clean up some exception ordering.
+        https://bugs.webkit.org/show_bug.cgi?id=164566
+
+        Reviewed by Alex Christensen.
+
+        * IndexedDB-private-browsing/idbcursor_advance_index7-expected.txt:
+        * IndexedDB-private-browsing/idbcursor_continue_index7-expected.txt:
+        * web-platform-tests/IndexedDB/idbcursor_advance_index7-expected.txt:
+        * web-platform-tests/IndexedDB/idbcursor_continue_index7-expected.txt:
+        * web-platform-tests/IndexedDB/idbobjectstore_createIndex14-exception_order-expected.txt:
+
 2016-11-09  Alex Christensen  <[email protected]>
 
         URLParser should not consider path of URLs with no host to start at the first slash after the colon

Modified: trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbcursor_advance_index7-expected.txt (208517 => 208518)


--- trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbcursor_advance_index7-expected.txt	2016-11-10 01:36:34 UTC (rev 208517)
+++ trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbcursor_advance_index7-expected.txt	2016-11-10 01:42:24 UTC (rev 208518)
@@ -1,5 +1,3 @@
 
-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
+PASS IDBCursor.advance() - index - throw TransactionInactiveError 
 

Modified: trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbcursor_continue_index7-expected.txt (208517 => 208518)


--- trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbcursor_continue_index7-expected.txt	2016-11-10 01:36:34 UTC (rev 208517)
+++ trunk/LayoutTests/imported/w3c/IndexedDB-private-browsing/idbcursor_continue_index7-expected.txt	2016-11-10 01:42:24 UTC (rev 208518)
@@ -1,5 +1,3 @@
 
-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
+PASS IDBCursor.continue() - index - throw TransactionInactiveError 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_advance_index7-expected.txt (208517 => 208518)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_advance_index7-expected.txt	2016-11-10 01:36:34 UTC (rev 208517)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_advance_index7-expected.txt	2016-11-10 01:42:24 UTC (rev 208518)
@@ -1,5 +1,3 @@
 
-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
+PASS IDBCursor.advance() - index - throw TransactionInactiveError 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_continue_index7-expected.txt (208517 => 208518)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_continue_index7-expected.txt	2016-11-10 01:36:34 UTC (rev 208517)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_continue_index7-expected.txt	2016-11-10 01:42:24 UTC (rev 208518)
@@ -1,5 +1,3 @@
 
-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
+PASS IDBCursor.continue() - index - throw TransactionInactiveError 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_createIndex14-exception_order-expected.txt (208517 => 208518)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_createIndex14-exception_order-expected.txt	2016-11-10 01:36:34 UTC (rev 208517)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_createIndex14-exception_order-expected.txt	2016-11-10 01:42:24 UTC (rev 208518)
@@ -2,7 +2,6 @@
 PASS InvalidStateError(Incorrect mode) vs. TransactionInactiveError 
 PASS InvalidStateError(Deleted ObjectStore) vs. TransactionInactiveError 
 PASS TransactionInactiveError vs. ConstraintError 
-FAIL ConstraintError vs. SyntaxError assert_throws: Index name check should precede syntax check of the key path function "function () {
-            store.createIndex("index", "inv..." threw object "SyntaxError (DOM IDBDatabase Exception 12): Failed to exe..." that is not a DOMException ConstraintError: property "code" is equal to 12, expected 0
+PASS ConstraintError vs. SyntaxError 
 PASS SyntaxError vs. InvalidAccessError 
 

Modified: trunk/Source/WebCore/ChangeLog (208517 => 208518)


--- trunk/Source/WebCore/ChangeLog	2016-11-10 01:36:34 UTC (rev 208517)
+++ trunk/Source/WebCore/ChangeLog	2016-11-10 01:42:24 UTC (rev 208518)
@@ -1,3 +1,19 @@
+2016-11-09  Brady Eidson  <[email protected]>
+
+        IndexedDB 2.0: Clean up some exception ordering.
+        https://bugs.webkit.org/show_bug.cgi?id=164566
+
+        Reviewed by Alex Christensen.
+
+        No new tests (Covered by existing tests).
+
+        * Modules/indexeddb/IDBCursor.cpp:
+        (WebCore::IDBCursor::advance):
+        (WebCore::IDBCursor::continueFunction):
+
+        * Modules/indexeddb/IDBObjectStore.cpp:
+        (WebCore::IDBObjectStore::createIndex):
+
 2016-11-09  Alex Christensen  <[email protected]>
 
         Unreviewed, rolling out r208438.

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp (208517 => 208518)


--- trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp	2016-11-10 01:36:34 UTC (rev 208517)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp	2016-11-10 01:42:24 UTC (rev 208518)
@@ -226,12 +226,12 @@
     if (!count)
         return Exception { TypeError, ASCIILiteral("Failed to execute 'advance' on 'IDBCursor': A count argument with value 0 (zero) was supplied, must be greater than 0.") };
 
+    if (!transaction().isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral("Failed to execute 'advance' on 'IDBCursor': The transaction is inactive or finished.") };
+
     if (sourcesDeleted())
         return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'advance' on 'IDBCursor': The cursor's source or effective object store has been deleted.") };
 
-    if (!transaction().isActive())
-        return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral("Failed to execute 'advance' on 'IDBCursor': The transaction is inactive or finished.") };
-
     if (!m_gotValue)
         return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'advance' on 'IDBCursor': The cursor is being iterated or has iterated past its end.") };
 
@@ -308,12 +308,12 @@
     if (!m_request)
         return Exception { IDBDatabaseException::InvalidStateError };
 
+    if (!transaction().isActive())
+        return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral("Failed to execute 'continue' on 'IDBCursor': The transaction is inactive or finished.") };
+
     if (sourcesDeleted())
         return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'continue' on 'IDBCursor': The cursor's source or effective object store has been deleted.") };
 
-    if (!transaction().isActive())
-        return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral("Failed to execute 'continue' on 'IDBCursor': The transaction is inactive or finished.") };
-
     if (!m_gotValue)
         return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'continue' on 'IDBCursor': The cursor is being iterated or has iterated past its end.") };
 

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp (208517 => 208518)


--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp	2016-11-10 01:36:34 UTC (rev 208517)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp	2016-11-10 01:42:24 UTC (rev 208518)
@@ -397,15 +397,18 @@
     LOG(IndexedDB, "IDBObjectStore::createIndex %s", name.utf8().data());
     ASSERT(currentThread() == m_transaction.database().originThreadID());
 
+    if (!m_transaction.isVersionChange())
+        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'createIndex' on 'IDBObjectStore': The database is not running a version change transaction.") };
+
     if (m_deleted)
         return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'createIndex' on 'IDBObjectStore': The object store has been deleted.") };
 
-    if (!m_transaction.isVersionChange())
-        return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'createIndex' on 'IDBObjectStore': The database is not running a version change transaction.") };
-
     if (!m_transaction.isActive())
-        return Exception { IDBDatabaseException::TransactionInactiveError };
+        return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral("Failed to execute 'createIndex' on 'IDBObjectStore': The transaction is inactive.")};
 
+    if (m_info.hasIndex(name))
+        return Exception { IDBDatabaseException::ConstraintError, ASCIILiteral("Failed to execute 'createIndex' on 'IDBObjectStore': An index with the specified name already exists.") };
+
     if (!isIDBKeyPathValid(keyPath))
         return Exception { IDBDatabaseException::SyntaxError, ASCIILiteral("Failed to execute 'createIndex' on 'IDBObjectStore': The keyPath argument contains an invalid key path.") };
 
@@ -412,9 +415,6 @@
     if (name.isNull())
         return Exception { TypeError };
 
-    if (m_info.hasIndex(name))
-        return Exception { IDBDatabaseException::ConstraintError, ASCIILiteral("Failed to execute 'createIndex' on 'IDBObjectStore': An index with the specified name already exists.") };
-
     if (parameters.multiEntry && WTF::holds_alternative<Vector<String>>(keyPath))
         return Exception { IDBDatabaseException::InvalidAccessError, ASCIILiteral("Failed to execute 'createIndex' on 'IDBObjectStore': The keyPath argument was an array and the multiEntry option is true.") };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to