Changeset 85234 in webkit
- Timestamp:
- Apr 28, 2011 1:49:52 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r85232 r85234 1 2011-04-28 Mark Pilgrim <pilgrim@chromium.org> 2 3 Reviewed by Tony Chang. 4 5 IndexedDB put() should fail if second (key) parameter is null 6 https://bugs.webkit.org/show_bug.cgi?id=58613 7 8 Added one test and fixed another that relied on old (broken) behavior 9 when passing null in second parameter. 10 11 * storage/indexeddb/mozilla/key-requirements-put-null-key-expected.txt: Added. 12 * storage/indexeddb/mozilla/key-requirements-put-null-key.html: Added. 13 * storage/indexeddb/objectstore-basics-expected.txt: 14 * storage/indexeddb/objectstore-basics.html: 15 1 16 2011-04-28 Mark Pilgrim <pilgrim@chromium.org> 2 17 -
trunk/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
r80025 r85234 68 68 db.transaction([], webkitIDBTransaction.READ_WRITE) 69 69 store = transaction.objectStore('storeName') 70 store.add({x: 'othervalue'}, null) 71 addWithNullKeyFailre(): 72 PASS event.target.errorCode is webkitIDBDatabaseException.DATA_ERR 73 event.preventDefault() 70 Expecting exception from store.add({x: 'othervalue'}, null) 71 PASS Exception was thrown. 72 PASS code is webkitIDBDatabaseException.DATA_ERR 74 73 db.transaction([], webkitIDBTransaction.READ_WRITE) 75 74 store = transaction.objectStore('storeName') -
trunk/LayoutTests/storage/indexeddb/objectstore-basics.html
r80025 r85234 186 186 var store = evalAndLog("store = transaction.objectStore('storeName')"); 187 187 188 request = evalAndLog("store.add({x: 'othervalue'}, null)"); 189 request.onsuccess = unexpectedSuccessCallback; 190 request.addEventListener('error', addWithNullKeyFailure, true); 191 } 192 193 function addWithNullKeyFailure() 194 { 195 debug("addWithNullKeyFailre():"); 196 shouldBe("event.target.errorCode", "webkitIDBDatabaseException.DATA_ERR"); 197 198 evalAndLog("event.preventDefault()"); 188 evalAndExpectException("store.add({x: 'othervalue'}, null)", "webkitIDBDatabaseException.DATA_ERR"); 199 189 200 190 transaction = evalAndLog("db.transaction([], webkitIDBTransaction.READ_WRITE)"); -
trunk/Source/WebCore/ChangeLog
r85233 r85234 1 2011-04-28 Mark Pilgrim <pilgrim@chromium.org> 2 3 Reviewed by Tony Chang. 4 5 IndexedDB put() should fail if second (key) parameter is null 6 https://bugs.webkit.org/show_bug.cgi?id=58613 7 8 If key arg is not specified, prpKey ends up as a null pointer in ::put(). 9 However, if the key arg is specified but is null, prpKey ends up as a 10 valid IDBKey which has a null key type. As it happens, we need to be able 11 to detect the difference between these cases (the key arg is optional but 12 if specified must not be null). 13 14 Test: storage/indexeddb/mozilla/key-requirements-put-null-key.html 15 16 * storage/IDBObjectStoreBackendImpl.cpp: 17 (WebCore::IDBObjectStoreBackendImpl::put): 18 1 19 2011-04-07 David Levin <levin@chromium.org> 2 20 -
trunk/Source/WebCore/storage/IDBObjectStoreBackendImpl.cpp
r85165 r85234 131 131 RefPtr<IDBCallbacks> callbacks = prpCallbacks; 132 132 RefPtr<IDBTransactionBackendInterface> transaction = transactionPtr; 133 134 if (key && (key->type() == IDBKey::NullType)) { 135 ec = IDBDatabaseException::DATA_ERR; 136 return; 137 } 133 138 // FIXME: This should throw a SERIAL_ERR on structured clone problems. 134 139 // FIXME: This should throw a DATA_ERR when the wrong key/keyPath data is supplied.
Note: See TracChangeset
for help on using the changeset viewer.