Commit f5571a27 authored by dgrogan@chromium.org's avatar dgrogan@chromium.org

Unprefix IndexedDB

https://bugs.webkit.org/show_bug.cgi?id=96548

Reviewed by Adam Barth.

Source/WebCore:

We are largely compatible with the FF implementation and the w3c test
suite submitted by MS. The w3c test suite doesn't yet check
for lack of prefix; this is mostly to signal to devs that we think our
implementation is stable.

This patch uses the new FeatureObserver to get data about prefixed
vs unprefixed usage.

Tests: storage/indexeddb/unprefix-workers.html
       storage/indexeddb/unprefix.html

* Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
(WebCore::DOMWindowIndexedDatabase::indexedDB):
* Modules/indexeddb/DOMWindowIndexedDatabase.h:
(DOMWindowIndexedDatabase):
* Modules/indexeddb/DOMWindowIndexedDatabase.idl:
* Modules/indexeddb/WorkerContextIndexedDatabase.cpp:
(WebCore::WorkerContextIndexedDatabase::indexedDB):
* Modules/indexeddb/WorkerContextIndexedDatabase.h:
(WorkerContextIndexedDatabase):
* Modules/indexeddb/WorkerContextIndexedDatabase.idl:
* bindings/generic/RuntimeEnabledFeatures.h:
Making the auxiliary objects RuntimeEnabled didn't make much sense as
they are useless without the factory, so always enable them.

(WebCore::RuntimeEnabledFeatures::indexedDBEnabled):
* bindings/scripts/CodeGeneratorGObject.pm:
(SkipAttribute):
* page/FeatureObserver.h:

LayoutTests:

* storage/indexeddb/resources/unprefix.js: Added.
(test):
* storage/indexeddb/unprefix-expected.txt: Added.
* storage/indexeddb/unprefix-workers-expected.txt: Added.
* storage/indexeddb/unprefix-workers.html: Added.
* storage/indexeddb/unprefix.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129385 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 47c476d7
2012-09-24 David Grogan <dgrogan@chromium.org>
Unprefix IndexedDB
https://bugs.webkit.org/show_bug.cgi?id=96548
Reviewed by Adam Barth.
* storage/indexeddb/resources/unprefix.js: Added.
(test):
* storage/indexeddb/unprefix-expected.txt: Added.
* storage/indexeddb/unprefix-workers-expected.txt: Added.
* storage/indexeddb/unprefix-workers.html: Added.
* storage/indexeddb/unprefix.html: Added.
2012-09-24 W. James MacLean <wjmaclean@chromium.org>
[chromium] Rebaseline gesture highlight test expectation images.
if (this.importScripts) {
importScripts('../../../fast/js/resources/js-test-pre.js');
importScripts('shared.js');
}
description("Check that IDBFactory is available through the prefixed or unprefixed entry point.");
function test()
{
shouldBeEqualToString("String(self.indexedDB)", "[object IDBFactory]");
shouldBeEqualToString("String(self.webkitIndexedDB)", "[object IDBFactory]");
shouldBeNonNull("IDBCursor");
shouldBeNonNull("IDBDatabase");
shouldBeNonNull("IDBFactory");
shouldBeNonNull("IDBIndex");
shouldBeNonNull("IDBKeyRange");
shouldBeNonNull("IDBObjectStore");
shouldBeNonNull("IDBRequest");
shouldBeNonNull("IDBTransaction");
finishJSTest();
}
test();
Check that IDBFactory is available through the prefixed or unprefixed entry point.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS String(self.indexedDB) is "[object IDBFactory]"
PASS String(self.webkitIndexedDB) is "[object IDBFactory]"
PASS IDBCursor is non-null.
PASS IDBDatabase is non-null.
PASS IDBFactory is non-null.
PASS IDBIndex is non-null.
PASS IDBKeyRange is non-null.
PASS IDBObjectStore is non-null.
PASS IDBRequest is non-null.
PASS IDBTransaction is non-null.
PASS successfullyParsed is true
TEST COMPLETE
[Worker] Check that IDBFactory is available through the prefixed or unprefixed entry point.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Starting worker: resources/unprefix.js
PASS [Worker] String(self.indexedDB) is "[object IDBFactory]"
PASS [Worker] String(self.webkitIndexedDB) is "[object IDBFactory]"
PASS [Worker] IDBCursor is non-null.
PASS [Worker] IDBDatabase is non-null.
PASS [Worker] IDBFactory is non-null.
PASS [Worker] IDBIndex is non-null.
PASS [Worker] IDBKeyRange is non-null.
PASS [Worker] IDBObjectStore is non-null.
PASS [Worker] IDBRequest is non-null.
PASS [Worker] IDBTransaction is non-null.
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE html>
<html>
<head>
<script src="../../fast/js/resources/js-test-pre.js"></script>
<script src="resources/shared.js"></script>
</head>
<body>
<script>startWorker('resources/unprefix.js');</script>
<script src="../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<script src="../../fast/js/resources/js-test-pre.js"></script>
<script src="resources/shared.js"></script>
</head>
<body>
<script src="resources/unprefix.js"></script>
<script src="../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
2012-09-24 David Grogan <dgrogan@chromium.org>
Unprefix IndexedDB
https://bugs.webkit.org/show_bug.cgi?id=96548
Reviewed by Adam Barth.
We are largely compatible with the FF implementation and the w3c test
suite submitted by MS. The w3c test suite doesn't yet check
for lack of prefix; this is mostly to signal to devs that we think our
implementation is stable.
This patch uses the new FeatureObserver to get data about prefixed
vs unprefixed usage.
Tests: storage/indexeddb/unprefix-workers.html
storage/indexeddb/unprefix.html
* Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
(WebCore::DOMWindowIndexedDatabase::indexedDB):
* Modules/indexeddb/DOMWindowIndexedDatabase.h:
(DOMWindowIndexedDatabase):
* Modules/indexeddb/DOMWindowIndexedDatabase.idl:
* Modules/indexeddb/WorkerContextIndexedDatabase.cpp:
(WebCore::WorkerContextIndexedDatabase::indexedDB):
* Modules/indexeddb/WorkerContextIndexedDatabase.h:
(WorkerContextIndexedDatabase):
* Modules/indexeddb/WorkerContextIndexedDatabase.idl:
* bindings/generic/RuntimeEnabledFeatures.h:
Making the auxiliary objects RuntimeEnabled didn't make much sense as
they are useless without the factory, so always enable them.
(WebCore::RuntimeEnabledFeatures::indexedDBEnabled):
* bindings/scripts/CodeGeneratorGObject.pm:
(SkipAttribute):
* page/FeatureObserver.h:
2012-09-24 Andrey Adaikin <aandrey@chromium.org>
Web Inspector: [WebGL] First step towards 2D canvas instrumentation in injected script
......@@ -88,12 +88,12 @@ void DOMWindowIndexedDatabase::willDetachGlobalObjectFromFrame()
DOMWindowProperty::willDetachGlobalObjectFromFrame();
}
IDBFactory* DOMWindowIndexedDatabase::webkitIndexedDB(DOMWindow* window)
IDBFactory* DOMWindowIndexedDatabase::indexedDB(DOMWindow* window)
{
return from(window)->webkitIndexedDB();
return from(window)->indexedDB();
}
IDBFactory* DOMWindowIndexedDatabase::webkitIndexedDB()
IDBFactory* DOMWindowIndexedDatabase::indexedDB()
{
Document* document = m_window->document();
if (!document)
......
......@@ -41,7 +41,7 @@ public:
virtual ~DOMWindowIndexedDatabase();
static DOMWindowIndexedDatabase* from(DOMWindow*);
static IDBFactory* webkitIndexedDB(DOMWindow*);
static IDBFactory* indexedDB(DOMWindow*);
virtual void disconnectFrameForPageCache() OVERRIDE;
virtual void reconnectFrameFromPageCache(Frame*) OVERRIDE;
......@@ -52,7 +52,7 @@ public:
private:
explicit DOMWindowIndexedDatabase(DOMWindow*);
IDBFactory* webkitIndexedDB();
IDBFactory* indexedDB();
DOMWindow* m_window;
RefPtr<IDBFactory> m_idbFactory;
......
......@@ -30,7 +30,7 @@ module window {
Conditional=INDEXED_DATABASE,
Supplemental=DOMWindow
] DOMWindowIndexedDatabase {
readonly attribute [V8MeasureAs=PrefixedIndexedDB] IDBFactory webkitIndexedDB;
readonly attribute [ImplementedAs=indexedDB,V8MeasureAs=PrefixedIndexedDB] IDBFactory webkitIndexedDB;
attribute IDBCursorConstructor webkitIDBCursor;
attribute IDBDatabaseConstructor webkitIDBDatabase;
......@@ -41,6 +41,18 @@ module window {
attribute IDBObjectStoreConstructor webkitIDBObjectStore;
attribute IDBRequestConstructor webkitIDBRequest;
attribute IDBTransactionConstructor webkitIDBTransaction;
readonly attribute [V8MeasureAs=UnprefixedIndexedDB] IDBFactory indexedDB;
attribute IDBCursorConstructor IDBCursor;
attribute IDBDatabaseConstructor IDBDatabase;
attribute IDBDatabaseExceptionConstructor IDBDatabaseException;
attribute IDBFactoryConstructor IDBFactory;
attribute IDBIndexConstructor IDBIndex;
attribute IDBKeyRangeConstructor IDBKeyRange;
attribute IDBObjectStoreConstructor IDBObjectStore;
attribute IDBRequestConstructor IDBRequest;
attribute IDBTransactionConstructor IDBTransaction;
};
}
......@@ -58,12 +58,12 @@ WorkerContextIndexedDatabase* WorkerContextIndexedDatabase::from(ScriptExecution
return supplement;
}
IDBFactory* WorkerContextIndexedDatabase::webkitIndexedDB(ScriptExecutionContext* context)
IDBFactory* WorkerContextIndexedDatabase::indexedDB(ScriptExecutionContext* context)
{
return from(context)->webkitIndexedDB();
return from(context)->indexedDB();
}
IDBFactory* WorkerContextIndexedDatabase::webkitIndexedDB()
IDBFactory* WorkerContextIndexedDatabase::indexedDB()
{
if (!m_context->securityOrigin()->canAccessDatabase())
return 0;
......
......@@ -42,12 +42,12 @@ public:
virtual ~WorkerContextIndexedDatabase();
static WorkerContextIndexedDatabase* from(ScriptExecutionContext*);
static IDBFactory* webkitIndexedDB(ScriptExecutionContext*);
static IDBFactory* indexedDB(ScriptExecutionContext*);
private:
explicit WorkerContextIndexedDatabase(ScriptExecutionContext*);
IDBFactory* webkitIndexedDB();
IDBFactory* indexedDB();
ScriptExecutionContext* m_context;
RefPtr<IDBFactoryBackendInterface> m_factoryBackend;
......
......@@ -30,17 +30,29 @@ module threads {
Conditional=INDEXED_DATABASE,
Supplemental=WorkerContext
] WorkerContextIndexedDatabase {
readonly attribute [V8EnabledAtRuntime] IDBFactory webkitIndexedDB;
readonly attribute [ImplementedAs=indexedDB,V8EnabledAtRuntime] IDBFactory webkitIndexedDB;
attribute [V8EnabledAtRuntime] IDBCursorConstructor webkitIDBCursor;
attribute [V8EnabledAtRuntime] IDBDatabaseConstructor webkitIDBDatabase;
attribute [V8EnabledAtRuntime] IDBDatabaseExceptionConstructor webkitIDBDatabaseException;
attribute [V8EnabledAtRuntime] IDBFactoryConstructor webkitIDBFactory;
attribute [V8EnabledAtRuntime] IDBIndexConstructor webkitIDBIndex;
attribute [V8EnabledAtRuntime] IDBKeyRangeConstructor webkitIDBKeyRange;
attribute [V8EnabledAtRuntime] IDBObjectStoreConstructor webkitIDBObjectStore;
attribute [V8EnabledAtRuntime] IDBRequestConstructor webkitIDBRequest;
attribute [V8EnabledAtRuntime] IDBTransactionConstructor webkitIDBTransaction;
attribute IDBCursorConstructor webkitIDBCursor;
attribute IDBDatabaseConstructor webkitIDBDatabase;
attribute IDBDatabaseExceptionConstructor webkitIDBDatabaseException;
attribute IDBFactoryConstructor webkitIDBFactory;
attribute IDBIndexConstructor webkitIDBIndex;
attribute IDBKeyRangeConstructor webkitIDBKeyRange;
attribute IDBObjectStoreConstructor webkitIDBObjectStore;
attribute IDBRequestConstructor webkitIDBRequest;
attribute IDBTransactionConstructor webkitIDBTransaction;
readonly attribute [V8EnabledAtRuntime] IDBFactory indexedDB;
attribute IDBCursorConstructor IDBCursor;
attribute IDBDatabaseConstructor IDBDatabase;
attribute IDBDatabaseExceptionConstructor IDBDatabaseException;
attribute IDBFactoryConstructor IDBFactory;
attribute IDBIndexConstructor IDBIndex;
attribute IDBKeyRangeConstructor IDBKeyRange;
attribute IDBObjectStoreConstructor IDBObjectStore;
attribute IDBRequestConstructor IDBRequest;
attribute IDBTransactionConstructor IDBTransaction;
};
}
......@@ -61,16 +61,7 @@ public:
static void setWebkitIndexedDBEnabled(bool isEnabled) { isIndexedDBEnabled = isEnabled; }
static bool webkitIndexedDBEnabled() { return isIndexedDBEnabled; }
static bool webkitIDBCursorEnabled() { return isIndexedDBEnabled; }
static bool webkitIDBDatabaseEnabled() { return isIndexedDBEnabled; }
static bool webkitIDBDatabaseErrorEnabled() { return isIndexedDBEnabled; }
static bool webkitIDBDatabaseExceptionEnabled() { return isIndexedDBEnabled; }
static bool webkitIDBFactoryEnabled() { return isIndexedDBEnabled; }
static bool webkitIDBIndexEnabled() { return isIndexedDBEnabled; }
static bool webkitIDBKeyRangeEnabled() { return isIndexedDBEnabled; }
static bool webkitIDBObjectStoreEnabled() { return isIndexedDBEnabled; }
static bool webkitIDBRequestEnabled() { return isIndexedDBEnabled; }
static bool webkitIDBTransactionEnabled() { return isIndexedDBEnabled; }
static bool indexedDBEnabled() { return isIndexedDBEnabled; }
#if ENABLE(CSS_EXCLUSIONS)
static void setCSSExclusionsEnabled(bool isEnabled) { isCSSExclusionsEnabled = isEnabled; }
......
......@@ -203,7 +203,7 @@ sub SkipAttribute {
}
# Skip indexed database attributes for now, they aren't yet supported for the GObject generator.
if ($attribute->signature->name =~ /^webkitIndexedDB/ or $attribute->signature->name =~ /^webkitIDB/) {
if ($attribute->signature->name =~ /^(?:webkit)?[Ii]ndexedDB/ or $attribute->signature->name =~ /^(?:webkit)?IDB/) {
return 1;
}
......
......@@ -48,6 +48,7 @@ public:
LegacyWebAudioNoteOn,
WebAudioStart,
PrefixedContentSecurityPolicy,
UnprefixedIndexedDB,
// Add new features above this line.
NumberOfFeatures, // This enum value must be last.
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment