summaryrefslogtreecommitdiff
path: root/dom/interfaces/base
diff options
context:
space:
mode:
Diffstat (limited to 'dom/interfaces/base')
-rw-r--r--dom/interfaces/base/domstubs.idl14
-rw-r--r--dom/interfaces/base/moz.build39
-rw-r--r--dom/interfaces/base/nsIBrowserDOMWindow.idl14
-rw-r--r--dom/interfaces/base/nsIContentPermissionPrompt.idl31
-rw-r--r--dom/interfaces/base/nsIContentPrefService.idl3
-rw-r--r--dom/interfaces/base/nsIContentPrefService2.idl28
-rw-r--r--dom/interfaces/base/nsIDOMCRMFObject.idl12
-rw-r--r--dom/interfaces/base/nsIDOMChromeWindow.idl8
-rw-r--r--dom/interfaces/base/nsIDOMClientInformation.idl25
-rw-r--r--dom/interfaces/base/nsIDOMClientRect.idl2
-rw-r--r--dom/interfaces/base/nsIDOMClientRectList.idl2
-rw-r--r--dom/interfaces/base/nsIDOMCrypto.idl8
-rw-r--r--dom/interfaces/base/nsIDOMCryptoLegacy.idl28
-rw-r--r--dom/interfaces/base/nsIDOMGlobalObjectConstructor.idl19
-rw-r--r--dom/interfaces/base/nsIDOMHistory.idl29
-rw-r--r--dom/interfaces/base/nsIDOMJSWindow.idl12
-rw-r--r--dom/interfaces/base/nsIDOMMediaQueryList.idl26
-rw-r--r--dom/interfaces/base/nsIDOMMimeType.idl15
-rw-r--r--dom/interfaces/base/nsIDOMMimeTypeArray.idl15
-rw-r--r--dom/interfaces/base/nsIDOMNavigator.idl98
-rw-r--r--dom/interfaces/base/nsIDOMPkcs11.idl16
-rw-r--r--dom/interfaces/base/nsIDOMPlugin.idl19
-rw-r--r--dom/interfaces/base/nsIDOMPluginArray.idl17
-rw-r--r--dom/interfaces/base/nsIDOMScreen.idl36
-rw-r--r--dom/interfaces/base/nsIDOMWindow.idl82
-rw-r--r--dom/interfaces/base/nsIDOMWindowB2G.idl14
-rw-r--r--dom/interfaces/base/nsIDOMWindowCollection.idl2
-rw-r--r--dom/interfaces/base/nsIDOMWindowUtils.idl691
-rw-r--r--dom/interfaces/base/nsIFocusManager.idl8
-rw-r--r--dom/interfaces/base/nsIRemoteBrowser.idl26
-rw-r--r--dom/interfaces/base/nsIServiceWorkerManager.idl109
-rw-r--r--dom/interfaces/base/nsISpeechSynthesisGetter.idl17
-rw-r--r--dom/interfaces/base/nsIStructuredCloneContainer.idl14
-rw-r--r--dom/interfaces/base/nsITabChild.idl17
-rw-r--r--dom/interfaces/base/nsITabParent.idl21
-rw-r--r--dom/interfaces/base/nsITextInputProcessor.idl576
-rw-r--r--dom/interfaces/base/nsITextInputProcessorCallback.idl104
37 files changed, 1504 insertions, 693 deletions
diff --git a/dom/interfaces/base/domstubs.idl b/dom/interfaces/base/domstubs.idl
index a2fbeeeb7..8c20f2523 100644
--- a/dom/interfaces/base/domstubs.idl
+++ b/dom/interfaces/base/domstubs.idl
@@ -28,7 +28,6 @@ interface nsIDOMNode;
interface nsIDOMNodeList;
interface nsIDOMProcessingInstruction;
interface nsIDOMText;
-interface nsIDOMDOMStringList;
interface nsIDOMClientRect;
interface nsIDOMClientRectList;
@@ -37,20 +36,14 @@ interface DOMException;
// Style Sheets
interface nsIDOMStyleSheetList;
-interface nsIDOMLinkStyle;
interface nsIDOMStyleSheet;
interface nsIDOMMediaList;
// Base
interface nsIDOMWindow;
interface nsIDOMWindowCollection;
-interface nsIDOMPlugin;
-interface nsIDOMPluginArray;
-interface nsIDOMMimeType;
-interface nsIDOMMimeTypeArray;
interface nsIDOMNavigator;
interface nsIDOMScreen;
-interface nsIDOMHistory;
// Events
interface nsIDOMEvent;
@@ -77,20 +70,13 @@ interface nsIDOMRect;
interface nsIDOMCSSStyleRule;
interface nsIDOMCSSStyleRuleCollection;
interface nsIDOMHTMLTableCaptionElement;
-interface nsIDOMHTMLTableSectionElement;
// Range
interface nsIDOMRange;
// Crypto
-interface nsIDOMCRMFObject;
interface nsIDOMCrypto;
-interface nsIDOMPkcs11;
// Used font face (for inspector)
interface nsIDOMFontFace;
interface nsIDOMFontFaceList;
-
-// Power
-interface nsIDOMMozPowerManager;
-interface nsIDOMMozWakeLock;
diff --git a/dom/interfaces/base/moz.build b/dom/interfaces/base/moz.build
index 3baa794e2..e30e7c82b 100644
--- a/dom/interfaces/base/moz.build
+++ b/dom/interfaces/base/moz.build
@@ -11,25 +11,17 @@ XPIDL_SOURCES += [
'nsIContentPrefService.idl',
'nsIContentPrefService2.idl',
'nsIContentURIGrouper.idl',
- 'nsIDOMCRMFObject.idl',
'nsIDOMChromeWindow.idl',
- 'nsIDOMClientInformation.idl',
'nsIDOMClientRect.idl',
'nsIDOMClientRectList.idl',
'nsIDOMConstructor.idl',
- 'nsIDOMGlobalObjectConstructor.idl',
+ 'nsIDOMCrypto.idl',
'nsIDOMGlobalPropertyInitializer.idl',
'nsIDOMHistory.idl',
'nsIDOMJSWindow.idl',
'nsIDOMLocation.idl',
- 'nsIDOMMediaQueryList.idl',
- 'nsIDOMMimeType.idl',
- 'nsIDOMMimeTypeArray.idl',
'nsIDOMModalContentWindow.idl',
'nsIDOMNavigator.idl',
- 'nsIDOMPkcs11.idl',
- 'nsIDOMPlugin.idl',
- 'nsIDOMPluginArray.idl',
'nsIDOMScreen.idl',
'nsIDOMWindow.idl',
'nsIDOMWindowCollection.idl',
@@ -38,35 +30,14 @@ XPIDL_SOURCES += [
'nsIFrameRequestCallback.idl',
'nsIIdleObserver.idl',
'nsIQueryContentEventResult.idl',
+ 'nsIRemoteBrowser.idl',
+ 'nsIServiceWorkerManager.idl',
'nsIStructuredCloneContainer.idl',
'nsITabChild.idl',
'nsITabParent.idl',
+ 'nsITextInputProcessor.idl',
+ 'nsITextInputProcessorCallback.idl',
]
-if CONFIG['MOZ_DISABLE_CRYPTOLEGACY']:
- XPIDL_SOURCES += [
- 'nsIDOMCrypto.idl',
- ]
-else:
- XPIDL_SOURCES += [
- 'nsIDOMCryptoLegacy.idl',
- ]
-
-if CONFIG['MOZ_B2G']:
- XPIDL_SOURCES += [
- 'nsIDOMWindowB2G.idl',
- ]
-
-if CONFIG['MOZ_WEBSPEECH']:
- XPIDL_SOURCES += [
- 'nsISpeechSynthesisGetter.idl'
- ]
-
XPIDL_MODULE = 'dom_base'
-XPIDL_FLAGS += [
- '-I$(topsrcdir)/dom/interfaces/events',
-]
-
-MODULE = 'dom'
-
diff --git a/dom/interfaces/base/nsIBrowserDOMWindow.idl b/dom/interfaces/base/nsIBrowserDOMWindow.idl
index 1eed33503..d0203f3ae 100644
--- a/dom/interfaces/base/nsIBrowserDOMWindow.idl
+++ b/dom/interfaces/base/nsIBrowserDOMWindow.idl
@@ -9,7 +9,15 @@ interface nsIDOMWindow;
interface nsIURI;
interface nsIFrameLoaderOwner;
-[scriptable, uuid(3ab89888-eb41-4dc8-b347-115555f47c80)]
+[scriptable, uuid(e774db14-79ac-4156-a7a3-aa3fd0a22c10)]
+
+interface nsIOpenURIInFrameParams : nsISupports
+{
+ attribute DOMString referrer;
+ attribute boolean isPrivate;
+};
+
+[scriptable, uuid(99f5a347-722c-4337-bd38-f14ec94801b3)]
/**
* The C++ source has access to the browser script source through
@@ -80,10 +88,10 @@ interface nsIBrowserDOMWindow : nsISupports
/**
* As above, but return the nsIFrameLoaderOwner for the new window.
- // XXXbz is this the right API? Do we really need the opener here?
+ // XXXbz is this the right API?
// See bug 537428
*/
- nsIFrameLoaderOwner openURIInFrame(in nsIURI aURI, in nsIDOMWindow aOpener,
+ nsIFrameLoaderOwner openURIInFrame(in nsIURI aURI, in nsIOpenURIInFrameParams params,
in short aWhere, in short aContext);
/**
diff --git a/dom/interfaces/base/nsIContentPermissionPrompt.idl b/dom/interfaces/base/nsIContentPermissionPrompt.idl
index 0fdda0ea6..a04b2bc59 100644
--- a/dom/interfaces/base/nsIContentPermissionPrompt.idl
+++ b/dom/interfaces/base/nsIContentPermissionPrompt.idl
@@ -7,15 +7,13 @@
interface nsIPrincipal;
interface nsIDOMWindow;
interface nsIDOMElement;
+interface nsIArray;
/**
- * Interface allows access to a content to request
- * permission to perform a privileged operation such as
- * geolocation.
+ * Interface provides the request type and its access.
*/
-[scriptable, uuid(1de67000-2de8-11e2-81c1-0800200c9a66)]
-interface nsIContentPermissionRequest : nsISupports {
-
+[scriptable, uuid(ef4db3b8-ca9c-4b1d-8f81-fd88ec32af13)]
+interface nsIContentPermissionType : nsISupports {
/**
* The type of the permission request, such as
* "geolocation".
@@ -29,6 +27,25 @@ interface nsIContentPermissionRequest : nsISupports {
readonly attribute ACString access;
/**
+ * The array of available options.
+ */
+ readonly attribute nsIArray options; // ["choice1", "choice2"]
+};
+
+/**
+ * Interface allows access to a content to request
+ * permission to perform a privileged operation such as
+ * geolocation.
+ */
+[scriptable, uuid(69a39d88-d1c4-4ba9-9b19-bafc7a1bb783)]
+interface nsIContentPermissionRequest : nsISupports {
+ /**
+ * The array will include the request types. Elements of this array are
+ * nsIContentPermissionType object.
+ */
+ readonly attribute nsIArray types;
+
+ /*
* The principal of the permission request.
*/
readonly attribute nsIPrincipal principal;
@@ -47,7 +64,7 @@ interface nsIContentPermissionRequest : nsISupports {
*/
void cancel();
- void allow();
+ void allow([optional] in jsval choices); // {"type1": "choice1", "type2": "choiceA"}
};
/**
diff --git a/dom/interfaces/base/nsIContentPrefService.idl b/dom/interfaces/base/nsIContentPrefService.idl
index 3de2e612e..60ac2ec39 100644
--- a/dom/interfaces/base/nsIContentPrefService.idl
+++ b/dom/interfaces/base/nsIContentPrefService.idl
@@ -39,6 +39,9 @@ interface nsIContentPrefCallback : nsISupports
void onResult(in nsIVariant aResult);
};
+/**
+ * @deprecated Please use nsIContentPrefService2 instead.
+ */
[scriptable, uuid(e3f772f3-023f-4b32-b074-36cf0fd5d414)]
interface nsIContentPrefService : nsISupports
{
diff --git a/dom/interfaces/base/nsIContentPrefService2.idl b/dom/interfaces/base/nsIContentPrefService2.idl
index da8fe7146..4ac1e21d8 100644
--- a/dom/interfaces/base/nsIContentPrefService2.idl
+++ b/dom/interfaces/base/nsIContentPrefService2.idl
@@ -67,10 +67,23 @@ interface nsIContentPref;
* See nsIContentPrefCallback2 below for more information about callbacks.
*/
-[scriptable, uuid(133608c7-f812-41ca-bc1c-62a4eb95e52a)]
+[scriptable, uuid(bed98666-d995-470f-bebd-62476d318576)]
interface nsIContentPrefService2 : nsISupports
{
/**
+ * Gets all the preferences with the given name.
+ *
+ * @param name The preferences' name.
+ * @param context The private-browsing context, if any.
+ * @param callback handleResult is called once for each preference unless
+ * no such preferences exist, in which case handleResult
+ * is not called at all.
+ */
+ void getByName(in AString name,
+ in nsILoadContext context,
+ in nsIContentPrefCallback2 callback);
+
+ /**
* Gets the preference with the given domain and name.
*
* @param domain The preference's domain.
@@ -153,7 +166,7 @@ interface nsIContentPrefService2 : nsISupports
void getCachedBySubdomainAndName(in AString domain,
in AString name,
in nsILoadContext context,
- out unsigned long len,
+ [optional] out unsigned long len,
[retval,array,size_is(len)] out nsIContentPref prefs);
/**
@@ -287,6 +300,17 @@ interface nsIContentPrefService2 : nsISupports
[optional] in nsIContentPrefCallback2 callback);
/**
+ * Removes all non-global preferences created after and including |since|.
+ *
+ * @param since Timestamp in milliseconds.
+ * @param context The private-browsing context, if any.
+ * @param callback handleCompletion is called when the operation completes.
+ */
+ void removeAllDomainsSince(in unsigned long long since,
+ in nsILoadContext context,
+ [optional] in nsIContentPrefCallback2 callback);
+
+ /**
* Removes all global preferences -- in other words, all preferences that have
* no domain.
*
diff --git a/dom/interfaces/base/nsIDOMCRMFObject.idl b/dom/interfaces/base/nsIDOMCRMFObject.idl
deleted file mode 100644
index 4e3637cd4..000000000
--- a/dom/interfaces/base/nsIDOMCRMFObject.idl
+++ /dev/null
@@ -1,12 +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/. */
-
-#include "domstubs.idl"
-
-[scriptable, uuid(16da46c0-208d-11d4-8a7c-006008c844c3)]
-interface nsIDOMCRMFObject : nsISupports
-{
- readonly attribute DOMString request;
-};
diff --git a/dom/interfaces/base/nsIDOMChromeWindow.idl b/dom/interfaces/base/nsIDOMChromeWindow.idl
index 63d4601f4..9118a0f80 100644
--- a/dom/interfaces/base/nsIDOMChromeWindow.idl
+++ b/dom/interfaces/base/nsIDOMChromeWindow.idl
@@ -10,7 +10,7 @@ interface nsIDOMElement;
interface nsIDOMEvent;
interface nsIMessageBroadcaster;
-[scriptable, uuid(6ff5df67-22da-4379-bf57-da775dad19f8)]
+[scriptable, uuid(78bdcb41-1efa-409f-aaba-70842213f80f)]
interface nsIDOMChromeWindow : nsISupports
{
const unsigned short STATE_MAXIMIZED = 1;
@@ -46,6 +46,12 @@ interface nsIDOMChromeWindow : nsISupports
readonly attribute nsIMessageBroadcaster messageManager;
/**
+ * Returns the message manager identified by the given group name that
+ * manages all frame loaders belonging to that group.
+ */
+ nsIMessageBroadcaster getGroupMessageManager(in AString group);
+
+ /**
* On some operating systems, we must allow the window manager to
* handle window dragging. This function tells the window manager to
* start dragging the window. This function will fail unless called
diff --git a/dom/interfaces/base/nsIDOMClientInformation.idl b/dom/interfaces/base/nsIDOMClientInformation.idl
deleted file mode 100644
index 847e8061d..000000000
--- a/dom/interfaces/base/nsIDOMClientInformation.idl
+++ /dev/null
@@ -1,25 +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/. */
-
-#include "domstubs.idl"
-
-interface nsIDOMOfflineResourceList;
-
-[scriptable, uuid(f8bbf8c3-c47b-465a-a221-22824449f689)]
-interface nsIDOMClientInformation : nsISupports
-{
- /**
- * Web Applications 1.0 Browser State: registerContentHandler
- * Allows web services to register themselves as handlers for certain content
- * types.
- * http://whatwg.org/specs/web-apps/current-work/
- */
- void registerContentHandler(in DOMString mimeType, in DOMString uri, in DOMString title);
- void registerProtocolHandler(in DOMString protocol, in DOMString uri, in DOMString title);
-
- boolean mozIsLocallyAvailable(in DOMString uri, in boolean whenOffline);
-};
-
-
diff --git a/dom/interfaces/base/nsIDOMClientRect.idl b/dom/interfaces/base/nsIDOMClientRect.idl
index df33273f0..905d68661 100644
--- a/dom/interfaces/base/nsIDOMClientRect.idl
+++ b/dom/interfaces/base/nsIDOMClientRect.idl
@@ -5,7 +5,7 @@
#include "domstubs.idl"
-[scriptable, uuid(B2F824C4-D9D3-499B-8D3B-45C8245497C6)]
+[uuid(B2F824C4-D9D3-499B-8D3B-45C8245497C6)]
interface nsIDOMClientRect : nsISupports
{
readonly attribute float left;
diff --git a/dom/interfaces/base/nsIDOMClientRectList.idl b/dom/interfaces/base/nsIDOMClientRectList.idl
index b5ba809c0..2056fe362 100644
--- a/dom/interfaces/base/nsIDOMClientRectList.idl
+++ b/dom/interfaces/base/nsIDOMClientRectList.idl
@@ -5,7 +5,7 @@
#include "domstubs.idl"
-[scriptable, uuid(f474c567-cbcb-458f-abad-ae42363da287)]
+[uuid(f474c567-cbcb-458f-abad-ae42363da287)]
interface nsIDOMClientRectList : nsISupports
{
readonly attribute unsigned long length;
diff --git a/dom/interfaces/base/nsIDOMCrypto.idl b/dom/interfaces/base/nsIDOMCrypto.idl
index 3a19ae76e..3df047934 100644
--- a/dom/interfaces/base/nsIDOMCrypto.idl
+++ b/dom/interfaces/base/nsIDOMCrypto.idl
@@ -4,9 +4,11 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
-
-[scriptable, uuid(a0a3bc68-eab3-4e66-b5cb-b1d86765119c)]
+
+interface nsIGlobalObject;
+
+[uuid(48d7f7fd-bb85-4c04-9b8b-5cd9131acdef)]
interface nsIDOMCrypto : nsISupports
{
- [implicit_jscontext] jsval getRandomValues(in jsval aData);
+ [notxpcom] void init(in nsIGlobalObject parent);
};
diff --git a/dom/interfaces/base/nsIDOMCryptoLegacy.idl b/dom/interfaces/base/nsIDOMCryptoLegacy.idl
deleted file mode 100644
index 2024ac2c0..000000000
--- a/dom/interfaces/base/nsIDOMCryptoLegacy.idl
+++ /dev/null
@@ -1,28 +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/. */
-
-#include "domstubs.idl"
-
-interface nsIDOMCRMFObject;
-
-[scriptable, uuid(e1df1d4d-41ef-4225-934a-107c5d612686)]
-interface nsIDOMCrypto : nsISupports
-{
- readonly attribute DOMString version;
- attribute boolean enableSmartCardEvents;
-
- nsIDOMCRMFObject generateCRMFRequest(/* ... */);
- DOMString importUserCertificates(in DOMString nickname,
- in DOMString cmmfResponse,
- in boolean doForcedBackup);
- DOMString popChallengeResponse(in DOMString challenge);
- DOMString random(in long numBytes);
- DOMString signText(in DOMString stringToSign,
- in DOMString caOption /* ... */);
- void logout();
- void disableRightClick();
-
- [implicit_jscontext] jsval getRandomValues(in jsval aData);
-};
diff --git a/dom/interfaces/base/nsIDOMGlobalObjectConstructor.idl b/dom/interfaces/base/nsIDOMGlobalObjectConstructor.idl
deleted file mode 100644
index 6d49efdcb..000000000
--- a/dom/interfaces/base/nsIDOMGlobalObjectConstructor.idl
+++ /dev/null
@@ -1,19 +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/. */
-
-#include "domstubs.idl"
-
-[scriptable, uuid(cb439c73-0129-4289-a349-c5216e6b912a)]
-interface nsIDOMGlobalObjectConstructor : nsISupports
-{
- /*
- * JS use only
- *
- * The constructor() method will be called with any parameters passed
- * to the object constructor.
- * If the JS implementation returns a value, it will be ignored.
- */
- void constructor();
-};
diff --git a/dom/interfaces/base/nsIDOMHistory.idl b/dom/interfaces/base/nsIDOMHistory.idl
index 38258afd4..b520b6212 100644
--- a/dom/interfaces/base/nsIDOMHistory.idl
+++ b/dom/interfaces/base/nsIDOMHistory.idl
@@ -5,33 +5,8 @@
#include "domstubs.idl"
-%{ C++
-struct JSContext;
-%}
-
-interface nsIVariant;
-
-[scriptable, uuid(d5a3006b-dd6b-4ba3-81be-6559f8889e60)]
+[uuid(55226663-fe68-48ba-addf-08e32eaab569)]
interface nsIDOMHistory : nsISupports
{
- readonly attribute long length;
- readonly attribute DOMString current;
- readonly attribute DOMString previous;
- readonly attribute DOMString next;
-
- void back();
- void forward();
-
- void go([optional] in long aDelta);
- DOMString item(in unsigned long index);
- [implicit_jscontext]
- void pushState(in nsIVariant aData,
- in DOMString aTitle,
- [optional] in DOMString aURL);
- [implicit_jscontext]
- void replaceState(in nsIVariant aData,
- in DOMString aTitle,
- [optional] in DOMString aURL);
-
- readonly attribute nsIVariant state;
+ // Empty interface that exists only for extension backwards compat
};
diff --git a/dom/interfaces/base/nsIDOMJSWindow.idl b/dom/interfaces/base/nsIDOMJSWindow.idl
index 5c5386e38..7c836dc60 100644
--- a/dom/interfaces/base/nsIDOMJSWindow.idl
+++ b/dom/interfaces/base/nsIDOMJSWindow.idl
@@ -5,7 +5,7 @@
#include "domstubs.idl"
-[scriptable, uuid(6652c4d2-6b49-424b-aaf9-91f91006fab7)]
+[scriptable, uuid(4237c376-d637-4b6e-9f8a-1da57e867834)]
interface nsIDOMJSWindow : nsISupports
{
void dump(in DOMString str);
@@ -37,11 +37,8 @@ interface nsIDOMJSWindow : nsISupports
* @deprecated These are old Netscape 4 methods. Do not use,
* the implementation is no-op.
*/
- void captureEvents(in long eventFlags);
- void releaseEvents(in long eventFlags);
- void routeEvent(in nsIDOMEvent evt);
- void enableExternalCapture();
- void disableExternalCapture();
+ void captureEvents();
+ void releaseEvents();
/**
* This is the scriptable version of nsIDOMWindow::open()
@@ -76,4 +73,7 @@ interface nsIDOMJSWindow : nsISupports
* This property is "replaceable" in JavaScript.
*/
readonly attribute nsIDOMWindow frames;
+
+ [implicit_jscontext, binaryname(ScriptableContent)]
+ readonly attribute jsval content;
};
diff --git a/dom/interfaces/base/nsIDOMMediaQueryList.idl b/dom/interfaces/base/nsIDOMMediaQueryList.idl
deleted file mode 100644
index 7eafc54ca..000000000
--- a/dom/interfaces/base/nsIDOMMediaQueryList.idl
+++ /dev/null
@@ -1,26 +0,0 @@
-/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
-/* 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/. */
-
-#include "domstubs.idl"
-
-interface nsIDOMMediaQueryListListener;
-
-/* see http://dev.w3.org/csswg/cssom-view/#the-mediaquerylist-interface */
-
-[scriptable, uuid(e0e49c52-915b-40f9-9cba-6026305cdf3e)]
-interface nsIDOMMediaQueryList : nsISupports
-{
- readonly attribute DOMString media;
- readonly attribute boolean matches;
-
- void addListener(in nsIDOMMediaQueryListListener listener);
- void removeListener(in nsIDOMMediaQueryListListener listener);
-};
-
-[scriptable, function, uuid(279a5cbd-5c15-475d-847b-e0de1624eb77)]
-interface nsIDOMMediaQueryListListener : nsISupports
-{
- void handleChange(in nsIDOMMediaQueryList mql);
-};
diff --git a/dom/interfaces/base/nsIDOMMimeType.idl b/dom/interfaces/base/nsIDOMMimeType.idl
deleted file mode 100644
index 97c639bc1..000000000
--- a/dom/interfaces/base/nsIDOMMimeType.idl
+++ /dev/null
@@ -1,15 +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/. */
-
-#include "domstubs.idl"
-
-[scriptable, uuid(f6134682-f28b-11d2-8360-c90899049c3c)]
-interface nsIDOMMimeType : nsISupports
-{
- readonly attribute DOMString description;
- readonly attribute nsIDOMPlugin enabledPlugin;
- readonly attribute DOMString suffixes;
- readonly attribute DOMString type;
-};
diff --git a/dom/interfaces/base/nsIDOMMimeTypeArray.idl b/dom/interfaces/base/nsIDOMMimeTypeArray.idl
deleted file mode 100644
index 58d5ac707..000000000
--- a/dom/interfaces/base/nsIDOMMimeTypeArray.idl
+++ /dev/null
@@ -1,15 +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/. */
-
-#include "domstubs.idl"
-
-[scriptable, uuid(f6134683-f28b-11d2-8360-c90899049c3c)]
-interface nsIDOMMimeTypeArray : nsISupports
-{
- readonly attribute unsigned long length;
-
- nsIDOMMimeType item(in unsigned long index);
- nsIDOMMimeType namedItem(in DOMString name);
-};
diff --git a/dom/interfaces/base/nsIDOMNavigator.idl b/dom/interfaces/base/nsIDOMNavigator.idl
index ff7763339..5fd16b8ae 100644
--- a/dom/interfaces/base/nsIDOMNavigator.idl
+++ b/dom/interfaces/base/nsIDOMNavigator.idl
@@ -7,116 +7,20 @@
interface nsIIdleObserver;
-[scriptable, uuid(b0ccf251-d793-48a1-94aa-cf840fe6639d)]
+[uuid(f1101fbb-d119-4cb8-845b-6bbae8a151c7)]
interface nsIDOMNavigator : nsISupports
{
readonly attribute DOMString appCodeName;
readonly attribute DOMString appName;
readonly attribute DOMString appVersion;
readonly attribute DOMString language;
- readonly attribute nsIDOMMimeTypeArray mimeTypes;
readonly attribute DOMString platform;
readonly attribute DOMString oscpu;
readonly attribute DOMString vendor;
readonly attribute DOMString vendorSub;
readonly attribute DOMString product;
readonly attribute DOMString productSub;
- readonly attribute nsIDOMPluginArray plugins;
readonly attribute DOMString userAgent;
- readonly attribute boolean cookieEnabled;
- readonly attribute boolean onLine;
readonly attribute DOMString buildID;
readonly attribute DOMString doNotTrack;
- readonly attribute nsIDOMMozPowerManager mozPower;
-
- boolean javaEnabled();
- boolean taintEnabled();
-
- /**
- * Pulse the device's vibrator, if it has one. If the device does not have a
- * vibrator, this function does nothing. If the window is hidden, this
- * function does nothing.
- *
- * vibrate takes one argument, which specifies either how long to vibrate for
- * or gives a pattern of vibrator-on/vibrator-off timings.
- *
- * If a vibration pattern is in effect when this function is called, this
- * call will overwrite the existing pattern, if this call successfully
- * completes.
- *
- * We handle the argument to vibrate as follows.
- *
- * - If the argument is undefined or null, we throw
- * NS_ERROR_DOM_NOT_SUPPORTED_ERR.
- *
- * - If the argument is 0, the empty list, or a list containing entirely 0s,
- * we cancel any outstanding vibration pattern; that is, we stop the device
- * from vibrating.
- *
- * - Otherwise, if the argument X is not a list, we treat it as though it's
- * the singleton list [X] and then proceed as below.
- *
- * - If the argument is a list (or if we wrapped it as a list above), then we
- * try to convert each element in the list to an integer, by first
- * converting it to a number and then rounding. If there is some element
- * that we can't convert to an integer, or if any of the integers are
- * negative, we throw NS_ERROR_DOM_NOT_SUPPORTED_ERR.
- *
- * This list of integers specifies a vibration pattern. Given a list of
- * numbers
- *
- * [a_1, b_1, a_2, b_2, ..., a_n]
- *
- * the device will vibrate for a_1 milliseconds, then be still for b_1
- * milliseconds, then vibrate for a_2 milliseconds, and so on.
- *
- * The list may contain an even or an odd number of elements, but if you
- * pass an even number of elements (that is, if your list ends with b_n
- * instead of a_n), the final element doesn't specify anything meaningful.
- *
- * We may throw NS_ERROR_DOM_NOT_SUPPORTED_ERR if the vibration pattern is
- * too long, or if any of its elements is too large.
- */
- [implicit_jscontext]
- void vibrate(in jsval aPattern);
-
- /**
- * Navigator requests to add an idle observer to the existing window.
- */
- void addIdleObserver(in nsIIdleObserver aIdleObserver);
-
- /**
- * Navigator requests to remove an idle observer from the existing window.
- */
- void removeIdleObserver(in nsIIdleObserver aIdleObserver);
-
- /**
- * Request a wake lock for a resource.
- *
- * A page holds a wake lock to request that a resource not be turned
- * off (or otherwise made unavailable).
- *
- * The topic is the name of a resource that might be made unavailable for
- * various reasons. For example, on a mobile device the power manager might
- * decide to turn off the screen after a period of idle time to save power.
- *
- * The resource manager checks the lock state of a topic before turning off
- * the associated resource. For example, a page could hold a lock on the
- * "screen" topic to prevent the screensaver from appearing or the screen
- * from turning off.
- *
- * The resource manager defines what each topic means and sets policy. For
- * example, the resource manager might decide to ignore 'screen' wake locks
- * held by pages which are not visible.
- *
- * One topic can be locked multiple times; it is considered released only when
- * all locks on the topic have been released.
- *
- * The returned nsIDOMMozWakeLock object is a token of the lock. You can
- * unlock the lock via the object's |unlock| method. The lock is released
- * automatically when its associated window is unloaded.
- *
- * @param aTopic resource name
- */
- nsIDOMMozWakeLock requestWakeLock(in DOMString aTopic);
};
diff --git a/dom/interfaces/base/nsIDOMPkcs11.idl b/dom/interfaces/base/nsIDOMPkcs11.idl
deleted file mode 100644
index 9811cbc17..000000000
--- a/dom/interfaces/base/nsIDOMPkcs11.idl
+++ /dev/null
@@ -1,16 +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/. */
-
-#include "domstubs.idl"
-
-[scriptable, uuid(9fd42950-25e7-11d4-8a7d-006008c844c3)]
-interface nsIDOMPkcs11 : nsISupports
-{
- long deletemodule(in DOMString moduleName);
- long addmodule(in DOMString moduleName,
- in DOMString libraryFullPath,
- in long cryptoMechanismFlags,
- in long cipherFlags);
-};
diff --git a/dom/interfaces/base/nsIDOMPlugin.idl b/dom/interfaces/base/nsIDOMPlugin.idl
deleted file mode 100644
index f8dd78218..000000000
--- a/dom/interfaces/base/nsIDOMPlugin.idl
+++ /dev/null
@@ -1,19 +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/. */
-
-#include "domstubs.idl"
-
-[scriptable, uuid(ff69a292-c74d-4ef5-9d0f-86112fff2d5b)]
-interface nsIDOMPlugin : nsISupports
-{
- readonly attribute DOMString description;
- readonly attribute DOMString filename;
- readonly attribute DOMString version;
- readonly attribute DOMString name;
-
- readonly attribute unsigned long length;
- nsIDOMMimeType item(in unsigned long index);
- nsIDOMMimeType namedItem(in DOMString name);
-};
diff --git a/dom/interfaces/base/nsIDOMPluginArray.idl b/dom/interfaces/base/nsIDOMPluginArray.idl
deleted file mode 100644
index 29dc1e6a4..000000000
--- a/dom/interfaces/base/nsIDOMPluginArray.idl
+++ /dev/null
@@ -1,17 +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/. */
-
-#include "domstubs.idl"
-
-[scriptable, uuid(f6134680-f28b-11d2-8360-c90899049c3c)]
-interface nsIDOMPluginArray : nsISupports
-{
- readonly attribute unsigned long length;
-
- nsIDOMPlugin item(in unsigned long index);
- nsIDOMPlugin namedItem(in DOMString name);
-
- void refresh([optional] in boolean reloadDocuments);
-};
diff --git a/dom/interfaces/base/nsIDOMScreen.idl b/dom/interfaces/base/nsIDOMScreen.idl
index a981996dd..1f1cab79d 100644
--- a/dom/interfaces/base/nsIDOMScreen.idl
+++ b/dom/interfaces/base/nsIDOMScreen.idl
@@ -5,7 +5,7 @@
#include "nsIDOMEventTarget.idl"
-[scriptable, builtinclass, uuid(310a1d9a-4271-4d85-9e35-9dae6683b2c1)]
+[builtinclass, uuid(82c7924b-4b46-4e5a-a8d2-6edb5fc0a60d)]
interface nsIDOMScreen : nsIDOMEventTarget
{
readonly attribute long top;
@@ -26,38 +26,4 @@ interface nsIDOMScreen : nsIDOMEventTarget
*/
[binaryname(SlowMozOrientation)]
readonly attribute DOMString mozOrientation;
-
- [implicit_jscontext] attribute jsval onmozorientationchange;
-
- /**
- * Lock the screen to the specified orientations(s). This method returns true
- * if the lock was acquired successfully, and false otherwise.
- *
- * The parameter can be a DOMString or an Array of DOMStrings. If you pass a
- * string, we lock the screen to that one orientation. If you pass an Array,
- * we ensure that the screen is always in one of the given orientations.
- *
- * Valid orientations are "portrait", "portrait-primary",
- * "portrait-secondary", "landscape", "landscape-primary", and
- * "landscape-secondary".
- * These tokens are case-sensitive.
- *
- * If you pass a string that's not one of the valid orientations, or if you
- * pass an array of orientations and any of the orientations in the array is
- * not valid, we reject the lock and return false.
- *
- * The "-primary" orientations correspond to holding the device right-side up,
- * while the "-secondary" orientations correspond to holding the device
- * upside-down. Locking the orientation in "portrait" is the same as locking
- * the orientation in ['portrait-primary', 'portrait-secondary'], and the
- * "landscape" orientation similarly corresponds to the set
- * ['landscape-primary', 'landscape-secondary'].
- */
- [implicit_jscontext] boolean mozLockOrientation(in jsval orientation);
-
- /**
- * Unlock the screen orientation.
- */
- [binaryname(SlowMozUnlockOrientation)]
- void mozUnlockOrientation();
};
diff --git a/dom/interfaces/base/nsIDOMWindow.idl b/dom/interfaces/base/nsIDOMWindow.idl
index 8fdb79cb8..5ef2336c2 100644
--- a/dom/interfaces/base/nsIDOMWindow.idl
+++ b/dom/interfaces/base/nsIDOMWindow.idl
@@ -9,9 +9,7 @@ interface nsIFrameRequestCallback;
interface nsIControllers;
interface nsIDOMBlob;
interface nsIDOMLocation;
-interface nsIDOMMediaQueryList;
interface nsIDOMOfflineResourceList;
-interface nsIDOMStorage;
interface nsIPrompt;
interface nsISelection;
interface nsIVariant;
@@ -25,7 +23,7 @@ interface nsIVariant;
* @see <http://www.whatwg.org/html/#window>
*/
-[scriptable, uuid(be62660a-e3f6-409c-a4a9-378364a9526f)]
+[scriptable, uuid(8146f3fc-9fc1-47c5-85ef-95d686e4ca6d)]
interface nsIDOMWindow : nsISupports
{
// the current browsing context
@@ -49,7 +47,7 @@ interface nsIDOMWindow : nsISupports
/* The setter that takes a string argument needs to be special cased! */
readonly attribute nsIDOMLocation location;
- readonly attribute nsIDOMHistory history;
+ readonly attribute nsISupports history;
/* [replaceable] locationbar */
@@ -152,7 +150,11 @@ interface nsIDOMWindow : nsISupports
}
%}
- attribute nsIDOMWindow opener;
+ [implicit_jscontext, binaryname(ScriptableOpener)]
+ attribute jsval opener;
+
+ [noscript, binaryname(Opener)]
+ attribute nsIDOMWindow openerWindow;
/**
* |frameElement| gets this window's <iframe> or <frame> element, if it has
@@ -238,15 +240,23 @@ interface nsIDOMWindow : nsISupports
// WindowSessionStorage
/**
* Session storage for the current browsing context.
+ * This attribute is a DOMStorage
*/
- readonly attribute nsIDOMStorage sessionStorage;
+ readonly attribute nsISupports sessionStorage;
// WindowLocalStorage
/**
* Local storage for the current browsing context.
+ * This attribute is a DOMStorage
*/
- readonly attribute nsIDOMStorage localStorage;
+ readonly attribute nsISupports localStorage;
+
+
+ // IndexedDB
+ // https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#requests
+ // IDBEnvironment
+ readonly attribute nsISupports indexedDB;
// DOM Range
@@ -258,7 +268,7 @@ interface nsIDOMWindow : nsISupports
// CSSOM-View
// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-window-interface
- nsIDOMMediaQueryList matchMedia(in DOMString media_query_list);
+ nsISupports matchMedia(in DOMString media_query_list);
readonly attribute nsIDOMScreen screen;
@@ -360,7 +370,7 @@ interface nsIDOMWindow : nsISupports
void sizeToContent();
/* [replaceable] content */
- readonly attribute nsIDOMWindow content;
+ [noscript] readonly attribute nsIDOMWindow content;
/* [replaceable] prompter */
[noscript] readonly attribute nsIPrompt prompter;
@@ -368,11 +378,9 @@ interface nsIDOMWindow : nsISupports
readonly attribute boolean closed;
readonly attribute nsIDOMCrypto crypto;
- readonly attribute nsIDOMPkcs11 pkcs11;
- // XXX Shouldn't this be in nsIDOMChromeWindow?
- /* [replaceable] controllers */
- readonly attribute nsIControllers controllers;
+ // Note: this is [ChromeOnly] scriptable via WebIDL.
+ [noscript] readonly attribute nsIControllers controllers;
readonly attribute float mozInnerScreenX;
readonly attribute float mozInnerScreenY;
@@ -417,7 +425,9 @@ interface nsIDOMWindow : nsISupports
in nsISupports aExtraArgument);
// XXX Should this be in nsIDOMChromeWindow?
- void updateCommands(in DOMString action);
+ void updateCommands(in DOMString action,
+ [optional] in nsISelection sel,
+ [optional] in short reason);
/* Find in page.
* @param str: the search pattern
@@ -468,52 +478,14 @@ interface nsIDOMWindow : nsISupports
readonly attribute long long mozAnimationStartTime;
/**
- * HTML5 event attributes that only apply to windows and <body>/<frameset>
- */
- [implicit_jscontext] attribute jsval onafterprint;
- [implicit_jscontext] attribute jsval onbeforeprint;
- [implicit_jscontext] attribute jsval onbeforeunload;
- [implicit_jscontext] attribute jsval onhashchange;
- [implicit_jscontext] attribute jsval onmessage;
- [implicit_jscontext] attribute jsval onoffline;
- [implicit_jscontext] attribute jsval ononline;
- [implicit_jscontext] attribute jsval onpopstate;
- [implicit_jscontext] attribute jsval onpagehide;
- [implicit_jscontext] attribute jsval onpageshow;
- // Not supported yet
- // [implicit_jscontext] attribute jsval onredo;
- [implicit_jscontext] attribute jsval onresize;
- // Not supported yet
- // [implicit_jscontext] attribute jsval onstorage;
- // Not supported yet
- // [implicit_jscontext] attribute jsval onundo;
- [implicit_jscontext] attribute jsval onunload;
-
- /**
- * Non-HTML5 window-specific event attributes
- */
- [implicit_jscontext] attribute jsval ondevicemotion;
- [implicit_jscontext] attribute jsval ondeviceorientation;
- [implicit_jscontext] attribute jsval ondeviceproximity;
- [implicit_jscontext] attribute jsval onuserproximity;
- [implicit_jscontext] attribute jsval ondevicelight;
-
- [implicit_jscontext] attribute jsval onmouseenter;
- [implicit_jscontext] attribute jsval onmouseleave;
-};
-
-[scriptable, uuid(2146c906-57f7-486c-a1b4-8cdb57ef577f)]
-interface nsIDOMWindowPerformance : nsISupports
-{
- /**
- * A namespace to hold performance related data and statistics.
+ * Console API
*/
- readonly attribute nsISupports performance;
+ [implicit_jscontext] attribute jsval console;
};
/**
* Empty interface for compatibility with older versions.
* @deprecated Use nsIDOMWindow instead
*/
-[scriptable, uuid(ad5768c7-8668-4cd4-bcac-3d0a400d50be)]
+[scriptable, uuid(2ec49e81-b2ba-4633-991a-f48f1e1d8800)]
interface nsIDOMWindowInternal : nsIDOMWindow {};
diff --git a/dom/interfaces/base/nsIDOMWindowB2G.idl b/dom/interfaces/base/nsIDOMWindowB2G.idl
deleted file mode 100644
index f5bfcc90d..000000000
--- a/dom/interfaces/base/nsIDOMWindowB2G.idl
+++ /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/. */
-
-#include "nsISupports.idl"
-
-[scriptable, uuid(96bde2ae-9b74-4f4d-b674-664a67a35b7e)]
-interface nsIDOMWindowB2G : nsISupports
-{
- [implicit_jscontext] attribute jsval onmoztimechange;
- [implicit_jscontext] attribute jsval onmoznetworkupload;
- [implicit_jscontext] attribute jsval onmoznetworkdownload;
-}; \ No newline at end of file
diff --git a/dom/interfaces/base/nsIDOMWindowCollection.idl b/dom/interfaces/base/nsIDOMWindowCollection.idl
index 1173ac24e..09a2434d2 100644
--- a/dom/interfaces/base/nsIDOMWindowCollection.idl
+++ b/dom/interfaces/base/nsIDOMWindowCollection.idl
@@ -10,7 +10,7 @@
* collection of DOM window objects.
*/
-[scriptable, uuid(a6cf906f-15b3-11d2-932e-00805f8add32)]
+[uuid(a6cf906f-15b3-11d2-932e-00805f8add32)]
interface nsIDOMWindowCollection : nsISupports
{
/**
diff --git a/dom/interfaces/base/nsIDOMWindowUtils.idl b/dom/interfaces/base/nsIDOMWindowUtils.idl
index 4cab8aa9d..3410e64bf 100644
--- a/dom/interfaces/base/nsIDOMWindowUtils.idl
+++ b/dom/interfaces/base/nsIDOMWindowUtils.idl
@@ -11,12 +11,17 @@
* elevated privileges; the method implementations should contain the
* necessary security checks. Access this interface by calling
* getInterface on a DOMWindow.
+ *
+ * WARNING: Do not use 'out jsval' parameters in this file.
+ * SpecialPowers, which is used to access nsIDOMWindowUtils
+ * in plain mochitests, does not know how to handle them.
+ * (Use 'jsval' return values instead.)
*/
%{C++
#include "nsColor.h"
-#include "nsRect.h"
-#include "gfxContext.h"
+class gfxContext;
+struct nsRect;
%}
[ref] native nsConstRect(const nsRect);
@@ -30,19 +35,22 @@ interface nsIDOMNodeList;
interface nsIDOMElement;
interface nsIDOMHTMLCanvasElement;
interface nsIDOMEvent;
+interface nsIDOMStyleSheet;
interface nsITransferable;
interface nsIQueryContentEventResult;
interface nsIDOMWindow;
interface nsIDOMBlob;
interface nsIDOMFile;
interface nsIFile;
-interface nsIDOMTouch;
interface nsIDOMClientRect;
interface nsIURI;
interface nsIDOMEventTarget;
interface nsIRunnable;
+interface nsITranslationNodeList;
+interface nsIJSRAIIHelper;
+interface nsIContentPermissionRequest;
-[scriptable, uuid(cbe333d7-5b2c-4a9b-b99b-e6e388afa62b)]
+[scriptable, uuid(d0461871-31bd-4da1-b22d-24595c27295c)]
interface nsIDOMWindowUtils : nsISupports {
/**
@@ -95,6 +103,11 @@ interface nsIDOMWindowUtils : nsISupports {
unsigned long redraw([optional] in unsigned long aCount);
/**
+ * Force a synchronous layer transaction for this window if necessary.
+ */
+ void updateLayerTree();
+
+ /**
* Set the CSS viewport to be |widthPx| x |heightPx| in units of CSS
* pixels, regardless of the size of the enclosing widget/view.
* This will trigger reflow.
@@ -142,43 +155,59 @@ interface nsIDOMWindowUtils : nsISupports {
* avoided if at all possible. Client code should do checks before
* calling this so that duplicate sets are not made with the same
* displayport.
+ *
+ * aPriority is recorded along with the displayport rectangle. If this
+ * method is called with a lower priority than the current priority, the
+ * call is ignored.
*/
void setDisplayPortForElement(in float aXPx, in float aYPx,
in float aWidthPx, in float aHeightPx,
- in nsIDOMElement aElement);
-
+ in nsIDOMElement aElement,
+ in uint32_t aPriority);
/**
- * When a display port is set, this allows a sub-section of that
- * display port to be marked as 'critical'. In this scenario, the
- * area outside of this rectangle may be rendered at a lower
- * detail (for example, by reducing its resolution), or not rendered
- * at all under some circumstances.
- * This call will have no effect if a display port has not been set.
+ * An alternate way to represent a displayport rect as a set of margins and a
+ * base rect to apply those margins to. A consumer of pixels may ask for as
+ * many extra pixels as it would like in each direction. Layout then sets
+ * the base rect to the "visible rect" of the element, which is just the
+ * subrect of the element that is drawn (it does not take in account content
+ * covering the element).
+ *
+ * If both a displayport rect and displayport margins with corresponding base
+ * rect are set with the same priority then the margins will take precendence.
+ *
+ * Specifying an alignment value will ensure that after the base rect has
+ * been expanded by the displayport margins, it will be further expanded so
+ * that each edge is located at a multiple of the "alignment" value.
+ *
+ * Note that both the margin values and alignment are treated as values in
+ * ScreenPixels. Refer to layout/base/Units.h for a description of this unit.
+ * The base rect values are in app units.
*/
- void setCriticalDisplayPortForElement(in float aXPx, in float aYPx,
- in float aWidthPx, in float aHeightPx,
- in nsIDOMElement aElement);
+ void setDisplayPortMarginsForElement(in float aLeftMargin,
+ in float aTopMargin,
+ in float aRightMargin,
+ in float aBottomMargin,
+ in nsIDOMElement aElement,
+ in uint32_t aPriority);
+
+ void setDisplayPortBaseForElement(in int32_t aX,
+ in int32_t aY,
+ in int32_t aWidth,
+ in int32_t aHeight,
+ in nsIDOMElement aElement);
/**
* Get/set the resolution at which rescalable web content is drawn.
- * Currently this is only (some) thebes content.
*
* Setting a new resolution does *not* trigger reflow. This API is
* entirely separate from textZoom and fullZoom; a resolution scale
* can be applied together with both textZoom and fullZoom.
*
- * The effect of is API for gfx code to allocate more or fewer
+ * The effect of this API is for gfx code to allocate more or fewer
* pixels for rescalable content by a factor of |resolution| in
- * either or both dimensions. setResolution() together with
- * setDisplayport() can be used to implement a non-reflowing
- * scale-zoom in concert with another entity that can draw with a
- * scale. For example, to scale a content |window| inside a
- * <browser> by a factor of 2.0
- *
- * window.setDisplayport(x, y, oldW / 2.0, oldH / 2.0);
- * window.setResolution(2.0, 2.0);
- * // elsewhere
- * browser.setViewportScale(2.0, 2.0);
+ * either or both dimensions. The scale at which the content is
+ * displayed does not change; if that is desired, use
+ * setResolutionAndScaleTo() instead.
*
* The caller of this method must have chrome privileges.
*/
@@ -187,6 +216,28 @@ interface nsIDOMWindowUtils : nsISupports {
void getResolution(out float aXResolution, out float aYResolution);
/**
+ * Similar to setResolution(), but also scales the content by the
+ * amount of the resolution, so that it is displayed at a
+ * correspondingly larger or smaller size, without the need for
+ * the caller to set an additional transform.
+ *
+ * This can be used to implement a non-reflowing scale-zoom, e.g.
+ * for pinch-zoom on mobile platforms.
+ *
+ * The caller of this method must have chrome privileges.
+ */
+ void setResolutionAndScaleTo(in float aXResolution, in float aYResolution);
+
+ /**
+ * Whether the resolution has been set by the user.
+ * This gives a way to check whether the provided resolution is the default
+ * value or restored from a previous session.
+ *
+ * Can only be accessed with chrome privileges.
+ */
+ readonly attribute boolean isResolutionSet;
+
+ /**
* Whether the next paint should be flagged as the first paint for a document.
* This gives a way to track the next paint that occurs after the flag is
* set. The flag gets cleared after the next paint.
@@ -210,14 +261,16 @@ interface nsIDOMWindowUtils : nsISupports {
const long MODIFIER_ALTGRAPH = 0x0010;
const long MODIFIER_CAPSLOCK = 0x0020;
const long MODIFIER_FN = 0x0040;
- const long MODIFIER_NUMLOCK = 0x0080;
- const long MODIFIER_SCROLLLOCK = 0x0100;
- const long MODIFIER_SYMBOLLOCK = 0x0200;
- const long MODIFIER_OS = 0x0400;
+ const long MODIFIER_FNLOCK = 0x0080;
+ const long MODIFIER_NUMLOCK = 0x0100;
+ const long MODIFIER_SCROLLLOCK = 0x0200;
+ const long MODIFIER_SYMBOL = 0x0400;
+ const long MODIFIER_SYMBOLLOCK = 0x0800;
+ const long MODIFIER_OS = 0x1000;
/** Synthesize a mouse event. The event types supported are:
* mousedown, mouseup, mousemove, mouseover, mouseout, contextmenu,
- * MozMouseHitTest
+ * MozMouseHittest
*
* Events are sent in coordinates offset by aX and aY from the window.
*
@@ -248,9 +301,13 @@ interface nsIDOMWindowUtils : nsISupports {
* @param aPressure touch input pressure: 0.0 -> 1.0
* @param aInputSourceArg input source, see nsIDOMMouseEvent for values,
* defaults to mouse input.
+ * @param aIsSynthesized controls nsIDOMEvent.isSynthesized value
+ * that helps identifying test related events,
+ * defaults to true
*
* returns true if the page called prevent default on this event
*/
+ [optional_argc]
boolean sendMouseEvent(in AString aType,
in float aX,
in float aY,
@@ -259,7 +316,74 @@ interface nsIDOMWindowUtils : nsISupports {
in long aModifiers,
[optional] in boolean aIgnoreRootScrollFrame,
[optional] in float aPressure,
- [optional] in unsigned short aInputSourceArg);
+ [optional] in unsigned short aInputSourceArg,
+ [optional] in boolean aIsSynthesized);
+
+
+ /** Synthesize a pointer event. The event types supported are:
+ * pointerdown, pointerup, pointermove, pointerover, pointerout
+ *
+ * Events are sent in coordinates offset by aX and aY from the window.
+ *
+ * Note that additional events may be fired as a result of this call. For
+ * instance, typically a click event will be fired as a result of a
+ * mousedown and mouseup in sequence.
+ *
+ * Normally at this level of events, the pointerover and pointerout events are
+ * only fired when the window is entered or exited. For inter-element
+ * pointerover and pointerout events, a movemove event fired on the new element
+ * should be sufficient to generate the correct over and out events as well.
+ *
+ * Cannot be accessed from unprivileged context (not content-accessible)
+ * Will throw a DOM security error if called without chrome privileges.
+ *
+ * The event is dispatched via the toplevel window, so it could go to any
+ * window under the toplevel window, in some cases it could never reach this
+ * window at all.
+ *
+ * @param aType event type
+ * @param aX x offset in CSS pixels
+ * @param aY y offset in CSS pixels
+ * @param aButton button to synthesize
+ * @param aClickCount number of clicks that have been performed
+ * @param aModifiers modifiers pressed, using constants defined as MODIFIER_*
+ * @param aIgnoreRootScrollFrame whether the event should ignore viewport bounds
+ * during dispatch
+ * @param aPressure touch input pressure: 0.0 -> 1.0
+ * @param aInputSourceArg input source, see nsIDOMMouseEvent for values,
+ * defaults to mouse input.
+ * @param aPointerId A unique identifier for the pointer causing the event. default is 0
+ * @param aWidth The width (magnitude on the X axis), default is 0
+ * @param aHeight The height (magnitude on the Y axis), default is 0
+ * @param aTilt The plane angle between the Y-Z plane
+ * and the plane containing both the transducer (e.g. pen stylus) axis and the Y axis. default is 0
+ * @param aTiltX The plane angle between the X-Z plane
+ * and the plane containing both the transducer (e.g. pen stylus) axis and the X axis. default is 0
+ * @param aIsPrimary Indicates if the pointer represents the primary pointer of this pointer type.
+ * @param aIsSynthesized controls nsIDOMEvent.isSynthesized value
+ * that helps identifying test related events,
+ * defaults to true
+ *
+ * returns true if the page called prevent default on this event
+ */
+
+ [optional_argc]
+ boolean sendPointerEvent(in AString aType,
+ in float aX,
+ in float aY,
+ in long aButton,
+ in long aClickCount,
+ in long aModifiers,
+ [optional] in boolean aIgnoreRootScrollFrame,
+ [optional] in float aPressure,
+ [optional] in unsigned short aInputSourceArg,
+ [optional] in long aPointerId,
+ [optional] in long aWidth,
+ [optional] in long aHeight,
+ [optional] in long aTiltX,
+ [optional] in long aTiltY,
+ [optional] in boolean aIsPrimary,
+ [optional] in boolean aIsSynthesized);
/** Synthesize a touch event. The event types supported are:
* touchstart, touchend, touchmove, and touchcancel
@@ -302,6 +426,7 @@ interface nsIDOMWindowUtils : nsISupports {
/** The same as sendMouseEvent but ensures that the event is dispatched to
* this DOM window or one of its children.
*/
+ [optional_argc]
void sendMouseEventToWindow(in AString aType,
in float aX,
in float aY,
@@ -310,7 +435,44 @@ interface nsIDOMWindowUtils : nsISupports {
in long aModifiers,
[optional] in boolean aIgnoreRootScrollFrame,
[optional] in float aPressure,
- [optional] in unsigned short aInputSourceArg);
+ [optional] in unsigned short aInputSourceArg,
+ [optional] in boolean aIsSynthesized);
+
+ /** The same as sendPointerEvent but ensures that the event
+ * is dispatched to this DOM window or one of its children.
+ */
+ [optional_argc]
+ void sendPointerEventToWindow(in AString aType,
+ in float aX,
+ in float aY,
+ in long aButton,
+ in long aClickCount,
+ in long aModifiers,
+ [optional] in boolean aIgnoreRootScrollFrame,
+ [optional] in float aPressure,
+ [optional] in unsigned short aInputSourceArg,
+ [optional] in long aPointerId,
+ [optional] in long aWidth,
+ [optional] in long aHeight,
+ [optional] in long aTiltX,
+ [optional] in long aTiltY,
+ [optional] in boolean aIsPrimary,
+ [optional] in boolean aIsSynthesized);
+
+ /** The same as sendTouchEvent but ensures that the event is dispatched to
+ * this DOM window or one of its children.
+ */
+ boolean sendTouchEventToWindow(in AString aType,
+ [array, size_is(count)] in uint32_t aIdentifiers,
+ [array, size_is(count)] in int32_t aXs,
+ [array, size_is(count)] in int32_t aYs,
+ [array, size_is(count)] in uint32_t aRxs,
+ [array, size_is(count)] in uint32_t aRys,
+ [array, size_is(count)] in float aRotationAngles,
+ [array, size_is(count)] in float aForces,
+ in uint32_t count,
+ in long aModifiers,
+ [optional] in boolean aIgnoreRootScrollFrame);
/** Synthesize a wheel event for a window. The event types supported is only
* wheel.
@@ -330,18 +492,20 @@ interface nsIDOMWindowUtils : nsISupports {
* @param aModifiers modifiers pressed, using constants defined as
* MODIFIER_*
* @param aLineOrPageDeltaX If you set this value non-zero for
- * DOM_DELTA_PIXEL event, nsEventStateManager will
+ * DOM_DELTA_PIXEL event, EventStateManager will
* dispatch NS_MOUSE_SCROLL event for horizontal
* scroll.
* @param aLineOrPageDeltaY If you set this value non-zero for
- * DOM_DELTA_PIXEL event, nsEventStateManager will
+ * DOM_DELTA_PIXEL event, EventStateManager will
* dispatch NS_MOUSE_SCROLL event for vertical
* scroll.
* @param aOptions Set following flags.
*/
- const unsigned long WHEEL_EVENT_CAUSED_BY_PIXEL_ONLY_DEVICE = 0x0001;
- const unsigned long WHEEL_EVENT_CAUSED_BY_MOMENTUM = 0x0002;
- const unsigned long WHEEL_EVENT_CUSTOMIZED_BY_USER_PREFS = 0x0004;
+ const unsigned long WHEEL_EVENT_CAUSED_BY_NO_LINE_OR_PAGE_DELTA_DEVICE = 0x0001;
+ // @deprecated Use WHEEL_EVENT_CAUSED_BY_NO_LINE_OR_PAGE_DELTA_DEVICE.
+ const unsigned long WHEEL_EVENT_CAUSED_BY_PIXEL_ONLY_DEVICE = 0x0001;
+ const unsigned long WHEEL_EVENT_CAUSED_BY_MOMENTUM = 0x0002;
+ const unsigned long WHEEL_EVENT_CUSTOMIZED_BY_USER_PREFS = 0x0004;
// If any of the following flags is specified this method will throw an
// exception in case the relevant overflowDelta has an unexpected value.
const unsigned long WHEEL_EVENT_EXPECTED_OVERFLOW_DELTA_X_ZERO = 0x0010;
@@ -384,14 +548,16 @@ interface nsIDOMWindowUtils : nsISupports {
// If this is set, preventDefault() the event before dispatch.
const unsigned long KEY_FLAG_PREVENT_DEFAULT = 0x0001;
+ // If this is set, the mIsSynthesizedForTests flag is set to false
+ // on the key event. Otherwise it is true.
+ const unsigned long KEY_FLAG_NOT_SYNTHESIZED_FOR_TESTS = 0x0002;
+
// if one of these flags is set, the KeyboardEvent.location will be the value.
// Otherwise, it will be computed from aKeyCode.
const unsigned long KEY_FLAG_LOCATION_STANDARD = 0x0010;
const unsigned long KEY_FLAG_LOCATION_LEFT = 0x0020;
const unsigned long KEY_FLAG_LOCATION_RIGHT = 0x0040;
const unsigned long KEY_FLAG_LOCATION_NUMPAD = 0x0080;
- const unsigned long KEY_FLAG_LOCATION_MOBILE = 0x0100;
- const unsigned long KEY_FLAG_LOCATION_JOYSTICK = 0x0200;
boolean sendKeyEvent(in AString aType,
in long aKeyCode,
@@ -427,6 +593,28 @@ interface nsIDOMWindowUtils : nsISupports {
in nsIDOMElement aElement);
/**
+ * The values for sendNativeMouseScrollEvent's aAdditionalFlags.
+ */
+
+ /**
+ * If MOUSESCROLL_PREFER_WIDGET_AT_POINT is set, widget will dispatch
+ * the event to a widget which is under the cursor. Otherwise, dispatch to
+ * a default target on the platform. E.g., on Windows, it's focused window.
+ */
+ const unsigned long MOUSESCROLL_PREFER_WIDGET_AT_POINT = 0x00000001;
+
+ /**
+ * The platform specific values of aAdditionalFlags. Must be over 0x00010000.
+ */
+
+ /**
+ * If MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL is set and aNativeMessage is
+ * WM_VSCROLL or WM_HSCROLL, widget will set the window handle to the lParam
+ * instead of NULL.
+ */
+ const unsigned long MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL = 0x00010000;
+
+ /**
* See nsIWidget::SynthesizeNativeMouseScrollEvent
*
* Will be called on the widget that contains aElement.
@@ -450,26 +638,79 @@ interface nsIDOMWindowUtils : nsISupports {
in nsIDOMElement aElement);
/**
- * The values of aAdditionalFlags.
- */
-
- /**
- * If MOUSESCROLL_PREFER_WIDGET_AT_POINT is set, widget will dispatch
- * the event to a widget which is under the cursor. Otherwise, dispatch to
- * a default target on the platform. E.g., on Windows, it's focused window.
- */
- const unsigned long MOUSESCROLL_PREFER_WIDGET_AT_POINT = 0x00000001;
+ * Touch states for sendNativeTouchPoint. These values match
+ * nsIWidget's TouchPointerState.
+ */
+
+ // The pointer is in a hover state above the digitizer
+ const long TOUCH_HOVER = 0x01;
+ // The pointer is in contact with the digitizer
+ const long TOUCH_CONTACT = 0x02;
+ // The pointer has been removed from the digitizer detection area
+ const long TOUCH_REMOVE = 0x04;
+ // The pointer has been canceled. Will cancel any pending os level
+ // gestures that would be triggered as a result of completion of the
+ // input sequence. This may not cancel moz platform related events
+ // that might get tirggered by input already delivered.
+ const long TOUCH_CANCEL = 0x08;
+
+ /**
+ * Create a new or update an existing touch point on the digitizer.
+ * To trigger os level gestures, individual touch points should
+ * transition through a complete set of touch states which should be
+ * sent as individual calls. For example:
+ * tap - msg1:TOUCH_CONTACT, msg2:TOUCH_REMOVE
+ * drag - msg1-n:TOUCH_CONTACT (moving), msgn+1:TOUCH_REMOVE
+ * hover drag - msg1-n:TOUCH_HOVER (moving), msgn+1:TOUCH_REMOVE
+ *
+ * Widget support: Windows 8.0+, Winrt/Win32. Gonk supports CONTACT, REMOVE,
+ * and CANCEL but no HOVER. Other widgets will throw.
+ *
+ * @param aPointerId The touch point id to create or update.
+ * @param aTouchState one or more of the touch states listed above
+ * @param aScreenX, aScreenY screen coords of this event
+ * @param aPressure 0.0 -> 1.0 float val indicating pressure
+ * @param aOrientation 0 -> 359 degree value indicating the
+ * orientation of the pointer. Use 90 for normal taps.
+ */
+ void sendNativeTouchPoint(in unsigned long aPointerId,
+ in unsigned long aTouchState,
+ in long aScreenX,
+ in long aScreenY,
+ in double aPressure,
+ in unsigned long aOrientation);
/**
- * The platform specific values of aAdditionalFlags. Must be over 0x00010000.
+ * Simulates native touch based taps on the input digitizer. Events
+ * triggered by this call are injected at the os level. Events do not
+ * bypass widget level input processing and as such can be used to
+ * test widget event logic and async pan-zoom controller functionality.
+ * Cannot be accessed from an unprivileged context.
+ *
+ * Long taps (based on the aLongTap parameter) will be completed
+ * asynchrnously after the call returns. Long tap delay is based on
+ * the ui.click_hold_context_menus.delay pref or 1500 msec if pref
+ * is not set.
+ *
+ * Widget support: Windows 8.0+, Winrt/Win32. Other widgets will
+ * throw.
+ *
+ * @param aScreenX, aScreenY screen coords of this event
+ * @param aLongTap true if the tap should be long, false for a short
+ * tap.
*/
+ void sendNativeTouchTap(in long aScreenX,
+ in long aScreenY,
+ in boolean aLongTap);
/**
- * If MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL is set and aNativeMessage is
- * WM_VSCROLL or WM_HSCROLL, widget will set the window handle to the lParam
- * instead of NULL.
+ * Cancel any existing touch points or long tap delays. Calling this is safe
+ * even if you're sure there aren't any pointers recorded. You should call
+ * this when tests shut down to reset the digitizer driver. Not doing so can
+ * leave the digitizer in an undetermined state which can screw up subsequent
+ * tests and native input.
*/
- const unsigned long MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL = 0x00010000;
+ void clearNativeTouchSequence();
/**
* See nsIWidget::ActivateNativeMenuItemAt
@@ -541,6 +782,12 @@ interface nsIDOMWindowUtils : nsISupports {
void cycleCollect([optional] in nsICycleCollectorListener aListener,
[optional] in long aExtraForgetSkippableCalls);
+ /**
+ * Trigger whichever GC or CC timer is currently active and waiting to fire.
+ * Don't do this too much for initiating heavy actions, like the start of a IGC.
+ */
+ void runNextCollectorTimer();
+
/** Synthesize a simple gesture event for a window. The event types
* supported are: MozSwipeGestureStart, MozSwipeGestureUpdate,
* MozSwipeGestureEnd, MozSwipeGesture, MozMagnifyGestureStart,
@@ -604,6 +851,16 @@ interface nsIDOMWindowUtils : nsISupports {
in boolean aIgnoreRootScrollFrame,
in boolean aFlushLayout);
+
+ /**
+ * Get a list of nodes that have meaningful textual content to
+ * be translated. The implementation of this algorithm is in flux
+ * as we experiment and refine which approach works best.
+ *
+ * This method requires chrome privileges.
+ */
+ nsITranslationNodeList getTranslationNodes(in nsIDOMNode aRoot);
+
/**
* Compare the two canvases, returning the number of differing pixels and
* the maximum difference in a channel. This will throw an error if
@@ -652,6 +909,14 @@ interface nsIDOMWindowUtils : nsISupports {
void getScrollXY(in boolean aFlushLayout, out long aScrollX, out long aScrollY);
/**
+ * Returns the scroll position of the window's currently loaded document.
+ *
+ * @param aFlushLayout flushes layout if true. Otherwise, no flush occurs.
+ * @see nsIDOMWindow::scrollX/Y
+ */
+ void getScrollXYFloat(in boolean aFlushLayout, out float aScrollX, out float aScrollY);
+
+ /**
* Returns the scrollbar width of the window's scroll frame.
*
* @param aFlushLayout flushes layout if true. Otherwise, no flush occurs.
@@ -718,7 +983,7 @@ interface nsIDOMWindowUtils : nsISupports {
/**
* Get the current zoom factor.
- * This is _approximately_ the same as nsIMarkupDocumentViewer.fullZoom,
+ * This is _approximately_ the same as nsIContentViewer.fullZoom,
* but takes into account Goanna's quantization of the zoom factor, which is
* implemented by adjusting the (integer) number of appUnits per devPixel.
*/
@@ -741,7 +1006,7 @@ interface nsIDOMWindowUtils : nsISupports {
in boolean aTrusted);
/**
- * Sets nsEvent::mFlags::mOnlyChromeDispatch to true to ensure that
+ * Sets WidgetEvent::mFlags::mOnlyChromeDispatch to true to ensure that
* the event is propagated only to chrome.
* Event's .target property will be aTarget.
* Returns the same value as what EventTarget.dispatchEvent does.
@@ -770,75 +1035,33 @@ interface nsIDOMWindowUtils : nsISupports {
[optional] in nsITransferable aTransferable);
/**
- * Synthesize a composition event to the window.
- *
- * Cannot be accessed from unprivileged context (not content-accessible)
- * Will throw a DOM security error if called without chrome privileges.
- *
- * @param aType The event type: "compositionstart", "compositionend" or
- * "compositionupdate".
- * @param aData The data property value. Note that this isn't applied
- * for compositionstart event because its value is the
- * selected text which is automatically computed.
- * @param aLocale The locale property value.
- */
- void sendCompositionEvent(in AString aType,
- in AString aData,
- in AString aLocale);
-
- /**
- * Synthesize a text event to the window.
- *
- * Cannot be accessed from unprivileged context (not content-accessible)
- * Will throw a DOM security error if called without chrome privileges.
- *
- * Currently, this method doesn't support 4 or more clauses composition
- * string.
- *
- * @param aCompositionString composition string
- * @param a*ClauseLengh the length of nth clause, set 0 when you
- * don't need second or third clause.
- * @param a*ClauseAttr the attribute of nth clause, uese following
- * const values.
- * @param aCaretStart the caret position in the composition string,
- * if you set negative value, this method don't
- * set the caret position to the event.
- * @param aCaretLength the caret length, if this is one or more,
- * the caret will be wide caret, otherwise,
- * it's collapsed.
- * XXX nsEditor doesn't support wide caret yet.
+ * If sendQueryContentEvent()'s aAdditionalFlags argument is
+ * QUERY_CONTENT_FLAG_USE_XP_LINE_BREAK, plain text generated from content
+ * is created with "\n".
+ * Otherwise, platform dependent. E.g., on Windows, "\r\n" is used.
+ * aOffset and aLength are offset and length in/of the plain text content.
+ * This flag also affects the result values such as offset, length and string.
*/
-
- // NOTE: These values must be same to NS_TEXTRANGE_* in nsGUIEvent.h
-
- const unsigned long COMPOSITION_ATTR_RAWINPUT = 0x02;
- const unsigned long COMPOSITION_ATTR_SELECTEDRAWTEXT = 0x03;
- const unsigned long COMPOSITION_ATTR_CONVERTEDTEXT = 0x04;
- const unsigned long COMPOSITION_ATTR_SELECTEDCONVERTEDTEXT = 0x05;
-
- void sendTextEvent(in AString aCompositionString,
- in long aFirstClauseLength,
- in unsigned long aFirstClauseAttr,
- in long aSecondClauseLength,
- in unsigned long aSecondClauseAttr,
- in long aThirdClauseLength,
- in unsigned long aThirdClauseAttr,
- in long aCaretStart,
- in long aCaretLength);
+ const unsigned long QUERY_CONTENT_FLAG_USE_NATIVE_LINE_BREAK = 0x0000;
+ const unsigned long QUERY_CONTENT_FLAG_USE_XP_LINE_BREAK = 0x0001;
/**
- * Synthesize a query content event.
+ * Synthesize a query content event. Note that the result value returned here
+ * is in LayoutDevice pixels rather than CSS pixels.
*
* @param aType One of the following const values. And see also each comment
* for the other parameters and the result.
+ * @param aAdditionalFlags See the description of QUERY_CONTENT_FLAG_*.
*/
- nsIQueryContentEventResult sendQueryContentEvent(in unsigned long aType,
- in unsigned long aOffset,
- in unsigned long aLength,
- in long aX,
- in long aY);
+ nsIQueryContentEventResult sendQueryContentEvent(
+ in unsigned long aType,
+ in unsigned long aOffset,
+ in unsigned long aLength,
+ in long aX,
+ in long aY,
+ [optional] in unsigned long aAdditionalFlags);
- // NOTE: following values are same as NS_QUERY_* in nsGUIEvent.h
+ // NOTE: following values are same as NS_QUERY_* in BasicEvents.h
/**
* QUERY_SELECTED_TEXT queries the first selection range's information.
@@ -949,6 +1172,22 @@ interface nsIDOMWindowUtils : nsISupports {
void exitFullscreen();
/**
+ * If sendQueryContentEvent()'s aAdditionalFlags argument is
+ * SELECTION_SET_FLAG_USE_NATIVE_LINE_BREAK, aOffset and aLength are offset
+ * and length in/of plain text generated from content is created with "\n".
+ * Otherwise, platform dependent. E.g., on Windows, "\r\n" is used.
+ */
+ const unsigned long SELECTION_SET_FLAG_USE_NATIVE_LINE_BREAK = 0x0000;
+ const unsigned long SELECTION_SET_FLAG_USE_XP_LINE_BREAK = 0x0001;
+
+ /**
+ * If SELECTION_SET_FLAG_REVERSE is set, the selection is set from
+ * |aOffset + aLength| to |aOffset|. Otherwise, it's set from |aOffset| to
+ * |aOffset + aLength|.
+ */
+ const unsigned long SELECTION_SET_FLAG_REVERSE = 0x0002;
+
+ /**
* Synthesize a selection set event to the window.
*
* This sets the selection as the specified information.
@@ -956,14 +1195,12 @@ interface nsIDOMWindowUtils : nsISupports {
* @param aOffset The caret offset of the selection start.
* @param aLength The length of the selection. If this is too long, the
* extra length is ignored.
- * @param aReverse If true, the selection set from |aOffset + aLength| to
- * |aOffset|. Otherwise, set from |aOffset| to
- * |aOffset + aLength|.
+ * @param aAdditionalFlags See the description of SELECTION_SET_FLAG_*.
* @return True, if succeeded. Otherwise, false.
*/
boolean sendSelectionSetEvent(in unsigned long aOffset,
in unsigned long aLength,
- in boolean aReverse);
+ [optional] in unsigned long aAdditionalFlags);
/* Selection behaviors - mirror nsIFrame's nsSelectionAmount constants */
const unsigned long SELECT_CHARACTER = 0;
@@ -1033,26 +1270,13 @@ interface nsIDOMWindowUtils : nsISupports {
* Put the window into a state where scripts are frozen and events
* suppressed, for use when the window has launched a modal prompt.
*/
- [noscript] void enterModalState();
+ void enterModalState();
/**
* Resume normal window state, where scripts can run and events are
* delivered.
*/
- [noscript] void leaveModalState();
-
- /**
- * Same as enterModalState, but returns the window associated with the
- * current JS context.
- */
- nsIDOMWindow enterModalStateWithWindow();
-
- /**
- * Same as leaveModalState, but takes a window associated with the active
- * context when enterModalStateWithWindow was called. The currently context
- * might be different at the moment (see bug 621764).
- */
- void leaveModalStateWithWindow(in nsIDOMWindow aWindow);
+ void leaveModalState();
/**
* Is the window is in a modal state? [See enterModalState()]
@@ -1080,7 +1304,7 @@ interface nsIDOMWindowUtils : nsISupports {
readonly attribute boolean layerManagerRemote;
/**
- * Record (and return) frame-intervals and paint-times for frames which were presented
+ * Record (and return) frame-intervals for frames which were presented
* between calling StartFrameTimeRecording and StopFrameTimeRecording.
*
* - Uses a cyclic buffer and serves concurrent consumers, so if Stop is called too late
@@ -1102,7 +1326,6 @@ interface nsIDOMWindowUtils : nsISupports {
* - Allocation is infallible. Should be released even if size is 0.
*/
void stopFrameTimeRecording(in unsigned long startIndex,
- [optional, array, size_is(frameCount)] out float paintTimes,
[optional] out unsigned long frameCount,
[retval, array, size_is(frameCount)] out float frameIntervals);
@@ -1123,6 +1346,12 @@ interface nsIDOMWindowUtils : nsISupports {
*/
nsIDOMWindow getOuterWindowWithId(in unsigned long long aOuterWindowID);
+ /**
+ * Return this window's frame element.
+ * Ignores all chrome/content or mozbrowser boundaries.
+ */
+ readonly attribute nsIDOMElement containerElement;
+
[noscript] void RenderDocument(in nsConstRect aRect,
in uint32_t aFlags,
in nscolor aBackgroundColor,
@@ -1161,10 +1390,17 @@ interface nsIDOMWindowUtils : nsISupports {
readonly attribute bool isTestControllingRefreshes;
/**
- * Method for testing nsStyleAnimation::ComputeDistance.
+ * Set async scroll offset on an element. The next composite will render
+ * with that offset if async scrolling is enabled, and then the offset
+ * will be removed. Only call this while test-controlled refreshes is enabled.
+ */
+ void setAsyncScrollOffset(in nsIDOMNode aNode, in int32_t aX, in int32_t aY);
+
+ /**
+ * Method for testing StyleAnimationValue::ComputeDistance.
*
* Returns the distance between the two values as reported by
- * nsStyleAnimation::ComputeDistance for the given element and
+ * StyleAnimationValue::ComputeDistance for the given element and
* property.
*/
double computeAnimationDistance(in nsIDOMElement element,
@@ -1190,6 +1426,12 @@ interface nsIDOMWindowUtils : nsISupports {
nsIDOMElement findElementWithViewId(in nsViewID aId);
/**
+ * Find the view ID for a given element. This is the reverse of
+ * findElementWithViewId().
+ */
+ nsViewID getViewId(in nsIDOMElement aElement);
+
+ /**
* Checks the layer tree for this window and returns true
* if all layers have transforms that are translations by integers,
* no leaf layers overlap, and the union of the leaf layers is exactly
@@ -1203,39 +1445,30 @@ interface nsIDOMWindowUtils : nsISupports {
readonly attribute boolean mayHaveTouchEventListeners;
/**
- * Check if any ThebesLayer painting has been done for this element,
+ * Check if any PaintedLayer painting has been done for this element,
* clears the painted flags if they have.
*/
boolean checkAndClearPaintedState(in nsIDOMElement aElement);
/**
- * Internal file constructor intended for testing of File objects.
- * Example of constructor usage:
- * getFile("myfile.txt", [b1, "foo"], { type: "text/plain" })
- */
- [optional_argc, implicit_jscontext]
- nsIDOMFile getFile(in DOMString aName, [optional] in jsval aBlobParts,
- [optional] in jsval aParameters);
-
- /**
- * Internal blob constructor intended for testing of Blob objects.
- * Example of constructor usage:
- * getBlob([b1, "foo"], { type: "text/plain" })
+ * Get internal id of the stored blob, file or file handle.
*/
- [optional_argc, implicit_jscontext]
- nsIDOMBlob getBlob([optional] in jsval aBlobParts,
- [optional] in jsval aParameters);
+ [implicit_jscontext] long long getFileId(in jsval aFile);
/**
- * Get internal id of the stored blob, file or file handle.
+ * Get internal file path of the stored file or file handle.
+ *
+ * TODO: File handle objects are actually not supported at the moment.
*/
- [implicit_jscontext] long long getFileId(in jsval aFile);
+ [implicit_jscontext] AString getFilePath(in jsval aFile);
/**
* Get file ref count info for given database and file id.
*
*/
+ [implicit_jscontext]
boolean getFileReferences(in AString aDatabaseName, in long long aId,
+ [optional] in jsval aOptions,
[optional] out long aRefCnt,
[optional] out long aDBRefCnt,
[optional] out long aSliceRefCnt);
@@ -1325,10 +1558,12 @@ interface nsIDOMWindowUtils : nsISupports {
in float aBottom, in float aLeft);
/**
- * Prevent this window (and any child windows) from displaying any further
- * dialogs (e.g. window.alert()).
+ * These are used to control whether dialogs (alert, prompt, confirm) are
+ * allowed.
*/
- void preventFurtherDialogs();
+ void disableDialogs();
+ void enableDialogs();
+ bool areDialogsEnabled();
const unsigned long AGENT_SHEET = 0;
const unsigned long USER_SHEET = 1;
@@ -1343,20 +1578,37 @@ interface nsIDOMWindowUtils : nsISupports {
*
* Sheets added via this API take effect immediately on the document.
*/
- void loadSheet(in nsIURI sheetURI,
- in unsigned long type);
+ void loadSheet(in nsIURI sheetURI, in unsigned long type);
+
+ /**
+ * Same as the above method but allows passing the URI as a string.
+ */
+ void loadSheetUsingURIString(in ACString sheetURI, in unsigned long type);
+
+ /**
+ * Adds a style sheet to the list of additional style sheets of the document.
+ *
+ * Style sheets can be preloaded with nsIStyleSheetService.preloadSheet.
+ *
+ * Sheets added via this API take effect immediately on the document.
+ */
+ void addSheet(in nsIDOMStyleSheet sheet, in unsigned long type);
/**
* Remove the document style sheet at |sheetURI| from the list of additional
* style sheets of the document. The removal takes effect immediately.
*/
- void removeSheet(in nsIURI sheetURI,
- in unsigned long type);
+ void removeSheet(in nsIURI sheetURI, in unsigned long type);
+
+ /**
+ * Same as the above method but allows passing the URI as a string.
+ */
+ void removeSheetUsingURIString(in ACString sheetURI, in unsigned long type);
/**
* Returns true if a user input is being handled.
*
- * This calls nsEventStateManager::IsHandlingUserInput().
+ * This calls EventStateManager::IsHandlingUserInput().
*/
readonly attribute boolean isHandlingUserInput;
@@ -1414,9 +1666,106 @@ interface nsIDOMWindowUtils : nsISupports {
void runBeforeNextEvent(in nsIRunnable runnable);
/*
- * Returns the value of a given property. If the property is animated off the
- * main thread, this function will fetch the correct value from the compositor.
+ * Returns the value of a given property animated on the compositor thread.
+ * If the property is NOT currently being animated on the compositor thread,
+ * returns an empty string.
+ */
+ AString getOMTAStyle(in nsIDOMElement aElement, in AString aProperty);
+
+ /**
+ * Special function that gets a property syncronously from the last composite
+ * that occured.
+ *
+ * Supported properties:
+ * "overdraw": Report a percentage between 0 and 999 indicate how many times
+ * each pixels on the destination window have been touched.
+ * "missed_hwc": Report a bool if hardware composer is supported but was
+ * not used for the last frame.
+ */
+ float requestCompositorProperty(in AString aProperty);
+
+ /**
+ * If aHandlingInput is true, this informs the event state manager that
+ * we're handling user input. Otherwise, this is a no-op (as by default
+ * we're not handling user input).
+ * Remember to call destruct() on the return value!
+ * See also nsIDOMWindowUtils::isHandlingUserInput.
+ */
+ nsIJSRAIIHelper setHandlingUserInput(in boolean aHandlingInput);
+
+ /**
+ * Get the content- and compositor-side APZ test data instances.
+ * The return values are of type APZTestData (see APZTestData.webidl).
*/
- AString getOMTAOrComputedStyle(in nsIDOMNode aNode,
- in AString aProperty);
+ [implicit_jscontext] jsval getContentAPZTestData();
+ [implicit_jscontext] jsval getCompositorAPZTestData();
+
+ /**
+ * With this it's possible to mute all the MediaElements in this window.
+ * We have audioMuted and audioVolume to preserve the volume across
+ * mute/umute.
+ */
+ attribute boolean audioMuted;
+
+ /**
+ * range: greater or equal to 0. The real volume level is affected by the
+ * volume of all ancestor windows.
+ */
+ attribute float audioVolume;
+
+ /**
+ * This method doesn't do anything useful. It was solely added for the
+ * purpose of the test for bug 503926.
+ */
+ void xpconnectArgument(in nsIDOMWindowUtils aThis);
+
+ /**
+ * Helper for JS components that need to send permission requests with
+ * e10s support properly.
+ */
+ void askPermission(in nsIContentPermissionRequest aRequest);
+
+ /**
+ * Number of frames constructed (excluding breaking) for the curent
+ * document.
+ *
+ * May throw NS_ERROR_NOT_AVAILABLE.
+ */
+ readonly attribute unsigned long long framesConstructed;
+
+ /**
+ * Number of frames reflowed for the curent document.
+ *
+ * May throw NS_ERROR_NOT_AVAILABLE.
+ */
+ readonly attribute unsigned long long framesReflowed;
+
+ /**
+ * Controls the amount of chrome that should be visible on each side of
+ * the window. Works like the chromemargin xul:window attribute.
+ * This should only be used with non-XUL windows.
+ */
+ void setChromeMargin(in int32_t aTop,
+ in int32_t aRight,
+ in int32_t aBottom,
+ in int32_t aLeft);
+};
+
+[scriptable, uuid(c694e359-7227-4392-a138-33c0cc1f15a6)]
+interface nsITranslationNodeList : nsISupports {
+ readonly attribute unsigned long length;
+ nsIDOMNode item(in unsigned long index);
+
+ // A translation root is a block element, or an inline element
+ // which its parent is not a translation node.
+ boolean isTranslationRootAtIndex(in unsigned long index);
+};
+
+/**
+ * JS doesn't do RAII very well. We can use this interface to make remembering
+ * to destruct an object in a finally clause easier.
+ */
+[scriptable, uuid(52e5a996-d0a9-4efc-a6fa-24489c532b19)]
+interface nsIJSRAIIHelper : nsISupports {
+ void destruct();
};
diff --git a/dom/interfaces/base/nsIFocusManager.idl b/dom/interfaces/base/nsIFocusManager.idl
index 7a8550276..7781b3f84 100644
--- a/dom/interfaces/base/nsIFocusManager.idl
+++ b/dom/interfaces/base/nsIFocusManager.idl
@@ -8,7 +8,7 @@
interface nsIDocument;
interface nsIContent;
-[scriptable, uuid(51db277b-7ee7-4bce-9b84-fd2efcd2c8bd)]
+[scriptable, uuid(c0716002-5602-4002-a0de-cc69b924b2c6)]
/**
* The focus manager deals with all focus related behaviour. Only one element
* in the entire application may have the focus at a time; this element
@@ -250,4 +250,10 @@ interface nsIFocusManager : nsISupports
* widget focus state is the responsibility of the caller.
*/
[noscript] void focusPlugin(in nsIContent aPlugin);
+
+ /**
+ * Used in a child process to indicate that the parent window is now
+ * active or deactive.
+ */
+ [noscript] void parentActivated(in nsIDOMWindow aWindow, in bool active);
};
diff --git a/dom/interfaces/base/nsIRemoteBrowser.idl b/dom/interfaces/base/nsIRemoteBrowser.idl
new file mode 100644
index 000000000..0b4f46099
--- /dev/null
+++ b/dom/interfaces/base/nsIRemoteBrowser.idl
@@ -0,0 +1,26 @@
+/* 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/. */
+
+#include "nsISupports.idl"
+
+[scriptable, uuid(C8379366-F79F-4D25-89A6-22BEC0A93D16)]
+interface nsIRemoteBrowser : nsISupports
+{
+ /*
+ * Called by the child to inform the parent that a command update has occurred
+ * and the supplied set of commands are now enabled and disabled.
+ *
+ * @param action command updater action
+ * @param enabledLength length of enabledCommands array
+ * @param enabledCommands commands to enable
+ * @param disabledLength length of disabledCommands array
+ * @param disabledCommand commands to disable
+ */
+ void enableDisableCommands(in AString action,
+ in unsigned long enabledLength,
+ [array, size_is(enabledLength)] in string enabledCommands,
+ in unsigned long disabledLength,
+ [array, size_is(disabledLength)] in string disabledCommands);
+};
+
diff --git a/dom/interfaces/base/nsIServiceWorkerManager.idl b/dom/interfaces/base/nsIServiceWorkerManager.idl
new file mode 100644
index 000000000..2cec7919a
--- /dev/null
+++ b/dom/interfaces/base/nsIServiceWorkerManager.idl
@@ -0,0 +1,109 @@
+/* -*- 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/. */
+
+#include "domstubs.idl"
+
+interface nsIDocument;
+interface nsIInterceptedChannel;
+interface nsIPrincipal;
+interface nsIURI;
+
+[builtinclass, uuid(d4367ffe-e435-4195-95f8-0a51b1bbfdfb)]
+interface nsIServiceWorkerUnregisterCallback : nsISupports
+{
+ // aState is true if the unregistration succeded.
+ // It's false if this ServiceWorkerRegistration doesn't exist.
+ [noscript] void UnregisterSucceeded(in bool aState);
+ [noscript] void UnregisterFailed();
+};
+
+[builtinclass, uuid(464882c8-81c0-4620-b9c4-44c12085b65b)]
+interface nsIServiceWorkerManager : nsISupports
+{
+ /**
+ * Registers a ServiceWorker with script loaded from `aScriptURI` to act as
+ * the ServiceWorker for aScope. Requires a valid entry settings object on
+ * the stack. This means you must call this from content code 'within'
+ * a window.
+ *
+ * Returns a Promise.
+ */
+ nsISupports register(in nsIDOMWindow aWindow, in DOMString aScope, in DOMString aScriptURI);
+
+ /**
+ * Unregister an existing ServiceWorker registration for `aScope`.
+ * It keeps aCallback alive until the operation is concluded.
+ */
+ void unregister(in nsIPrincipal aPrincipal,
+ in nsIServiceWorkerUnregisterCallback aCallback,
+ in DOMString aScope);
+
+ // Returns a Promise
+ nsISupports getRegistrations(in nsIDOMWindow aWindow);
+
+ // Returns a Promise
+ nsISupports getRegistration(in nsIDOMWindow aWindow, in DOMString aScope);
+
+ // Returns a Promise
+ nsISupports getReadyPromise(in nsIDOMWindow aWindow);
+
+ // Remove ready pending Promise
+ void removeReadyPromise(in nsIDOMWindow aWindow);
+
+ // Returns true if a ServiceWorker is available for the scope of aURI.
+ bool isAvailableForURI(in nsIURI aURI);
+
+ // Returns true if a given document is currently controlled by a ServiceWorker
+ bool isControlled(in nsIDocument aDocument);
+
+ // Cause a fetch event to be dispatched to the worker global associated with the given document.
+ void dispatchFetchEvent(in nsIDocument aDoc, in nsIInterceptedChannel aChannel);
+
+ // aTarget MUST be a ServiceWorkerRegistration.
+ [noscript] void AddRegistrationEventListener(in DOMString aScope, in nsIDOMEventTarget aTarget);
+ [noscript] void RemoveRegistrationEventListener(in DOMString aScope, in nsIDOMEventTarget aTarget);
+
+ /**
+ * Call this to request that document `aDoc` be controlled by a ServiceWorker
+ * if a registration exists for it's scope.
+ *
+ * This MUST only be called once per document!
+ */
+ [notxpcom,nostdcall] void MaybeStartControlling(in nsIDocument aDoc);
+
+ /**
+ * Documents that have called MaybeStartControlling() should call this when
+ * they are destroyed. This function may be called multiple times, and is
+ * idempotent.
+ */
+ [notxpcom,nostdcall] void MaybeStopControlling(in nsIDocument aDoc);
+
+ /*
+ * Returns a ServiceWorker.
+ * window is the window of the caller. scope is the registration's scope and must be
+ * a valid entry that window is allowed to load, otherwise this will return nullptr.
+ * These are only meant to be called from ServiceWorkerRegistration instances.
+ */
+ [noscript] nsISupports GetInstalling(in nsIDOMWindow aWindow, in DOMString aScope);
+ [noscript] nsISupports GetWaiting(in nsIDOMWindow aWindow, in DOMString aScope);
+ [noscript] nsISupports GetActive(in nsIDOMWindow aWindow, in DOMString aScope);
+
+ /*
+ * Returns a ServiceWorker.
+ */
+ [noscript] nsISupports GetDocumentController(in nsIDOMWindow aWindow);
+
+ /*
+ * This implements the update algorithm.
+ */
+ void update(in DOMString aScope);
+
+ // Testing
+ DOMString getScopeForUrl(in DOMString path);
+};
+
+%{ C++
+#define SERVICEWORKERMANAGER_CONTRACTID "@mozilla.org/serviceworkers/manager;1"
+%}
diff --git a/dom/interfaces/base/nsISpeechSynthesisGetter.idl b/dom/interfaces/base/nsISpeechSynthesisGetter.idl
deleted file mode 100644
index 21611d6bf..000000000
--- a/dom/interfaces/base/nsISpeechSynthesisGetter.idl
+++ /dev/null
@@ -1,17 +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/. */
-
-#include "nsISupports.idl"
-
-/**
- * SpeechSynthesisGetter
- * http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#tts-section
- */
-
-[scriptable, uuid(31e6c818-0279-4948-843c-930043f6bafd)]
-interface nsISpeechSynthesisGetter : nsISupports
-{
- readonly attribute nsISupports speechSynthesis;
-};
diff --git a/dom/interfaces/base/nsIStructuredCloneContainer.idl b/dom/interfaces/base/nsIStructuredCloneContainer.idl
index 4f6d9d550..68813be5d 100644
--- a/dom/interfaces/base/nsIStructuredCloneContainer.idl
+++ b/dom/interfaces/base/nsIStructuredCloneContainer.idl
@@ -11,7 +11,7 @@ interface nsIVariant;
interface nsIDocument;
%{C++
-struct JSContext;
+#include "js/TypeDecls.h"
%}
/**
@@ -19,7 +19,7 @@ struct JSContext;
* structured clone algorithm.
*
* You can copy an object into an nsIStructuredCloneContainer using
- * initFromVariant or initFromBase64. It's an error to initialize an
+ * initFromJSVal or initFromBase64. It's an error to initialize an
* nsIStructuredCloneContainer more than once.
*
* Once you've initialized the container, you can get a copy of the object it
@@ -27,15 +27,15 @@ struct JSContext;
* string containing a copy of the container's serialized data, using
* getDataAsBase64.
*/
-[scriptable, uuid(400a282d-7157-4ed0-85b4-8bdc2fa634cd)]
+[scriptable, uuid(63eeafec-63f5-42c3-aea9-5c04678784e7)]
interface nsIStructuredCloneContainer : nsISupports
{
/**
* Initialize this structured clone container so it contains a clone of the
- * given variant. aData must be backed by a jsval.
+ * given jsval.
*/
- [implicit_jscontext]
- void initFromVariant(in nsIVariant aData);
+ [noscript, implicit_jscontext]
+ void initFromJSVal(in jsval aData);
/**
* Initialize this structured clone container from a base-64-encoded byte
@@ -46,7 +46,7 @@ interface nsIStructuredCloneContainer : nsISupports
void initFromBase64(in AString aData,in unsigned long aFormatVersion);
/**
- * Deserialize the object this conatiner holds, returning it wrapped as
+ * Deserialize the object this container holds, returning it wrapped as
* an nsIVariant.
*/
[implicit_jscontext]
diff --git a/dom/interfaces/base/nsITabChild.idl b/dom/interfaces/base/nsITabChild.idl
index 5f09e1d85..6574502b1 100644
--- a/dom/interfaces/base/nsITabChild.idl
+++ b/dom/interfaces/base/nsITabChild.idl
@@ -5,11 +5,24 @@
#include "domstubs.idl"
interface nsIContentFrameMessageManager;
+interface nsIWebBrowserChrome3;
-// Sole purpose is to be able to identify the concrete class nsTabChild
-[uuid(bf1eddf9-731b-4a4b-bd65-9a712a892832)]
+native CommandsArray(nsTArray<nsCString>);
+[ref] native CommandsArrayRef(nsTArray<nsCString>);
+
+[scriptable, uuid(1fb79c27-e760-4088-b19c-1ce3673ec24e)]
interface nsITabChild : nsISupports
{
readonly attribute nsIContentFrameMessageManager messageManager;
+
+ attribute nsIWebBrowserChrome3 webBrowserChrome;
+
+ [notxpcom] void sendRequestFocus(in boolean canFocus);
+
+ [noscript, notxpcom] void enableDisableCommands(in AString action,
+ in CommandsArrayRef enabledCommands,
+ in CommandsArrayRef disabledCommands);
+
+ readonly attribute uint64_t tabId;
};
diff --git a/dom/interfaces/base/nsITabParent.idl b/dom/interfaces/base/nsITabParent.idl
index c69d57506..01c4fa184 100644
--- a/dom/interfaces/base/nsITabParent.idl
+++ b/dom/interfaces/base/nsITabParent.idl
@@ -5,8 +5,25 @@
#include "domstubs.idl"
-// Sole purpose is to be able to identify the concrete class nsTabParent
-[uuid(95c7c50b-6677-456f-9f1e-885e1cc272dc)]
+[scriptable, uuid(b19038ba-0d75-40d2-be35-742e26d33bf9)]
interface nsITabParent : nsISupports
{
+ void injectTouchEvent(in AString aType,
+ [array, size_is(count)] in uint32_t aIdentifiers,
+ [array, size_is(count)] in int32_t aXs,
+ [array, size_is(count)] in int32_t aYs,
+ [array, size_is(count)] in uint32_t aRxs,
+ [array, size_is(count)] in uint32_t aRys,
+ [array, size_is(count)] in float aRotationAngles,
+ [array, size_is(count)] in float aForces,
+ in uint32_t count,
+ in long aModifiers);
+
+ void getChildProcessOffset(out int32_t aCssX, out int32_t aCssY);
+
+ readonly attribute boolean useAsyncPanZoom;
+
+ void setIsDocShellActive(in bool aIsActive);
+
+ readonly attribute uint64_t tabId;
};
diff --git a/dom/interfaces/base/nsITextInputProcessor.idl b/dom/interfaces/base/nsITextInputProcessor.idl
new file mode 100644
index 000000000..8c597125d
--- /dev/null
+++ b/dom/interfaces/base/nsITextInputProcessor.idl
@@ -0,0 +1,576 @@
+/* -*- 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/. */
+
+#include "nsISupports.idl"
+
+interface nsIDOMKeyEvent;
+interface nsIDOMWindow;
+interface nsITextInputProcessorCallback;
+
+/**
+ * An nsITextInputProcessor instance is associated with a top level widget which
+ * handles native IME. It's associated by calling beginInputTransaction() or
+ * beginInputTransactionForTests(). While an instance has composition, nobody
+ * can steal the rights to make composition on the top level widget. In other
+ * words, if another instance is composing on a top level widget, either
+ * beginInputTransaction() or beginInputTransactionForTests() returns false
+ * (i.e., not throws an exception).
+ *
+ * NOTE: See nsITextInputProcessorCallback.idl for examples of |callback| in
+ * following examples,
+ *
+ * Example #1 JS-IME can start composition like this:
+ *
+ * var TIP = Components.classes["@mozilla.org/text-input-processor;1"].
+ * createInstance(Components.interfaces.nsITextInputProcessor);
+ * if (!TIP.beginInputTransaction(window, callback)) {
+ * return; // You failed to get the rights to make composition
+ * }
+ * // Create a keyboard event if the following compositionc change is caused
+ * // by a key event.
+ * var keyEvent =
+ * new KeyboardEvent("", { key: "foo", code: "bar", keyCode: buzz });
+ * // Set new composition string first
+ * TIP.setPendingCompositionString("some-words-are-inputted");
+ * // Set clause information.
+ * TIP.appendClauseToPendingComposition(23, TIP.ATTR_RAW_CLAUSE);
+ * // Set caret position, this is optional.
+ * TIP.setCaretInPendingComposition(23);
+ * // Flush the pending composition
+ * if (!TIP.flushPendingComposition(keyEvent)) {
+ * // If it returns false, it fails to start composition.
+ * return;
+ * }
+ *
+ * Example #2 JS-IME can separate composition string to two or more clauses:
+ *
+ * // Create a keyboard event if the following compositionc change is caused
+ * // by a key event.
+ * var keyEvent =
+ * new KeyboardEvent("", { key: "foo", code: "bar", keyCode: buzz });
+ * // First, set composition string again
+ * TIP.setPendingCompositionString("some-words-are-inputted");
+ * // Then, if "are" is selected to convert, there are 3 clauses:
+ * TIP.appendClauseToPendingComposition(11, TIP.ATTR_CONVERTED_CLAUSE);
+ * TIP.appendClauseToPendingComposition(3, TIP.ATTR_SELECTED_CLAUSE);
+ * TIP.appendClauseToPendingComposition(9, TIP.ATTR_CONVERTED_CLAUSE);
+ * // Show caret at the beginning of the selected clause
+ * TIP.setCaretInPendingComposition(11);
+ * // Flush the pending composition. Note that if there is a composition,
+ * // flushPendingComposition() won't return false.
+ * TIP.flushPendingComposition(keyEvent);
+ *
+ * Example #3 JS-IME can commit composition with specific string with this:
+ *
+ * // Create a keyboard event if the following compositionc change is caused
+ * // by a key event.
+ * var keyEvent1 =
+ * new KeyboardEvent("", { key: "foo", code: "bar", keyCode: buzz });
+ * // First, there is a composition.
+ * TIP.setPendingCompositionString("some-words-directly-inputted");
+ * TIP.appendClauseToPendingComposition(28, TIP.ATTR_RAW_CLAUSE);
+ * TIP.flushPendingComposition(keyEvent1);
+ * // Create a keyboard event if the following commit composition is caused
+ * // by a key event.
+ * var keyEvent2 =
+ * new KeyboardEvent("", { key: "foo", code: "bar", keyCode: buzz });
+ * // This is useful when user selects a commit string from candidate list UI
+ * // which is provided by JS-IME.
+ * TIP.commitCompositionWith("selected-words-from-candidate-list", keyEvent2);
+ *
+ * Example #4 JS-IME can commit composition with the last composition string
+ * without specifying commit string:
+ *
+ * // Create a keyboard event if the following compositionc change is caused
+ * // by a key event.
+ * var keyEvent1 =
+ * new KeyboardEvent("", { key: "foo", code: "bar", keyCode: buzz });
+ * // First, there is a composition.
+ * TIP.setPendingCompositionString("some-words-will-be-commited");
+ * TIP.appendClauseToPendingComposition(27, TIP.ATTR_RAW_CLAUSE);
+ * TIP.flushPendingComposition(keyEvent1);
+ * // Create a keyboard event if the following commit is caused by a key
+ * // event.
+ * var keyEvent2 =
+ * new KeyboardEvent("", { key: "Enter", code: "Enter",
+ keyCode: KeyboardEvent.DOM_VK_RETURN });
+ * // This is useful when user just type Enter key.
+ * TIP.commitComposition(keyEvent2);
+ *
+ * Example #5 JS-IME can cancel composition with this:
+ *
+ * // Create a keyboard event if the following composition change is caused
+ * // by a key event.
+ * var keyEvent1 =
+ * new KeyboardEvent("", { key: "foo", code: "bar", keyCode: buzz });
+ * // First, there is a composition.
+ * TIP.setPendingCompositionString("some-words-will-be-canceled");
+ * TIP.appendClauseToPendingComposition(27, TIP.ATTR_RAW_CLAUSE);
+ * TIP.flushPendingComposition(keyEvent1);
+ * // Create a keyboard event if the following canceling composition is
+ * // caused by a key event.
+ * var keyEvent2 =
+ * new KeyboardEvent("", { key: "Escape", code: "Escape",
+ keyCode: KeyboardEvent.DOM_VK_ESCAPE });
+ * // This is useful when user doesn't want to commit the composition.
+ * // FYI: This is same as TIP.commitCompositionWith("") for now.
+ * TIP.cancelComposition(keyEvent2);
+ *
+ * Example #6 JS-IME can insert text only with commitCompositionWith():
+ *
+ * // Create a keyboard event if the following inserting text is caused by a
+ * // key event.
+ * var keyEvent1 =
+ * new KeyboardEvent("", { key: "foo", code: "bar", keyCode: buzz });
+ * if (!TIP.beginInputTransaction(window, callback)) {
+ * return; // You failed to get the rights to make composition
+ * }
+ * TIP.commitCompositionWith("Some words", keyEvent1);
+ *
+ * Example #7 JS-IME can start composition explicitly:
+ *
+ * if (!TIP.beginInputTransaction(window, callback)) {
+ * return; // You failed to get the rights to make composition
+ * }
+ * // Create a keyboard event if the following starting composition is caused
+ * // by a key event.
+ * var keyEvent1 =
+ * new KeyboardEvent("", { key: "foo", code: "bar", keyCode: buzz });
+ * // If JS-IME don't want to show composing string in the focused editor,
+ * // JS-IME can dispatch only compositionstart event with this.
+ * if (!TIP.startComposition(keyEvent1)) {
+ * // Failed to start composition.
+ * return;
+ * }
+ * // And when user selects a result from UI of JS-IME, commit with it.
+ * // Then, the key event should be null.
+ * TIP.commitCompositionWith("selected-words");
+ *
+ * Example #8 JS-IME or JS-Keyboard should dispatch key events even during
+ * composition (non-printable key case):
+ *
+ * if (!TIP.beginInputTransaction(window, callback)) {
+ * return; // You failed to get the rights to dispatch key events
+ * }
+ *
+ * // You don't need to specify .keyCode value if it's non-printable key
+ * // because it can be computed from .key value.
+ * // If you specify non-zero value to .keyCode, it'll be used.
+ * var keyEvent = new KeyboardEvent("", { code: "Enter", key: "Enter" });
+ * if (TIP.keydown(keyEvent)) {
+ * // Handle its default action
+ * }
+ *
+ * // Even if keydown event was consumed, keyup event should be dispatched.
+ * if (TIP.keyup(keyEvent)) {
+ * // Handle its default action
+ * }
+ *
+ * Example #9 JS-IME or JS-Keyboard should dispatch key events even during
+ * composition (printable key case):
+ *
+ * if (!TIP.beginInputTransaction(window, callback)) {
+ * return; // You failed to get the rights to dispatch key events
+ * }
+ *
+ * // You need to specify .keyCode value if it's printable key.
+ * // The rules of .keyCode value is documented in MDN:
+ * // https://developer.mozilla.org/docs/Web/API/KeyboardEvent.keyCode
+ * //
+ * // #1 If the key location is DOM_KEY_LOCATION_NUMPAD and NumLock is
+ * // active, you should specify DOM_VK_NUMPAD[0-9], DOM_VK_MULTIPLY,
+ * // DOM_VK_ADD, DOM_VK_SEPARATOR, DOM_VK_SUBTRACT, DOM_VK_DECIMAL or
+ * // DOM_VK_DIVIDE.
+ * // #2 If the key is Spacebar, use DOM_VK_SPACE.
+ * //
+ * // Following rules are printable keys in DOM_KEY_LOCATION_STANDARD.
+ * // .keyCode value for a key shouldn't be changed by modifier states:
+ * // #1 If the key can input [0-9] with any modifier state (except
+ * // NumLock state), the value should be DOM_VK_[0-9].
+ * // #2 Otherwise, and if the key inputs an ASCII alphabet with no
+ * // active modifiers, use DOM_VK_[A-Z].
+ * // #3 Otherwise, and if the key inputs an ASCII alphabet with no
+ * // active modifiers except Shift key state, use DOM_VK_[A-Z] for
+ * // the shifted character. E.g., if a key causes non-alphabet
+ * // character such as "@" or a Unicode character without Shift key
+ * // but "a" is inputted when Shift key is pressed, the proper
+ * // keyCode is DOM_VK_A.
+ * // #4 Otherwise, and if the key inputs another ASCII character with
+ * // no modifier states, use a proper value for the character. E.g.,
+ * // if the key inputs "*" without Shift key state, it should be
+ * // DOM_VK_ASTERISK.
+ * // #5 Otherwise, and if the key inputs another ASCII character with
+ * // Shift key state, use a proper value for the character. E.g.,
+ * // if a key causes a Unicode character without Shift key but "&"
+ * // is inputted when Shift key is pressed, the proper keyCode is
+ * // DOM_VK_AMPERSAND.
+ * // See above document for the other cases.
+ * //
+ * // NOTE: If the software keyboard is 10-key like simple phone,
+ * // We don't have common rules to decide its .keyCode value.
+ * // Above rules should be used when the JS-Keyboard emulates PC
+ * // keyboard.
+ * // .key value should be inputting character by the key with current
+ * // modifier state.
+ * // .code value should be empty string if the JS-Keyboard isn't emulating
+ * // physical keyboard. Otherwise, use same value with physical keyboard's
+ * // same key.
+ * var keyEvent = new KeyboardEvent("", { code: "KeyA", key: "a",
+ * keyCode: KeyboardEvent.DOM_VK_A });
+ * if (TIP.keydown(keyEvent)) {
+ * // Handle its default action
+ * }
+ *
+ * // Even if keydown event was consumed, keyup event should be dispatched.
+ * if (TIP.keyup(keyEvent)) {
+ * // Handle its default action
+ * }
+ *
+ * Example #10 JS-Keyboard doesn't need to initialize modifier states at
+ * calling either keydown() or keyup().
+ *
+ * // Neither beginInputTransaction() nor beginInputTransactionForTests()
+ * // resets modifier state.
+ * if (!TIP.beginInputTransaction(window, callback)) {
+ * return; // You failed to get the rights to dispatch key events
+ * }
+ *
+ * var leftShift = new KeyboardEvent("", { code: "ShiftLeft", key: "Shift" });
+ *
+ * // This causes following key events will be shifted automatically.
+ * TIP.keydown(leftShift);
+ *
+ * var rightShift =
+ * new KeyboardEvent("", { code: "ShiftRight", key: "Shift" });
+ *
+ * TIP.keydown(rightShift);
+ *
+ * // keyup of one of shift key doesn't cause inactivating "Shift" state.
+ * TIP.keyup(rightShift);
+ *
+ * // This causes inactivating "Shift" state completely.
+ * TIP.keyup(leftShift);
+ */
+
+[scriptable, builtinclass, uuid(6617a9f6-3e16-4086-9e1e-c8a6c5d505c7)]
+interface nsITextInputProcessor : nsISupports
+{
+ /**
+ * Returns true if this instance was dispatched compositionstart but hasn't
+ * dispatched compositionend yet.
+ */
+ readonly attribute boolean hasComposition;
+
+ /**
+ * When you create an instance, you must call beginInputTransaction() first
+ * except when you created the instance for automated tests.
+ *
+ * @param aWindow A DOM window. The instance will look for a top
+ * level widget from this.
+ * @param aCallback Callback interface which handles requests to
+ * IME and notifications to IME. This must not be
+ * null.
+ * @return If somebody uses internal text input service for a
+ * composition, this returns false. Otherwise, returns
+ * true. I.e., only your TIP can create composition
+ * when this returns true. If this returns false,
+ * your TIP should wait next chance.
+ */
+ boolean beginInputTransaction(in nsIDOMWindow aWindow,
+ in nsITextInputProcessorCallback aCallback);
+
+ /**
+ * When you create an instance for automated test, you must call
+ * beginInputTransaction(), first. See beginInputTransaction() for more
+ * detail of this.
+ * Note that aCallback can be null. If it's null, nsITextInputProcessor
+ * implementation will handle them automatically.
+ */
+ [optional_argc] boolean
+ beginInputTransactionForTests(
+ in nsIDOMWindow aWindow,
+ [optional] in nsITextInputProcessorCallback aCallback);
+
+ /**
+ * startComposition() dispatches compositionstart event explicitly.
+ * IME does NOT need to call this typically since compositionstart event
+ * is automatically dispatched by sendPendingComposition() if
+ * compositionstart event hasn't been dispatched yet. If this is called
+ * when compositionstart has already been dispatched, this throws an
+ * exception.
+ *
+ * @param aKeyboardEvent Key event which causes starting composition.
+ * If its type value is "keydown", this method
+ * dispatches only keydown event first. Otherwise,
+ * dispatches keydown first and keyup at last.
+ * @param aKeyFlags See KEY_* constants.
+ * @return Returns true if composition starts normally.
+ * Otherwise, returns false because it might be
+ * canceled by the web application.
+ */
+ [optional_argc]
+ boolean startComposition([optional] in nsIDOMKeyEvent aKeyboardEvent,
+ [optional] in unsigned long aKeyFlags);
+
+ /**
+ * Set new composition string. Pending composition will be flushed by
+ * a call of flushPendingComposition(). However, if the new composition
+ * string isn't empty, you need to call appendClauseToPendingComposition() to
+ * fill all characters of aString with one or more clauses before flushing.
+ * Note that if you need to commit or cancel composition, use
+ * commitComposition(), commitCompositionWith() or cancelComposition().
+ */
+ void setPendingCompositionString(in DOMString aString);
+
+ // ATTR_RAW_CLAUSE means that the clause hasn't been selected nor converted
+ // yet.
+ const unsigned long ATTR_RAW_CLAUSE = 0x02;
+ // ATTR_SELECTED_RAW_CLAUSE means that the clause hasn't been converted yet
+ // but is selected for converting to the other string.
+ const unsigned long ATTR_SELECTED_RAW_CLAUSE = 0x03;
+ // ATTR_CONVERTED_CLAUSE means that the clause has already been converted but
+ // is not selected. This does NOT mean that this clause isn't modifiable.
+ const unsigned long ATTR_CONVERTED_CLAUSE = 0x04;
+ // ATTR_SELECTED_CLAUSE means that the clause has already been converted and
+ // is selected. In other words, the clause is being converted.
+ const unsigned long ATTR_SELECTED_CLAUSE = 0x05;
+
+ /**
+ * Append a clause to the pending composition.
+ *
+ * If you need to fill the pending composition string with a clause, you
+ * should call this once. For example:
+ * appendClauseToPendingComposition(compositionString.length,
+ * ATTR_RAW_CLAUSE);
+ * is enough. If you need to separate the pending composition string to
+ * multiple clauses, you need to call this multiple times. For example,
+ * if your pending composition string has three clauses and the second clause
+ * is being converted:
+ * appendClauseToPendingComposition(firstClauseLength,
+ * ATTR_CONVERTED_CLAUSE);
+ * appendClauseToPendingComposition(secondClauseLength,
+ * ATTR_SELECTED_CLAUSE);
+ * appendClauseToPendingComposition(thirdClauseLength,
+ * ATTR_CONVERTED_CLAUSE);
+ * Note that if sum of aLength mismatches length of the pending composition
+ * string, flushPendingComposition() will throw an exception. I.e.,
+ * |firstClauseLength + secondClauseLength + thirdClauseLength| must be
+ * same as the length of pending composition string.
+ *
+ * TODO: Should be able to specify custom clause style.
+ *
+ * @param aLength Length of the clause.
+ * @param aAttribute One of ATTR_* constants.
+ */
+ void appendClauseToPendingComposition(in unsigned long aLength,
+ in unsigned long aAttribute);
+
+ /**
+ * Set caret offset in the pending composition string. If you don't need to
+ * show a caret, you don't need to call this.
+ *
+ * @param aOffset Caret offset in the pending composition string.
+ * This must be between 0 and length of the pending
+ * composition string.
+ */
+ void setCaretInPendingComposition(in unsigned long aOffset);
+
+ /**
+ * flushPendingComposition() must be called after
+ * setPendingCompositionString() and appendClauseToPendingComposition()
+ * (setCaretInPendingComposition() is optional) are called.
+ *
+ * Note that compositionstart will be automatically dispatched if this is
+ * called when there is no composition.
+ *
+ * Note that if sum of lengths of appended clauses are not same as composition
+ * string or caret offset is larger than the composition string length, this
+ * throws an exception.
+ *
+ * @param aKeyboardEvent Key event which causes the composition string.
+ * If its type value is "keydown", this method
+ * dispatches only keydown event first. Otherwise,
+ * dispatches keydown first and keyup at last.
+ * @param aKeyFlags See KEY_* constants.
+ * @return Returns true if there is a composition already or
+ * starting composition automatically.
+ * Otherwise, i.e., if it cannot start composition
+ * automatically, e.g., canceled by web apps, returns
+ * false.
+ */
+ [optional_argc]
+ boolean flushPendingComposition(
+ [optional] in nsIDOMKeyEvent aKeyboardEvent,
+ [optional] in unsigned long aKeyFlags);
+
+ /**
+ * commitComposition() will commit composition with the last composition
+ * string. If there is no composition, this will throw an exception.
+ *
+ * @param aKeyboardEvent Key event which causes the commit composition.
+ * If its type value is "keydown", this method
+ * dispatches only keydown event first. Otherwise,
+ * dispatches keydown first and keyup at last.
+ * @param aKeyFlags See KEY_* constants.
+ */
+ [optional_argc]
+ void commitComposition([optional] in nsIDOMKeyEvent aKeyboardEvent,
+ [optional] in unsigned long aKeyFlags);
+
+ /**
+ * commitCompositionWith() will commit composition with the specific string.
+ * If there is no composition, this will start composition and commit it
+ * with the specified string.
+ *
+ * @param aCommitString The string to be committed.
+ * @param aKeyboardEvent Key event which causes the commit composition.
+ * If its type value is "keydown", this method
+ * dispatches only keydown event first. Otherwise,
+ * dispatches keydown first and keyup at last.
+ * @param aKeyFlags See KEY_* constants.
+ * @return Returns true if there is a composition already or
+ * starting composition automatically.
+ * Otherwise, i.e., if it cannot start composition
+ * automatically, e.g., canceled by web apps, returns
+ * false.
+ */
+ [optional_argc]
+ boolean commitCompositionWith(in DOMString aCommitString,
+ [optional] in nsIDOMKeyEvent aKeyboardEvent,
+ [optional] in unsigned long aKeyFlags);
+
+ /**
+ * cancelComposition() will cancel composition. This is for now the same as
+ * calling commitComposition(""). However, in the future, this might work
+ * better. If your IME needs to cancel composition, use this instead of
+ * commitComposition().
+ *
+ * Note that if you tries to cancel composition when there is no composition,
+ * this throws an exception.
+ *
+ * @param aKeyboardEvent Key event which causes the canceling composition.
+ * If its type value is "keydown", this method
+ * dispatches only keydown event first. Otherwise,
+ * dispatches keydown first and keyup at last.
+ * @param aKeyFlags See KEY_* constants.
+ */
+ [optional_argc]
+ void cancelComposition([optional] in nsIDOMKeyEvent aKeyboardEvent,
+ [optional] in unsigned long aKeyFlags);
+
+ // Specifying KEY_DEFAULT_PREVENTED can dispatch key events whose
+ // defaultPrevented are true. Note that if this is specified, keypress event
+ // won't be fired.
+ const unsigned long KEY_DEFAULT_PREVENTED = 0x00000001;
+ // If KEY_NON_PRINTABLE_KEY is specified and the .key value isn't valid
+ // key name, the methods will throws an exception. In other words, this
+ // flag prevents to dispatch key events with wrong key values and to cause
+ // such key events input the key values as text.
+ const unsigned long KEY_NON_PRINTABLE_KEY = 0x00000002;
+ // If KEY_FORCE_PRINTABLE_KEY is specified and even if the .key value is a
+ // registered key name, it's treated as inputting text value.
+ const unsigned long KEY_FORCE_PRINTABLE_KEY = 0x00000004;
+ // If KEY_KEEP_KEY_LOCATION_STANDARD is specified when its .location is not
+ // initialized or initialized with 0, the value isn't computed with .code
+ // value. Note that if .location is initialized with non-zero value,
+ // this flag causes throwing an exception.
+ // NOTE: This is not recommended to use except for tests.
+ const unsigned long KEY_KEEP_KEY_LOCATION_STANDARD = 0x00000008;
+ // If KEY_KEEP_KEYCODE_ZERO is specified when its .keyCode is not initialized
+ // or initialized with 0, the value isn't computed with .key value when it
+ // represents non-printable key. Note that if .keyCode is initialized with
+ // non-zero value, this flag causes throwing an exception.
+ const unsigned long KEY_KEEP_KEYCODE_ZERO = 0x00000010;
+ // If KEY_DONT_DISPATCH_MODIFIER_KEY_EVENT is specified when the key event is
+ // a modifier key's, keydown() and keyup() only modifies its modifier state
+ // without dispatching key events. This is useful for testing odd behavior
+ // or emulating legacy API behavior.
+ const unsigned long KEY_DONT_DISPATCH_MODIFIER_KEY_EVENT = 0x00000020;
+
+ /**
+ * keydown() may dispatch a keydown event and some keypress events if
+ * preceding keydown event isn't consumed and they are necessary.
+ * Note that even if this is called during composition, key events may not
+ * be dispatched. In this case, this returns false.
+ *
+ * You should initialize at least .key value and .code value of the event.
+ * Additionally, if you try to emulate a printable key, .keyCode value should
+ * be specified if there is proper key value. See the comment of above
+ * example how to decide .keyCode value of a printable key. On the other
+ * hand, .keyCode value is automatically computed when you try to emulate
+ * non-printable key. However, if you try to emulate physical keyboard of
+ * desktop platform, you need to specify proper value explicitly because
+ * the mapping table of this API isn't enough to emulate the behavior of
+ * Goanna for desktop platforms.
+ *
+ * NOTE: Even if this has composition, JS-Keyboard should call keydown() and
+ * keyup(). Although, with the default preferences and normal
+ * conditions, DOM key events won't be fired during composition.
+ * However, they MAY be dispatched for some reasons, e.g., the web
+ * content listens only key events, or if the standard DOM event spec
+ * will be changed in the future.
+ *
+ * @param aKeyboardEvent Must be a keyboard event which should be dispatched
+ * as a keydown event and keypress events.
+ * #1 Note that you don't need to set charCode value
+ * because it's computed from its key value.
+ * #2 If code value is set properly and location value
+ * isn't specified (i.e., 0), the location value will
+ * be guessed from the code value.
+ * #3 Non-defined code names are not allowed. If your
+ * key isn't registered, file a bug. If your key isn't
+ * defined by any standards, use "" (empty string).
+ * #4 .keyCode is guessed from .key value if the key
+ * name is registered and .keyCode isn't initialized.
+ * #5 modifier key states, e.g., .shiftKey, are
+ * ignored. Instead, modifier states are managed by
+ * each instance and set automatically.
+ * @param aKeyFlags Special flags. The values can be some of KEY_*
+ * constants.
+ * @return true if neither the keydown event or following
+ * keypress events is *not* consumed.
+ * Otherwise, i.e., preventDefault() is called, false.
+ */
+ [optional_argc]
+ boolean keydown(in nsIDOMKeyEvent aKeyboardEvent,
+ [optional] in unsigned long aKeyFlags);
+
+ /**
+ * Similar to keydown(), but this dispatches only a keyup event.
+ */
+ [optional_argc]
+ boolean keyup(in nsIDOMKeyEvent aKeyboardEvent,
+ [optional] in unsigned long aKeyFlags);
+
+ /**
+ * getModifierState() returns modifier state managed by this instance.
+ *
+ * @param aModifier One of modifier key names. This doesn't support
+ * virtual modifiers like "Accel".
+ * @return true if the modifier key is active. Otherwise,
+ * false.
+ */
+ boolean getModifierState(in DOMString aModifierKey);
+
+ /**
+ * shareModifierStateOf() makes the instance shares modifier state of
+ * another instance. When this is called, the instance refers the modifier
+ * state of another instance. After that, changes to either this and the
+ * other instance's modifier state is synchronized.
+ *
+ * @param aOther Another instance which will be referred by the
+ * instance. If this is null, the instance restarts
+ * to manage modifier state independently.
+ */
+ void shareModifierStateOf(in nsITextInputProcessor aOther);
+};
+
+%{C++
+#define TEXT_INPUT_PROCESSOR_CID \
+ { 0xcaaab47f, 0x1e31, 0x478e, \
+ { 0x89, 0x19, 0x97, 0x09, 0x04, 0xe9, 0xcb, 0x72 } }
+#define TEXT_INPUT_PROCESSOR_CONTRACTID \
+ "@mozilla.org/text-input-processor;1"
+%}
diff --git a/dom/interfaces/base/nsITextInputProcessorCallback.idl b/dom/interfaces/base/nsITextInputProcessorCallback.idl
new file mode 100644
index 000000000..d7b20e436
--- /dev/null
+++ b/dom/interfaces/base/nsITextInputProcessorCallback.idl
@@ -0,0 +1,104 @@
+/* -*- 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/. */
+
+#include "nsISupports.idl"
+
+interface nsITextInputProcessor;
+
+/**
+ * nsITextInputProcessorNotification stores the type of notification to IME and
+ * its detail. See each explanation of attribute for the detail.
+ */
+
+[scriptable, builtinclass, uuid(c0ce1add-82bb-45ab-b99a-42cfba7fd5d7)]
+interface nsITextInputProcessorNotification : nsISupports
+{
+ /**
+ * type attribute represents what's notified or requested. Value must be
+ * one of following values:
+ *
+ * "request-to-commit" (required to be handled)
+ * This is requested when Goanna believes that active composition should be
+ * committed. nsITextInputProcessorCallback::onNotify() has to handle this
+ * notification.
+ *
+ * "request-to-cancel" (required to be handled)
+ * This is requested when Goanna believes that active composition should be
+ * canceled. I.e., composition should be committed with empty string.
+ * nsITextInputProcessorCallback::onNotify() has to handle this
+ * notification.
+ *
+ * "notify-end-input-transaction" (optional)
+ * This is notified when the callback is detached from
+ * nsITextInputProcessor. I.e., the TextInputProcessor lost the rights
+ * to input text and needs to call .beginInputTransaction() before next
+ * input.
+ *
+ * "notify-focus" (optional)
+ * This is notified when an editable editor gets focus and Goanna starts
+ * to observe changes in the content. E.g., selection changes.
+ * IME shouldn't change DOM tree, focus nor something when this is notified.
+ *
+ * "notify-blur" (optional)
+ * This is notified when an editable editor loses focus and Goanna stops
+ * observing the changes in the content.
+ */
+ readonly attribute ACString type;
+};
+
+/**
+ * nsITextInputProcessorCallback is a callback interface for JS to implement
+ * IME. IME implemented by JS can implement onNotify() function and must send
+ * it to nsITextInputProcessor at initializing. Then, onNotify() will be
+ * called with nsITextInputProcessorNotification instance.
+ * The reason why onNotify() uses string simply is that if we will support
+ * other notifications such as text changes and selection changes, we need to
+ * notify IME of some other information. Then, only changing
+ * nsITextInputProcessorNotification interface is better for compatibility.
+ */
+
+[scriptable, function, uuid(23d5f242-adb5-46f1-8766-90d1bf0383df)]
+interface nsITextInputProcessorCallback : nsISupports
+{
+ /**
+ * When Goanna notifies IME of something or requests something to IME,
+ * this is called.
+ *
+ * @param aTextInputProcessor Reference to the nsITextInputProcessor service
+ * which is the original receiver of the request
+ * or notification.
+ * @param aNotification Stores type of notifications and additional
+ * information.
+ * @return Return true if it succeeded or does nothing.
+ * Otherwise, return false.
+ *
+ * Example #1 The simplest implementation of nsITextInputProcessorCallback is:
+ *
+ * function simpleCallback(aTIP, aNotification)
+ * {
+ * try {
+ * switch (aNotification.type) {
+ * case "request-to-commit":
+ * aTIP.commitComposition();
+ * break;
+ * case "request-to-cancel":
+ * aTIP.cancelComposition();
+ * break;
+ * }
+ * } catch (e) {
+ * return false;
+ * }
+ * return true;
+ * }
+ *
+ * var TIP = Components.classes["@mozilla.org/text-input-processor;1"].
+ * createInstance(Components.interfaces.nsITextInputProcessor);
+ * if (!TIP.init(window, simpleCallback)) {
+ * return;
+ * }
+ */
+ boolean onNotify(in nsITextInputProcessor aTextInputProcessor,
+ in nsITextInputProcessorNotification aNotification);
+};