WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-91687-20120718160451.patch (text/plain), 27.84 KB, created by
Joshua Bell
on 2012-07-18 16:04:52 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Joshua Bell
Created:
2012-07-18 16:04:52 PDT
Size:
27.84 KB
patch
obsolete
>Subversion Revision: 122997 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 0c7aea8f23564e04c005c81bc5d000c66f125577..5cd3a0954787b11cb6efa67507c61deef0993b79 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,22 @@ >+2012-07-18 Joshua Bell <jsbell@chromium.org> >+ >+ IndexedDB: Direction parameter ignored by some openCursor() overloads >+ https://bugs.webkit.org/show_bug.cgi?id=91687 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ A few of the openCursor() and openKeyCursor() overloads were not passing along the >+ direction parameter, resulting in the default direction being used. Trivial fixes. >+ Also, added a whitespace fix to a relevant console warning. >+ >+ Test: storage/indexeddb/cursor-overloads.html >+ >+ * Modules/indexeddb/IDBIndex.cpp: >+ (WebCore::IDBIndex::openCursor): >+ (WebCore::IDBIndex::openKeyCursor): >+ * Modules/indexeddb/IDBObjectStore.cpp: >+ (WebCore::IDBObjectStore::openCursor): >+ > 2012-07-18 Varun Jain <varunjain@chromium.org> > > [chromium] Drag image for image elements should be scaled with device scale factor. >diff --git a/Source/WebCore/Modules/indexeddb/IDBIndex.cpp b/Source/WebCore/Modules/indexeddb/IDBIndex.cpp >index fec96804b66902433d2cedc9c2c37c44d5bedc19..eae4884001221907c9e7ba9930be943ecd13611e 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBIndex.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBIndex.cpp >@@ -100,7 +100,7 @@ PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, Pas > RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(key, ec); > if (ec) > return 0; >- return openCursor(context, keyRange.release(), ec); >+ return openCursor(context, keyRange.release(), direction, ec); > } > > PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, unsigned short direction, ExceptionCode& ec) >@@ -109,7 +109,7 @@ PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, Pas > RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(key, ec); > if (ec) > return 0; >- return openCursor(context, keyRange.release(), ec); >+ return openCursor(context, keyRange.release(), direction, ec); > } > > PassRefPtr<IDBRequest> IDBIndex::count(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec) >@@ -183,7 +183,7 @@ PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context, > RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(key, ec); > if (ec) > return 0; >- return openKeyCursor(context, keyRange.release(), ec); >+ return openKeyCursor(context, keyRange.release(), direction, ec); > } > > PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, unsigned short direction, ExceptionCode& ec) >@@ -192,7 +192,7 @@ PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context, > RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(key, ec); > if (ec) > return 0; >- return openKeyCursor(context, keyRange.release(), ec); >+ return openKeyCursor(context, keyRange.release(), direction, ec); > } > > PassRefPtr<IDBRequest> IDBIndex::get(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, ExceptionCode& ec) >diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp >index dae83c5908a90fca450f571f99f73bebabea666d..bdd7b731d93539451a2e5979c0f8fa19f47a5d12 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp >@@ -389,7 +389,7 @@ PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* contex > PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, unsigned short direction, ExceptionCode& ec) > { > IDB_TRACE("IDBObjectStore::openCursor"); >- DEFINE_STATIC_LOCAL(String, consoleMessage, ("Numeric direction values are deprecated in IDBObjectStore.openCursor. Use\"next\", \"nextunique\", \"prev\", or \"prevunique\".")); >+ DEFINE_STATIC_LOCAL(String, consoleMessage, ("Numeric direction values are deprecated in IDBObjectStore.openCursor. Use \"next\", \"nextunique\", \"prev\", or \"prevunique\".")); > context->addConsoleMessage(JSMessageSource, LogMessageType, WarningMessageLevel, consoleMessage); > const String& directionString = IDBCursor::directionToString(direction, ec); > if (ec) >@@ -403,7 +403,7 @@ PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* contex > RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(key, ec); > if (ec) > return 0; >- return openCursor(context, keyRange.release(), ec); >+ return openCursor(context, keyRange.release(), direction, ec); > } > > PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, unsigned short direction, ExceptionCode& ec) >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index ade54c1697903d60bc07bab78fd7d497c2bf0d50..4ac111197df6a6b7d54dc16c233976ece4ca147e 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2012-07-18 Joshua Bell <jsbell@chromium.org> >+ >+ IndexedDB: Direction parameter ignored by some openCursor() overloads >+ https://bugs.webkit.org/show_bug.cgi?id=91687 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test the overloads to ensure cursor direction is set correctly. >+ >+ * storage/indexeddb/cursor-overloads-expected.txt: Added. >+ * storage/indexeddb/cursor-overloads.html: Added. >+ * storage/indexeddb/legacy-constants-expected.txt: Fix whitespace in console warnings. >+ > 2012-07-18 Tony Chang <tony@chromium.org> > > [chromium] Unreviewed gardening. Rebaseline 2 tests due to minor changes from r122980. >diff --git a/LayoutTests/storage/indexeddb/cursor-overloads-expected.txt b/LayoutTests/storage/indexeddb/cursor-overloads-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..33cbb4c646740b18536bf63f0812955be18523b9 >--- /dev/null >+++ b/LayoutTests/storage/indexeddb/cursor-overloads-expected.txt >@@ -0,0 +1,220 @@ >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBIndex.openCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBIndex.openCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBIndex.openCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBIndex.openCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBIndex.openCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBIndex.openCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBIndex.openCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBIndex.openCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBIndex.openKeyCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBIndex.openKeyCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBIndex.openKeyCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBIndex.openKeyCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBIndex.openKeyCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBIndex.openKeyCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBIndex.openKeyCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBIndex.openKeyCursor. Use "next", "nextunique", "prev", or "prevunique". >+Validate the overloads of IDBObjectStore.openCursor(), IDBIndex.openCursor() and IDBIndex.openKeyCursor(). >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB; >+ >+dbname = 'cursor-overloads' >+indexedDB.deleteDatabase(dbname) >+indexedDB.open(dbname) >+db = request.result >+PASS db.version is "" >+db.setVersion('1') >+store = db.createObjectStore('store') >+index = store.createIndex('index', 'value') >+store.put({value: 0}, 0) >+ >+verifyOverloads(): >+trans = db.transaction('store') >+store = trans.objectStore('store') >+index = store.index('index') >+store.openCursor() >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "next" >+store.openCursor(0) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "next" >+store.openCursor(0, 'next') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "next" >+store.openCursor(0, 'nextunique') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "nextunique" >+store.openCursor(0, 'prev') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prev" >+store.openCursor(0, 'prevunique') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prevunique" >+store.openCursor(0, IDBCursor.NEXT) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "next" >+store.openCursor(0, IDBCursor.NEXT_NO_DUPLICATE) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "nextunique" >+store.openCursor(0, IDBCursor.PREV) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prev" >+store.openCursor(0, IDBCursor.PREV_NO_DUPLICATE) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prevunique" >+store.openCursor(IDBKeyRange.only(0)) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "next" >+store.openCursor(IDBKeyRange.only(0), 'next') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "next" >+store.openCursor(IDBKeyRange.only(0), 'nextunique') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "nextunique" >+store.openCursor(IDBKeyRange.only(0), 'prev') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prev" >+store.openCursor(IDBKeyRange.only(0), 'prevunique') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prevunique" >+store.openCursor(IDBKeyRange.only(0), IDBCursor.NEXT) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "next" >+store.openCursor(IDBKeyRange.only(0), IDBCursor.NEXT_NO_DUPLICATE) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "nextunique" >+store.openCursor(IDBKeyRange.only(0), IDBCursor.PREV) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prev" >+store.openCursor(IDBKeyRange.only(0), IDBCursor.PREV_NO_DUPLICATE) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prevunique" >+index.openCursor() >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "next" >+index.openCursor(0) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "next" >+index.openCursor(0, 'next') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "next" >+index.openCursor(0, 'nextunique') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "nextunique" >+index.openCursor(0, 'prev') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prev" >+index.openCursor(0, 'prevunique') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prevunique" >+index.openCursor(0, IDBCursor.NEXT) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "next" >+index.openCursor(0, IDBCursor.NEXT_NO_DUPLICATE) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "nextunique" >+index.openCursor(0, IDBCursor.PREV) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prev" >+index.openCursor(0, IDBCursor.PREV_NO_DUPLICATE) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prevunique" >+index.openCursor(IDBKeyRange.only(0)) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "next" >+index.openCursor(IDBKeyRange.only(0), 'next') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "next" >+index.openCursor(IDBKeyRange.only(0), 'nextunique') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "nextunique" >+index.openCursor(IDBKeyRange.only(0), 'prev') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prev" >+index.openCursor(IDBKeyRange.only(0), 'prevunique') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prevunique" >+index.openCursor(IDBKeyRange.only(0), IDBCursor.NEXT) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "next" >+index.openCursor(IDBKeyRange.only(0), IDBCursor.NEXT_NO_DUPLICATE) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "nextunique" >+index.openCursor(IDBKeyRange.only(0), IDBCursor.PREV) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prev" >+index.openCursor(IDBKeyRange.only(0), IDBCursor.PREV_NO_DUPLICATE) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prevunique" >+index.openKeyCursor() >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "next" >+index.openKeyCursor(0) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "next" >+index.openKeyCursor(0, 'next') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "next" >+index.openKeyCursor(0, 'nextunique') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "nextunique" >+index.openKeyCursor(0, 'prev') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prev" >+index.openKeyCursor(0, 'prevunique') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prevunique" >+index.openKeyCursor(0, IDBCursor.NEXT) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "next" >+index.openKeyCursor(0, IDBCursor.NEXT_NO_DUPLICATE) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "nextunique" >+index.openKeyCursor(0, IDBCursor.PREV) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prev" >+index.openKeyCursor(0, IDBCursor.PREV_NO_DUPLICATE) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prevunique" >+index.openKeyCursor(IDBKeyRange.only(0)) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "next" >+index.openKeyCursor(IDBKeyRange.only(0), 'next') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "next" >+index.openKeyCursor(IDBKeyRange.only(0), 'nextunique') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "nextunique" >+index.openKeyCursor(IDBKeyRange.only(0), 'prev') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prev" >+index.openKeyCursor(IDBKeyRange.only(0), 'prevunique') >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prevunique" >+index.openKeyCursor(IDBKeyRange.only(0), IDBCursor.NEXT) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "next" >+index.openKeyCursor(IDBKeyRange.only(0), IDBCursor.NEXT_NO_DUPLICATE) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "nextunique" >+index.openKeyCursor(IDBKeyRange.only(0), IDBCursor.PREV) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prev" >+index.openKeyCursor(IDBKeyRange.only(0), IDBCursor.PREV_NO_DUPLICATE) >+PASS event.target.result is non-null. >+PASS event.target.result.direction is "prevunique" >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/storage/indexeddb/cursor-overloads.html b/LayoutTests/storage/indexeddb/cursor-overloads.html >new file mode 100644 >index 0000000000000000000000000000000000000000..63416a37dea0d058772481dd05c3ae7e3bad2206 >--- /dev/null >+++ b/LayoutTests/storage/indexeddb/cursor-overloads.html >@@ -0,0 +1,129 @@ >+<!DOCTYPE html> >+<script src="../../fast/js/resources/js-test-pre.js"></script> >+<script src="resources/shared.js"></script> >+<script> >+description("Validate the overloads of IDBObjectStore.openCursor(), IDBIndex.openCursor() and IDBIndex.openKeyCursor()."); >+ >+function test() >+{ >+ removeVendorPrefixes(); >+ prepareDatabase(); >+} >+ >+function prepareDatabase() >+{ >+ evalAndLog("dbname = 'cursor-overloads'"); >+ request = evalAndLog("indexedDB.deleteDatabase(dbname)"); >+ request.onerror = unexpectedErrorCallback; >+ request.onsuccess = function(e) { >+ request = evalAndLog("indexedDB.open(dbname)"); >+ request.onerror = unexpectedErrorCallback; >+ request.onsuccess = function(e) { >+ evalAndLog("db = request.result"); >+ shouldBeEqualToString("db.version", ""); >+ request = evalAndLog("db.setVersion('1')"); >+ request.onerror = unexpectedErrorCallback; >+ request.onsuccess = function(e) { >+ trans = request.result; >+ evalAndLog("store = db.createObjectStore('store')"); >+ evalAndLog("index = store.createIndex('index', 'value')"); >+ evalAndLog("store.put({value: 0}, 0)"); >+ trans.oncomplete = verifyOverloads; >+ >+ }; >+ }; >+ }; >+} >+ >+function verifyOverloads() >+{ >+ debug(""); >+ debug("verifyOverloads():"); >+ evalAndLog("trans = db.transaction('store')"); >+ evalAndLog("store = trans.objectStore('store')"); >+ evalAndLog("index = store.index('index')"); >+ >+ checkCursorDirection("store.openCursor()", "next"); >+ checkCursorDirection("store.openCursor(0)", "next"); >+ checkCursorDirection("store.openCursor(0, 'next')", "next"); >+ checkCursorDirection("store.openCursor(0, 'nextunique')", "nextunique"); >+ checkCursorDirection("store.openCursor(0, 'prev')", "prev"); >+ checkCursorDirection("store.openCursor(0, 'prevunique')", "prevunique"); >+ checkCursorDirection("store.openCursor(0, IDBCursor.NEXT)", "next"); >+ checkCursorDirection("store.openCursor(0, IDBCursor.NEXT_NO_DUPLICATE)", "nextunique"); >+ checkCursorDirection("store.openCursor(0, IDBCursor.PREV)", "prev"); >+ checkCursorDirection("store.openCursor(0, IDBCursor.PREV_NO_DUPLICATE)", "prevunique"); >+ >+ // FIXME: Remove when grace period expires: http://webkit.org/b/85315 >+ checkCursorDirection("store.openCursor(IDBKeyRange.only(0))", "next"); >+ checkCursorDirection("store.openCursor(IDBKeyRange.only(0), 'next')", "next"); >+ checkCursorDirection("store.openCursor(IDBKeyRange.only(0), 'nextunique')", "nextunique"); >+ checkCursorDirection("store.openCursor(IDBKeyRange.only(0), 'prev')", "prev"); >+ checkCursorDirection("store.openCursor(IDBKeyRange.only(0), 'prevunique')", "prevunique"); >+ checkCursorDirection("store.openCursor(IDBKeyRange.only(0), IDBCursor.NEXT)", "next"); >+ checkCursorDirection("store.openCursor(IDBKeyRange.only(0), IDBCursor.NEXT_NO_DUPLICATE)", "nextunique"); >+ checkCursorDirection("store.openCursor(IDBKeyRange.only(0), IDBCursor.PREV)", "prev"); >+ checkCursorDirection("store.openCursor(IDBKeyRange.only(0), IDBCursor.PREV_NO_DUPLICATE)", "prevunique"); >+ >+ checkCursorDirection("index.openCursor()", "next"); >+ checkCursorDirection("index.openCursor(0)", "next"); >+ checkCursorDirection("index.openCursor(0, 'next')", "next"); >+ checkCursorDirection("index.openCursor(0, 'nextunique')", "nextunique"); >+ checkCursorDirection("index.openCursor(0, 'prev')", "prev"); >+ checkCursorDirection("index.openCursor(0, 'prevunique')", "prevunique"); >+ checkCursorDirection("index.openCursor(0, IDBCursor.NEXT)", "next"); >+ checkCursorDirection("index.openCursor(0, IDBCursor.NEXT_NO_DUPLICATE)", "nextunique"); >+ checkCursorDirection("index.openCursor(0, IDBCursor.PREV)", "prev"); >+ checkCursorDirection("index.openCursor(0, IDBCursor.PREV_NO_DUPLICATE)", "prevunique"); >+ >+ // FIXME: Remove when grace period expires: http://webkit.org/b/85315 >+ checkCursorDirection("index.openCursor(IDBKeyRange.only(0))", "next"); >+ checkCursorDirection("index.openCursor(IDBKeyRange.only(0), 'next')", "next"); >+ checkCursorDirection("index.openCursor(IDBKeyRange.only(0), 'nextunique')", "nextunique"); >+ checkCursorDirection("index.openCursor(IDBKeyRange.only(0), 'prev')", "prev"); >+ checkCursorDirection("index.openCursor(IDBKeyRange.only(0), 'prevunique')", "prevunique"); >+ checkCursorDirection("index.openCursor(IDBKeyRange.only(0), IDBCursor.NEXT)", "next"); >+ checkCursorDirection("index.openCursor(IDBKeyRange.only(0), IDBCursor.NEXT_NO_DUPLICATE)", "nextunique"); >+ checkCursorDirection("index.openCursor(IDBKeyRange.only(0), IDBCursor.PREV)", "prev"); >+ checkCursorDirection("index.openCursor(IDBKeyRange.only(0), IDBCursor.PREV_NO_DUPLICATE)", "prevunique"); >+ >+ checkCursorDirection("index.openKeyCursor()", "next"); >+ checkCursorDirection("index.openKeyCursor(0)", "next"); >+ checkCursorDirection("index.openKeyCursor(0, 'next')", "next"); >+ checkCursorDirection("index.openKeyCursor(0, 'nextunique')", "nextunique"); >+ checkCursorDirection("index.openKeyCursor(0, 'prev')", "prev"); >+ checkCursorDirection("index.openKeyCursor(0, 'prevunique')", "prevunique"); >+ checkCursorDirection("index.openKeyCursor(0, IDBCursor.NEXT)", "next"); >+ checkCursorDirection("index.openKeyCursor(0, IDBCursor.NEXT_NO_DUPLICATE)", "nextunique"); >+ checkCursorDirection("index.openKeyCursor(0, IDBCursor.PREV)", "prev"); >+ checkCursorDirection("index.openKeyCursor(0, IDBCursor.PREV_NO_DUPLICATE)", "prevunique"); >+ >+ // FIXME: Remove when grace period expires: http://webkit.org/b/85315 >+ checkCursorDirection("index.openKeyCursor(IDBKeyRange.only(0))", "next"); >+ checkCursorDirection("index.openKeyCursor(IDBKeyRange.only(0), 'next')", "next"); >+ checkCursorDirection("index.openKeyCursor(IDBKeyRange.only(0), 'nextunique')", "nextunique"); >+ checkCursorDirection("index.openKeyCursor(IDBKeyRange.only(0), 'prev')", "prev"); >+ checkCursorDirection("index.openKeyCursor(IDBKeyRange.only(0), 'prevunique')", "prevunique"); >+ checkCursorDirection("index.openKeyCursor(IDBKeyRange.only(0), IDBCursor.NEXT)", "next"); >+ checkCursorDirection("index.openKeyCursor(IDBKeyRange.only(0), IDBCursor.NEXT_NO_DUPLICATE)", "nextunique"); >+ checkCursorDirection("index.openKeyCursor(IDBKeyRange.only(0), IDBCursor.PREV)", "prev"); >+ checkCursorDirection("index.openKeyCursor(IDBKeyRange.only(0), IDBCursor.PREV_NO_DUPLICATE)", "prevunique"); >+ >+ trans.oncomplete = finishJSTest; >+} >+ >+function checkCursorDirection(statement, direction) >+{ >+ request = eval(statement); >+ request.onerror = unexpectedErrorCallback; >+ request.onsuccess = function() { >+ debug(statement); >+ shouldBeNonNull("event.target.result") >+ shouldBeEqualToString("event.target.result.direction", direction); >+ }; >+} >+ >+test(); >+ >+</script> >+<script src="../../fast/js/resources/js-test-post.js"></script> >diff --git a/LayoutTests/storage/indexeddb/legacy-constants-expected.txt b/LayoutTests/storage/indexeddb/legacy-constants-expected.txt >index 0a7ddd154aa3a52d7136414a6f45f054c4b77421..1e4788bae858f9292286355e4252653f5c725ea2 100644 >--- a/LayoutTests/storage/indexeddb/legacy-constants-expected.txt >+++ b/LayoutTests/storage/indexeddb/legacy-constants-expected.txt >@@ -1,16 +1,16 @@ > CONSOLE MESSAGE: Numeric transaction modes are deprecated in IDBDatabase.transaction. Use "readonly" or "readwrite". > CONSOLE MESSAGE: Numeric transaction modes are deprecated in IDBDatabase.transaction. Use "readonly" or "readwrite". >-CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use"next", "nextunique", "prev", or "prevunique". >-CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use"next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use "next", "nextunique", "prev", or "prevunique". > CONSOLE MESSAGE: Numeric transaction modes are deprecated in IDBDatabase.transaction. Use "readonly" or "readwrite". >-CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use"next", "nextunique", "prev", or "prevunique". >-CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use"next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use "next", "nextunique", "prev", or "prevunique". > CONSOLE MESSAGE: Numeric transaction modes are deprecated in IDBDatabase.transaction. Use "readonly" or "readwrite". >-CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use"next", "nextunique", "prev", or "prevunique". >-CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use"next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use "next", "nextunique", "prev", or "prevunique". > CONSOLE MESSAGE: Numeric transaction modes are deprecated in IDBDatabase.transaction. Use "readonly" or "readwrite". >-CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use"next", "nextunique", "prev", or "prevunique". >-CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use"next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use "next", "nextunique", "prev", or "prevunique". >+CONSOLE MESSAGE: Numeric direction values are deprecated in IDBObjectStore.openCursor. Use "next", "nextunique", "prev", or "prevunique". > Test that legacy direction/mode constants work > > On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 91687
: 153125