Bug 1035748 - WebIDL for DeviceStorageAreaChangedEvent. r=bz

This commit is contained in:
Kershaw Chang 2015-04-23 19:35:00 -04:00
parent f9d5ecd745
commit 9d15245a45
5 changed files with 41 additions and 0 deletions

View File

@ -881,6 +881,7 @@ GK_ATOM(onstatechange, "onstatechange")
GK_ATOM(onstatuschanged, "onstatuschanged")
GK_ATOM(onstkcommand, "onstkcommand")
GK_ATOM(onstksessionend, "onstksessionend")
GK_ATOM(onstorageareachanged, "onstorageareachanged")
GK_ATOM(onsubmit, "onsubmit")
GK_ATOM(onsuccess, "onsuccess")
GK_ATOM(ontypechange, "ontypechange")

View File

@ -168,6 +168,10 @@ const kEventConstructors = {
return new DeviceProximityEvent(aName, aProps);
},
},
DeviceStorageAreaChangedEvent: { create: function (aName, aProps) {
return new DeviceStorageAreaChangedEvent(aName, aProps);
},
},
DeviceStorageChangeEvent: { create: function (aName, aProps) {
return new DeviceStorageChangeEvent(aName, aProps);
},

View File

@ -340,6 +340,8 @@ var interfaceNamesInGlobalScope =
"DeviceOrientationEvent",
// IMPORTANT: Do not change this list without review from a DOM peer!
"DeviceProximityEvent",
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "DeviceStorageAreaChangedEvent", pref: "device.storage.enabled" },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "DeviceStorage", pref: "device.storage.enabled" },
// IMPORTANT: Do not change this list without review from a DOM peer!

View File

@ -0,0 +1,33 @@
/* -*- 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/. */
enum DeviceStorageAreaChangedEventOperation {
"added",
"removed",
"unknown"
};
/*
* For the EventHandler - onstorageareachanged, new event is introduced and called
* DeviceStorageAreaChangedEvent.
* The attribute - operation indicates that there is a storage area has been
* added or removed.
* 1. If a storage area is added, then the 'storageName' attribute will contain the
* name of the storage area. To access this new storage area, a user needs to pass
* storageName to navigator.getDeviceStorageByNameAndType to get a DeviceStorage object.
* 2. If a storage area is removed, then the 'storageName' attribute indicates
* which storage area was removed.
*/
[Pref="device.storage.enabled",
Constructor(DOMString type, optional DeviceStorageAreaChangedEventInit eventInitDict)]
interface DeviceStorageAreaChangedEvent : Event {
readonly attribute DeviceStorageAreaChangedEventOperation operation;
readonly attribute DOMString storageName;
};
dictionary DeviceStorageAreaChangedEventInit : EventInit {
DeviceStorageAreaChangedEventOperation operation = "unknown";
DOMString storageName = "";
};

View File

@ -727,6 +727,7 @@ GENERATED_EVENTS_WEBIDL_FILES = [
'DeviceLightEvent.webidl',
'DeviceOrientationEvent.webidl',
'DeviceProximityEvent.webidl',
'DeviceStorageAreaChangedEvent.webidl',
'DeviceStorageChangeEvent.webidl',
'DOMTransactionEvent.webidl',
'DownloadEvent.webidl',