https://bugs.webkit.org/show_bug.cgi?id=191500
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/IndexedDB/keygenerator-explicit-expected.txt:
Source/WebCore:
When double value is bigger than maximum unsigned int, converting double to unsigned int has
different behaviors on macOS and iOS. On macOS, the result would be 0 while on iOS it would be
maximum unsigned int.
Covered by existing test.
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
(WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
LayoutTests:
The test should not crash now.
* platform/ios-device/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238112
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2018-11-12 Sihui Liu <sihui_liu@apple.com>
+
+ imported/w3c/web-platform-tests/IndexedDB/keygenerator-explicit.html crashing on iOS device
+ https://bugs.webkit.org/show_bug.cgi?id=191500
+
+ Reviewed by Dean Jackson.
+
+ The test should not crash now.
+
+ * platform/ios-device/TestExpectations:
+
2018-11-12 Tim Horton <timothy_horton@apple.com>
Make it possible to edit images inline
+2018-11-12 Sihui Liu <sihui_liu@apple.com>
+
+ imported/w3c/web-platform-tests/IndexedDB/keygenerator-explicit.html crashing on iOS device
+ https://bugs.webkit.org/show_bug.cgi?id=191500
+
+ Reviewed by Dean Jackson.
+
+ * web-platform-tests/IndexedDB/keygenerator-explicit-expected.txt:
+
2018-11-12 Youenn Fablet <youenn@apple.com>
Support setting stream ids when adding a transceiver
PASS Key generator vs. explicit key 53 bits
PASS Key generator vs. explicit key greater than 53 bits, less than 64 bits
PASS Key generator vs. explicit key greater than 53 bits, less than 64 bits (negative)
-FAIL Key generator vs. explicit key 63 bits assert_unreached: put should succeed Reached unreachable code
+PASS Key generator vs. explicit key 63 bits
PASS Key generator vs. explicit key 63 bits (negative)
-FAIL Key generator vs. explicit key 64 bits assert_unreached: put should fail Reached unreachable code
+PASS Key generator vs. explicit key 64 bits
PASS Key generator vs. explicit key 64 bits (negative)
-FAIL Key generator vs. explicit key greater than 64 bits, but still finite assert_unreached: put should fail Reached unreachable code
+PASS Key generator vs. explicit key greater than 64 bits, but still finite
PASS Key generator vs. explicit key greater than 64 bits, but still finite (negative)
-FAIL Key generator vs. explicit key equal to Infinity assert_unreached: put should fail Reached unreachable code
+PASS Key generator vs. explicit key equal to Infinity
PASS Key generator vs. explicit key equal to -Infinity
imported/blink/storage/indexeddb/blob-delete-objectstore-db.html [ Failure ]
imported/blink/storage/indexeddb/blob-valid-after-deletion.html [ Failure ]
imported/blink/storage/indexeddb/blob-valid-before-commit.html [ Failure ]
-imported/w3c/web-platform-tests/IndexedDB/keygenerator-explicit.html [ Failure ]
imported/w3c/web-platform-tests/IndexedDB/keypath-special-identifiers.htm [ Failure ]
imported/w3c/web-platform-tests/cssom-view/Screen-pixelDepth-Screen-colorDepth001.html [ Failure ]
imported/w3c/web-platform-tests/cssom-view/scrolling-quirks-vs-nonquirks.html [ Failure ]
+2018-11-12 Sihui Liu <sihui_liu@apple.com>
+
+ imported/w3c/web-platform-tests/IndexedDB/keygenerator-explicit.html crashing on iOS device
+ https://bugs.webkit.org/show_bug.cgi?id=191500
+
+ Reviewed by Dean Jackson.
+
+ When double value is bigger than maximum unsigned int, converting double to unsigned int has
+ different behaviors on macOS and iOS. On macOS, the result would be 0 while on iOS it would be
+ maximum unsigned int.
+
+ Covered by existing test.
+
+ * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
+ (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
+ (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
+
2018-11-12 Basuke Suzuki <basuke.suzuki@sony.com>
[Curl] Add API Test for Curl cookie backend.
// Current version of the metadata schema being used in the metadata database.
static const int currentMetadataVersion = 1;
+// The IndexedDatabase spec defines the max key generator value as 2^53.
+static const uint64_t maxGeneratorValue = 0x20000000000000;
+
static int idbKeyCollate(int aLength, const void* aBuffer, int bLength, const void* bBuffer)
{
IDBKeyData a, b;
ASSERT(m_sqliteDB);
ASSERT(m_sqliteDB->isOpen());
- // The IndexedDatabase spec defines the max key generator value as 2^53;
- static uint64_t maxGeneratorValue = 0x20000000000000;
-
auto* transaction = m_transactions.get(transactionIdentifier);
if (!transaction || !transaction->inProgress()) {
LOG_ERROR("Attempt to generate key in database without an in-progress transaction");
if (newKeyNumber <= currentValue)
return IDBError { };
- uint64_t newKeyInteger(newKeyNumber);
- if (newKeyInteger <= uint64_t(newKeyNumber))
- ++newKeyInteger;
-
- ASSERT(newKeyInteger > uint64_t(newKeyNumber));
-
- return uncheckedSetKeyGeneratorValue(objectStoreID, newKeyInteger - 1);
+ return uncheckedSetKeyGeneratorValue(objectStoreID, std::min(newKeyNumber, (double)maxGeneratorValue));
}
IDBError SQLiteIDBBackingStore::openCursor(const IDBResourceIdentifier& transactionIdentifier, const IDBCursorInfo& info, IDBGetResult& result)