Diff
Modified: trunk/LayoutTests/ChangeLog (122172 => 122173)
--- trunk/LayoutTests/ChangeLog 2012-07-10 00:41:16 UTC (rev 122172)
+++ trunk/LayoutTests/ChangeLog 2012-07-10 00:48:10 UTC (rev 122173)
@@ -1,3 +1,17 @@
+2012-07-09 Joshua Bell <[email protected]>
+
+ IndexedDB: A null or undefined storeNames argument to IDBDatabase::transaction() should be coerced to string
+ https://bugs.webkit.org/show_bug.cgi?id=90474
+
+ Reviewed by Tony Chang.
+
+ * storage/indexeddb/resources/transaction-basics.js:
+ (testInvalidMode):
+ (testDegenerateNames.request.onsuccess):
+ (testDegenerateNames.verifyDegenerateNames):
+ (testDegenerateNames):
+ * storage/indexeddb/transaction-basics-expected.txt:
+
2012-07-09 Vincent Scheib <[email protected]>
Pointer Lock requestPointerLock rejects locking an element not in a document.
Modified: trunk/LayoutTests/storage/indexeddb/resources/transaction-basics.js (122172 => 122173)
--- trunk/LayoutTests/storage/indexeddb/resources/transaction-basics.js 2012-07-10 00:41:16 UTC (rev 122172)
+++ trunk/LayoutTests/storage/indexeddb/resources/transaction-basics.js 2012-07-10 00:48:10 UTC (rev 122173)
@@ -280,7 +280,32 @@
debug("");
debug("Verify that specifying an invalid mode raises an exception");
evalAndExpectException("db.transaction(['storeName'], 'lsakjdf')", "IDBDatabaseException.TYPE_ERR", "'TypeError'");
- finishJSTest();
+ testDegenerateNames();
}
+function testDegenerateNames()
+{
+ debug("");
+ debug("Test that null and undefined are treated as strings");
+
+ evalAndExpectException("db.transaction(null)", "DOMException.NOT_FOUND_ERR", "'NotFoundError'");
+ evalAndExpectException("db.transaction(undefined)", "DOMException.NOT_FOUND_ERR", "'NotFoundError'");
+
+ request = evalAndLog("db.setVersion('funny names')");
+ request._onerror_ = unexpectedErrorCallback;
+ request._onsuccess_ = function () {
+ var trans = request.result;
+ evalAndLog("db.createObjectStore('null')");
+ evalAndLog("db.createObjectStore('undefined')");
+ trans._oncomplete_ = verifyDegenerateNames;
+ };
+ function verifyDegenerateNames() {
+ shouldNotThrow("transaction = db.transaction(null)");
+ shouldBeNonNull("transaction.objectStore('null')");
+ shouldNotThrow("transaction = db.transaction(undefined)");
+ shouldBeNonNull("transaction.objectStore('undefined')");
+ finishJSTest();
+ }
+}
+
test();
Modified: trunk/LayoutTests/storage/indexeddb/transaction-basics-expected.txt (122172 => 122173)
--- trunk/LayoutTests/storage/indexeddb/transaction-basics-expected.txt 2012-07-10 00:41:16 UTC (rev 122172)
+++ trunk/LayoutTests/storage/indexeddb/transaction-basics-expected.txt 2012-07-10 00:48:10 UTC (rev 122173)
@@ -202,6 +202,23 @@
PASS Exception was thrown.
PASS code is IDBDatabaseException.TYPE_ERR
PASS ename is 'TypeError'
+
+Test that null and undefined are treated as strings
+Expecting exception from db.transaction(null)
+PASS Exception was thrown.
+PASS code is DOMException.NOT_FOUND_ERR
+PASS ename is 'NotFoundError'
+Expecting exception from db.transaction(undefined)
+PASS Exception was thrown.
+PASS code is DOMException.NOT_FOUND_ERR
+PASS ename is 'NotFoundError'
+db.setVersion('funny names')
+db.createObjectStore('null')
+db.createObjectStore('undefined')
+PASS transaction = db.transaction(null) did not throw exception.
+PASS transaction.objectStore('null') is non-null.
+PASS transaction = db.transaction(undefined) did not throw exception.
+PASS transaction.objectStore('undefined') is non-null.
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/Source/WebCore/ChangeLog (122172 => 122173)
--- trunk/Source/WebCore/ChangeLog 2012-07-10 00:41:16 UTC (rev 122172)
+++ trunk/Source/WebCore/ChangeLog 2012-07-10 00:48:10 UTC (rev 122173)
@@ -1,5 +1,18 @@
2012-07-09 Joshua Bell <[email protected]>
+ IndexedDB: A null or undefined storeNames argument to IDBDatabase::transaction() should be coerced to string
+ https://bugs.webkit.org/show_bug.cgi?id=90474
+
+ Reviewed by Tony Chang.
+
+ Test: storage/indexeddb/transaction-basics.html
+
+ * Modules/indexeddb/IDBDatabase.cpp:
+ (WebCore::IDBDatabase::transaction):
+ * Modules/indexeddb/IDBDatabase.idl:
+
+2012-07-09 Joshua Bell <[email protected]>
+
IndexedDB: Remove obsolete accessor plumbing
https://bugs.webkit.org/show_bug.cgi?id=90812
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp (122172 => 122173)
--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp 2012-07-10 00:41:16 UTC (rev 122172)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp 2012-07-10 00:48:10 UTC (rev 122173)
@@ -207,7 +207,8 @@
PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, PassRefPtr<DOMStringList> prpStoreNames, const String& modeString, ExceptionCode& ec)
{
RefPtr<DOMStringList> storeNames = prpStoreNames;
- if (!storeNames || storeNames->isEmpty()) {
+ ASSERT(storeNames.get());
+ if (storeNames->isEmpty()) {
ec = IDBDatabaseException::IDB_INVALID_ACCESS_ERR;
return 0;
}
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl (122172 => 122173)
--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl 2012-07-10 00:41:16 UTC (rev 122172)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl 2012-07-10 00:48:10 UTC (rev 122173)
@@ -45,17 +45,17 @@
raises (IDBDatabaseException);
[CallWith=ScriptExecutionContext] IDBVersionChangeRequest setVersion(in DOMString version)
raises (IDBDatabaseException);
- [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMStringList? storeNames, in [Optional=DefaultIsNullString] DOMString mode)
+ [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMStringList storeNames, in [Optional=DefaultIsNullString] DOMString mode)
raises (IDBDatabaseException);
- [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString[]? storeNames, in [Optional=DefaultIsNullString] DOMString mode)
+ [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString[] storeNames, in [Optional=DefaultIsNullString] DOMString mode)
raises (IDBDatabaseException);
[CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString storeName, in [Optional=DefaultIsNullString] DOMString mode)
raises (IDBDatabaseException);
// FIXME: remove these when https://bugs.webkit.org/show_bug.cgi?id=85326 is fixed.
- [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMStringList? storeNames, in unsigned short mode)
+ [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMStringList storeNames, in unsigned short mode)
raises (IDBDatabaseException);
- [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString[]? storeNames, in unsigned short mode)
+ [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString[] storeNames, in unsigned short mode)
raises (IDBDatabaseException);
[CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString storeName, in unsigned short mode)
raises (IDBDatabaseException);