Bug 1306181 - Remove IDBEnvironment in favor of partial interface in WindowOrWorkerGlobalScope. r=bkelly
authorBevis Tseng <btseng@mozilla.com>
Mon, 24 Oct 2016 10:41:13 +0800
changeset 347365 67fbbeb0677bc843006a88c541abc27f260f106d
parent 347364 961a845748368c2d51a4c3fc97c55525e8cb7091
child 347366 aacc86dbfeea0cbcf4e46bef3d531e52aa6b0165
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly
bugs1306181
milestone52.0a1
Bug 1306181 - Remove IDBEnvironment in favor of partial interface in WindowOrWorkerGlobalScope. r=bkelly
dom/webidl/IDBEnvironment.webidl
dom/webidl/Window.webidl
dom/webidl/WindowOrWorkerGlobalScope.webidl
dom/webidl/WorkerGlobalScope.webidl
dom/webidl/moz.build
testing/web-platform/tests/IndexedDB/interfaces.html
testing/web-platform/tests/IndexedDB/interfaces.idl
testing/web-platform/tests/IndexedDB/interfaces.worker.js
deleted file mode 100644
--- a/dom/webidl/IDBEnvironment.webidl
+++ /dev/null
@@ -1,14 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is:
- * https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html
- */
-
-[Exposed=(Window,Worker), NoInterfaceObject]
-interface IDBEnvironment {
-    //[Throws] readonly    attribute IDBFactory indexedDB;
-    [Throws] readonly    attribute IDBFactory? indexedDB;
-};
--- a/dom/webidl/Window.webidl
+++ b/dom/webidl/Window.webidl
@@ -118,19 +118,16 @@ partial interface Window {
 };
 
 // https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html
 partial interface Window {
   //[Throws] Selection getSelection();
   [Throws] Selection? getSelection();
 };
 
-// https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html
-Window implements IDBEnvironment;
-
 // http://dev.w3.org/csswg/cssom/
 partial interface Window {
   //[NewObject, Throws] CSSStyleDeclaration getComputedStyle(Element elt, optional DOMString pseudoElt = "");
   [NewObject, Throws] CSSStyleDeclaration? getComputedStyle(Element elt, optional DOMString pseudoElt = "");
 };
 
 // http://dev.w3.org/csswg/cssom-view/
 enum ScrollBehavior { "auto", "instant", "smooth" };
--- a/dom/webidl/WindowOrWorkerGlobalScope.webidl
+++ b/dom/webidl/WindowOrWorkerGlobalScope.webidl
@@ -48,16 +48,23 @@ partial interface WindowOrWorkerGlobalSc
   [NewObject] Promise<Response> fetch(RequestInfo input, optional RequestInit init);
 };
 
 // https://w3c.github.io/webappsec-secure-contexts/#monkey-patching-global-object
 partial interface WindowOrWorkerGlobalScope {
   readonly attribute boolean isSecureContext;
 };
 
+// http://w3c.github.io/IndexedDB/#factory-interface
+partial interface WindowOrWorkerGlobalScope {
+   // readonly attribute IDBFactory indexedDB;
+   [Throws]
+   readonly attribute IDBFactory? indexedDB;
+};
+
 // Mozilla extensions
 partial interface WindowOrWorkerGlobalScope {
   // Extensions to ImageBitmap bits.
   // Bug 1141979 - [FoxEye] Extend ImageBitmap with interfaces to access its
   // underlying image data
   //
   // Note:
   // Overloaded functions cannot have different "extended attributes",
--- a/dom/webidl/WorkerGlobalScope.webidl
+++ b/dom/webidl/WorkerGlobalScope.webidl
@@ -37,17 +37,16 @@ partial interface WorkerGlobalScope {
 
 // https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#self-caches
 partial interface WorkerGlobalScope {
 [Throws, Func="mozilla::dom::cache::CacheStorage::PrefEnabled", SameObject]
 readonly attribute CacheStorage caches;
 };
 
 WorkerGlobalScope implements GlobalCrypto;
-WorkerGlobalScope implements IDBEnvironment;
 WorkerGlobalScope implements WindowOrWorkerGlobalScope;
 
 // Not implemented yet: bug 1072107.
 // WorkerGlobalScope implements FontFaceSource;
 
 // Mozilla extensions
 partial interface WorkerGlobalScope {
 
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -252,17 +252,16 @@ WEBIDL_FILES = [
     'HTMLTimeElement.webidl',
     'HTMLTitleElement.webidl',
     'HTMLTrackElement.webidl',
     'HTMLUListElement.webidl',
     'HTMLVideoElement.webidl',
     'IccCardLockError.webidl',
     'IDBCursor.webidl',
     'IDBDatabase.webidl',
-    'IDBEnvironment.webidl',
     'IDBFactory.webidl',
     'IDBFileHandle.webidl',
     'IDBFileRequest.webidl',
     'IDBIndex.webidl',
     'IDBKeyRange.webidl',
     'IDBMutableFile.webidl',
     'IDBObjectStore.webidl',
     'IDBOpenDBRequest.webidl',
--- a/testing/web-platform/tests/IndexedDB/interfaces.html
+++ b/testing/web-platform/tests/IndexedDB/interfaces.html
@@ -18,26 +18,26 @@ setup(function() {
   request.open("GET", "interfaces.idl");
   request.send();
   request.onload = function() {
     var idls = request.responseText;
 
     idlArray.add_untested_idls("[PrimaryGlobal] interface Window { };");
     idlArray.add_untested_idls("[Exposed=(Window,Worker)] interface Event { };");
     idlArray.add_untested_idls("[Exposed=(Window,Worker)] interface EventTarget { };");
+    idlArray.add_untested_idls("[NoInterfaceObject, Exposed=(Window,Worker)] interface WindowOrWorkerGlobalScope { };");
 
     // From Indexed DB:
     idlArray.add_idls(idls);
-    idlArray.add_idls("Window implements IDBEnvironment;");
+    idlArray.add_idls("Window implements WindowOrWorkerGlobalScope;");
 
     idlArray.add_objects({
       IDBCursor: [],
       IDBCursorWithValue: [],
       IDBDatabase: [],
-      IDBEnvironment: [],
       IDBFactory: ["window.indexedDB"],
       IDBIndex: [],
       IDBKeyRange: ["IDBKeyRange.only(0)"],
       IDBObjectStore: [],
       IDBOpenDBRequest: [],
       IDBRequest: [],
       IDBTransaction: [],
       IDBVersionChangeEvent: ["new IDBVersionChangeEvent('foo')"],
--- a/testing/web-platform/tests/IndexedDB/interfaces.idl
+++ b/testing/web-platform/tests/IndexedDB/interfaces.idl
@@ -62,19 +62,18 @@ interface IDBOpenDBRequest : IDBRequest 
 
 [Exposed=(Window,Worker),
  Constructor(DOMString type, optional IDBVersionChangeEventInit eventInitDict)]
 interface IDBVersionChangeEvent : Event {
     readonly    attribute unsigned long long  oldVersion;
     readonly    attribute unsigned long long? newVersion;
 };
 
-[NoInterfaceObject]
-interface IDBEnvironment {
-    readonly    attribute IDBFactory indexedDB;
+partial interface WindowOrWorkerGlobalScope {
+  readonly attribute IDBFactory indexedDB;
 };
 
 [Exposed=(Window,Worker)]
 interface IDBFactory {
     IDBOpenDBRequest open (DOMString name, [EnforceRange] optional unsigned long long version);
     IDBOpenDBRequest deleteDatabase (DOMString name);
     short            cmp (any first, any second);
 };
--- a/testing/web-platform/tests/IndexedDB/interfaces.worker.js
+++ b/testing/web-platform/tests/IndexedDB/interfaces.worker.js
@@ -8,26 +8,26 @@ request.open("GET", "interfaces.idl");
 request.send();
 request.onload = function() {
   var idlArray = new IdlArray();
   var idls = request.responseText;
 
   idlArray.add_untested_idls("[Exposed=Worker] interface WorkerGlobalScope {};");
   idlArray.add_untested_idls("[Exposed=(Window,Worker)] interface Event { };");
   idlArray.add_untested_idls("[Exposed=(Window,Worker)] interface EventTarget { };");
+  idlArray.add_untested_idls("[NoInterfaceObject, Exposed=(Window,Worker)] interface WindowOrWorkerGlobalScope {};");
 
   // From Indexed DB:
-  idlArray.add_idls("WorkerGlobalScope implements IDBEnvironment;");
+  idlArray.add_idls("WorkerGlobalScope implements WindowOrWorkerGlobalScope;");
   idlArray.add_idls(idls);
 
   idlArray.add_objects({
     IDBCursor: [],
     IDBCursorWithValue: [],
     IDBDatabase: [],
-    IDBEnvironment: [],
     IDBFactory: ["self.indexedDB"],
     IDBIndex: [],
     IDBKeyRange: ["IDBKeyRange.only(0)"],
     IDBObjectStore: [],
     IDBOpenDBRequest: [],
     IDBRequest: [],
     IDBTransaction: [],
     IDBVersionChangeEvent: ["new IDBVersionChangeEvent('foo')"],