Bug 1306181 - Remove IDBEnvironment in favor of partial interface in WindowOrWorkerGlobalScope. r=bkelly

--HG--
extra : rebase_source : de7d7964b225602000453eee7689db4fc1d71fb5
This commit is contained in:
Bevis Tseng 2016-10-24 10:41:13 +08:00
parent 1c9167ba68
commit 3602bae888
8 changed files with 13 additions and 26 deletions

View File

@ -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;
};

View File

@ -123,9 +123,6 @@ partial interface Window {
[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 = "");

View File

@ -53,6 +53,13 @@ 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.

View File

@ -42,7 +42,6 @@ readonly attribute CacheStorage caches;
};
WorkerGlobalScope implements GlobalCrypto;
WorkerGlobalScope implements IDBEnvironment;
WorkerGlobalScope implements WindowOrWorkerGlobalScope;
// Not implemented yet: bug 1072107.

View File

@ -257,7 +257,6 @@ WEBIDL_FILES = [
'IccCardLockError.webidl',
'IDBCursor.webidl',
'IDBDatabase.webidl',
'IDBEnvironment.webidl',
'IDBFactory.webidl',
'IDBFileHandle.webidl',
'IDBFileRequest.webidl',

View File

@ -23,16 +23,16 @@ setup(function() {
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)"],

View File

@ -67,9 +67,8 @@ interface IDBVersionChangeEvent : Event {
readonly attribute unsigned long long? newVersion;
};
[NoInterfaceObject]
interface IDBEnvironment {
readonly attribute IDBFactory indexedDB;
partial interface WindowOrWorkerGlobalScope {
readonly attribute IDBFactory indexedDB;
};
[Exposed=(Window,Worker)]

View File

@ -13,16 +13,16 @@ request.onload = function() {
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)"],