Title: [129385] trunk
Revision
129385
Author
[email protected]
Date
2012-09-24 10:17:22 -0700 (Mon, 24 Sep 2012)

Log Message

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.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (129384 => 129385)


--- trunk/LayoutTests/ChangeLog	2012-09-24 17:10:53 UTC (rev 129384)
+++ trunk/LayoutTests/ChangeLog	2012-09-24 17:17:22 UTC (rev 129385)
@@ -1,3 +1,17 @@
+2012-09-24  David Grogan  <[email protected]>
+
+        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  <[email protected]>
 
         [chromium] Rebaseline gesture highlight test expectation images.

Added: trunk/LayoutTests/storage/indexeddb/resources/unprefix.js (0 => 129385)


--- trunk/LayoutTests/storage/indexeddb/resources/unprefix.js	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/unprefix.js	2012-09-24 17:17:22 UTC (rev 129385)
@@ -0,0 +1,23 @@
+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();

Added: trunk/LayoutTests/storage/indexeddb/unprefix-expected.txt (0 => 129385)


--- trunk/LayoutTests/storage/indexeddb/unprefix-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/unprefix-expected.txt	2012-09-24 17:17:22 UTC (rev 129385)
@@ -0,0 +1,19 @@
+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
+

Added: trunk/LayoutTests/storage/indexeddb/unprefix-workers-expected.txt (0 => 129385)


--- trunk/LayoutTests/storage/indexeddb/unprefix-workers-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/unprefix-workers-expected.txt	2012-09-24 17:17:22 UTC (rev 129385)
@@ -0,0 +1,20 @@
+[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
+

Added: trunk/LayoutTests/storage/indexeddb/unprefix-workers.html (0 => 129385)


--- trunk/LayoutTests/storage/indexeddb/unprefix-workers.html	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/unprefix-workers.html	2012-09-24 17:17:22 UTC (rev 129385)
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script src=""
+</head>
+<body>
+<script>startWorker('resources/unprefix.js');</script>
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/storage/indexeddb/unprefix.html (0 => 129385)


--- trunk/LayoutTests/storage/indexeddb/unprefix.html	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/unprefix.html	2012-09-24 17:17:22 UTC (rev 129385)
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (129384 => 129385)


--- trunk/Source/WebCore/ChangeLog	2012-09-24 17:10:53 UTC (rev 129384)
+++ trunk/Source/WebCore/ChangeLog	2012-09-24 17:17:22 UTC (rev 129385)
@@ -1,3 +1,40 @@
+2012-09-24  David Grogan  <[email protected]>
+
+        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  <[email protected]>
 
         Web Inspector: [WebGL] First step towards 2D canvas instrumentation in injected script

Modified: trunk/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp (129384 => 129385)


--- trunk/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp	2012-09-24 17:10:53 UTC (rev 129384)
+++ trunk/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp	2012-09-24 17:17:22 UTC (rev 129385)
@@ -88,12 +88,12 @@
     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)

Modified: trunk/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.h (129384 => 129385)


--- trunk/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.h	2012-09-24 17:10:53 UTC (rev 129384)
+++ trunk/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.h	2012-09-24 17:17:22 UTC (rev 129385)
@@ -41,7 +41,7 @@
     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 @@
 private:
     explicit DOMWindowIndexedDatabase(DOMWindow*);
 
-    IDBFactory* webkitIndexedDB();
+    IDBFactory* indexedDB();
 
     DOMWindow* m_window;
     RefPtr<IDBFactory> m_idbFactory;

Modified: trunk/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.idl (129384 => 129385)


--- trunk/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.idl	2012-09-24 17:10:53 UTC (rev 129384)
+++ trunk/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.idl	2012-09-24 17:17:22 UTC (rev 129385)
@@ -30,7 +30,7 @@
         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 @@
         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;
     };
 
 }

Modified: trunk/Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.cpp (129384 => 129385)


--- trunk/Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.cpp	2012-09-24 17:10:53 UTC (rev 129384)
+++ trunk/Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.cpp	2012-09-24 17:17:22 UTC (rev 129385)
@@ -58,12 +58,12 @@
     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;

Modified: trunk/Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.h (129384 => 129385)


--- trunk/Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.h	2012-09-24 17:10:53 UTC (rev 129384)
+++ trunk/Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.h	2012-09-24 17:17:22 UTC (rev 129385)
@@ -42,12 +42,12 @@
     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;

Modified: trunk/Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.idl (129384 => 129385)


--- trunk/Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.idl	2012-09-24 17:10:53 UTC (rev 129384)
+++ trunk/Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.idl	2012-09-24 17:17:22 UTC (rev 129385)
@@ -30,17 +30,29 @@
         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;
     };
 
 }

Modified: trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h (129384 => 129385)


--- trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h	2012-09-24 17:10:53 UTC (rev 129384)
+++ trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h	2012-09-24 17:17:22 UTC (rev 129385)
@@ -61,16 +61,7 @@
 
     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; }

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm (129384 => 129385)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm	2012-09-24 17:10:53 UTC (rev 129384)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm	2012-09-24 17:17:22 UTC (rev 129385)
@@ -203,7 +203,7 @@
     }
 
     # 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;
     }
 

Modified: trunk/Source/WebCore/page/FeatureObserver.h (129384 => 129385)


--- trunk/Source/WebCore/page/FeatureObserver.h	2012-09-24 17:10:53 UTC (rev 129384)
+++ trunk/Source/WebCore/page/FeatureObserver.h	2012-09-24 17:17:22 UTC (rev 129385)
@@ -48,6 +48,7 @@
         LegacyWebAudioNoteOn,
         WebAudioStart,
         PrefixedContentSecurityPolicy,
+        UnprefixedIndexedDB,
         // Add new features above this line.
         NumberOfFeatures, // This enum value must be last.
     };
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to